fix: Add charset to cast binary and json data correctly

This commit is contained in:
Jaime Filho committed 2022-02-18 19:12:46 -03:00
1 parent 0c7620613f
commit 8611cc0762
2 files changed
+16 -1

No files matched your search

+12
View File
@@ -191,6 +191,18 @@ index c612f66..02dbe22 100644
case 'number':
type = Types.DOUBLE;
diff --git a/node_modules/mysql2/lib/parsers/text_parser.js b/node_modules/mysql2/lib/parsers/text_parser.js
index 0af4a7a..bce66bc 100644
--- a/node_modules/mysql2/lib/parsers/text_parser.js
+++ b/node_modules/mysql2/lib/parsers/text_parser.js
@@ -85,6 +85,7 @@ function compile(fields, options, config) {
db: field.schema,
table: field.table,
name: field.name,
+ charset: field.characterSet,
string: function() {
return _this.packet.readLengthCodedString(field.encoding);
},
diff --git a/node_modules/mysql2/promise.d.ts b/node_modules/mysql2/promise.d.ts
index 6ab3d6f..64246e8 100644
--- a/node_modules/mysql2/promise.d.ts