=== Applying patches on top of PostgreSQL commit ID f3ae1ec7295b6c4d54974eea14bef4b917dc2c7e === /etc/rc.d/jail: WARNING: Per-jail configuration via jail_* variables is obsolete. Please consider migrating to /etc/jail.conf. Fri Apr 17 18:31:26 UTC 2026 On branch cf/6332 nothing to commit, working tree clean === using 'git am' to apply patch ./v22-0001-JSON-TABLE-PLAN-clause.patch === Applying: Add the PLAN clauses for JSON_TABLE Revisited Using index info to reconstruct a base tree... M src/backend/nodes/makefuncs.c M src/backend/parser/gram.y M src/backend/utils/adt/jsonpath_exec.c M src/backend/utils/adt/ruleutils.c M src/include/nodes/makefuncs.h M src/include/nodes/parsenodes.h M src/include/nodes/primnodes.h M src/tools/pgindent/typedefs.list Falling back to patching base and 3-way merge... Auto-merging src/tools/pgindent/typedefs.list Auto-merging src/include/nodes/primnodes.h Auto-merging src/include/nodes/parsenodes.h Auto-merging src/include/nodes/makefuncs.h Auto-merging src/backend/utils/adt/ruleutils.c Auto-merging src/backend/utils/adt/jsonpath_exec.c CONFLICT (content): Merge conflict in src/backend/utils/adt/jsonpath_exec.c Auto-merging src/backend/parser/gram.y Auto-merging src/backend/nodes/makefuncs.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 the PLAN clauses for JSON_TABLE Revisited 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 ./v22-0001-JSON-TABLE-PLAN-clause.patch === patching file src/backend/nodes/makefuncs.c patching file src/backend/parser/gram.y Hunk #1 succeeded at 672 (offset 2 lines). Hunk #2 succeeded at 691 (offset 2 lines). Hunk #3 succeeded at 15199 (offset 122 lines). Hunk #4 succeeded at 15211 (offset 122 lines). Hunk #5 succeeded at 15311 (offset 122 lines). Hunk #6 succeeded at 15322 (offset 122 lines). Hunk #7 succeeded at 15341 (offset 122 lines). patching file src/backend/parser/parse_jsontable.c patching file src/backend/utils/adt/jsonpath_exec.c Hunk #1 succeeded at 240 (offset 27 lines). Hunk #2 succeeded at 395 (offset 29 lines). Hunk #3 succeeded at 4520 (offset 307 lines). Hunk #4 succeeded at 4540 (offset 307 lines). Hunk #5 succeeded at 4596 (offset 307 lines). Hunk #6 succeeded at 4607 (offset 307 lines). Hunk #7 FAILED at 4468. Hunk #8 succeeded at 4880 (offset 307 lines). 1 out of 8 hunks FAILED -- saving rejects to file src/backend/utils/adt/jsonpath_exec.c.rej patching file src/backend/utils/adt/ruleutils.c Hunk #1 succeeded at 12660 (offset 37 lines). Hunk #2 succeeded at 12712 (offset 37 lines). Hunk #3 succeeded at 12792 (offset 37 lines). Hunk #4 succeeded at 12872 (offset 37 lines). patching file src/include/nodes/makefuncs.h patching file src/include/nodes/parsenodes.h Hunk #1 succeeded at 1984 (offset 19 lines). Hunk #2 succeeded at 2037 (offset 19 lines). patching file src/include/nodes/primnodes.h Hunk #1 succeeded at 1933 (offset 2 lines). Hunk #2 succeeded at 1955 (offset 2 lines). patching file src/test/regress/expected/sqljson_jsontable.out patching file src/tools/pgindent/typedefs.list Hunk #1 succeeded at 1478 (offset 28 lines). Hunk #2 succeeded at 1494 (offset 28 lines). Unstaged changes after reset: M src/backend/nodes/makefuncs.c M src/backend/parser/gram.y M src/backend/parser/parse_jsontable.c M src/backend/utils/adt/jsonpath_exec.c M src/backend/utils/adt/ruleutils.c M src/include/nodes/makefuncs.h M src/include/nodes/parsenodes.h M src/include/nodes/primnodes.h M src/test/regress/expected/sqljson_jsontable.out M src/tools/pgindent/typedefs.list Removing src/backend/utils/adt/jsonpath_exec.c.rej === using 'git apply' to apply patch ./v22-0001-JSON-TABLE-PLAN-clause.patch === Applied patch to 'src/backend/nodes/makefuncs.c' cleanly. Applied patch to 'src/backend/parser/gram.y' cleanly. Applied patch to 'src/backend/parser/parse_jsontable.c' cleanly. Applied patch to 'src/backend/utils/adt/jsonpath_exec.c' with conflicts. Applied patch to 'src/backend/utils/adt/ruleutils.c' cleanly. Applied patch to 'src/include/nodes/makefuncs.h' cleanly. Applied patch to 'src/include/nodes/parsenodes.h' cleanly. Applied patch to 'src/include/nodes/primnodes.h' cleanly. Applied patch to 'src/test/regress/expected/sqljson_jsontable.out' cleanly. Applied patch to 'src/tools/pgindent/typedefs.list' cleanly. U src/backend/utils/adt/jsonpath_exec.c diff --cc src/backend/utils/adt/jsonpath_exec.c index 0ec9b4df2ef,62d8d988353..00000000000 --- a/src/backend/utils/adt/jsonpath_exec.c +++ b/src/backend/utils/adt/jsonpath_exec.c @@@ -4712,32 -4491,6 +4798,35 @@@ JsonTableResetNestedPlan(JsonTablePlanS } /* ++<<<<<<< ours + * Fetch the next row from a JsonTableSiblingJoin. + * + * This is essentially a UNION between the rows from left and right siblings. + */ +static bool +JsonTablePlanJoinNextRow(JsonTablePlanState *planstate) +{ + + /* Fetch row from left sibling. */ + if (!JsonTablePlanNextRow(planstate->left)) + { + /* + * Left sibling ran out of rows, so start fetching from the right + * sibling. + */ + if (!JsonTablePlanNextRow(planstate->right)) + { + /* Right sibling ran out of rows too, so there are no more rows. */ + return false; + } + } + + return true; +} + +/* ++======= ++>>>>>>> theirs * JsonTableFetchRow * Prepare the next "current" row for upcoming GetValue calls. *