From 7e96b25205ff273454db6da8f69a308333b3166b Mon Sep 17 00:00:00 2001 From: vincent Date: Fri, 3 Sep 2021 12:30:33 +0800 Subject: [PATCH] replace column quotes in _getBodyForInsert function. because non-ascii column name required surrounding quotes, should remove it to get correct field list. --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index b7e2755..692328a 100644 --- a/index.js +++ b/index.js @@ -417,7 +417,7 @@ class QueryCursor { if (isFirstElObject) { let m = query.match(/INSERT INTO (.+?) \((.+?)\)/); if (m) { - fieldList = m[2].split(',').map(s => s.trim()); + fieldList = m[2].split(',').map(s => s.replace(/"|`/g, '').trim()); } else { throw new Error('insert query wasnt parsed field list after TABLE_NAME'); }