From f2425a97d5f8f5ca4321b27a99824552bfe26508 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 18 Jun 2015 14:33:41 +0200 Subject: [PATCH] Select -1 as `state' for history queries not providing a valid state PostgreSQL does not seem to be able to union null values with integers... refs #9009 --- .../Monitoring/Backend/Ido/Query/HostcommenthistoryQuery.php | 2 +- .../Backend/Ido/Query/HostdowntimestarthistoryQuery.php | 2 +- .../Monitoring/Backend/Ido/Query/ServicecommenthistoryQuery.php | 2 +- .../Backend/Ido/Query/ServicedowntimestarthistoryQuery.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostcommenthistoryQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostcommenthistoryQuery.php index 031c3f795..1931b6638 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostcommenthistoryQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostcommenthistoryQuery.php @@ -26,7 +26,7 @@ class HostcommenthistoryQuery extends IdoQuery 'type' => "(CASE hch.entry_type WHEN 1 THEN 'comment' WHEN 2 THEN 'dt_comment' WHEN 3 THEN 'flapping' WHEN 4 THEN 'ack' END)", 'timestamp' => 'UNIX_TIMESTAMP(hch.comment_time)', 'object_id' => 'hch.object_id', - 'state' => '(NULL)', + 'state' => '(-1)', 'output' => "('[' || hch.author_name || '] ' || hch.comment_data)", ), 'hostgroups' => array( diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostdowntimestarthistoryQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostdowntimestarthistoryQuery.php index 63c08845c..118f7e526 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostdowntimestarthistoryQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostdowntimestarthistoryQuery.php @@ -26,7 +26,7 @@ class HostdowntimestarthistoryQuery extends IdoQuery 'type' => "('dt_start')", 'timestamp' => 'UNIX_TIMESTAMP(hdh.actual_start_time)', 'object_id' => 'hdh.object_id', - 'state' => '(NULL)', + 'state' => '(-1)', 'output' => "('[' || hdh.author_name || '] ' || hdh.comment_data)", ), 'hostgroups' => array( diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicecommenthistoryQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicecommenthistoryQuery.php index e1388cc0f..baa3d4d5a 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicecommenthistoryQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicecommenthistoryQuery.php @@ -30,7 +30,7 @@ class ServicecommenthistoryQuery extends IdoQuery 'type' => "(CASE sch.entry_type WHEN 1 THEN 'comment' WHEN 2 THEN 'dt_comment' WHEN 3 THEN 'flapping' WHEN 4 THEN 'ack' END)", 'timestamp' => 'UNIX_TIMESTAMP(sch.comment_time)', 'object_id' => 'sch.object_id', - 'state' => '(NULL)', + 'state' => '(-1)', 'output' => "('[' || sch.author_name || '] ' || sch.comment_data)", ), 'hostgroups' => array( diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicedowntimestarthistoryQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicedowntimestarthistoryQuery.php index 5cadcc01c..deaa4ae9b 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicedowntimestarthistoryQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicedowntimestarthistoryQuery.php @@ -30,7 +30,7 @@ class ServicedowntimestarthistoryQuery extends IdoQuery 'type' => "('dt_start')", 'timestamp' => 'UNIX_TIMESTAMP(sdh.actual_start_time)', 'object_id' => 'sdh.object_id', - 'state' => '(NULL)', + 'state' => '(-1)', 'output' => "('[' || sdh.author_name || '] ' || sdh.comment_data)", ), 'hostgroups' => array(