8000 bpo-32215: Fix performance regression in sqlite3 (GH-8511) · python/cpython@4fb672f · GitHub
[go: up one dir, main page]

Skip to content

Commit 4fb672f

Browse files
miss-islingtonberkerpeksag
< 8000 a class="Box-sc-g0xbh4-0 dkaFxu prc-Link-Link-85e08" data-muted="true" muted="" href="/python/cpython/commits?author=miss-islington" aria-label="commits by miss-islington" data-hovercard-url="/users/miss-islington/hovercard">miss-islington
andcommitted
bpo-32215: Fix performance regression in sqlite3 (GH-8511)
(cherry picked from commit 8d1e190) Co-authored-by: Berker Peksag <berker.peksag@gmail.com>
1 parent 1eabe19 commit 4fb672f

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix performance regression in :mod:`sqlite3` when a DML statement appeared
2+
in a different line than the rest of the SQL query.

Modules/_sqlite/statement.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@ int pysqlite_statement_create(pysqlite_Statement* self, pysqlite_Connection* con
8585
continue;
8686
}
8787

88-
self->is_dml = (PyOS_strnicmp(p, "insert ", 7) == 0)
89-
|| (PyOS_strnicmp(p, "update ", 7) == 0)
90-
|| (PyOS_strnicmp(p, "delete ", 7) == 0)
91-
|| (PyOS_strnicmp(p, "replace ", 8) == 0);
88+
self->is_dml = (PyOS_strnicmp(p, "insert", 6) == 0)
89+
|| (PyOS_strnicmp(p, "update", 6) == 0)
90+
|| (PyOS_strnicmp(p, "delete", 6) == 0)
91+
|| (PyOS_strnicmp(p, "replace", 7) == 0);
9292
break;
9393
}
9494

0 commit comments

Comments
 (0)
0