[ZBX-8379] Limit applied before filter on host.get apparently Created: 2014 Jun 20 Updated: 2017 May 30 Resolved: 2014 Jun 25 |
|
Status: | Closed |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | API (A) |
Affects Version/s: | 2.0.12 |
Fix Version/s: | 2.3.2 |
Type: | Incident report | Priority: | Major |
Reporter: | Volker Fröhlich | Assignee: | Unassigned |
Resolution: | Fixed | Votes: | 0 |
Labels: | limits, maintenance | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified |
Description |
$filterOptions = array( $hosts = API::Host()->get(array( Using a limit of 10 is getting me only 4 results, while I get 7 (the actual number!) when I remove the limit or raise it to say 100. I would expect 7 results with a limit of 10. |
Comments |
Comment by Oleksii Zagorskyi [ 2014 Jun 22 ] |
Something similar for inventories reported in |
Comment by Volker Fröhlich [ 2014 Jun 23 ] |
Changing the sortfield is affecting the result. The following query is the result of $this->createSelectQueryFromParts($sqlParts) in CHost.php. When reviewing the result it becomes clear why it is wrong: zabbix20=# SELECT DISTINCT h.hostid,h.name,h.maintenanceid,hg.groupid FROM hosts h,hosts_groups hg WHERE (hg.groupid BETWEEN '4' AND '15' OR hg.groupid BETWEEN '18' AND '23' OR hg.groupid BETWEEN '28' AND '32' OR hg.groupid BETWEEN '34' AND '54' OR hg.groupid BETWEEN '56' AND '60' OR hg.groupid BETWEEN '63' AND '69' OR hg.groupid BETWEEN '73' AND '98' OR hg.groupid IN ('1','2','25','71','100','101','103','105','106','107','108')) AND hg.hostid=h.hostid AND h.status IN (0,1) AND h.maintenance_status='1' AND h.status='0' ORDER BY h.name; When you now apply a limit of 10, you only catch 4 out of 7 hostnames, which exactly resembles the witnessed behaviour. |
Comment by Krists Krigers (Inactive) [ 2014 Jun 25 ] |
This was fixed in trunk some time back. |
Comment by Pavels Jelisejevs (Inactive) [ 2014 Jul 22 ] |
CLOSED. |