Skip to content

Commit a25d38f

Browse files
Merge pull request balderdashy#71 from chadxz/master
making update statement return empty result set when criteria would affect 0 rows
2 parents 5adaedd + a83cd9b commit a25d38f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/adapter.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,11 @@ module.exports = (function() {
429429
connection.query(query, function(err, results) {
430430
if(err) return cb(err);
431431

432+
// update statement will affect 0 rows
433+
if (results.length === 0) {
434+
return cb(null, []);
435+
}
436+
432437
var pks = [];
433438

434439
results.forEach(function(result) {

0 commit comments

Comments
 (0)