PDA

View Full Version : Can't access Graphs configuration after migrating from 1.4.1 to 1.4.2


dsipe
23-08-2007, 12:34
I've got the following error when clicking on the link Configuration->Graphs

* Error in query [select distinct g.* from graphs g left join graphs_items gi on g.graphid=gi.graphid left join items i on gi.itemid=i.itemid while (g.graphid div 100000000000000) in (0) and ( i.hostid not in (-1) OR i.hostid is NULL ) order by g.name, g.graphid] [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'while (g.graphid div 100000000000000) in (0) and ( i.hostid not in (-1) OR i.' at line 1]
* mysql_fetch_array(): supplied argument is not a valid MySQL result resource[/srv/www/htdocs/zabbix/include/db.inc.php:411]


What's wrong ??

nb: i don't make any change to the database schema when migrating to 1.4.2, hoping that nothing has changed :(

pixelplumber
23-08-2007, 13:19
I second this problem. I get the same issue with a fresh install of 1.4.2

dsipe
23-08-2007, 13:58
More info on the problem:

In fact, the problem come ONLY with filters Group->ALL and Host->ALL

If you select a group, or a host, no errors!

pixelplumber
23-08-2007, 14:12
ahhhh....... same again with a fresh install too. (I thought I was going crazy there for a minute thinking it had fixed itself)

Alexei
23-08-2007, 15:48
Sorry, it is a typo in the SQL statement, 'while'=>'where'. It was fixed yesterday in SVN code.

dsipe
23-08-2007, 17:12
ok!
can you tell us which file to modify please ?

jkoyle
23-08-2007, 20:48
Edit the top level graphs.php line 348.

Change the while statement to where like this:

$result = DBselect("select distinct g.* from graphs g left join graphs_items gi on g.graphid=gi.graphid ".
" left join items i on gi.itemid=i.itemid ".
' where '.DBin_node('g.graphid').
" and ( i.hostid not in (".$denyed_hosts.") OR i.hostid is NULL )".
" order by g.name, g.graphid");