diff options
author | alex <alex@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2006-11-28 14:48:24 +0000 |
---|---|---|
committer | alex <alex@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2006-11-28 14:48:24 +0000 |
commit | 8a08a39f58032aae2a50f3bc6183d0f7b036c970 (patch) | |
tree | 782201bfcb8b175cb541832ffe1e9e86cd6f5c73 /src/zabbix_server/nodewatcher/nodewatcher.c | |
parent | 86b0303fd6d078f3d07528666d491a240b09d8af (diff) | |
download | zabbix-8a08a39f58032aae2a50f3bc6183d0f7b036c970.tar.gz zabbix-8a08a39f58032aae2a50f3bc6183d0f7b036c970.tar.xz zabbix-8a08a39f58032aae2a50f3bc6183d0f7b036c970.zip |
Change for PostgreSQL support.
git-svn-id: svn://svn.zabbix.com/trunk@3537 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'src/zabbix_server/nodewatcher/nodewatcher.c')
-rw-r--r-- | src/zabbix_server/nodewatcher/nodewatcher.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/zabbix_server/nodewatcher/nodewatcher.c b/src/zabbix_server/nodewatcher/nodewatcher.c index 5653e316..de62267c 100644 --- a/src/zabbix_server/nodewatcher/nodewatcher.c +++ b/src/zabbix_server/nodewatcher/nodewatcher.c @@ -210,7 +210,7 @@ static int compare_checksums() /* Begin work */ /* Find updated records */ - result = DBselect("select new.nodeid,new.tablename,new.recordid from node_cksum old, node_cksum new where new.tablename=old.tablename and new.recordid=old.recordid and new.fieldname=old.fieldname and new.nodeid=old.nodeid and new.cksum<>old.cksum and new.cksumtype=%d and old.cksumtype=%d", NODE_CKSUM_TYPE_NEW, NODE_CKSUM_TYPE_OLD); + result = DBselect("select curr.nodeid,curr.tablename,curr.recordid from node_cksum prev, node_cksum curr where curr.tablename=prev.tablename and curr.recordid=prev.recordid and curr.fieldname=prev.fieldname and curr.nodeid=prev.nodeid and curr.cksum<>prev.cksum and curr.cksumtype=%d and prev.cksumtype=%d", NODE_CKSUM_TYPE_NEW, NODE_CKSUM_TYPE_OLD); while((row=DBfetch(result))) { // zabbix_log( LOG_LEVEL_WARNING, "Adding record to node_configlog"); @@ -222,10 +222,10 @@ static int compare_checksums() DBfree_result(result); /* Find new records */ - result = DBselect("select new.nodeid,new.tablename,new.recordid from node_cksum new" \ - " left join node_cksum old" \ - " on new.tablename=old.tablename and new.recordid=old.recordid and new.fieldname=old.fieldname and new.nodeid=old.nodeid and new.cksumtype<>old.cksumtype" \ - " where old.cksumid is null and new.cksumtype=%d", NODE_CKSUM_TYPE_NEW); + result = DBselect("select curr.nodeid,curr.tablename,curr.recordid from node_cksum curr" \ + " left join node_cksum prev" \ + " on curr.tablename=prev.tablename and curr.recordid=prev.recordid and curr.fieldname=prev.fieldname and curr.nodeid=prev.nodeid and curr.cksumtype<>prev.cksumtype" \ + " where prev.cksumid is null and curr.cksumtype=%d", NODE_CKSUM_TYPE_NEW); while((row=DBfetch(result))) { @@ -238,10 +238,10 @@ static int compare_checksums() DBfree_result(result); /* Find deleted records */ - result = DBselect("select new.nodeid,new.tablename,new.recordid from node_cksum new" \ - " left join node_cksum old" \ - " on new.tablename=old.tablename and new.recordid=old.recordid and new.fieldname=old.fieldname and new.nodeid=old.nodeid and new.cksumtype<>old.cksumtype" \ - " where old.cksumid is null and new.cksumtype=%d", NODE_CKSUM_TYPE_OLD); + result = DBselect("select curr.nodeid,curr.tablename,curr.recordid from node_cksum curr" \ + " left join node_cksum prev" \ + " on curr.tablename=prev.tablename and curr.recordid=prev.recordid and curr.fieldname=prev.fieldname and curr.nodeid=prev.nodeid and curr.cksumtype<>prev.cksumtype" \ + " where prev.cksumid is null and curr.cksumtype=%d", NODE_CKSUM_TYPE_OLD); while((row=DBfetch(result))) { |