From 13ead1ddebec8af497422098badc34f462959433 Mon Sep 17 00:00:00 2001 From: Simon Smith Date: Tue, 31 Oct 2023 19:11:17 +0000 Subject: [PATCH] fix mariadb parsing with mysql (#5488) --- db.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/db.js b/db.js index 0834a829..046a32b7 100644 --- a/db.js +++ b/db.js @@ -1244,7 +1244,11 @@ module.exports.CreateDB = function (parent, func) { var docs = []; for (var i in results) { if (results[i].doc) { - docs.push(results[i].doc); + if (typeof results[i].doc == 'string') { + docs.push(JSON.parse(results[i].doc)); + } else { + docs.push(results[i].doc); + } } else if ((results.length == 1) && (results[i]['COUNT(doc)'] != null)) { // This is a SELECT COUNT() operation docs = results[i]['COUNT(doc)'];