8000 bpo-44165: optimise sqlite3 statement preparation by passing string size by erlend-aasland · Pull Request #26206 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-44165: optimise sqlite3 statement preparation by passing string size #26206

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 5 commits into from
Jun 2, 2021
Merged
Show file tree
Hide file tree
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
Raise DataError iso. OverflowError to keep current behaviour
  • Loading branch information
Erlend E. Aasland committed May 19, 2021
commit d981be607da735a80ab5b467dfb8e1efb82dbb5f
2 changes: 1 addition & 1 deletion Modules/_sqlite/cursor.c
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ pysqlite_cursor_executescript(pysqlite_Cursor *self, PyObject *script_obj)
return NULL;
}
if (sql_len >= self->connection->max_length) {
PyErr_SetString(PyExc_OverflowError, "query string is too large");
PyErr_SetString(pysqlite_DataError, "query string is too large");
return NULL;
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion Modules/_sqlite/statement.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ int pysqlite_statement_create(pysqlite_Statement* self, pysqlite_Connection* con
return rc;
}
if (sql_cstr_len >= connection->max_length) {
PyErr_SetString(PyExc_OverflowError, "query string is too large");
PyErr_SetString(pysqlite_DataError, "query string is too large");
return PYSQLITE_TOO_MUCH_SQL;
}
if (strlen(sql_cstr) != (size_t)sql_cstr_len) {
Expand Down
0