This commit is contained in:
kssenii 2021-06-25 07:00:15 +00:00
parent ca1f336c46
commit ded9007ca0
2 changed files with 5 additions and 3 deletions

View File

@ -11,7 +11,6 @@
#include <Interpreters/InterpreterSelectQuery.h>
#include <Interpreters/IdentifierSemantic.h>
#include <Interpreters/getHeaderForProcessingStage.h>
#include <Interpreters/TreeRewriter.h>
#include <Parsers/ASTSelectQuery.h>
#include <Parsers/ASTLiteral.h>
#include <Parsers/ASTIdentifier.h>
@ -267,6 +266,9 @@ Pipe StorageMerge::read(
if (const auto * ast_function = typeid_cast<const ASTFunction *>(expr.get()))
{
if (!ast_function->arguments)
return;
for (const auto & arg : ast_function->arguments->children)
extract_columns_from_alias_expression(arg);
}

View File

@ -53,5 +53,5 @@ insert into alias_2 (dt, col, col2, col3) values ('2020-02-01', 1, 2, 3);
select 'alias2';
select colAlias0, colAlias1, colAlias2, colAlias3 from alias_2;
select colAlias3, colAlias2, colAlias1, colAlias0 from merge;
select * from merge;
select colAlias3, colAlias2, colAlias1, colAlias0 from merge order by dt;
select * from merge order by dt;