fix: error joining tables with different schema

This commit is contained in:
Fabio Di Stasio 2022-10-17 13:55:48 +02:00
parent d52b7af297
commit 88408da745
3 changed files with 8 additions and 1 deletions

View File

@ -78,6 +78,7 @@ export const BLOB = [
'TINYBLOB',
'MEDIUMBLOB',
'LONGBLOB',
'LONG_BLOB',
'BYTEA'
];

View File

@ -469,7 +469,12 @@ export class MySQLClient extends AntaresCore {
.orderBy({ ORDINAL_POSITION: 'ASC' })
.run<TableColumnsResult>();
const { rows: fields } = await this.raw<antares.QueryResult<CreateTableResult>>(`SHOW CREATE TABLE \`${schema}\`.\`${table}\``);
let fields: CreateTableResult[] = [];
try {
const { rows } = await this.raw<antares.QueryResult<CreateTableResult>>(`SHOW CREATE TABLE \`${schema}\`.\`${table}\``);
fields = rows;
}
catch (_) {}
const remappedFields = fields.map(row => {
if (!row['Create Table']) return false;

View File

@ -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,