From cae430a2c1b1d36073708c2264ae2faf20afca42 Mon Sep 17 00:00:00 2001 From: Eugen Betke Date: Wed, 30 Oct 2024 13:51:36 +0100 Subject: [PATCH] ECC-1898: Revert changes --- src/action_class_alias.cc | 21 +++++++++++++-------- tests/CMakeLists.txt | 2 +- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/action_class_alias.cc b/src/action_class_alias.cc index b5bf7f179..91f6cf28f 100644 --- a/src/action_class_alias.cc +++ b/src/action_class_alias.cc @@ -137,8 +137,6 @@ static int create_accessor(grib_section* p, grib_action* act, grib_loader* h) if (x->name_space_ == NULL) x->name_space_ = act->name_space; - // TODO(maee): Make sure that the accessor is added to the trie - grib_context_log(p->h->context, GRIB_LOG_DEBUG, "alias: add only namespace: %s.%s", act->name_space, act->name); i = 0; @@ -180,12 +178,19 @@ static int create_accessor(grib_section* p, grib_action* act, grib_loader* h) act->name_space, act->name, y->name_); /* printf("[%s %s]\n",y->all_names_[i], y->all_name_spaces_[i]); */ - // ECC-1898: Remove accessor from cache - grib_handle* hand = grib_handle_of_accessor(y); - if (hand->use_trie && y->all_name_spaces_[i] != NULL && strcmp(y->name_, act->name) != 0) { - int id = grib_hash_keys_get_id(hand->context->keys, act->name); - hand->accessors[id] = NULL; - } + /* + * ECC-1898: Remove accessor from cache + * This workaround was disabled because it was causing problems with the unaliasing mars.step, + * i.e., when unaliasing "mars.step" it also unaliases "step" + */ + + // TODO(maee): Implement a new hash function, which uses the name and the name_space as well + + //grib_handle* hand = grib_handle_of_accessor(y); + //if (hand->use_trie && y->all_name_spaces_[i] != NULL && strcmp(y->name_, act->name) != 0) { + // int id = grib_hash_keys_get_id(hand->context->keys, act->name); + // hand->accessors[id] = NULL; + //} while (i < MAX_ACCESSOR_NAMES - 1) { y->all_names_[i] = y->all_names_[i + 1]; diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 493386a5e..c53e98b73 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -276,7 +276,7 @@ if( HAVE_BUILD_TOOLS ) grib_ecc-1764 grib_ecc-1792 grib_ecc-1806 - grib_ecc-1898 + #grib_ecc-1898 grib_ecc-1907 grib_ecc-1941 grib_ecc-1942