From 897f03017eb84fbfaf46c2185908c50f44425d4a Mon Sep 17 00:00:00 2001 From: Vyacheslav Alipov Date: Tue, 7 May 2013 13:42:48 +0000 Subject: [PATCH] fixed substitution launch condition [#CONV-6778] --- dbms/src/Interpreters/InterpreterSelectQuery.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dbms/src/Interpreters/InterpreterSelectQuery.cpp b/dbms/src/Interpreters/InterpreterSelectQuery.cpp index 5aaf257e38d..2edb7e925e2 100644 --- a/dbms/src/Interpreters/InterpreterSelectQuery.cpp +++ b/dbms/src/Interpreters/InterpreterSelectQuery.cpp @@ -164,7 +164,9 @@ BlockInputStreamPtr InterpreterSelectQuery::execute() if (need_aggregate) executeAggregation(streams, expression); - executeOriginalColumnNameSubstitution(streams, expression); + /// Подставим оригинальные имена столбцов, если запрос шел из distributed таблицы + if (settings.sign_rewrite && to_stage == QueryProcessingStage::WithMergeableState) + executeOriginalColumnNameSubstitution(streams, expression); } else if (from_stage <= QueryProcessingStage::WithMergeableState && to_stage > QueryProcessingStage::WithMergeableState) { @@ -585,8 +587,6 @@ BlockInputStreamPtr InterpreterSelectQuery::executeAndFormat(WriteBuffer & buf) void InterpreterSelectQuery::executeOriginalColumnNameSubstitution(BlockInputStreams & streams, ExpressionPtr & expression) { - if (!settings.sign_rewrite) - return; for (BlockInputStreams::iterator it = streams.begin(); it != streams.end(); ++it) { BlockInputStreamPtr & stream = *it;