mirror of https://github.com/Icinga/icinga2.git
Merge pull request #5716 from spaolo/fix/livestatus-empty-result-with-nonmatch-filter-5626
add bogus zero reply in livestatus when aggregate and non matching filter
This commit is contained in:
commit
3a8d4c5920
|
@ -571,6 +571,17 @@ void LivestatusQuery::ExecuteGetHelper(const Stream::Ptr& stream)
|
|||
|
||||
AppendResultRow(result, row, first_row);
|
||||
}
|
||||
|
||||
/* add a bogus zero value if aggregated is empty*/
|
||||
if (allStats.empty()) {
|
||||
Array::Ptr row = new Array();
|
||||
|
||||
for (size_t i = 1; i <= m_Aggregators.size(); i++) {
|
||||
row->Add(0);
|
||||
}
|
||||
|
||||
AppendResultRow(result, row, first_row);
|
||||
}
|
||||
}
|
||||
|
||||
EndResultSet(result);
|
||||
|
|
Loading…
Reference in New Issue