Skip to content

Commit

Permalink
fix(mysql2/binary_parser): Return BLOB as an array
Browse files Browse the repository at this point in the history
  • Loading branch information
thelindat committed Feb 18, 2022
1 parent 82f0382 commit 14d9f43
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions patches/mysql2+2.3.3.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 14d9f43

Please sign in to comment.