Skip to content

Commit b7cf26a

Browse files
committed
Parses OkPacket message and try to find changed rows (should solve most of #251)
Exposes the key "changedRows"
1 parent 1ff4b90 commit b7cf26a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/protocol/packets/OkPacket.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ OkPacket.prototype.parse = function(parser) {
1515
this.serverStatus = parser.parseUnsignedNumber(2);
1616
this.warningCount = parser.parseUnsignedNumber(2);
1717
this.message = parser.parsePacketTerminatedString();
18+
19+
var m = this.message.match(/\schanged:\s*(\d+)/i);
20+
21+
if (m !== null) {
22+
this.changedRows = parseInt(m[1], 10);
23+
}
1824
};
1925

2026
OkPacket.prototype.write = function(writer) {

0 commit comments

Comments
 (0)