mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
Issue #16864: Cursor.lastrowid now supports REPLACE statement
Initial patch by Alex LordThorsen.
This commit is contained in:
parent
34f12d7315
commit
e0b70cd8a9
6 changed files with 66 additions and 5 deletions
|
|
@ -698,7 +698,9 @@ PyObject* _pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject*
|
|||
}
|
||||
|
||||
Py_DECREF(self->lastrowid);
|
||||
if (!multiple && statement_type == STATEMENT_INSERT) {
|
||||
if (!multiple &&
|
||||
/* REPLACE is an alias for INSERT OR REPLACE */
|
||||
(statement_type == STATEMENT_INSERT || statement_type == STATEMENT_REPLACE)) {
|
||||
sqlite_int64 lastrowid;
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
lastrowid = sqlite3_last_insert_rowid(self->connection->db);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue