Fix PostgreSQL queries that use GROUP BY
Add missing instance_id to getGroup query functions to avoid query errors in PostgreSQL. fixes #10160
This commit is contained in:
parent
8cea292745
commit
3b135c6b6f
|
@ -181,6 +181,10 @@ class HostcommentQuery extends IdoQuery
|
|||
if ($this->hasJoinedVirtualTable('hoststatus')) {
|
||||
$group[] = 'hs.hoststatus_id';
|
||||
}
|
||||
|
||||
if ($this->hasJoinedVirtualTable('instances')) {
|
||||
$group[] = 'i.instance_id';
|
||||
}
|
||||
}
|
||||
|
||||
return $group;
|
||||
|
|
|
@ -187,6 +187,10 @@ class HostdowntimeQuery extends IdoQuery
|
|||
if ($this->hasJoinedVirtualTable('hoststatus')) {
|
||||
$group[] = 'hs.hoststatus_id';
|
||||
}
|
||||
|
||||
if ($this->hasJoinedVirtualTable('instances')) {
|
||||
$group[] = 'i.instance_id';
|
||||
}
|
||||
}
|
||||
|
||||
return $group;
|
||||
|
|
|
@ -265,6 +265,10 @@ class HostnotificationQuery extends IdoQuery
|
|||
if ($this->hasJoinedVirtualTable('acknowledgements')) {
|
||||
$group[] = 'a.acknowledgement_id';
|
||||
}
|
||||
|
||||
if ($this->hasJoinedVirtualTable('instances')) {
|
||||
$group[] = 'i.instance_id';
|
||||
}
|
||||
}
|
||||
|
||||
return $group;
|
||||
|
|
|
@ -336,6 +336,9 @@ class HoststatusQuery extends IdoQuery
|
|||
$group[] = 'so.object_id';
|
||||
$group[] = 's.service_id';
|
||||
break;
|
||||
case 'instances':
|
||||
$group[] = 'i.instance_id';
|
||||
break;
|
||||
default:
|
||||
continue 2;
|
||||
}
|
||||
|
|
|
@ -203,6 +203,10 @@ class ServicecommentQuery extends IdoQuery
|
|||
if ($this->hasJoinedVirtualTable('servicestatus')) {
|
||||
$group[] = 'ss.servicestatus_id';
|
||||
}
|
||||
|
||||
if ($this->hasJoinedVirtualTable('instances')) {
|
||||
$group[] = 'i.instance_id';
|
||||
}
|
||||
}
|
||||
|
||||
return $group;
|
||||
|
|
|
@ -210,6 +210,10 @@ class ServicedowntimeQuery extends IdoQuery
|
|||
if ($this->hasJoinedVirtualTable('servicestatus')) {
|
||||
$group[] = 'ss.servicestatus_id';
|
||||
}
|
||||
|
||||
if ($this->hasJoinedVirtualTable('instances')) {
|
||||
$group[] = 'i.instance_id';
|
||||
}
|
||||
}
|
||||
|
||||
return $group;
|
||||
|
|
|
@ -268,6 +268,10 @@ class ServicenotificationQuery extends IdoQuery
|
|||
if ($this->hasJoinedVirtualTable('acknowledgements')) {
|
||||
$group[] = 'a.acknowledgement_id';
|
||||
}
|
||||
|
||||
if ($this->hasJoinedVirtualTable('instances')) {
|
||||
$group[] = 'i.instance_id';
|
||||
}
|
||||
}
|
||||
|
||||
return $group;
|
||||
|
|
|
@ -452,6 +452,9 @@ class ServicestatusQuery extends IdoQuery
|
|||
case 'hoststatus':
|
||||
$group[] = 'hs.hoststatus_id';
|
||||
break;
|
||||
case 'instances':
|
||||
$group[] = 'i.instance_id';
|
||||
break;
|
||||
case 'servicestatus':
|
||||
$group[] = 'ss.servicestatus_id';
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue