Skip to content

Commit

Permalink
fix(MySQL): multiple queries non properly split in some cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabio286 committed Apr 29, 2021
1 parent 6e332da commit 5208ec1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/libs/clients/MySQLClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -1278,7 +1278,7 @@ export class MySQLClient extends AntaresCore {
const nestTables = args.nest ? '.' : false;
const resultsArr = [];
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

Expand Down

0 comments on commit 5208ec1

Please sign in to comment.