Do not return lastInsertRowID for INSERT, REPLACE, and CREATE

Unreliable for async queries
This commit is contained in:
Aurimas Vinckevicius 2015-09-16 17:48:37 -05:00
parent 6cef123662
commit 0320b08b05

View file

@ -673,15 +673,9 @@ Zotero.DBConnection.prototype.queryAsync = function (sql, params, options) {
return rows;
}
else {
if (op == 'insert' || op == 'replace') {
return conn.lastInsertRowID;
}
else if (op == 'create') {
return true;
}
else {
return conn.affectedRows;
}
// lastInsertRowID is unreliable for async queries, so we don't bother
// returning it for SELECT and REPLACE queries
return;
}
})
.catch(function (e) {