Merge pull request #3836 from Icinga/fix/query-double-execution
Fix double query execution
This commit is contained in:
commit
6ea012af7e
|
@ -450,7 +450,17 @@ class SimpleQuery implements QueryInterface, Queryable, Iterator
|
|||
*/
|
||||
public function hasResult()
|
||||
{
|
||||
return $this->iteratorPosition !== null || $this->fetchRow() !== false;
|
||||
if ($this->iteratorPosition !== null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$hasResult = false;
|
||||
foreach ($this as $row) {
|
||||
$hasResult = true;
|
||||
break;
|
||||
}
|
||||
|
||||
return $hasResult;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue