Author: Amaury Forgeot d'Arc <[email protected]>
Branch: py3.6
Changeset: r93457:b9413da29d91
Date: 2017-12-14 22:52 +0100
http://bitbucket.org/pypy/pypy/changeset/b9413da29d91/
Log: CPython Issue #16864: Cursor.lastrowid now supports REPLACE
statement
diff --git a/lib_pypy/_sqlite3.py b/lib_pypy/_sqlite3.py
--- a/lib_pypy/_sqlite3.py
+++ b/lib_pypy/_sqlite3.py
@@ -930,7 +930,9 @@
self.__rowcount = 0
self.__rowcount +=
_lib.sqlite3_changes(self.__connection._db)
- if not multiple and self.__statement._type ==
_STMT_TYPE_INSERT:
+ if not multiple and self.__statement._type in (
+ # REPLACE is an alias for INSERT OR REPLACE
+ _STMT_TYPE_INSERT, _STMT_TYPE_REPLACE):
self.__lastrowid =
_lib.sqlite3_last_insert_rowid(self.__connection._db)
else:
self.__lastrowid = None
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit