NotificationQuery: Do not use a placeholder if it's possible to select a real value
refs #9009
This commit is contained in:
parent
2669d0e478
commit
75c5aab1b9
|
@ -53,7 +53,8 @@ class HostnotificationQuery extends IdoQuery
|
|||
'services' => array(
|
||||
'service' => 'so.name2 COLLATE latin1_general_ci',
|
||||
'service_description' => 'so.name2',
|
||||
'service_display_name' => 's.display_name COLLATE latin1_general_ci'
|
||||
'service_display_name' => 's.display_name COLLATE latin1_general_ci',
|
||||
'service_host_name' => 'so.name1'
|
||||
)
|
||||
);
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
|
||||
namespace Icinga\Module\Monitoring\Backend\Ido\Query;
|
||||
|
||||
use Zend_Db_Expr;
|
||||
use Zend_Db_Select;
|
||||
use Icinga\Data\Filter\Filter;
|
||||
|
||||
|
@ -71,10 +70,9 @@ class NotificationQuery extends IdoQuery
|
|||
*/
|
||||
protected function joinHosts()
|
||||
{
|
||||
$columns = array_keys($this->columnMap['notifications'] + $this->columnMap['hosts']);
|
||||
foreach (array_keys($this->columnMap['services']) as $column) {
|
||||
$columns[$column] = new Zend_Db_Expr('NULL');
|
||||
}
|
||||
$columns = array_keys(
|
||||
$this->columnMap['notifications'] + $this->columnMap['hosts'] + $this->columnMap['services']
|
||||
);
|
||||
$hosts = $this->createSubQuery('hostnotification', $columns);
|
||||
$this->subQueries[] = $hosts;
|
||||
$this->notificationQuery->union(array($hosts), Zend_Db_Select::SQL_UNION_ALL);
|
||||
|
|
Loading…
Reference in New Issue