Do not return lastInsertRowID for INSERT, REPLACE, and CREATE
Unreliable for async queries
This commit is contained in:
parent
6cef123662
commit
0320b08b05
1 changed files with 3 additions and 9 deletions
|
@ -673,15 +673,9 @@ Zotero.DBConnection.prototype.queryAsync = function (sql, params, options) {
|
||||||
return rows;
|
return rows;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (op == 'insert' || op == 'replace') {
|
// lastInsertRowID is unreliable for async queries, so we don't bother
|
||||||
return conn.lastInsertRowID;
|
// returning it for SELECT and REPLACE queries
|
||||||
}
|
return;
|
||||||
else if (op == 'create') {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return conn.affectedRows;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(function (e) {
|
.catch(function (e) {
|
||||||
|
|
Loading…
Reference in a new issue