=== Applying patches on top of PostgreSQL commit ID 5ee476294c517ce0024e865e6f51c4ce34bc044e === /etc/rc.d/jail: WARNING: Per-jail configuration via jail_* variables is obsolete. Please consider migrating to /etc/jail.conf. Wed Apr 16 01:47:21 UTC 2025 On branch cf/5487 nothing to commit, working tree clean === using 'git am' to apply patch ./v3-0001-Add-appling-the-pull-up-transformation-for-expressio.patch === Applying: Add appling the pull-up transformation for expressions. We examine all expressions and need to increase the varno of vars which belong to subquery, because they will be belonged to another part of the query. But we need to decrease the sublevel number for vars which belong the upper level of the query because the subquery will be plat, so they will be the same sublevel number. That's why we separate such vars on leftargs and rightargs lists. leftargs list contain vars belonged to upper level part of query, rightargs contain vars belonged to subquery. newWhere list contain expressions for which we can't determine what part of query they belonged to, probably constants from subquery. Using index info to reconstruct a base tree... M src/backend/optimizer/plan/subselect.c M src/test/regress/expected/partition_join.out 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/test/regress/expected/partition_join.out CONFLICT (content): Merge conflict in src/test/regress/expected/partition_join.out Auto-merging src/backend/optimizer/plan/subselect.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 Add appling the pull-up transformation for expressions. We examine all expressions and need to increase the varno of vars which belong to subquery, because they will be belonged to another part of the query. But we need to decrease the sublevel number for vars which belong the upper level of the query because the subquery will be plat, so they will be the same sublevel number. That's why we separate such vars on leftargs and rightargs lists. leftargs list contain vars belonged to upper level part of query, rightargs contain vars belonged to subquery. newWhere list contain expressions for which we can't determine what part of query they belonged to, probably constants from subquery. 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". Unstaged changes after reset: M src/backend/optimizer/plan/subselect.c M src/test/regress/expected/partition_join.out M src/test/regress/expected/subselect.out M src/test/regress/expected/updatable_views.out M src/test/regress/sql/subselect.sql === using patch(1) to apply patch ./v3-0001-Add-appling-the-pull-up-transformation-for-expressio.patch === patching file src/backend/optimizer/plan/subselect.c Hunk #1 succeeded at 1458 (offset 80 lines). Hunk #2 succeeded at 1480 (offset 80 lines). Hunk #3 succeeded at 1497 (offset 80 lines). Hunk #4 succeeded at 1669 (offset 80 lines). Hunk #5 succeeded at 1681 (offset 80 lines). Hunk #6 succeeded at 1721 (offset 80 lines). Hunk #7 succeeded at 1751 (offset 80 lines). patching file src/test/regress/expected/partition_join.out Hunk #1 succeeded at 2527 (offset 35 lines). Hunk #2 succeeded at 2538 (offset 35 lines). Hunk #3 FAILED at 2534. Hunk #4 FAILED at 2545. 2 out of 4 hunks FAILED -- saving rejects to file src/test/regress/expected/partition_join.out.rej patching file src/test/regress/expected/subselect.out patching file src/test/regress/expected/updatable_views.out patching file src/test/regress/sql/subselect.sql Unstaged changes after reset: M src/backend/optimizer/plan/subselect.c M src/test/regress/expected/partition_join.out M src/test/regress/expected/subselect.out M src/test/regress/expected/updatable_views.out M src/test/regress/sql/subselect.sql Removing src/test/regress/expected/partition_join.out.rej === using 'git apply' to apply patch ./v3-0001-Add-appling-the-pull-up-transformation-for-expressio.patch === Applied patch to 'src/backend/optimizer/plan/subselect.c' cleanly. Applied patch to 'src/test/regress/expected/partition_join.out' with conflicts. Applied patch to 'src/test/regress/expected/subselect.out' cleanly. Applied patch to 'src/test/regress/expected/updatable_views.out' cleanly. Applied patch to 'src/test/regress/sql/subselect.sql' cleanly. U src/test/regress/expected/partition_join.out diff --cc src/test/regress/expected/partition_join.out index 6101c8c7cf1,8cb4cda388e..00000000000 --- a/src/test/regress/expected/partition_join.out +++ b/src/test/regress/expected/partition_join.out @@@ -2568,24 -2533,24 +2568,34 @@@ where not exists (select 1 from prtx -> Seq Scan on prtx1_1 Filter: ((a < 20) AND (c = 91)) -> Bitmap Heap Scan on prtx2_1 ++<<<<<<< ours + Recheck Cond: ((b = (prtx1_1.b + 1)) OR (c = 99)) + Filter: (a = prtx1_1.a) ++======= + Recheck Cond: ((c = 99) OR (b = (prtx1_1.b + 1))) + Filter: (prtx1_1.a = a) ++>>>>>>> theirs -> BitmapOr - -> Bitmap Index Scan on prtx2_1_c_idx - Index Cond: (c = 99) -> Bitmap Index Scan on prtx2_1_b_idx Index Cond: (b = (prtx1_1.b + 1)) + -> Bitmap Index Scan on prtx2_1_c_idx + Index Cond: (c = 99) -> Nested Loop Anti Join -> Seq Scan on prtx1_2 Filter: ((a < 20) AND (c = 91)) -> Bitmap Heap Scan on prtx2_2 ++<<<<<<< ours + Recheck Cond: ((b = (prtx1_2.b + 1)) OR (c = 99)) + Filter: (a = prtx1_2.a) ++======= + Recheck Cond: ((c = 99) OR (b = (prtx1_2.b + 1))) + Filter: (prtx1_2.a = a) ++>>>>>>> theirs -> BitmapOr - -> Bitmap Index Scan on prtx2_2_c_idx - Index Cond: (c = 99) -> Bitmap Index Scan on prtx2_2_b_idx Index Cond: (b = (prtx1_2.b + 1)) + -> Bitmap Index Scan on prtx2_2_c_idx + Index Cond: (c = 99) (23 rows) select * from prtx1