fix(MySQL): multiple queries non properly split in some cases

This commit is contained in:
Fabio Di Stasio 2021-04-29 21:03:32 +02:00
parent 6e332da425
commit 5208ec171b
1 changed files with 1 additions and 1 deletions

View File

@ -1278,7 +1278,7 @@ export class MySQLClient extends AntaresCore {
const nestTables = args.nest ? '.' : false; const nestTables = args.nest ? '.' : false;
const resultsArr = []; const resultsArr = [];
let paramsArr = []; let paramsArr = [];
const queries = args.split ? sql.split(/(?!\B['"][^'"]*);(?![^'"]*['"]\B)/gm) : [sql]; const queries = args.split ? sql.split(/((?:[^;'"]*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*')[^;'"]*)+)|;/gm) : [sql];
if (process.env.NODE_ENV === 'development') this._logger(sql);// TODO: replace BLOB content with a placeholder if (process.env.NODE_ENV === 'development') this._logger(sql);// TODO: replace BLOB content with a placeholder