-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
fix: prepared query is executed when using QueryBuilder #6164
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.
I'm not very familiar with query pretending but the code logic looks good. Was this bug actually "hiding" because of the PHPStan exemption? Or was that just a coincidence?
The changes seem fine but I guess I'm not understanding how this stops the prepared query from being executed with a query builder call. |
@lonnieezell See the current
But the line to return when $pretend is true is here.CodeIgniter4/system/Database/BaseConnection.php Lines 664 to 669 in e8f2080
I have moved this before the I believe this PR behaves the same as before in Prepared Queries without the bug, |
Probably no. If we remove the the PHPStan exemption, we get the errors.
It is true that the if conditions of the lines with errors are not necessary, but probably we don't notice this bug. |
Description
How to confirm the bug
The MySQL query log of testExecuteRunsQueryAndReturnsResultObject():
Checklist: