=== Applying patches on top of PostgreSQL commit ID 780fa49746d57403b871f4ef4c92499b324df32c === /etc/rc.d/jail: WARNING: Per-jail configuration via jail_* variables is obsolete. Please consider migrating to /etc/jail.conf. Mon Aug 3 09:38:37 UTC 2026 On branch cf/7080 nothing to commit, working tree clean === using 'git am' to apply patch ./v2-0001-Don-t-prove-a-sub-select-s-upper-level-output-Var.patch === Applying: Don't prove a sub-select's upper-level output Var non-nullable from a qual Using index info to reconstruct a base tree... M src/backend/optimizer/util/clauses.c M src/test/regress/expected/subselect.out M src/test/regress/sql/subselect.sql Falling back to patching base and 3-way merge... Auto-merging src/test/regress/sql/subselect.sql Auto-merging src/test/regress/expected/subselect.out Auto-merging src/backend/optimizer/util/clauses.c CONFLICT (content): Merge conflict in src/backend/optimizer/util/clauses.c error: Failed to merge in the changes. hint: Use 'git am --show-current-patch=diff' to see the failed patch Patch failed at 0001 Don't prove a sub-select's upper-level output Var non-nullable from a qual When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort". === using patch(1) to apply patch ./v2-0001-Don-t-prove-a-sub-select-s-upper-level-output-Var.patch === patching file src/backend/optimizer/util/clauses.c Hunk #1 FAILED at 2163. 1 out of 1 hunk FAILED -- saving rejects to file src/backend/optimizer/util/clauses.c.rej patching file src/test/regress/expected/subselect.out patching file src/test/regress/sql/subselect.sql Unstaged changes after reset: M src/test/regress/expected/subselect.out M src/test/regress/sql/subselect.sql Removing src/backend/optimizer/util/clauses.c.rej === using 'git apply' to apply patch ./v2-0001-Don-t-prove-a-sub-select-s-upper-level-output-Var.patch === Applied patch to 'src/backend/optimizer/util/clauses.c' with conflicts. Applied patch to 'src/test/regress/expected/subselect.out' cleanly. Applied patch to 'src/test/regress/sql/subselect.sql' cleanly. U src/backend/optimizer/util/clauses.c diff --cc src/backend/optimizer/util/clauses.c index 337fc27262e,c1d786dfff5..00000000000 --- a/src/backend/optimizer/util/clauses.c +++ b/src/backend/optimizer/util/clauses.c @@@ -2163,7 -2163,13 +2163,17 @@@ query_outputs_are_not_nullable(Query *q if (expr_is_nonnullable(&subroot, expr, NOTNULL_SOURCE_CATALOG)) continue; ++<<<<<<< ours + /* Note we can only prove things about this query's own Vars */ ++======= + /* + * Upper-level Vars must be excluded here: find_nonnullable_vars only + * reports Vars of this query level, and identifies them by varno and + * varattno alone, so an upper-level Var would be matched against a + * local Var of an unrelated relation that happens to have the same + * varno and varattno. + */ ++>>>>>>> theirs if (IsA(expr, Var) && ((Var *) expr)->varlevelsup == 0) { Var *var = (Var *) expr;