Skip to content

Commit

Permalink
bpo-32215: Fix performance regression in sqlite3 (GH-8511)
Browse files Browse the repository at this point in the history
(cherry picked from commit 8d1e190)

Co-authored-by: Berker Peksag <berker.peksag@gmail.com>
  • Loading branch information
miss-islington and berkerpeksag committed Sep 20, 2018
1 parent 4761770 commit 015cd0f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix performance regression in :mod:`sqlite3` when a DML statement appeared
in a different line than the rest of the SQL query.
8 changes: 4 additions & 4 deletions Modules/_sqlite/statement.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ int pysqlite_statement_create(pysqlite_Statement* self, pysqlite_Connection* con
continue;
}

self->is_dml = (PyOS_strnicmp(p, "insert ", 7) == 0)
|| (PyOS_strnicmp(p, "update ", 7) == 0)
|| (PyOS_strnicmp(p, "delete ", 7) == 0)
|| (PyOS_strnicmp(p, "replace ", 8) == 0);
self->is_dml = (PyOS_strnicmp(p, "insert", 6) == 0)
|| (PyOS_strnicmp(p, "update", 6) == 0)
|| (PyOS_strnicmp(p, "delete", 6) == 0)
|| (PyOS_strnicmp(p, "replace", 7) == 0);
break;
}

Expand Down

0 comments on commit 015cd0f

Please sign in to comment.