mirror of https://github.com/Fabio286/antares.git
fix: error joining tables with different schema
This commit is contained in:
parent
d52b7af297
commit
88408da745
|
@ -78,6 +78,7 @@ export const BLOB = [
|
||||||
'TINYBLOB',
|
'TINYBLOB',
|
||||||
'MEDIUMBLOB',
|
'MEDIUMBLOB',
|
||||||
'LONGBLOB',
|
'LONGBLOB',
|
||||||
|
'LONG_BLOB',
|
||||||
'BYTEA'
|
'BYTEA'
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -469,7 +469,12 @@ export class MySQLClient extends AntaresCore {
|
||||||
.orderBy({ ORDINAL_POSITION: 'ASC' })
|
.orderBy({ ORDINAL_POSITION: 'ASC' })
|
||||||
.run<TableColumnsResult>();
|
.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 => {
|
const remappedFields = fields.map(row => {
|
||||||
if (!row['Create Table']) return false;
|
if (!row['Create Table']) return false;
|
||||||
|
|
|
@ -63,6 +63,7 @@
|
||||||
"mediumblob": $blob-color,
|
"mediumblob": $blob-color,
|
||||||
"medium_blob": $blob-color,
|
"medium_blob": $blob-color,
|
||||||
"longblob": $blob-color,
|
"longblob": $blob-color,
|
||||||
|
"long_blob": $blob-color,
|
||||||
"bytea": $blob-color,
|
"bytea": $blob-color,
|
||||||
"enum": $enum-color,
|
"enum": $enum-color,
|
||||||
"set": $enum-color,
|
"set": $enum-color,
|
||||||
|
|
Loading…
Reference in New Issue