Skip to content

Commit 8198b81

Browse files
author
Erlend E. Aasland
committed
SQLITE_LIMIT_SQL_LENGTH is inclusive
1 parent 79a57ff commit 8198b81

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Modules/_sqlite/cursor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,7 @@ pysqlite_cursor_executescript_impl(pysqlite_Cursor *self,
730730
size_t sql_len = strlen(sql_script);
731731
int max_length = sqlite3_limit(self->connection->db,
732732
SQLITE_LIMIT_SQL_LENGTH, -1);
733-
if (sql_len >= (unsigned)max_length) {
733+
if (sql_len > (unsigned)max_length) {
734734
PyErr_SetString(self->connection->DataError,
735735
"query string is too large");
736736
return NULL;

Modules/_sqlite/statement.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ pysqlite_statement_create(pysqlite_Connection *connection, PyObject *sql)
6161

6262
sqlite3 *db = connection->db;
6363
int max_length = sqlite3_limit(db, SQLITE_LIMIT_SQL_LENGTH, -1);
64-
if (size >= max_length) {
64+
if (size > max_length) {
6565
PyErr_SetString(connection->DataError,
6666
"query string is too large");
6767
return NULL;

0 commit comments

Comments
 (0)