-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
ensureForwardCompatibilityStatement broke existing code #4619
Comments
A possible solution: Modify the change made in #4590 but call This is basically what I did as a temporary fix (call the |
I Can confirm same issue with custom PDO. |
@mdumoulin can you please advise? |
We have the same problem when using when using https://github.com/crate/crate-dbal implementation which is build on top of https://github.com/crate/crate-pdo which errors with following message:
|
@alexander-schranz The issue is on crate project side, the crate driver connection should implements DBAL\Driver\Connection interface : https://github.com/doctrine/dbal/blob/2.13.x/lib/Doctrine/DBAL/Driver/Connection.php To be specific, the PDOConnection::exec() method should return a DBAL\Driver\Statement object instead of a \PDOStatement object to be compatible with DBAL. You may take inspiration of Driver\PDOConnection for solution : https://github.com/doctrine/dbal/blob/2.13.x/lib/Doctrine/DBAL/Driver/PDOConnection.php#L40 |
@mdumoulin Thx for the response. The Connection interface is used over the ServerInfoAwareInterface. I hope crate pdo support that attribute for the statement, tried to fix it in there repository. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Bug Report
This is likely a low priority.
Summary
Commit 4297f50 broke
Connection
when passing in$params['pdo']
#4590 says it should have fixed the issue, but I'm using 2.13.1 and it still seems to be broken.
Current behaviour
If you build a
Connection
object using an already established$params['pdo']
connection, commit 4297f50 caused breaking changes that no longer allow that behavior. Now you get the following error:How to reproduce
executeQuery()
method, it calls$connection = $this->getWrappedConnection();
which is returning the raw PDO connection.$stmt = $connection->prepare($sql);
which is a raw PDOStatement object.return $this->ensureForwardCompatibilityStatement($stmt);
and it expects$stmt
to be an instance ofResultStatement
, but of course it's the raw PDOStatement instead.Expected behaviour
No error to be thrown
The text was updated successfully, but these errors were encountered: