Skip to content

Commit cf316db

Browse files
committed
Use the same regex as mysqljs for changed rows
1 parent 11c6c92 commit cf316db

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/packets/resultset_header.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ class ResultSetHeader {
9191
if (stateChanges) {
9292
this.stateChanges = stateChanges;
9393
}
94-
const m = this.info.match(/\schanged:\s*(\d+)/i);
94+
// Use the same regex as mysqljs at https://github.com/mysqljs/mysql/blob/dc9c152a87ec51a1f647447268917243d2eab1fd/lib/protocol/packets/OkPacket.js#L3C29-L3C91
95+
const m = this.info.match(/^[^:0-9]+: [0-9]+[^:0-9]+: ([0-9]+)[^:0-9]+: [0-9]+[^:0-9]*$/);
9596
if (m !== null) {
9697
this.changedRows = parseInt(m[1], 10);
9798
} else {

0 commit comments

Comments
 (0)