From c3c0bb730f16e3f56d1a2d4880cf14f27934b756 Mon Sep 17 00:00:00 2001 From: Fu Zhe Date: Sat, 20 Nov 2021 12:59:48 +0800 Subject: [PATCH] Fix bug that copy ExpressionActionsChain's last step by value, not by reference. (#3487) --- dbms/src/Flash/Coprocessor/DAGExpressionAnalyzer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dbms/src/Flash/Coprocessor/DAGExpressionAnalyzer.cpp b/dbms/src/Flash/Coprocessor/DAGExpressionAnalyzer.cpp index fcc1a1ea381..8bf8f229de8 100644 --- a/dbms/src/Flash/Coprocessor/DAGExpressionAnalyzer.cpp +++ b/dbms/src/Flash/Coprocessor/DAGExpressionAnalyzer.cpp @@ -1132,7 +1132,7 @@ void DAGExpressionAnalyzer::appendAggSelect(ExpressionActionsChain & chain, cons initChain(chain, getCurrentInputColumns()); bool need_update_aggregated_columns = false; std::vector updated_aggregated_columns; - ExpressionActionsChain::Step step = chain.steps.back(); + ExpressionActionsChain::Step & step = chain.steps.back(); for (Int32 i = 0; i < aggregation.agg_func_size(); i++) { String & name = aggregated_columns[i].name; @@ -1236,7 +1236,7 @@ NamesWithAliases DAGExpressionAnalyzer::appendFinalProject( /// for all the columns that need to be returned, if the type is timestamp, then convert /// the timestamp column to UTC based, refer to appendTimeZoneCastsAfterTS for more details initChain(chain, getCurrentInputColumns()); - ExpressionActionsChain::Step step = chain.steps.back(); + ExpressionActionsChain::Step & step = chain.steps.back(); tipb::Expr tz_expr; constructTZExpr(tz_expr, context.getTimezoneInfo(), false);