fix mariadb parsing with mysql (#5488)

This commit is contained in:
Simon Smith 2023-10-31 19:11:17 +00:00 committed by GitHub
parent fed8f021f2
commit 13ead1ddeb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

6
db.js
View File

@ -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)'];