2013-12-16 Sergio Martin <sergio.martin@artica.es>

* include/functions_events.php: Added criticity subquery to
	events grouped query to fix bad criticity bug.
	Incident: #406



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9235 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
zarzuelo 2013-12-16 16:20:56 +00:00
parent 89b0986267
commit 89f86dcbfa
2 changed files with 12 additions and 4 deletions

View File

@ -1,3 +1,9 @@
2013-12-16 Sergio Martin <sergio.martin@artica.es>
* include/functions_events.php: Added criticity subquery to
events grouped query to fix bad criticity bug.
Incident: #406
2013-12-16 Sergio Martin <sergio.martin@artica.es>
* include/functions_gis.php: Disable more controls

View File

@ -133,7 +133,8 @@ function events_get_events_grouped($sql_post, $offset = 0, $pagination = 1, $met
COUNT(*) AS event_rep, MAX(utimestamp) AS timestamp_rep,
MIN(utimestamp) AS timestamp_rep_min,
(SELECT owner_user FROM tevento WHERE id_evento = MAX(te.id_evento)) owner_user,
(SELECT id_usuario FROM tevento WHERE id_evento = MAX(te.id_evento)) id_usuario
(SELECT id_usuario FROM tevento WHERE id_evento = MAX(te.id_evento)) id_usuario,
(SELECT criticity FROM tevento WHERE id_evento = MAX(te.id_evento)) AS criticity
FROM $table te
WHERE 1=1 " . $sql_post . "
GROUP BY estado, evento, id_agentmodule" . $groupby_extra . "
@ -153,7 +154,8 @@ function events_get_events_grouped($sql_post, $offset = 0, $pagination = 1, $met
COUNT(*) AS event_rep, MAX(utimestamp) AS timestamp_rep,
MIN(utimestamp) AS timestamp_rep_min,
(SELECT owner_user FROM tevento WHERE id_evento = MAX(te.id_evento)) owner_user,
(SELECT id_usuario FROM tevento WHERE id_evento = MAX(te.id_evento)) id_usuario
(SELECT id_usuario FROM tevento WHERE id_evento = MAX(te.id_evento)) id_usuario,
(SELECT criticity FROM tevento WHERE id_evento = MAX(te.id_evento)) AS criticity
FROM $table te
WHERE 1=1 " . $sql_post . "
GROUP BY estado, 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" . $groupby_extra . "
@ -180,7 +182,8 @@ function events_get_events_grouped($sql_post, $offset = 0, $pagination = 1, $met
LISTAGG(id_evento, '') AS similar_ids,
MIN(utimestamp) AS timestamp_rep_min,
(SELECT owner_user FROM tevento WHERE id_evento = MAX(te.id_evento)) owner_user,
(SELECT id_usuario FROM tevento WHERE id_evento = MAX(te.id_evento)) id_usuario
(SELECT id_usuario FROM tevento WHERE id_evento = MAX(te.id_evento)) id_usuario,
(SELECT criticity FROM tevento WHERE id_evento = MAX(te.id_evento)) AS criticity
FROM $table te
WHERE 1=1 " . $sql_post . "
GROUP BY estado, to_char(evento), id_agentmodule" . $groupby_extra . ") b
@ -192,7 +195,6 @@ function events_get_events_grouped($sql_post, $offset = 0, $pagination = 1, $met
break;
}
//Extract the events by filter (or not) from db
$events = db_get_all_rows_sql ($sql);