Parse multi-stmts with doble quoted strings, ExporterEngine: shaSum fixes

This commit is contained in:
Juan Ferrer 2022-04-03 13:42:53 +02:00
parent eba585acf4
commit 2274f77063
3 changed files with 12 additions and 1 deletions

6
lib.js
View File

@ -144,12 +144,18 @@ class ExporterEngine {
} }
shaSum(sql) { shaSum(sql) {
if (!sql) return null;
return shajs('sha256') return shajs('sha256')
.update(JSON.stringify(sql)) .update(JSON.stringify(sql))
.digest('hex'); .digest('hex');
} }
setShaSum(type, schema, name, shaSum) { setShaSum(type, schema, name, shaSum) {
if (!shaSum) {
this.deleteShaSum(type, schema, name);
return;
}
const shaSums = this.shaSums; const shaSums = this.shaSums;
if (!shaSums[schema]) if (!shaSums[schema])
shaSums[schema] = {}; shaSums[schema] = {};

View File

@ -561,6 +561,11 @@ const tokens = {
end: '\'', end: '\'',
escape: char => char == '\'' || char == '\\' escape: char => char == '\'' || char == '\\'
}, },
quotedString: {
start: '"',
end: '"',
escape: char => char == '"' || char == '\\'
},
id: { id: {
start: '`', start: '`',
end: '`', end: '`',

View File

@ -1,6 +1,6 @@
{ {
"name": "myvc", "name": "myvc",
"version": "1.3.6", "version": "1.3.7",
"author": "Verdnatura Levante SL", "author": "Verdnatura Levante SL",
"description": "MySQL Version Control", "description": "MySQL Version Control",
"license": "GPL-3.0", "license": "GPL-3.0",