-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
bpo-32215: Fix performance regression in sqlite3 #8511
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
bpo-32215: Fix performance regression in sqlite3 #8511
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nice to add tests.
Is the tab character recognized as a whitespace by Sqlite?
|| (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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there commands that start with "update", "delete", etc? Can a user function that starts with such prefix (for example "replacewhitespaces()") be used in this context?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can a user function that starts with such prefix (for example "replacewhitespaces()") be used in this context?
Yes, they can. The original intent of the old version was to make that check more robust and avoid cases like you've mentioned. I don't think there is a way to achieve this without relying on SQLite APIs, but then relying on newer APIs usually results seeing "I can't compile the sqlite3 module on my system" issues on the tracker :)
To test that the performance regression is fixed or to test that something like a user defined function (e.g.
Looking at https://github.com/mackyle/sqlite/blob/master/src/tokenize.c it does. |
First, test that Testing a user function starting with one of these prefixes would be nice too. |
I'm going to merge this without tests to get it in for 3.7.1 and open a separate pull request for tests. |
Thanks @berkerpeksag for the PR 🌮🎉.. I'm working now to backport this PR to: 3.6, 3.7. |
(cherry picked from commit 8d1e190) Co-authored-by: Berker Peksag <berker.peksag@gmail.com>
GH-9441 is a backport of this pull request to the 3.7 branch. |
(cherry picked from commit 8d1e190) Co-authored-by: Berker Peksag <berker.peksag@gmail.com>
GH-9442 is a backport of this pull request to the 3.6 branch. |
Thanks @berkerpeksag for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7. |
(cherry picked from commit 8d1e190) Co-authored-by: Berker Peksag <berker.peksag@gmail.com>
GH-9449 is a backport of this pull request to the 3.7 branch. |
Thanks @berkerpeksag for the PR 🌮🎉.. I'm working now to backport this PR to: 3.6. |
(cherry picked from commit 8d1e190) Co-authored-by: Berker Peksag <berker.peksag@gmail.com>
GH-9452 is a backport of this pull request to the 3.6 branch. |
https://bugs.python.org/issue32215