mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-44165: Optimise sqlite3 statement preparation by passing string size (GH-26206)
This commit is contained in:
parent
ee7637596d
commit
a384b6c040
3 changed files with 25 additions and 7 deletions
|
@ -451,7 +451,7 @@ pysqlite_connection_commit_impl(pysqlite_Connection *self)
|
|||
if (!sqlite3_get_autocommit(self->db)) {
|
||||
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
rc = sqlite3_prepare_v2(self->db, "COMMIT", -1, &statement, NULL);
|
||||
rc = sqlite3_prepare_v2(self->db, "COMMIT", 7, &statement, NULL);
|
||||
Py_END_ALLOW_THREADS
|
||||
if (rc != SQLITE_OK) {
|
||||
_pysqlite_seterror(self->db);
|
||||
|
@ -501,7 +501,7 @@ pysqlite_connection_rollback_impl(pysqlite_Connection *self)
|
|||
pysqlite_do_all_statements(self, ACTION_RESET, 1);
|
||||
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
rc = sqlite3_prepare_v2(self->db, "ROLLBACK", -1, &statement, NULL);
|
||||
rc = sqlite3_prepare_v2(self->db, "ROLLBACK", 9, &statement, NULL);
|
||||
Py_END_ALLOW_THREADS
|
||||
if (rc != SQLITE_OK) {
|
||||
_pysqlite_seterror(self->db);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue