=== Applying patches on top of PostgreSQL commit ID 32e4508db27d1fa3dc07404ad69d43ed97870f15 === /etc/rc.d/jail: WARNING: Per-jail configuration via jail_* variables is obsolete. Please consider migrating to /etc/jail.conf. Fri Jul 17 14:08:26 UTC 2026 On branch cf/7003 nothing to commit, working tree clean === using 'git am' to apply patch ./v1-0001-Cover-get_json_table_plan-with-tests.patch === Applying: Cover get_json_table_plan() with tests Using index info to reconstruct a base tree... M src/test/regress/expected/sqljson_jsontable.out M src/test/regress/sql/sqljson_jsontable.sql Falling back to patching base and 3-way merge... Auto-merging src/test/regress/sql/sqljson_jsontable.sql CONFLICT (content): Merge conflict in src/test/regress/sql/sqljson_jsontable.sql Auto-merging src/test/regress/expected/sqljson_jsontable.out CONFLICT (content): Merge conflict in src/test/regress/expected/sqljson_jsontable.out error: Failed to merge in the changes. hint: Use 'git am --show-current-patch=diff' to see the failed patch Patch failed at 0001 Cover get_json_table_plan() with tests 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 ./v1-0001-Cover-get_json_table_plan-with-tests.patch === patching file src/test/regress/expected/sqljson_jsontable.out Hunk #1 FAILED at 1847. 1 out of 1 hunk FAILED -- saving rejects to file src/test/regress/expected/sqljson_jsontable.out.rej patching file src/test/regress/sql/sqljson_jsontable.sql Hunk #1 FAILED at 1004. 1 out of 1 hunk FAILED -- saving rejects to file src/test/regress/sql/sqljson_jsontable.sql.rej Removing src/test/regress/expected/sqljson_jsontable.out.rej Removing src/test/regress/sql/sqljson_jsontable.sql.rej === using 'git apply' to apply patch ./v1-0001-Cover-get_json_table_plan-with-tests.patch === Applied patch to 'src/test/regress/expected/sqljson_jsontable.out' with conflicts. Applied patch to 'src/test/regress/sql/sqljson_jsontable.sql' with conflicts. U src/test/regress/expected/sqljson_jsontable.out U src/test/regress/sql/sqljson_jsontable.sql diff --cc src/test/regress/expected/sqljson_jsontable.out index ae64dbed303,fc8e8d7e1a7..00000000000 --- a/src/test/regress/expected/sqljson_jsontable.out +++ b/src/test/regress/expected/sqljson_jsontable.out @@@ -1910,19 -1847,58 +1910,77 @@@ CREATE OR REPLACE VIEW public.json_tabl ) ) DROP VIEW json_table_view8, json_table_view9; ++<<<<<<< ours +-- Test JSON_TABLE() column deparsing -- a non-default ON EMPTY behavior of a +-- column must be preserved +CREATE VIEW json_table_view_on_empty AS +SELECT * FROM JSON_TABLE(jsonb '{}', '$' AS p0 + COLUMNS (a int PATH '$.nosuch' ERROR ON EMPTY) + ERROR ON ERROR); +\sv json_table_view_on_empty; +CREATE OR REPLACE VIEW public.json_table_view_on_empty AS + SELECT a + FROM JSON_TABLE( + '{}'::jsonb, '$' AS p0 + COLUMNS ( + a integer PATH '$."nosuch"' ERROR ON EMPTY + ) ERROR ON ERROR + ) +DROP VIEW json_table_view_on_empty; ++======= + -- Test get_json_table_plan() + -- covers the INNER branch and the UNION branch + CREATE VIEW jt_plan_inner_union AS + SELECT * FROM JSON_TABLE( + jsonb 'null', '$' AS p + COLUMNS (NESTED PATH '$[*]' AS p1 COLUMNS (a int), + NESTED PATH '$[*]' AS p2 COLUMNS (b int)) + PLAN (p INNER (p1 UNION p2)) + ); + \sv jt_plan_inner_union + CREATE OR REPLACE VIEW public.jt_plan_inner_union AS + SELECT a, + b + FROM JSON_TABLE( + 'null'::jsonb, '$' AS p + COLUMNS ( + NESTED PATH '$[*]' AS p1 + COLUMNS ( + a integer PATH '$."a"' + ), + NESTED PATH '$[*]' AS p2 + COLUMNS ( + b integer PATH '$."b"' + ) + ) + PLAN (p INNER (p1 UNION p2)) + ) + DROP VIEW jt_plan_inner_union; + -- covers the OUTER branch and the CROSS branch + CREATE VIEW jt_plan_outer_cross AS + SELECT * FROM JSON_TABLE( + jsonb 'null', '$' AS p + COLUMNS (NESTED PATH '$[*]' AS p1 COLUMNS (a int), + NESTED PATH '$[*]' AS p2 COLUMNS (b int)) + PLAN (p OUTER (p1 CROSS p2)) + ); + \sv jt_plan_outer_cross + CREATE OR REPLACE VIEW public.jt_plan_outer_cross AS + SELECT a, + b + FROM JSON_TABLE( + 'null'::jsonb, '$' AS p + COLUMNS ( + NESTED PATH '$[*]' AS p1 + COLUMNS ( + a integer PATH '$."a"' + ), + NESTED PATH '$[*]' AS p2 + COLUMNS ( + b integer PATH '$."b"' + ) + ) + PLAN (p OUTER (p1 CROSS p2)) + ) + DROP VIEW jt_plan_outer_cross; ++>>>>>>> theirs diff --cc src/test/regress/sql/sqljson_jsontable.sql index 2a33aaec57f,74903a75fc8..00000000000 --- a/src/test/regress/sql/sqljson_jsontable.sql +++ b/src/test/regress/sql/sqljson_jsontable.sql @@@ -1043,12 -1005,24 +1043,36 @@@ CREATE VIEW json_table_view9 AS SELECT DROP VIEW json_table_view8, json_table_view9; ++<<<<<<< ours +-- Test JSON_TABLE() column deparsing -- a non-default ON EMPTY behavior of a +-- column must be preserved +CREATE VIEW json_table_view_on_empty AS +SELECT * FROM JSON_TABLE(jsonb '{}', '$' AS p0 + COLUMNS (a int PATH '$.nosuch' ERROR ON EMPTY) + ERROR ON ERROR); +\sv json_table_view_on_empty; + +DROP VIEW json_table_view_on_empty; ++======= + -- Test get_json_table_plan() + -- covers the INNER branch and the UNION branch + CREATE VIEW jt_plan_inner_union AS + SELECT * FROM JSON_TABLE( + jsonb 'null', '$' AS p + COLUMNS (NESTED PATH '$[*]' AS p1 COLUMNS (a int), + NESTED PATH '$[*]' AS p2 COLUMNS (b int)) + PLAN (p INNER (p1 UNION p2)) + ); + \sv jt_plan_inner_union + DROP VIEW jt_plan_inner_union; + -- covers the OUTER branch and the CROSS branch + CREATE VIEW jt_plan_outer_cross AS + SELECT * FROM JSON_TABLE( + jsonb 'null', '$' AS p + COLUMNS (NESTED PATH '$[*]' AS p1 COLUMNS (a int), + NESTED PATH '$[*]' AS p2 COLUMNS (b int)) + PLAN (p OUTER (p1 CROSS p2)) + ); + \sv jt_plan_outer_cross + DROP VIEW jt_plan_outer_cross; ++>>>>>>> theirs