Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
misc - correct character_set_client unexpect error parsing OK_Packet #…
  • Loading branch information
diego Dupin committed Dec 9, 2021
1 parent d17378a commit c8eb320
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/cmd/command.js
Expand Up @@ -113,7 +113,7 @@ class Command extends EventEmitter {
this.emit('end');
}

static parseOkPacket(packet, out, opts, info) {
parseOkPacket(packet, out, opts, info) {
packet.skip(1); //skip header

const affectedRows = packet.readUnsignedLength();
Expand Down
2 changes: 1 addition & 1 deletion lib/cmd/resultset.js
Expand Up @@ -138,7 +138,7 @@ class ResultSet extends Command {
* @returns {*} null or {Resultset.readResponsePacket} in case of multi-result-set
*/
readOKPacket(packet, out, opts, info) {
const okPacket = Command.parseOkPacket(packet, out, opts, info);
const okPacket = this.parseOkPacket(packet, out, opts, info);
this._rows.push(okPacket);

if (info.status & ServerStatus.MORE_RESULTS_EXISTS) {
Expand Down
6 changes: 6 additions & 0 deletions lib/io/packet.js
Expand Up @@ -285,6 +285,12 @@ class Packet {
return this.buf.toString('ascii', this.pos - len, this.pos);
}

readStringLength() {
throw new Error(
'code is normally superseded by Node encoder or Iconv depending on charset used'
);
}

readStringLengthEncoded(encoding) {
const len = this.readUnsignedLength();
if (len === null) return null;
Expand Down

0 comments on commit c8eb320

Please sign in to comment.