From: Paolo Schiro Date: Fri, 3 Nov 2017 00:14:05 +0000 (+0100) Subject: add a bogus zero reply in livestatus if aggregate filter does not match, fix I#5626 X-Git-Tag: v2.8.1~28 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3a7c54c3d1e5be424fdccef6383f53fde40e5005;p=icinga2 add a bogus zero reply in livestatus if aggregate filter does not match, fix I#5626 refs #5716 --- diff --git a/lib/livestatus/livestatusquery.cpp b/lib/livestatus/livestatusquery.cpp index 2427d40e7..3132fe532 100644 --- a/lib/livestatus/livestatusquery.cpp +++ b/lib/livestatus/livestatusquery.cpp @@ -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);