diff --git a/Misc/NEWS.d/next/Library/2018-07-28-12-08-53.bpo-32215.EU68SY.rst b/Misc/NEWS.d/next/Library/2018-07-28-12-08-53.bpo-32215.EU68SY.rst new file mode 100644 index 00000000000000..c097cf7310dfb3 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-07-28-12-08-53.bpo-32215.EU68SY.rst @@ -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. diff --git a/Modules/_sqlite/statement.c b/Modules/_sqlite/statement.c index 38690884227e68..78033d8efcaed1 100644 --- a/Modules/_sqlite/statement.c +++ b/Modules/_sqlite/statement.c @@ -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; }