Skip to content

Commit f8fe05b

Browse files
committed
Added the icov for later encoding parsing
1 parent 4105981 commit f8fe05b

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

lib/compile_text_parser.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ function compile (fields, options, config) {
1313

1414
// node-mysql typeCast compatibility wrapper
1515
// see https://github.com/mysqljs/mysql/blob/96fdd0566b654436624e2375c7b6604b1f50f825/lib/protocol/packets/Field.js
16-
function wrap(field, type, packet) {
16+
function wrap (field, type, packet) {
1717
return {
1818
type: type,
1919
length: field.columnLength,
2020
db: field.schema,
2121
table: field.table,
2222
name: field.name,
23-
string: function() { return packet.readLengthCodedString(); },
23+
string: function () { return packet.readLengthCodedString(); },
2424
buffer: function () { return packet.readLengthCodedBuffer(); },
2525
geometry: function () { return packet.parseGeometryValue(); }
2626
};

lib/packets/packet.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// var BigNumber = require("bignumber.js");
1+
var iconv = require('iconv-lite');
22
var ErrorCodeToName = require('../constants/errors.js');
33

44
var Long = require('long');
@@ -340,7 +340,7 @@ Packet.prototype.readTimeString = function (convertTtoMs) {
340340
return (sign === -1 ? '-' : '') + [(d ? (d * 24) + H : H), leftPad(2, M), leftPad(2, S)].join(':') + (ms ? '.' + ms : '');
341341
};
342342

343-
Packet.prototype.readLengthCodedString = function () {
343+
Packet.prototype.readLengthCodedString = function (charset) {
344344
var len = this.readLengthCodedNumber();
345345
// TODO: check manually first byte here to avoid polymorphic return type?
346346
if (len === null) {

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"dependencies": {
3131
"cardinal": "0.7.0",
3232
"double-ended-queue": "2.1.0-0",
33+
"iconv-lite": "^0.4.13",
3334
"long": "^3.2.0",
3435
"named-placeholders": "1.1.1",
3536
"readable-stream": "2.1.4",

0 commit comments

Comments
 (0)