diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index e1648a5292..dd68cd3fcb 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2012-03-25 Junichi Satoh + + * include/functions_graph.php, operation/events/events_list.php: Fixed + SQL error with PostgreSQL. + 2012-03-25 Junichi Satoh * include/db/postgresql.sql: Removed unnecessary quotes for making diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index 80fd1496d5..f9c2462834 100755 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -1419,11 +1419,11 @@ function grafico_eventos_grupo ($width = 300, $height = 200, $url = "") { //is required if both DISTINCT() and COUNT() are in the statement switch ($config["dbtype"]) { case "mysql": - case "postgresql": $sql = sprintf ('SELECT DISTINCT(id_agente) AS id_agente, id_grupo, COUNT(id_agente) AS count FROM tevento WHERE 1=1 %s GROUP BY id_agente ORDER BY count DESC', $url); break; + case "postgresql": case "oracle": $sql = sprintf ('SELECT DISTINCT(id_agente) AS id_agente, id_grupo, COUNT(id_agente) AS count FROM tevento WHERE 1=1 %s diff --git a/pandora_console/operation/events/events_list.php b/pandora_console/operation/events/events_list.php index ffdad853ec..2f8073e08a 100644 --- a/pandora_console/operation/events/events_list.php +++ b/pandora_console/operation/events/events_list.php @@ -466,7 +466,7 @@ else { MIN(estado) AS min_estado, MAX(estado) AS max_estado, COUNT(*) AS event_rep, MAX(utimestamp) AS timestamp_rep FROM tevento WHERE 1=1 ".$sql_post." - GROUP BY evento, id_agentmodule + GROUP BY evento, id_agentmodule, id_evento, id_agente, id_usuario, id_grupo, estado, timestamp, utimestamp, event_type, id_alert_am, criticity, user_comment, tags, source, id_extra ORDER BY timestamp_rep DESC LIMIT ".$pagination." OFFSET ".$offset; break; case "oracle":