From 2274f770639dffd2be0eb1477ec15c6adb6c8eb1 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Sun, 3 Apr 2022 13:42:53 +0200 Subject: [PATCH] Parse multi-stmts with doble quoted strings, ExporterEngine: shaSum fixes --- lib.js | 6 ++++++ myvc-push.js | 5 +++++ package.json | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/lib.js b/lib.js index ab9f3d3..c4a7009 100644 --- a/lib.js +++ b/lib.js @@ -144,12 +144,18 @@ class ExporterEngine { } shaSum(sql) { + if (!sql) return null; return shajs('sha256') .update(JSON.stringify(sql)) .digest('hex'); } setShaSum(type, schema, name, shaSum) { + if (!shaSum) { + this.deleteShaSum(type, schema, name); + return; + } + const shaSums = this.shaSums; if (!shaSums[schema]) shaSums[schema] = {}; diff --git a/myvc-push.js b/myvc-push.js index fdf1a90..30da278 100644 --- a/myvc-push.js +++ b/myvc-push.js @@ -561,6 +561,11 @@ const tokens = { end: '\'', escape: char => char == '\'' || char == '\\' }, + quotedString: { + start: '"', + end: '"', + escape: char => char == '"' || char == '\\' + }, id: { start: '`', end: '`', diff --git a/package.json b/package.json index fc156de..fe730ae 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "myvc", - "version": "1.3.6", + "version": "1.3.7", "author": "Verdnatura Levante SL", "description": "MySQL Version Control", "license": "GPL-3.0",