Hi all
My zabbix server (1.4.2 on centos5-i386, postgresql version, postgresql 8.2.4 on centos4-x86_64) sometimes dies with these messages:
Query::select new.itemid from items new, items dest where dest.itemid=10420 and new.key_=dest.key_ and new.hostid=10020
Query failed:PGRES_FATAL_ERROR:FEHLER: NEW in einer Anfrage verwendet, die nicht Teil einer Regel ist
(in english: NEW used in a query that is not part of a rule)
(obviously the query uses new as aliasname, which causes a conflict with the predefined NEW variable).
Is this a known problem? Perhaps the queries should be rewritten to avoid reserved names as aliases?
In the source, I find this problem in two files:
frontends/php/include/graphs.inc.php on line 209
src/libs/zbxdbhigh/host.c on line 973
I replaced the token 'new' by 'neww' in these two queries, then my problem disappeared (see the patch enclosed).
I suggest that this small change be applied to the sources.
btw: congrats to the wonderful error messages in the logs. These were descriptive enough to allow me to find the problem within a few minutes.
...meanwhile I filed this as a bug.
Regards
--Marcel
My zabbix server (1.4.2 on centos5-i386, postgresql version, postgresql 8.2.4 on centos4-x86_64) sometimes dies with these messages:
Query::select new.itemid from items new, items dest where dest.itemid=10420 and new.key_=dest.key_ and new.hostid=10020
Query failed:PGRES_FATAL_ERROR:FEHLER: NEW in einer Anfrage verwendet, die nicht Teil einer Regel ist
(in english: NEW used in a query that is not part of a rule)
(obviously the query uses new as aliasname, which causes a conflict with the predefined NEW variable).
Is this a known problem? Perhaps the queries should be rewritten to avoid reserved names as aliases?
In the source, I find this problem in two files:
frontends/php/include/graphs.inc.php on line 209
src/libs/zbxdbhigh/host.c on line 973
I replaced the token 'new' by 'neww' in these two queries, then my problem disappeared (see the patch enclosed).
I suggest that this small change be applied to the sources.
btw: congrats to the wonderful error messages in the logs. These were descriptive enough to allow me to find the problem within a few minutes.
...meanwhile I filed this as a bug.
Regards
--Marcel
Comment