On Sun, Mar 8, 2026 at 5:16 PM Richard Guo <[email protected]> wrote:
> Attached is an updated version of the patch that replaces foreach with
> foreach_ptr or foreach_node accordingly.  Nothing else has changed.
>
> I plan to do one more round of self-review on this.  Unless there are
> any further thoughts or concerns, I'm hoping to commit this in a week
> or two.  Please let me know if anyone spots anything else I might have
> missed.

I just finished a final self-review and noticed a subtle issue in
query_outputs_are_not_nullable().  When preparing a target expression
for the non-nullability check, the previous code flattened join
aliases Vars before grouping Vars.  However, because the parser
processes FROM/JOIN clauses before the GROUP BY clause, a grouping Var
can actually wrap a join alias Var, not the reverse.  So we should
flatten grouping Vars first.

Attached is an updated patch that fixes that issue.  I plan to commit
this in a week or two, barring any objections.

- Richard

Attachment: v6-0001-Convert-NOT-IN-sublinks-to-anti-joins-when-safe.patch
Description: Binary data

Reply via email to