fix(mysql2/binary_parser): Return BLOB as an array

This commit is contained in:
Linden committed 2022-02-19 09:32:55 +11:00
1 parent 82f0382518
commit 14d9f43991
1 file changed
+13
+13
View File
@@ -191,6 +191,19 @@ index c612f66..02dbe22 100644
case 'number':
type = Types.DOUBLE;
diff --git a/node_modules/mysql2/lib/parsers/binary_parser.js b/node_modules/mysql2/lib/parsers/binary_parser.js
index bbd2959..80ab00d 100644
--- a/node_modules/mysql2/lib/parsers/binary_parser.js
+++ b/node_modules/mysql2/lib/parsers/binary_parser.js
@@ -72,7 +72,7 @@ function readCodeFor(field, config, options, fieldNum) {
default:
if (field.characterSet === Charsets.BINARY) {
- return 'packet.readLengthCodedBuffer();';
+ return '[...packet.readLengthCodedBuffer()];';
}
return `packet.readLengthCodedString(fields[${fieldNum}].encoding)`;
}
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