commit 0320b08b054c3ab2b39fb46a30a8542520b5e9d9
parent 6cef1236628f5c0b7d6f9f5d9cbcda20e5f60c49
Author: Aurimas Vinckevicius <aurimas.dev@gmail.com>
Date: Wed, 16 Sep 2015 17:48:37 -0500
Do not return lastInsertRowID for INSERT, REPLACE, and CREATE
Unreliable for async queries
Diffstat:
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/chrome/content/zotero/xpcom/db.js b/chrome/content/zotero/xpcom/db.js
@@ -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) {