diff options
author | Ilya Mashchenko <ilya@netdata.cloud> | 2024-06-26 16:04:02 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-26 16:04:02 +0300 |
commit | 2bad58ba6ef4bf23ea992c630c5b5bc7e6cc804b (patch) | |
tree | b60516b5177e8ae7024d07d21748aba873e451a0 /src | |
parent | 16fea49038739ef839d6579c75a3bfc25186b310 (diff) |
rrdlabels: allow uppercase A-Z in label name (#18013)
Diffstat (limited to 'src')
-rw-r--r-- | src/database/rrdlabels.c | 38 |
1 files changed, 6 insertions, 32 deletions
diff --git a/src/database/rrdlabels.c b/src/database/rrdlabels.c index b82fa76d29..65e2dc9e4e 100644 --- a/src/database/rrdlabels.c +++ b/src/database/rrdlabels.c @@ -412,32 +412,6 @@ __attribute__((constructor)) void initialize_labels_keys_char_map(void) { label_names_char_map[i] = label_values_char_map[i]; // apply overrides to the label names map - label_names_char_map['A'] = 'a'; - label_names_char_map['B'] = 'b'; - label_names_char_map['C'] = 'c'; - label_names_char_map['D'] = 'd'; - label_names_char_map['E'] = 'e'; - label_names_char_map['F'] = 'f'; - label_names_char_map['G'] = 'g'; - label_names_char_map['H'] = 'h'; - label_names_char_map['I'] = 'i'; - label_names_char_map['J'] = 'j'; - label_names_char_map['K'] = 'k'; - label_names_char_map['L'] = 'l'; - label_names_char_map['M'] = 'm'; - label_names_char_map['N'] = 'n'; - label_names_char_map['O'] = 'o'; - label_names_char_map['P'] = 'p'; - label_names_char_map['Q'] = 'q'; - label_names_char_map['R'] = 'r'; - label_names_char_map['S'] = 's'; - label_names_char_map['T'] = 't'; - label_names_char_map['U'] = 'u'; - label_names_char_map['V'] = 'v'; - label_names_char_map['W'] = 'w'; - label_names_char_map['X'] = 'x'; - label_names_char_map['Y'] = 'y'; - label_names_char_map['Z'] = 'z'; label_names_char_map['='] = '_'; label_names_char_map[':'] = '_'; label_names_char_map['+'] = '_'; @@ -1652,13 +1626,13 @@ static int rrdlabels_unittest_add_pairs() { errors += rrdlabels_unittest_add_a_pair("\"tag=1\": country:\"Gre\\\"ece\"", "tag_1", "country:Gre_ece"); errors += rrdlabels_unittest_add_a_pair("\"tag=1\" = country:\"Gre\\\"ece\"", "tag_1", "country:Gre_ece"); - errors += rrdlabels_unittest_add_a_pair("\t'LABE=L'\t=\t\"World\" peace", "labe_l", "World peace"); - errors += rrdlabels_unittest_add_a_pair("\t'LA\\'B:EL'\t=\tcountry:\"World\":\"Europe\":\"Greece\"", "la_b_el", "country:World:Europe:Greece"); - errors += rrdlabels_unittest_add_a_pair("\t'LA\\'B:EL'\t=\tcountry\\\"World\"\\\"Europe\"\\\"Greece\"", "la_b_el", "country/World/Europe/Greece"); + errors += rrdlabels_unittest_add_a_pair("\t'LABE=L'\t=\t\"World\" peace", "LABE_L", "World peace"); + errors += rrdlabels_unittest_add_a_pair("\t'LA\\'B:EL'\t=\tcountry:\"World\":\"Europe\":\"Greece\"", "LA_B_EL", "country:World:Europe:Greece"); + errors += rrdlabels_unittest_add_a_pair("\t'LA\\'B:EL'\t=\tcountry\\\"World\"\\\"Europe\"\\\"Greece\"", "LA_B_EL", "country/World/Europe/Greece"); - errors += rrdlabels_unittest_add_a_pair("NAME=\"VALUE\"", "name", "VALUE"); - errors += rrdlabels_unittest_add_a_pair("\"NAME\" : \"VALUE\"", "name", "VALUE"); - errors += rrdlabels_unittest_add_a_pair("NAME: \"VALUE\"", "name", "VALUE"); + errors += rrdlabels_unittest_add_a_pair("NAME=\"VALUE\"", "NAME", "VALUE"); + errors += rrdlabels_unittest_add_a_pair("\"NAME\" : \"VALUE\"", "NAME", "VALUE"); + errors += rrdlabels_unittest_add_a_pair("NAME: \"VALUE\"", "NAME", "VALUE"); return errors; } |