From 04cce00b4606aea853f06c1558e8bda00bf2915d Mon Sep 17 00:00:00 2001 From: HHongSeungWoo Date: Sat, 6 Feb 2021 15:59:08 +0900 Subject: [PATCH] fix: fix old mysql query result ony buffer --- src/drivers/MysqlDriver.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/drivers/MysqlDriver.ts b/src/drivers/MysqlDriver.ts index 8ce8248..110c0ce 100644 --- a/src/drivers/MysqlDriver.ts +++ b/src/drivers/MysqlDriver.ts @@ -493,6 +493,17 @@ export default class MysqlDriver extends AbstractDriver { }; } + config.typeCast = (field, next) => { + switch (field.type) { + case "VAR_STRING": + return field.string(); + case "BLOB": + return field.string(); + default: + return next(); + } + }; + const promise = new Promise((resolve, reject) => { this.Connection = this.MYSQL.createConnection(config);