提交 33612471 编写于 作者: A Alexey Milovidov

Fix lifetime of Context reference in functions (first quick variant) [#CLICKHOUSE-2]

上级 697067f2
......@@ -2054,8 +2054,13 @@ void ExpressionAnalyzer::getActionsImpl(const ASTPtr & ast, bool no_subqueries,
if (AggregateFunctionFactory::instance().isAggregateFunctionName(node->name))
return;
const FunctionBuilderPtr & function_builder = FunctionFactory::instance().get(node->name, context.getQueryContext());
auto projection_action = getProjectionAction(node->name, actions_stack, projection_manipulator, getColumnName(), context);
/// Context object that we pass to function should live during query.
const Context & function_context = context.hasQueryContext()
? context.getQueryContext()
: context;
const FunctionBuilderPtr & function_builder = FunctionFactory::instance().get(node->name, function_context);
auto projection_action = getProjectionAction(node->name, actions_stack, projection_manipulator, getColumnName(), function_context);
Names argument_names;
DataTypes argument_types;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册