Skip to content

Phalcon 3.2.4 - ResultSet "losing" the correct results #15889

Answered by Belzebell
Belzebell asked this question in Q&A
Discussion options

You must be logged in to vote

I figured out the answer to my question.

The key lies within this part:

This returns a ResultSet/Simple with 35 entries.

As it turns out, the ResultSet logic changes when we have more than 32 results.
We can see this in the ResultSet constructor - if the result count is 32 or less, all results are fetched at once and stored in the ResultSet, meaning we can loop through as often as we want.

However, if we get more than 32 results, none of them are fetched in the constructor, and instead they are fetched every time during the loop, hence why the second loop now fails.

My previous, successful runs of the job had had around 25-30 results, only the last one, where it started failing, had 35.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@niden
Comment options

niden Feb 4, 2022
Maintainer Sponsor

@m-yamaishi09580
Comment options

Answer selected by Belzebell
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants