mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
Keep alias after substitution of query parameters #11914
This commit is contained in:
parent
2da7b356ab
commit
cd34cacee2
@ -49,6 +49,7 @@ void ReplaceQueryParameterVisitor::visitQueryParameter(ASTPtr & ast)
|
||||
const auto & ast_param = ast->as<ASTQueryParameter &>();
|
||||
const String & value = getParamValue(ast_param.name);
|
||||
const String & type_name = ast_param.type;
|
||||
String alias = ast_param.alias;
|
||||
|
||||
const auto data_type = DataTypeFactory::instance().get(type_name);
|
||||
auto temp_column_ptr = data_type->createColumn();
|
||||
@ -63,6 +64,7 @@ void ReplaceQueryParameterVisitor::visitQueryParameter(ASTPtr & ast)
|
||||
+ value.substr(0, read_buffer.count()), ErrorCodes::BAD_QUERY_PARAMETER);
|
||||
|
||||
ast = addTypeConversionToAST(std::make_shared<ASTLiteral>(temp_column[0]), type_name);
|
||||
ast->setAlias(alias);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user