summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorErlend Egeberg Aasland <erlend.aasland@innova.no>2022-01-03 19:02:39 (GMT)
committerGitHub <noreply@github.com>2022-01-03 19:02:39 (GMT)
commit9d6a239a34a66e16188d76c23a3a770515ca44ca (patch)
tree254afa367df14a95548df952452285de93cb37a3 /Modules
parent9d35dedc5e7e940b639230fba93c763bd9f19c09 (diff)
downloadcpython-9d6a239a34a66e16188d76c23a3a770515ca44ca.zip
cpython-9d6a239a34a66e16188d76c23a3a770515ca44ca.tar.gz
cpython-9d6a239a34a66e16188d76c23a3a770515ca44ca.tar.bz2
bpo-44092: Don't reset statements/cursors before rollback (GH-26026)
In SQLite versions pre 3.7.11, pending statements would block a rollback. This is no longer the case, so remove the workaround.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_sqlite/connection.c24
1 files changed, 0 insertions, 24 deletions
diff --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c
index 4f0baa6..02f4ac4 100644
--- a/Modules/_sqlite/connection.c
+++ b/Modules/_sqlite/connection.c
@@ -274,28 +274,6 @@ pysqlite_connection_init_impl(pysqlite_Connection *self,
return 0;
}
-static void
-pysqlite_do_all_statements(pysqlite_Connection *self)
-{
- // Reset all statements
- sqlite3_stmt *stmt = NULL;
- while ((stmt = sqlite3_next_stmt(self->db, stmt))) {
- if (sqlite3_stmt_busy(stmt)) {
- (void)sqlite3_reset(stmt);
- }
- }
-
- // Reset all cursors
- for (int i = 0; i < PyList_Size(self->cursors); i++) {
- PyObject *weakref = PyList_GetItem(self->cursors, i);
- PyObject *object = PyWeakref_GetObject(weakref);
- if (object != Py_None) {
- pysqlite_Cursor *cursor = (pysqlite_Cursor *)object;
- cursor->reset = 1;
- }
- }
-}
-
#define VISIT_CALLBACK_CONTEXT(ctx) \
do { \
if (ctx) { \
@@ -549,8 +527,6 @@ pysqlite_connection_rollback_impl(pysqlite_Connection *self)
}
if (!sqlite3_get_autocommit(self->db)) {
- pysqlite_do_all_statements(self);
-
int rc;
Py_BEGIN_ALLOW_THREADS