Closed Grundik closed 1 year ago
Yes, as stated in referenced issue. Calling ->rewind() just caused one row to be read from database. Always. Even if current positions already was at the beginning of result.
@Ocramius iirc, call ->rewind()
was requires ->buffer()
call to always back to position 0. It probably requires new test on combination with ->buffer()
Ok, given @samsonasik's feedback, could such a test be introduced, @Grundik?
I'd then gladly merge, even at the risk of minor BC issues.
As I can see, buffering for PDO results are explicitly disabled:
/**
* @return void
*/
public function buffer()
{
}
/**
* @return bool|null
*/
public function isBuffered()
{
return false;
}
So, this should not be an issue at all.
That's on class implements AbstractResultSet
in general
This is my old blog post about buffer()
to set position 0 on rewind()
call
Will this be enough?
Yes, that's should be enough 👍
Sorry! Extra code have slipped through. Removed duplicate of existing test.
I think this should go to 2.17.0
since it behaviour change, I will let's @Ocramius decide on that
@samsonasik as a bugfix, targeting for a patch release: bugfixes are behaviour changes anyway 😁
Description
Fixes #196.
BC break can occur if one deliberately used this bug as a feature. But that should not be the case in sane projects.