reset so that we can call find_many after count #97
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi
it's a very common case.
we use
$orm = ORM::for_table('table');
// then we build complicated where.
then we count first
$total = $orm->count();
if total > 0, we then select with a limit.
$xxx = $orm->limit(50)->offset(10)->find_many();
or we call find_many first, then we call count on those build complicated where.
the patch will reset the _values and _result_columns so that the case will work. right now it is broken because the _values will be pushed twice. and COUNT(*) will stay on find_many.
Thanks.