« Previous | Next » 

Revision d7bf9fca

IDd7bf9fcaa75c35239352efa95e76de218e8e5dc0

Added by Bastian Waidelich almost 9 years ago

[!!!][BUGFIX] Respect limit/offset constraints when counting results

Until now QueryResult::count() discarded limit constraints that were
active for the affected query, so
$query->setLimit(3)->execute()->count() could return a value > 3.
If the query had an offset Flow even threw an exception.

This changeset adjusts the Query so that limit and offset constraints
are taken into account. It furthermore unsets the offset in the query
in order to circumvent the exception.

This is a breaking change if you relied on Query::count() to always return
all results regardless of a specified limit. In this case better generate
multiple QueryResults (they're only created in-memory until you actually
access them)

Change-Id: I7ed06adf54d7ce9d5aff08433afc4aee9964e8b7
Fixes: #42955
Releases: 1.1, 1.2

  • added
  • modified
  • copied
  • renamed
  • deleted