create table t1(v varchar(100));
insert into t1 values('abc~001');
create or replace function sameout
(in vc varchar) returns varchar AS $BODY$
begin
return vc;
END;
$BODY$
LANGUAGE plpgsql;
set optimizer to off;
select (select sameout(v) t) from t1; -- will coredump
This case has nothing to do with the table itself and the custom function. Only relative the parameterized path.
ORCA also will got the same issue with other sql.
So the SQL select (select sameout(v) t) from t1; plan is
Cloudberry Database version
All versions affected
Also GP7 have the same issue.
What happened
This case has nothing to do with the table itself and the custom function. Only relative the parameterized path.
ORCA also will got the same issue with other sql.
So the SQL
select (select sameout(v) t) from t1;
plan isAs u can see we do have a
Motion
node exist in subplan. Then inResult
node won't get any tuple in this path.I guess this case is caused by optimizer. The optimizer should not create the parameterized path with the motion.
What you think should happen instead
this sql can change to the
select sameout(v) from t1;
or a subqueryselect sameout(v) from (select v from t1) t;
The corrent plan should flat the parameterized path or become a subquery
or no motion inside
How to reproduce
above
Operating System
any
Anything else
No response
Are you willing to submit PR?
Code of Conduct