diff options
Diffstat (limited to 'web/api/queries/query.c')
-rw-r--r-- | web/api/queries/query.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/web/api/queries/query.c b/web/api/queries/query.c index 6f3cbd5fd..8a4e94c96 100644 --- a/web/api/queries/query.c +++ b/web/api/queries/query.c @@ -1364,10 +1364,12 @@ static bool query_plan(QUERY_ENGINE_OPS *ops, time_t after_wanted, time_t before if(!query_metric_is_valid_tier(qm, selected_tier)) return false; + } - if(qm->tiers[selected_tier].db_first_time_s > before_wanted || - qm->tiers[selected_tier].db_last_time_s < after_wanted) - return false; + if(qm->tiers[selected_tier].db_first_time_s > before_wanted || + qm->tiers[selected_tier].db_last_time_s < after_wanted) { + // we don't have any data to satisfy this query + return false; } qm->plan.used = 1; @@ -2201,7 +2203,7 @@ bool query_target_calculate_window(QUERY_TARGET *qt) { } // convert our before_wanted and after_wanted to absolute - rrdr_relative_window_to_absolute(&after_wanted, &before_wanted, NULL, unittest_running); + rrdr_relative_window_to_absolute_query(&after_wanted, &before_wanted, NULL, unittest_running); query_debug_log(":relative2absolute after %ld, before %ld", after_wanted, before_wanted); if (natural_points && (options & RRDR_OPTION_SELECTED_TIER) && tier > 0 && storage_tiers > 1) { @@ -2497,7 +2499,7 @@ static void query_group_by_make_dimension_key(BUFFER *key, RRDR_GROUP_BY group_b } if (group_by & RRDR_GROUP_BY_LABEL) { - DICTIONARY *labels = rrdinstance_acquired_labels(qi->ria); + RRDLABELS *labels = rrdinstance_acquired_labels(qi->ria); for (size_t l = 0; l < qt->group_by[group_by_id].used; l++) { buffer_fast_strcat(key, "|", 1); rrdlabels_get_value_to_buffer_or_unset(labels, key, qt->group_by[group_by_id].label_keys[l], "[unset]"); @@ -2545,7 +2547,7 @@ static void query_group_by_make_dimension_id(BUFFER *key, RRDR_GROUP_BY group_by } if (group_by & RRDR_GROUP_BY_LABEL) { - DICTIONARY *labels = rrdinstance_acquired_labels(qi->ria); + RRDLABELS *labels = rrdinstance_acquired_labels(qi->ria); for (size_t l = 0; l < qt->group_by[group_by_id].used; l++) { if (buffer_strlen(key) != 0) buffer_fast_strcat(key, ",", 1); @@ -2600,7 +2602,7 @@ static void query_group_by_make_dimension_name(BUFFER *key, RRDR_GROUP_BY group_ } if (group_by & RRDR_GROUP_BY_LABEL) { - DICTIONARY *labels = rrdinstance_acquired_labels(qi->ria); + RRDLABELS *labels = rrdinstance_acquired_labels(qi->ria); for (size_t l = 0; l < qt->group_by[group_by_id].used; l++) { if (buffer_strlen(key) != 0) buffer_fast_strcat(key, ",", 1); |