From 40bedd88e7d9126cba7802d9efad7a929d2fdb48 Mon Sep 17 00:00:00 2001 From: Vladimir Chebotarev Date: Thu, 12 Aug 2021 10:36:08 +0300 Subject: [PATCH] One more fix. --- src/Interpreters/MutationsInterpreter.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Interpreters/MutationsInterpreter.cpp b/src/Interpreters/MutationsInterpreter.cpp index f2b62ec4aa2..65edaa49b29 100644 --- a/src/Interpreters/MutationsInterpreter.cpp +++ b/src/Interpreters/MutationsInterpreter.cpp @@ -200,13 +200,14 @@ bool isStorageTouchedByMutations( else all_commands_can_be_skipped = false; - if (command.type == MutationCommand::MATERIALIZE_COLUMN && !command.materialize_column_final) + if (command.type == MutationCommand::MATERIALIZE_COLUMN) { if (!storage_from_merge_tree_data_part) throw Exception("ALTER MATERIALIZE COLUMN is not supported for non-MergeTree tables", ErrorCodes::NOT_IMPLEMENTED); - if (storage_from_merge_tree_data_part->isColumnEmpty(command.column_name)) + if (!storage_from_merge_tree_data_part->isColumnEmpty(command.column_name) || command.materialize_column_final) all_commands_can_be_skipped = false; + /// FIXME this is very bad place to check final :((( } }