From 0d479e33a8ebe206dc5b62135f90880e54b6c117 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 17 Aug 2023 12:46:15 +0200 Subject: Merging upstream version 1.42.1. Signed-off-by: Daniel Baumann --- libnetdata/facets/facets.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'libnetdata/facets/facets.c') diff --git a/libnetdata/facets/facets.c b/libnetdata/facets/facets.c index 8762b43b..b285baf0 100644 --- a/libnetdata/facets/facets.c +++ b/libnetdata/facets/facets.c @@ -1,6 +1,5 @@ #include "facets.h" -#define FACET_VALUE_UNSET "-" #define HISTOGRAM_COLUMNS 60 static void facets_row_free(FACETS *facets __maybe_unused, FACET_ROW *row); @@ -197,14 +196,14 @@ static void facet_value_insert_callback(const DICTIONARY_ITEM *item __maybe_unus FACET_VALUE *v = value; FACET_KEY *k = data; + if(!v->selected) + v->selected = k->default_selected_for_values; + if(v->name) { // an actual value, not a filter v->name = strdupz(v->name); facet_value_is_used(k, v); } - - if(!v->selected) - v->selected = k->default_selected_for_values; } static bool facet_value_conflict_callback(const DICTIONARY_ITEM *item __maybe_unused, void *old_value, void *new_value, void *data) { @@ -219,6 +218,9 @@ static bool facet_value_conflict_callback(const DICTIONARY_ITEM *item __maybe_un if(v->name) facet_value_is_used(k, v); + internal_fatal(v->name && strcmp(v->name, nv->name) != 0, "hash conflict: '%s' and '%s' have the same hash '%s'", v->name, nv->name, + dictionary_acquired_item_name(item)); + return false; } -- cgit v1.2.3