[ZBX-5505] When you open "Monitoring-Graphs" in frontend You get SQL error. Created: 2012 Aug 29  Updated: 2017 May 30  Resolved: 2012 Aug 31

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Frontend (F)
Affects Version/s: 1.8.15
Fix Version/s: 1.8.16rc1

Type: Incident report Priority: Major
Reporter: Artis Steinbergs Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: frontend, graphs
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Red Hat Enterprise Linux Server release 6.0 , Oracle 11gR2


Issue Links:
Duplicate

 Description   

When you open "Monitoring -> Graphs" You get SQL errors rather than graphs:

ociexecute(): ORA-00907: missing right parenthesis [include/db.inc.php:461]
SQL error [ORA-00907: missing right parenthesis] in [SELECT DISTINCT g.* FROM groups g,hosts_groups hg,hosts h WHERE ((g.groupid BETWEEN 000000000000000 AND 099999999999999)) AND hg.groupid=g.groupid AND h.hostid=hg.hostid AND h.status=0 AND EXISTS (SELECT 1 FROM items i,graphs_items gi WHERE i.hostid=hg.hostid AND i.itemid=gi.itemid ROWNUM <=1)]
ocifetchinto(): ORA-24374: define not done before fetch or execute and fetch [include/db.inc.php:625]

Using Oracle as backend: SQL errors
Using MySQL as backend: all is normal



 Comments   
Comment by richlv [ 2012 Aug 29 ]

this was fixed for 2.0 as ZBX-5389

Comment by Alexander Vladishev [ 2012 Aug 30 ]

I confirm in latest 1.8 r29943.

Comment by Eduards Samersovs (Inactive) [ 2012 Aug 31 ]

Fixed in development branch svn://svn.zabbix.com/branches/dev/ZBX-5505

Comment by Eduards Samersovs (Inactive) [ 2012 Sep 04 ]

Fixed in versions pre-1.8.16 r30084

Comment by lyle medio [ 2012 Sep 05 ]

Edit line 318 of htdocs/zabbix/api/classes/CHostGroup.php and insert "AND" between itemid and zbx_limit
Edit line 435 of htdocs/zabbix/api/classes/CHost.php and insert "AND" between itemid and zbx_limit

before:
' AND i.itemid=gi.itemid '.zbx_limit(1).')';
after:
' AND i.itemid=gi.itemid AND '.zbx_limit(1).')';

Comment by Eduards Samersovs (Inactive) [ 2012 Sep 05 ]

Operator "AND" is inside zbx_limit() function, because in MySql "ROWNUM" not exist, but is used LIMIT

Generated at Sat Apr 20 06:52:38 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.