[New-bugs-announce] [issue44092] [sqlite3] consider removing special rollback handling
Erlend E. Aasland
report at bugs.python.org
Sun May 9 17:36:02 EDT 2021
New submission from Erlend E. Aasland <erlend.aasland at innova.no>:
Ref. bpo-33376 and bpo-10513.
Quoting from the SQLite 3.7.11 changelog:
"Pending statements no longer block ROLLBACK. Instead, the pending statement will return SQLITE_ABORT upon next access after the ROLLBACK."
Quoting from the SQLite 188.8.131.52 changelog:
"Enhance the ROLLBACK command so that pending queries are allowed to continue as long as the schema is unchanged. Formerly, a ROLLBACK would cause all pending queries to fail with an SQLITE_ABORT or SQLITE_ABORT_ROLLBACK error. That error is still returned if the ROLLBACK modifies the schema."
Quoting from the SQLite docs:
"In more recent versions of SQLite, the ROLLBACK will proceed and pending statements will often be aborted, causing them to return an SQLITE_ABORT or SQLITE_ABORT_ROLLBACK error. In SQLite version 3.8.8 (2015-01-16) and later, a pending read will continue functioning after the ROLLBACK as long as the ROLLBACK does not modify the database schema."
I've done some tests with SQLite versions 3.35.4 and 3.7.15 where I've removed the call to pysqlite_do_all_statements() (introduced by ) in pysqlite_connection_rollback_impl(), and I've also removed the pysqlite_Cursor.reset member and all of the related code. The test suite passes fine (except for, as expected, the two tests that check for InterfaceError in case of fetch across rollback).
Do we really need to special case rollbacks anymore? I've tried to come up with tests that prove this approach wrong, but I haven't found any yet.
components: Extension Modules
nosy: berker.peksag, erlendaasland, lemburg, serhiy.storchaka
title: [sqlite3] consider removing special rollback handling
versions: Python 3.11
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce