summaryrefslogtreecommitdiff
path: root/Modules/_sqlite/statement.c
diff options
context:
space:
mode:
authorErlend Egeberg Aasland <erlend.aasland@innova.no>2021-11-10 19:46:11 +0100
committerGitHub <noreply@github.com>2021-11-10 18:46:11 +0000
commitc1323d4b8cb010a06c11bace6e681bea7f895851 (patch)
tree37800fb4b11f3dddef2f3c337fbf0deb98884d69 /Modules/_sqlite/statement.c
parent4cdeee5978ee3f8ea7fe95172ae04d866cd88177 (diff)
downloadcpython-git-c1323d4b8cb010a06c11bace6e681bea7f895851.tar.gz
bpo-45754: Use correct SQLite limit when checking statement length (GH-29489)
Diffstat (limited to 'Modules/_sqlite/statement.c')
-rw-r--r--Modules/_sqlite/statement.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/_sqlite/statement.c b/Modules/_sqlite/statement.c
index b20c91da31..66fadb63e5 100644
--- a/Modules/_sqlite/statement.c
+++ b/Modules/_sqlite/statement.c
@@ -60,8 +60,8 @@ pysqlite_statement_create(pysqlite_Connection *connection, PyObject *sql)
}
sqlite3 *db = connection->db;
- int max_length = sqlite3_limit(db, SQLITE_LIMIT_LENGTH, -1);
- if (size >= max_length) {
+ int max_length = sqlite3_limit(db, SQLITE_LIMIT_SQL_LENGTH, -1);
+ if (size > max_length) {
PyErr_SetString(connection->DataError,
"query string is too large");
return NULL;