[fix](planner)literal expr should do nothing in substituteImpl() method (#23438)

substitute a literal expr is pointless and wrong. This pr keep literal expr unchanged during substitute process
This commit is contained in:
starocean999
2023-08-25 11:21:35 +08:00
committed by GitHub
parent 18094511e7
commit 37b90021b7
3 changed files with 24 additions and 0 deletions

View File

@ -402,4 +402,10 @@ public abstract class LiteralExpr extends Expr implements Comparable<LiteralExpr
public boolean matchExprs(List<Expr> exprs, SelectStmt stmt, boolean ignoreAlias, TupleDescriptor tuple) {
return true;
}
@Override
protected Expr substituteImpl(ExprSubstitutionMap smap, ExprSubstitutionMap disjunctsMap,
Analyzer analyzer) {
return this;
}
}

View File

@ -4,3 +4,6 @@
2
3
-- !select2 --
0 2.0

View File

@ -63,6 +63,21 @@ suite("test_subquery_with_agg") {
subq_1.gid;
"""
qt_select2 """
select
0 as row_number,
round(sum(num) / 10, 0) as org_id
from
(
select
num
from
agg_subquery_table
) t
group by
1;
"""
sql """
drop table if exists agg_subquery_table;
"""