From a49106e583db6fa7cd627f36340137dc8462ae60 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Wed, 2 Mar 2022 13:21:53 +0300 Subject: [PATCH] Fix non-MergeTree engines for system.*_log Fixes: https://github.com/ClickHouse/ClickHouse/pull/34949 Signed-off-by: Azat Khuzhin --- src/Interpreters/SystemLog.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Interpreters/SystemLog.cpp b/src/Interpreters/SystemLog.cpp index db46097b06a..59545d4314d 100644 --- a/src/Interpreters/SystemLog.cpp +++ b/src/Interpreters/SystemLog.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -472,8 +473,13 @@ ASTPtr SystemLog::getCreateTableQuery() /// Write additional (default) settings for MergeTree engine to make it make it possible to compare ASTs /// and recreate tables on settings changes. - auto storage_settings = std::make_unique(getContext()->getMergeTreeSettings()); - storage_settings->loadFromQuery(*create->storage); + const auto & engine = create->storage->engine->as(); + if (endsWith(engine.name, "MergeTree")) + { + auto storage_settings = std::make_unique(getContext()->getMergeTreeSettings()); + storage_settings->loadFromQuery(*create->storage); + } + return create; }