[issue44041] [sqlite3] optimisation: only call sqlite3_column_count when needed

2021-06-04 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: This change breaks existing behaviour (see test below). Also, sqlite3_column_count() is implemented as a simple lookup in SQLite; it is never an expensive function. Suggests to add the following test instead: diff --git a/Lib/sqlite3/test/dbapi.py

[issue44041] [sqlite3] optimisation: only call sqlite3_column_count when needed

2021-05-04 Thread Erlend Egeberg Aasland
Change by Erlend Egeberg Aasland : -- keywords: +patch pull_requests: +24575 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25907 ___ Python tracker

[issue44041] [sqlite3] optimisation: only call sqlite3_column_count when needed

2021-05-04 Thread Erlend Egeberg Aasland
New submission from Erlend Egeberg Aasland : Pr. now, we call sqlite3_column_count() for every iteration in the _pysqlite_query_execute() loop. If detect_types is set, we call it twice for every loop. Suggesting to move it out of the loop and into the pysqlite_Statement object. In