This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author erlendaasland
Recipients berker.peksag, erlendaasland, pablogsal, serhiy.storchaka
Date 2021-08-19.20:05:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1629403509.48.0.897657910933.issue44958@roundup.psfhosted.org>
In-reply-to
Content
Ref. Serhiy's msg387858 in bpo-43350:
"Maybe the code could be rewritten in more explicit way and call pysqlite_statement_reset() only when it is necessary [...]"

Currently, we try to reset statements in all "statement exit" routes. IMO, it would be cleaner to just reset statements when we really need to:
1. before the first sqlite3_step()
2. at cursor exit, if there's an active statement
(3. in pysqlite_do_all_statements() ... see bpo-44092)

This will make the code easier to follow, and it will minimise the number of resets. The current patch is pretty small: 7 insertions(+), 33 deletions(-)

Pro:
- less lines of code, less maintenance
- cleaner exit paths
- optimise SQLite API usage
Con:
- code churn


If this is accepted, PR 25984 of bpo-44073 will be easier to land and review :)
History
Date User Action Args
2021-08-20 07:33:50erlendaaslandunlinkissue44958 messages
2021-08-19 20:05:09erlendaaslandsetrecipients: + erlendaasland, berker.peksag, serhiy.storchaka, pablogsal
2021-08-19 20:05:09erlendaaslandsetmessageid: <1629403509.48.0.897657910933.issue44958@roundup.psfhosted.org>
2021-08-19 20:05:09erlendaaslandlinkissue44958 messages
2021-08-19 20:05:08erlendaaslandcreate