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

Making sure that fetch returns false if nothing is found #2500

Merged
merged 2 commits into from
Sep 8, 2016
Merged

Making sure that fetch returns false if nothing is found #2500

merged 2 commits into from
Sep 8, 2016

Conversation

PatrickLouys
Copy link
Contributor

@PatrickLouys PatrickLouys commented Sep 8, 2016

added test to make sure that fetch returns false if nothing is found

fixed mysqli

Resolves #2497

@@ -242,7 +242,7 @@ public function fetch($fetchMode = null)
{
$values = $this->_fetch();
if (null === $values) {
return null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens when a null is actually retrieved? Is it supposed to always retrieve an array?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure that I understand your question.
It's supposed to return false or an array (boolean|array).

Now that I think about it, _fetch is not even supposed to return null in the first place, so that should be fixed as well I suppose.

@Ocramius Ocramius self-assigned this Sep 8, 2016
@Ocramius Ocramius added this to the 2.5.5 milestone Sep 8, 2016
@Ocramius Ocramius merged commit 8140eca into doctrine:master Sep 8, 2016
Ocramius added a commit that referenced this pull request Sep 8, 2016
Ocramius added a commit that referenced this pull request Sep 8, 2016
@Ocramius
Copy link
Member

Ocramius commented Sep 8, 2016

@PatrickLouys merged, thanks!

master: a6d3d16
2.5: 75ac2f6

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ResultStatement::fetch() returns null instead of false with mysqli
2 participants