2012-03-25 Junichi Satoh <junichi@rworks.jp>

* include/functions_graph.php, operation/events/events_list.php: Fixed
	SQL error with PostgreSQL.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5833 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
jsatoh 2012-03-25 12:32:18 +00:00
parent ba72fa3cbe
commit 8f56a29064
3 changed files with 7 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2012-03-25 Junichi Satoh <junichi@rworks.jp>
* include/functions_graph.php, operation/events/events_list.php: Fixed
SQL error with PostgreSQL.
2012-03-25 Junichi Satoh <junichi@rworks.jp>
* include/db/postgresql.sql: Removed unnecessary quotes for making

View File

@ -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

View File

@ -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":