Commit a869ab3
kongfanshen
fix: place JOIN_RIGHT_SEMI at end of JoinType enum to preserve ABI
The initial backport (commit for aa86129e1) inserted JOIN_RIGHT_SEMI in
its upstream position, immediately before JOIN_RIGHT_ANTI. In the
Greenplum/Cloudberry tree this shifts the integer values of the
GPDB-specific join codes that follow it -- JOIN_RIGHT_ANTI,
JOIN_UNIQUE_OUTER/INNER and especially JOIN_DEDUP_SEMI /
JOIN_DEDUP_SEMI_REVERSE.
Some value-dependent code relies on those stable integer values; shifting
them corrupts MPP motion planning. Concretely, the regression query
with ctetable as not materialized (select 1 as f1)
select * from ctetable c1
where f1 in (select c3.f1 from ctetable c2 full join ctetable c3 on true);
(which the baseline plans as a plain Hash Semi Join returning 1 row)
started producing a degenerate plan with "Gather Motion 0:1" /
"Redistribute Motion 1:0" and crashed with SIGSEGV in
setupCdbProcessList() during dispatch.
Isolation showed the crash reproduces with ONLY the enum change applied
(clean full rebuild) and disappears entirely once the pre-existing enum
values are kept stable. Move JOIN_RIGHT_SEMI to the end of the enum so
every previously-defined value is unchanged. JOIN_RIGHT_SEMI is still a
fully executor-supported join type; only its numeric position differs
from upstream.
Verified: the crashing query now returns 1 row under both optimizers, and
Hash Right Semi Join is still chosen (and correct) for the small-build-side
case.1 parent 5f33f44 commit a869ab3
1 file changed
Lines changed: 13 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1026 | 1026 | | |
1027 | 1027 | | |
1028 | 1028 | | |
1029 | | - | |
1030 | 1029 | | |
1031 | 1030 | | |
1032 | 1031 | | |
| |||
1046 | 1045 | | |
1047 | 1046 | | |
1048 | 1047 | | |
1049 | | - | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
1050 | 1061 | | |
1051 | 1062 | | |
1052 | 1063 | | |
| |||
0 commit comments