Skip to content
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

Doctrine DBAL 2.13 $statement->execute() returns bool (instead of Result) #4569

Closed
knallcharge opened this issue Apr 1, 2021 · 6 comments · Fixed by #4580
Closed

Doctrine DBAL 2.13 $statement->execute() returns bool (instead of Result) #4569

knallcharge opened this issue Apr 1, 2021 · 6 comments · Fixed by #4580

Comments

@knallcharge
Copy link

Bug Report

Q A
BC Break no
Version 2.13.0

Summary

The release notes for DBAL 2.13 (https://www.doctrine-project.org/2021/03/29/dbal-2.13.html) stated that "DBAL 3.0 extracts all fetch-methods from the Statement API and moved them to a new Result API that is returned from Statement::execute. **We have backported this API to 2.13**"
It also gives an example that with 2.13 you could/should use code like this:

$result = $statement->execute();
while (($row = $result->fetchAssociative()) !== false) {
}

Current behaviour

$statement->execute() still returns only a boolean value instead of a resultset.

How to reproduce

  • Upgrade to 2.13.0
  • try to use fetch() on the result of $statement->execute()

Expected behaviour

$statement->execute() should return a resultset instead of bool.

@michaljusiega
Copy link

I can confirm, that changes in 2.13.0 is a little weird comparing to Changelog.

@beberlei
Copy link
Member

beberlei commented Apr 1, 2021

Yes it looks we made a mistake there, will try to figure it out.

@michaljusiega
Copy link

Yes it looks we made a mistake there, will try to figure it out.

Thank you.

@beberlei
Copy link
Member

Fixed in #4580

@knallcharge
Copy link
Author

Thanks for the fix. Side note: The release doc (https://www.doctrine-project.org/2021/03/29/dbal-2.13.html) still states that "$result = $statement->execute();" is to be used now. Updating to 2.13.1 reveals that execute() is now (too) deprecated, so the notes could need an update :)

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants