From ce37bd659b2891f24e6330fbab24f74f6c087e34 Mon Sep 17 00:00:00 2001 From: Hirofumi Kosaka Date: Fri, 8 Jan 2016 17:26:28 +0900 Subject: [PATCH] Fixed if direccion of any agents has NULL, snmp console fail to list unregistered agents' trap (by using "NOT IN" against NULL-inclued list). --- pandora_console/operation/snmpconsole/snmp_view.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pandora_console/operation/snmpconsole/snmp_view.php b/pandora_console/operation/snmpconsole/snmp_view.php index 1b6a9829a3..f6742a2073 100755 --- a/pandora_console/operation/snmpconsole/snmp_view.php +++ b/pandora_console/operation/snmpconsole/snmp_view.php @@ -176,7 +176,7 @@ switch ($config["dbtype"]) { WHERE (`source` IN ( SELECT direccion FROM tagente WHERE id_grupo IN ($str_user_groups) - ) OR `source`='' OR `source` NOT IN (SELECT direccion FROM tagente)) %s + ) OR `source`='' OR `source` NOT IN (SELECT direccion FROM tagente WHERE direccion IS NOT NULL)) %s ORDER BY timestamp DESC LIMIT %d,%d"; break; @@ -187,7 +187,7 @@ switch ($config["dbtype"]) { WHERE (source IN ( SELECT direccion FROM tagente WHERE id_grupo IN ($str_user_groups) - ) OR source='' OR source NOT IN (SELECT direccion FROM tagente)) %s + ) OR source='' OR source NOT IN (SELECT direccion FROM tagente WHERE direccion IS NOT NULL)) %s ORDER BY timestamp DESC LIMIT %d OFFSET %d"; break; @@ -198,7 +198,7 @@ $sql_all = "SELECT * SELECT direccion FROM tagente WHERE id_grupo IN ($str_user_groups) ) - OR source='' OR source NOT IN (SELECT direccion FROM tagente)) %s + OR source='' OR source NOT IN (SELECT direccion FROM tagente WHERE direccion IS NOT NULL)) %s ORDER BY timestamp DESC"; $sql_count = "SELECT COUNT(id_trap) FROM ttrap @@ -206,7 +206,7 @@ $sql_count = "SELECT COUNT(id_trap) SELECT direccion FROM tagente WHERE id_grupo IN ($str_user_groups) ) - OR source='' OR source NOT IN (SELECT direccion FROM tagente)) %s"; + OR source='' OR source NOT IN (SELECT direccion FROM tagente WHERE direccion IS NOT NULL)) %s"; //$whereSubquery = 'WHERE 1=1'; $whereSubquery = '';