[New-bugs-announce] [issue44965] [sqlite3] early exit for non-DML statements in executemany()
Erlend E. Aasland
report at bugs.python.org
Fri Aug 20 16:07:27 EDT 2021
New submission from Erlend E. Aasland <erlend.aasland at innova.no>:
Currently, if a non-DML statement is executed with executemany(), we only bail as late as possible: just before the call to _pysqlite_fetch_one_row(). This means that we've already stepped through the statement once (!), and possibly bound values, built the row cast map, and created the description tuple, all before raising the "executemany() can only execute DML statements."
So, the error message currently is not quite true, because we already executed the statement once.
Checking for this earlier will prevent a (possibly time-consuming) sqlite3_step(), and it will leave the main loop in _pysqlite_query_execute() slightly easier to read, IMO.
----------
components: Extension Modules
messages: 399992
nosy: berker.peksag, erlendaasland, serhiy.storchaka
priority: low
severity: normal
status: open
title: [sqlite3] early exit for non-DML statements in executemany()
type: enhancement
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44965>
_______________________________________
More information about the New-bugs-announce
mailing list