[issue43350] [sqlite3] Active statements are reset twice in _pysqlite_query_execute()

2021-08-19 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: msg387858 (Serhiy): > Maybe the code could be rewritten in more explicit way and call > pysqlite_statement_reset() only when it is necessary [...] I've opened bpo-44958 for such an enhancement. Closing this issue. -- resolution: -> duplicate

[issue43350] [sqlite3] Active statements are reset twice in _pysqlite_query_execute()

2021-05-10 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: Grep for SECONDRESET in log.txt to get the complete "API context". As far as I can see, there is no harm in removing the redundant reset statement. -- ___ Python tracker

[issue43350] [sqlite3] Active statements are reset twice in _pysqlite_query_execute()

2021-05-10 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: Complete fprintf log added, for reference. -- Added file: https://bugs.python.org/file50033/log.txt ___ Python tracker ___

[issue43350] [sqlite3] Active statements are reset twice in _pysqlite_query_execute()

2021-05-10 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: fprintf debugging patch added, for reference -- Added file: https://bugs.python.org/file50032/fprintf.diff ___ Python tracker ___

[issue43350] [sqlite3] Active statements are reset twice in _pysqlite_query_execute()

2021-05-10 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: Adding fprintf's in pysqlite_statement_reset: diff --git a/Modules/_sqlite/statement.c b/Modules/_sqlite/statement.c --- a/Modules/_sqlite/statement.c +++ b/Modules/_sqlite/statement.c @@ -347,19 +363,23 @@ int pysqlite_statement_reset(pysqlite_Statement*

[issue43350] [sqlite3] Active statements are reset twice in _pysqlite_query_execute()

2021-05-10 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: Tests that exercise this branch: Lib/sqlite3/test/dbapi.py: test_in_transaction Lib/sqlite3/test/dbapi.py: test_last_row_id_insert_o_r Lib/sqlite3/test/dbapi.py: test_on_conflict_abort_raises_with_explicit_transactions Lib/sqlite3/test/dbapi.py:

[issue43350] [sqlite3] Active statements are reset twice in _pysqlite_query_execute()

2021-05-10 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: Relevant historical commits: - https://github.com/ghaering/pysqlite/commit/a471f0495956c3b8e3f45895b172e522a9ecd683 - https://github.com/ghaering/pysqlite/commit/5a009ed6fb2e90b952438f5786f93cd1e8ac8722 - 191321d11bc7e064e1a07830a43fa600de310e1b (in

[issue43350] [sqlite3] Active statements are reset twice in _pysqlite_query_execute()

2021-05-10 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: Relevant historical commits: - https://github.com/ghaering/pysqlite/commit/a471f0495956c3b8e3f45895b172e522a9ecd683 - https://github.com/ghaering/pysqlite/commit/5a009ed6fb2e90b952438f5786f93cd1e8ac8722 - 191321d11bc7e064e1a07830a43fa600de310e1bj (in

[issue43350] [sqlite3] Active statements are reset twice in _pysqlite_query_execute()

2021-05-10 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- Removed message: https://bugs.python.org/msg393386 ___ Python tracker ___ ___ Python-bugs-list

[issue43350] [sqlite3] Active statements are reset twice in _pysqlite_query_execute()

2021-05-10 Thread Greg Stein
Change by Greg Stein : -- nosy: +gstein nosy_count: 3.0 -> 4.0 pull_requests: +24667 pull_request: https://github.com/python/cpython/pull/26015 ___ Python tracker ___

[issue43350] [sqlite3] Active statements are reset twice in _pysqlite_query_execute()

2021-05-10 Thread Berker Peksag
Berker Peksag added the comment: Serhiy is right. Without a proper research on why it was added in the first place, simply removing the second call won't make code any better and it may introduce regressions (we've already introduced two in 3.10) Maybe doing some digging in pysqlite commits

[issue43350] [sqlite3] Active statements are reset twice in _pysqlite_query_execute()

2021-05-08 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: > Hm, I guess we could use sqlite3_stmt_busy() instead of the in_use flag. I opened bpo-44073 for this. -- ___ Python tracker ___

[issue43350] [sqlite3] Active statements are reset twice in _pysqlite_query_execute()

2021-03-01 Thread Erlend Egeberg Aasland
Erlend Egeberg Aasland added the comment: Hm, I guess we could use sqlite3_stmt_busy() instead of the in_use flag. -- ___ Python tracker ___

[issue43350] [sqlite3] Active statements are reset twice in _pysqlite_query_execute()

2021-03-01 Thread Erlend Egeberg Aasland
Erlend Egeberg Aasland added the comment: > There are three calls of pysqlite_statement_reset() in > _pysqlite_query_execute() Yes, but only two before the cache is queried. > So additional call of pysqlite_statement_reset() does not harm. That's true, but removing redundant code makes it

[issue43350] [sqlite3] Active statements are reset twice in _pysqlite_query_execute()

2021-03-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There are three calls of pysqlite_statement_reset() in _pysqlite_query_execute(). And all three of them can be called with the same statement object. But repeated calls are no-ops because pysqlite_statement_reset() clears flag in_use and calls

[issue43350] [sqlite3] Active statements are reset twice in _pysqlite_query_execute()

2021-03-01 Thread Erlend Egeberg Aasland
Change by Erlend Egeberg Aasland : -- keywords: +patch pull_requests: +23466 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24681 ___ Python tracker

[issue43350] [sqlite3] Active statements are reset twice in _pysqlite_query_execute()

2021-03-01 Thread Erlend Egeberg Aasland
New submission from Erlend Egeberg Aasland : In _pysqlite_query_execute(), if the cursor already has a statement object, it is reset twice before the cache is queried. -- components: Library (Lib) messages: 387850 nosy: berker.peksag, erlendaasland, serhiy.storchaka priority: normal