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
This commit is contained in:
Johannes Meyer 2015-06-18 14:33:41 +02:00
parent 77fe094870
commit f2425a97d5
4 changed files with 4 additions and 4 deletions

View File

@ -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)", '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)', 'timestamp' => 'UNIX_TIMESTAMP(hch.comment_time)',
'object_id' => 'hch.object_id', 'object_id' => 'hch.object_id',
'state' => '(NULL)', 'state' => '(-1)',
'output' => "('[' || hch.author_name || '] ' || hch.comment_data)", 'output' => "('[' || hch.author_name || '] ' || hch.comment_data)",
), ),
'hostgroups' => array( 'hostgroups' => array(

View File

@ -26,7 +26,7 @@ class HostdowntimestarthistoryQuery extends IdoQuery
'type' => "('dt_start')", 'type' => "('dt_start')",
'timestamp' => 'UNIX_TIMESTAMP(hdh.actual_start_time)', 'timestamp' => 'UNIX_TIMESTAMP(hdh.actual_start_time)',
'object_id' => 'hdh.object_id', 'object_id' => 'hdh.object_id',
'state' => '(NULL)', 'state' => '(-1)',
'output' => "('[' || hdh.author_name || '] ' || hdh.comment_data)", 'output' => "('[' || hdh.author_name || '] ' || hdh.comment_data)",
), ),
'hostgroups' => array( 'hostgroups' => array(

View File

@ -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)", '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)', 'timestamp' => 'UNIX_TIMESTAMP(sch.comment_time)',
'object_id' => 'sch.object_id', 'object_id' => 'sch.object_id',
'state' => '(NULL)', 'state' => '(-1)',
'output' => "('[' || sch.author_name || '] ' || sch.comment_data)", 'output' => "('[' || sch.author_name || '] ' || sch.comment_data)",
), ),
'hostgroups' => array( 'hostgroups' => array(

View File

@ -30,7 +30,7 @@ class ServicedowntimestarthistoryQuery extends IdoQuery
'type' => "('dt_start')", 'type' => "('dt_start')",
'timestamp' => 'UNIX_TIMESTAMP(sdh.actual_start_time)', 'timestamp' => 'UNIX_TIMESTAMP(sdh.actual_start_time)',
'object_id' => 'sdh.object_id', 'object_id' => 'sdh.object_id',
'state' => '(NULL)', 'state' => '(-1)',
'output' => "('[' || sdh.author_name || '] ' || sdh.comment_data)", 'output' => "('[' || sdh.author_name || '] ' || sdh.comment_data)",
), ),
'hostgroups' => array( 'hostgroups' => array(