Richard Guo <[email protected]> 于2026年10月8日周四 14:12写道:
>
> The following query fails on v14 to master:
>
> create table t (a int);
>
> select 1 from t t1 left join t t2 on true,
> lateral (select t2.a offset 0) s1 left join t t3 on s1.a = t3.a,
> lateral (select t3.a offset 0) s2
> where s2.a > t1.a;
> ERROR: failed to build any 5-way joins
I found a variant that still fails with the v1 patch applied.
Replacing the second LEFT JOIN with a FULL JOIN reproduces it:
CREATE TABLE t (a int);
SELECT 1
FROM t t1 LEFT JOIN t t2 ON true,
LATERAL (SELECT t2.a OFFSET 0) s1
FULL JOIN t t3 ON s1.a = t3.a,
LATERAL (SELECT t3.a OFFSET 0) s2
WHERE s2.a > t1.a;
This gives:
ERROR: failed to build any 4-way joins
It fails both with and without v1.
I haven't traced the exact cause yet, but wanted to flag this case.
--
Thanks,
Tender Wang