ObjectList: Register columns to select even if we're only counting
We should never apply any pseudo optimizations on a higher level if already the lower level applies them, as the optimization might not be valid in every circumstance. fixes #9573
This commit is contained in:
parent
f5089dab1a
commit
fc8b51c4be
modules/monitoring/library/Monitoring/Object
|
@ -124,9 +124,14 @@ abstract class ObjectList implements Countable, IteratorAggregate, Filterable
|
||||||
public function count()
|
public function count()
|
||||||
{
|
{
|
||||||
if ($this->count === null) {
|
if ($this->count === null) {
|
||||||
$this->count = (int) $this->backend->select()->from($this->dataViewName)->applyFilter($this->filter)
|
$this->count = (int) $this->backend
|
||||||
->getQuery()->count();
|
->select()
|
||||||
|
->from($this->dataViewName, $this->columns)
|
||||||
|
->applyFilter($this->filter)
|
||||||
|
->getQuery()
|
||||||
|
->count();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->count;
|
return $this->count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue