8000 gh-79579: Improve DML query detection in sqlite3 by erlend-aasland · Pull Request #93623 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-79579: Improve DML query detection in sqlite3 #93623

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Adjust comment
  • Loading branch information
erlend-aasland committed Jun 8, 2022
commit 631f24dd076319234720da4f2584996a0f1a316b
7 changes: 5 additions & 2 deletions Modules/_sqlite/statement.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,15 @@ stmt_traverse(pysqlite_Statement *self, visitproc visit, void *arg)
}

/*
* Checks if there is anything left in an SQL string after SQLite compiled it.
* Strips leading whitespace and SQL comments from input string and returns a
* pointer to the first non-whitespace, non-comment character.
*
* This is used to check if somebody tried to execute more than one SQL command
* with one execute()/executemany() command, which the DB-API and we don't
* allow.
*
* Returns 1 if there is more left than should be. 0 if ok.
* It is also used to strip leading whitespace and comments from input SQL
* queries, so we can easily detect DML queries.
*/
static const char *
lstrip_sql(const char *sql)
Expand Down
0