Skip to content

Commit

Permalink
fix fold constant
Browse files Browse the repository at this point in the history
  • Loading branch information
keanji-x committed Nov 2, 2023
1 parent 6010be8 commit 0488737
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public boolean isNullable() {
*/
@Override
public Expr getResultValue(boolean inView) throws AnalysisException {
recursiveResetChildrenResult(inView);
recursiveResetChildrenResult(!inView);
final Expr childValue = getChild(0);
if (!(childValue instanceof LiteralExpr)) {
return this;
Expand Down
5 changes: 5 additions & 0 deletions regression-test/data/query_p0/literal_view/lietral_test.out
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
-- This file is automatically generated. You should know what you did if you want to edit this
-- !sql --

-- !left --
3 flink 20 \N
1 doris 10 \N
2 spark 2 \N

-- !sql1 --

Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,15 @@ suite("literal_view_test") {
insert into test_insert values (1,'doris',10),(2,'spark',2),(3,'flink',20);
"""

sql "set enable_nereids_planner=false"
qt_left """select *
from test_insert
left join (select 1 as v1) t1
on false
where t1.v1 is null
"""
sql "set enable_nereids_planner=true"

qt_sql1 """
select id, name
from (
Expand Down

0 comments on commit 0488737

Please sign in to comment.