Fix join condition lost after pull up sublink to join - #1961
Conversation
After pulling up the sublink to join, the raw join condition may get lost in the rewritten query, potentially leading to incorrect results. Within the SubqueryToJoinWalker() function, we address this issue by adding an 'else' branch to prevent the loss of join clauses and keep them in their original positions. (cherry picked from open-gpdb commit c06d16b)
|
When a correlated aggregate subquery is pulled up into a join, A one-predicate set optimizer = off;
create table o (a int, d int); insert into o values (2, 1);
create table i1(a int); insert into i1 values (1);
create table i2(a int); insert into i2 values (1), (2);
select * from o where o.a > (select max(i2.a) from i1 join i2 on i2.a = i1.a where i1.a = o.d);
The fix adds an |
|
It looks like something wrong with subselect.out |
Fix join condition lost after pull up sublink to join.
After pulling up the sublink to join, the raw join condition may get lost in the rewritten query, potentially leading to incorrect results. Within the SubqueryToJoinWalker() function, we address this issue by adding an 'else' branch to prevent the loss of join clauses and keep them in their original positions.
(cherry picked from open-gpdb commit c06d16b)
Type of Change
Breaking Changes
Test Plan
make installcheckmake -C src/test installcheck-cbdb-parallelImpact
Performance:
User-facing changes:
Dependencies:
Checklist
Additional Context
CI Skip Instructions