From 14d9f43991fcc888c726796b16a2f22eeb4247bd Mon Sep 17 00:00:00 2001 From: Linden <65407488+thelindat@users.noreply.github.com> Date: Sat, 19 Feb 2022 09:32:55 +1100 Subject: [PATCH] fix(mysql2/binary_parser): Return BLOB as an array --- patches/mysql2+2.3.3.patch | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/patches/mysql2+2.3.3.patch b/patches/mysql2+2.3.3.patch index 6685bbe..3f825e9 100644 --- a/patches/mysql2+2.3.3.patch +++ b/patches/mysql2+2.3.3.patch @@ -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