-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix sqlite3 fetchArray #64531 #5137
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
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.
Thanks for the PR! According to your comment in the bugtracker, this should probably target PHP-7.3, so please rebase onto that branch.
Anyhow, while this is not a general fix for bug #64531, it seems that it still makes sense to have this patched.
Please address my comment below, and also please add test cases which show what is fixed, and what is not yet fixed with this patch. Thanks.
Pushed again to force travis-ci tests rerun. Network problems... |
Note I've rebased from 7.3 branch and renamed as master in my repo. The pull request still points to php/master branch (should be changed to 7.3). Let me know if I should open a new PR to the correct branch. Regards |
Nope, not necessary. I'll currently investigate on some not directly related issues I've stumbled upon while having a closer look at this PR. Will come back to this PR afterwards. Thanks for the added test case, anyway. :) |
I'm not sure if this solution would really be helpful. While it certainly catches some cases, it wouldn't work for the PR #5204 would be a cleaner solution, but has issues on its own (error code). |
Fix #64531 SQLite3 SQLite3Result::fetchArray()
Avoid sqlite3_step() call when result contains no columns (ie non-select-like query).
sqlite3_column_count() described here https://sqlite.org/c3ref/column_count.html
A SELECT statement will always have a positive sqlite3_column_count()
Patch uploaded: https://bugs.php.net/patch-display.php?bug_id=64531&patch=fix64531-sqlite3-fetchArray-skipNoColumns&revision=1580516014