Skip to content

Commit

Permalink
fixed incorrext error packet length calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
sidorares committed Jun 3, 2013
1 parent 88a81d0 commit 1ec11b3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/packets/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ module.exports.Error = function Error() {
};

module.exports.Error.toPacket = function(args) {
var packet = new Packet(0, new Buffer(9 + Buffer.byteLength(args.message, 'utf8')));
var packet = new Packet(0, new Buffer(13 + Buffer.byteLength(args.message, 'utf8')));
packet.offset = 4;
packet.writeInt8(0xff);
packet.writeInt16(args.code);
packet.writeString('#______');
packet.writeString('#_____');
packet.writeString(args.message);
return packet;
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mysql2",
"version": "0.8.11",
"version": "0.8.12",
"description": "fast mysql driver. Implements core protocol, prepared statements, ssl and compression in native JS",
"main": "index.js",
"directories": {
Expand Down

0 comments on commit 1ec11b3

Please sign in to comment.