]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-79579: Improve DML query detection in sqlite3 (#93623)
authorErlend Egeberg Aasland <erlend.aasland@protonmail.com>
Tue, 14 Jun 2022 11:56:36 +0000 (13:56 +0200)
committerGitHub <noreply@github.com>
Tue, 14 Jun 2022 11:56:36 +0000 (13:56 +0200)
commit46740073ef32bf83964c39609c7a7a4772c51ce3
tree659ceb673fb4e9e2606221a531270f61eb946dc5
parente566ce5496f1bad81c431aaee65e36d5e44771c5
gh-79579: Improve DML query detection in sqlite3 (#93623)

The fix involves using pysqlite_check_remaining_sql(), not only to check
for multiple statements, but now also to strip leading comments and
whitespace from SQL statements, so we can improve DML query detection.

pysqlite_check_remaining_sql() is renamed lstrip_sql(), to more
accurately reflect its function, and hardened to handle more SQL comment
corner cases.
Lib/test/test_sqlite3/test_dbapi.py
Misc/NEWS.d/next/Library/2022-06-06-12-58-27.gh-issue-79579.e8rB-M.rst [new file with mode: 0644]
Modules/_sqlite/statement.c