-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Lock] Don't allow mysqli to be used as it doesn't work #35375
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
OR, we shouldn't use named parameters. Can you consider this option? |
Yep that would be my preference. How would you like to approach regression tests? |
maybe just a comment inline telling why we don't use named params? |
ef3bcda
to
90752a2
Compare
Seems like a dangerous approach to regression testing but as that's your preference I've pushed up a version that replaces named parameters with positional ones and removes the exception I previously added |
I didn't say that's my preference :) |
Side question: why are you using mysqli instead of PDO? |
We had some legacy code in an application that was using We're switching it to |
Thanks for the feedback. Since myslqi doesn't work already, let's throw an exception when someone tries to use it with Lock, but also with Cache or HttpFoundation's Session. |
Ok I'll take a look at adding those exceptions now... |
90752a2
to
ef3bcda
Compare
I've reverted this to the exception version now, and opened #35473 for cache, I couldn't see anywhere the session handler supports |
I'm thinking of ./src/Symfony/Component/HttpFoundation/Session/Storage/Handler/PdoSessionHandler.php |
Sorry I wasn't clear, that's the file I've looked in, it only codes for |
OK, got it, you're right, nothing to change there. |
… (duncan3dc) This PR was merged into the 4.3 branch. Discussion ---------- [Cache] Don't allow mysqli to be used as it doesn't work | Q | A | ------------- | --- | Branch? | 4.3 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | | License | MIT | Doc PR | As discussed in #35375 Mysqli doesn't support named parameters, so if you pass a doctrine connection using `mysqli` then you get errors for any queries using named parameters. This PR ensures a clear error is provided and suggests to use `pdo_mysql` instead Commits ------- a786448 Mysqli doesn't support the named parameters used by PdoAdapter
Thank you @duncan3dc. |
…(duncan3dc) This PR was merged into the 4.3 branch. Discussion ---------- [Lock] Don't allow mysqli to be used as it doesn't work | Q | A | ------------- | --- | Branch? | 4.3 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | | License | MIT | Doc PR | Mysqli doesn't support named parameters, so if you pass a doctrine connection using `mysqli` then you get the following error: `You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':id, :token, UNIX_TIMESTAMP() + 300)'` This PR ensures a clear error is provided and suggests to use `pdo_mysql` instead Commits ------- ef3bcda Mysqli doesn't support the named parameters used by PdoStore
Mysqli doesn't support named parameters, so if you pass a doctrine connection using
mysqli
then you get the following error:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':id, :token, UNIX_TIMESTAMP() + 300)'
This PR ensures a clear error is provided and suggests to use
pdo_mysql
instead