-
-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
[Lock] fix PDO SQLSRV throws for method_exists() #43316
Conversation
pdo_sqlsrv driver 5.9.0 on mac throws an exception for any call on method_exists(). (see microsoft/msphpsql/issues/1306) executeStatement() is a DBAL-method, exec() is PDO. fix by excluding method_exists() check for PDO type of connections
It looks like you unchecked the "Allow edits from maintainer" box. That is fine, but please note that if you have multiple commits, you'll need to squash your commits into one before this can be merged. Or, you can check the "Allow edits from maintainers" box and the maintainer can squash for you. Cheers! Carsonbot |
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 you please confirm there are no similar changes needed in any other components, and add them to this PR if not?
I'm not using any other components that use PDO in this way (e.g. http-foundation, process) I was hoping for a hot-fix so we could deploy, since the prune command crashed and made locks hang. |
would be nice yes 🙏 |
For now i have updated our Fork of the lock component, so we could deploy. Can you help with the pull request? if ($conn instanceof Connection && method_exists($conn, 'executeStatement')) {
$conn->executeStatement($sql);
} else {
$conn->exec($sql);
} else { |
Correct, but it has been deprecated and removed in later DBAL versions. This is why we have that code: If our connection is a DBAL connection that already implements
Yes please! Your proposed condition is the way to go, imho: if ($conn instanceof Connection && method_exists($conn, 'executeStatement')) { |
pdo_sqlsrv driver 5.9.0 (on mac) always throws an exception for any call on method_exists().
(see microsoft/msphpsql/issues/1306)
executeStatement()
is a DBAL-method, andexec()
is PDO.fix by excluding method_exists() check for PDO type of connections