!4443 修复创建base result plan的bug

Merge pull request !4443 from pengjiong/drop_ext
This commit is contained in:
opengauss_bot
2023-11-20 01:50:42 +00:00
committed by Gitee
3 changed files with 26 additions and 1 deletions

View File

@ -387,8 +387,11 @@ static Plan* create_plan_recurse(PlannerInfo* root, Path* best_path)
Assert(IsA(best_path, ResultPath));
plan = (Plan*)create_result_plan(root, (ResultPath*)best_path);
}
} else {
} else if (IsA(best_path, ResultPath)) {
plan = (Plan*)create_result_plan(root, (ResultPath*)best_path);
} else {
Assert(IsA(best_path, Path));
plan = create_scan_plan(root, best_path);
}
break;
case T_ProjectSet:

View File

@ -321,6 +321,21 @@ explain (verbose, costs off) select * from t2 where t2.c1 in (select t1.c1 from
drop table if exists t1;
drop table if exists t2;
CREATE TABLE table1 ( column63 INT , column44 INT ) ;
SELECT 1 FROM ( SELECT 1 FROM table1 WHERE NOT EXISTS ( SELECT 1 WHERE column63 = column44 ) ) AS alias1 ;
?column?
----------
(0 rows)
insert into table1 values(2,3);
insert into table1 values(4,4);
SELECT 1 FROM ( SELECT 1 FROM table1 WHERE NOT EXISTS ( SELECT 1 WHERE column63 = column44 ) ) AS alias1 ;
?column?
----------
1
(1 row)
drop table table1;
drop schema query_rewrite cascade;
NOTICE: drop cascades to 7 other objects
DETAIL: drop cascades to table t3

View File

@ -187,5 +187,12 @@ explain (verbose, costs off) select * from t2 where t2.c1 in (select t1.c1 from
drop table if exists t1;
drop table if exists t2;
CREATE TABLE table1 ( column63 INT , column44 INT ) ;
SELECT 1 FROM ( SELECT 1 FROM table1 WHERE NOT EXISTS ( SELECT 1 WHERE column63 = column44 ) ) AS alias1 ;
insert into table1 values(2,3);
insert into table1 values(4,4);
SELECT 1 FROM ( SELECT 1 FROM table1 WHERE NOT EXISTS ( SELECT 1 WHERE column63 = column44 ) ) AS alias1 ;
drop table table1;
drop schema query_rewrite cascade;
reset current_schema;