Skip to content

Commit db13c91

Browse files
authored
Merge pull request #667 from williamdes/master
sqlState normalized (error object) && minor version bump && Changelog update
2 parents 5719e9f + 51f5b50 commit db13c91

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

Changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
1.4.3 (03/11/2017)
2+
- Added sqlMessage to Error callback object #665
3+
- Normalized sqlState to a string of 5 chars #667
4+
as Mysql specifies it
15
1.4.2 ( 27/08/2017 )
26
- fix null value incorrectly returned as empty
37
string fro int values in text protocol #637

lib/packets/packet.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,8 @@ Packet.prototype.asError = function(encoding) {
706706
var errorCode = this.readInt16();
707707
var sqlState = '';
708708
if (this.buffer[this.offset] == 0x23) {
709-
sqlState = this.readBuffer(6).toString();
709+
this.skip(1);
710+
sqlState = this.readBuffer(5).toString();
710711
}
711712
var message = this.readString(undefined, encoding);
712713
var err = new Error(message);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mysql2",
3-
"version": "1.4.2",
3+
"version": "1.4.3",
44
"description": "fast mysql driver. Implements core protocol, prepared statements, ssl and compression in native JS",
55
"main": "index.js",
66
"directories": {

0 commit comments

Comments
 (0)