diff --git a/src/Interpreters/InterpreterCreateQuery.cpp b/src/Interpreters/InterpreterCreateQuery.cpp index b027f6aad61..ff0e1d7f5a8 100644 --- a/src/Interpreters/InterpreterCreateQuery.cpp +++ b/src/Interpreters/InterpreterCreateQuery.cpp @@ -1959,7 +1959,7 @@ void InterpreterCreateQuery::throwIfTooManyEntities(ASTCreateQuery & create, Sto entity_name, setting_name, num_limit, attached_count); }; - if (auto * replicated_storage = typeid_cast(storage.get())) + if (typeid_cast(storage.get()) != nullptr) check_and_throw(ServerSetting::max_replicated_table_num_to_throw, CurrentMetrics::AttachedReplicatedTable, "max_replicated_table_num_to_throw", "replicated tables"); else if (create.is_dictionary) check_and_throw(ServerSetting::max_dictionary_num_to_throw, CurrentMetrics::AttachedDictionary, "max_dictionary_num_to_throw", "dictionaries"); diff --git a/src/Storages/Utils.cpp b/src/Storages/Utils.cpp index 72aeb0d158d..7143ca6cf76 100644 --- a/src/Storages/Utils.cpp +++ b/src/Storages/Utils.cpp @@ -25,7 +25,7 @@ namespace DB { return {CurrentMetrics::AttachedDictionary}; } - if (auto * replicated_storage = typeid_cast(storage.get())) + if (typeid_cast(storage.get()) != nullptr) { return {CurrentMetrics::AttachedTable, CurrentMetrics::AttachedReplicatedTable}; }