Code

When querying services/metrics skip hosts without such children.
[sysdb.git] / src / frontend / query.c
index 0ee734c4ee24428d98efa324b4a1237054fad62d..1751ba57e7a9a241b148cbc4f4dc391787cf0c44 100644 (file)
@@ -271,9 +271,11 @@ sdb_fe_exec_list(sdb_conn_t *conn, int type, sdb_store_matcher_t *filter)
        if (type == SDB_HOST)
                flags = SDB_SKIP_ALL;
        else if (type == SDB_SERVICE)
-               flags = SDB_SKIP_ALL & (~SDB_SKIP_SERVICES);
+               flags = (SDB_SKIP_ALL & (~SDB_SKIP_SERVICES))
+                       | SDB_SKIP_EMPTY_SERVICES;
        else if (type == SDB_METRIC)
-               flags = SDB_SKIP_ALL & (~SDB_SKIP_METRICS);
+               flags = (SDB_SKIP_ALL & (~SDB_SKIP_METRICS))
+                       | SDB_SKIP_EMPTY_METRICS;
        else {
                sdb_log(SDB_LOG_ERR, "frontend: Invalid object type %d "
                                "for LIST command", type);