From 88408da745e45c70de977bc4270e5f61825be65f Mon Sep 17 00:00:00 2001 From: Fabio Di Stasio Date: Mon, 17 Oct 2022 13:55:48 +0200 Subject: [PATCH] fix: error joining tables with different schema --- src/common/fieldTypes.ts | 1 + src/main/libs/clients/MySQLClient.ts | 7 ++++++- src/renderer/scss/_data-types.scss | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/common/fieldTypes.ts b/src/common/fieldTypes.ts index 678430cb..25ffdfaf 100644 --- a/src/common/fieldTypes.ts +++ b/src/common/fieldTypes.ts @@ -78,6 +78,7 @@ export const BLOB = [ 'TINYBLOB', 'MEDIUMBLOB', 'LONGBLOB', + 'LONG_BLOB', 'BYTEA' ]; diff --git a/src/main/libs/clients/MySQLClient.ts b/src/main/libs/clients/MySQLClient.ts index 7226f089..de142359 100644 --- a/src/main/libs/clients/MySQLClient.ts +++ b/src/main/libs/clients/MySQLClient.ts @@ -469,7 +469,12 @@ export class MySQLClient extends AntaresCore { .orderBy({ ORDINAL_POSITION: 'ASC' }) .run(); - const { rows: fields } = await this.raw>(`SHOW CREATE TABLE \`${schema}\`.\`${table}\``); + let fields: CreateTableResult[] = []; + try { + const { rows } = await this.raw>(`SHOW CREATE TABLE \`${schema}\`.\`${table}\``); + fields = rows; + } + catch (_) {} const remappedFields = fields.map(row => { if (!row['Create Table']) return false; diff --git a/src/renderer/scss/_data-types.scss b/src/renderer/scss/_data-types.scss index b7aeea4a..c1e65943 100644 --- a/src/renderer/scss/_data-types.scss +++ b/src/renderer/scss/_data-types.scss @@ -63,6 +63,7 @@ "mediumblob": $blob-color, "medium_blob": $blob-color, "longblob": $blob-color, + "long_blob": $blob-color, "bytea": $blob-color, "enum": $enum-color, "set": $enum-color,