mirror of https://github.com/Fabio286/antares.git
fix(MySQL): support to ANSI_QUOTES mode not working, closes #243
This commit is contained in:
parent
70cb92521f
commit
9fcc7d1cef
|
@ -192,7 +192,7 @@ export class MySQLClient extends AntaresCore {
|
||||||
|
|
||||||
// ANSI_QUOTES check
|
// ANSI_QUOTES check
|
||||||
const [response] = await connection.query<mysql.RowDataPacket[]>('SHOW GLOBAL VARIABLES LIKE \'%sql_mode%\'');
|
const [response] = await connection.query<mysql.RowDataPacket[]>('SHOW GLOBAL VARIABLES LIKE \'%sql_mode%\'');
|
||||||
const sqlMode = response[0]?.Variable_name?.split(',');
|
const sqlMode = response[0]?.Value?.split(',');
|
||||||
const hasAnsiQuotes = sqlMode.includes('ANSI_QUOTES');
|
const hasAnsiQuotes = sqlMode.includes('ANSI_QUOTES');
|
||||||
|
|
||||||
if (this._params.readonly)
|
if (this._params.readonly)
|
||||||
|
@ -219,7 +219,7 @@ export class MySQLClient extends AntaresCore {
|
||||||
|
|
||||||
// ANSI_QUOTES check
|
// ANSI_QUOTES check
|
||||||
const [res] = await connection.query<mysql.RowDataPacket[]>('SHOW GLOBAL VARIABLES LIKE \'%sql_mode%\'');
|
const [res] = await connection.query<mysql.RowDataPacket[]>('SHOW GLOBAL VARIABLES LIKE \'%sql_mode%\'');
|
||||||
const sqlMode = res[0]?.Variable_name?.split(',');
|
const sqlMode = res[0]?.Value?.split(',');
|
||||||
const hasAnsiQuotes = sqlMode.includes('ANSI_QUOTES');
|
const hasAnsiQuotes = sqlMode.includes('ANSI_QUOTES');
|
||||||
|
|
||||||
if (hasAnsiQuotes)
|
if (hasAnsiQuotes)
|
||||||
|
|
Loading…
Reference in New Issue