Skip to content

[3.11] gh-79579: Improve DML query detection in sqlite3 (GH-93623) - #93800

Merged
erlend-aasland merged 1 commit into
python:3.11from
erlend-aasland:backport-4674007-3.11
Jun 14, 2022
Merged

erlend-aasland merged 1 commit into
python:3.11from
erlend-aasland:backport-4674007-3.11

Conversation

@erlend-aasland

Copy link
Copy Markdown
Contributor

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.
(cherry picked from commit 4674007)

Co-authored-by: Erlend Egeberg Aasland erlend.aasland@protonmail.com

…GH-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.
(cherry picked from commit 4674007)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
@erlend-aasland

Copy link
Copy Markdown
Contributor Author

test_threading changed the environment in the ASAN CI. Re-running.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants