]> granicus.if.org Git - icinga2/commitdiff
add a bogus zero reply in livestatus if aggregate filter does not match, fix I#5626
authorPaolo Schiro <paolo.schiro@kpnqwest.it>
Fri, 3 Nov 2017 00:14:05 +0000 (01:14 +0100)
committerMichael Friedrich <michael.friedrich@icinga.com>
Thu, 7 Dec 2017 12:28:16 +0000 (13:28 +0100)
refs #5716

lib/livestatus/livestatusquery.cpp

index 2427d40e74cd124ff4ce5587fba88a94c07e6f1a..3132fe53232d70da4f9d0c00f094361c2c9412b9 100644 (file)
@@ -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);