fix mariadb parsing with mysql (#5488)
Simon Smith committed
Oct 31, 2023 at 19:11 UTC
13ead1ddebec8af497422098badc34f462959433
1 file changed
+5
-1
db.js
+5
-1
@@ -1244,7 +1244,11 @@ module.exports.CreateDB = function (parent, func) {
1244
var docs = [];
1245
for (var i in results) {
1246
if (results[i].doc) {
1247
- docs.push(results[i].doc);
1247
+ if (typeof results[i].doc == 'string') {
1248
+ docs.push(JSON.parse(results[i].doc));
1249
+ } else {
1250
+ docs.push(results[i].doc);
1251
+ }
1252
} else if ((results.length == 1) && (results[i]['COUNT(doc)'] != null)) {
1253
// This is a SELECT COUNT() operation
1254
docs = results[i]['COUNT(doc)'];