Skip to content

Register the forms a trailing SQL default allows for the set path functions - #538

Merged
estebanzimanyi merged 1 commit into
MobilityDB:mainfrom
estebanzimanyi:fix/jsonbset-path-defaults
Oct 30, 2026
Merged

estebanzimanyi merged 1 commit into
MobilityDB:mainfrom
estebanzimanyi:fix/jsonbset-path-defaults

Conversation

@estebanzimanyi

Copy link
Copy Markdown
Member

MobilityDB declares jsonbsetExtractPath and jsonbsetExtractPathText with
null_handle text DEFAULT 'use_json_null', and jsonbsetInsert with after
boolean DEFAULT false. shape_text_array registers the path functions over
a set, and shape_sig_call, which registers the forms a default allows,
reads no set operand, so the set functions register their full form
alone.

shape_text_array registers, for a set operand, each form its trailing
defaults allow: text_array_default_forms states each shorter tail, the
omitted argument a literal sig_call_literal converts from its default,
and each form is its own body, Gen__v, beside the full one.

Witness: jsonbsetExtractPath(set([jsonb '{"a":{"b":7}}']), ['a','b'])
finds no function on main, where the extension lists the three-argument
form alone; it answers {7}, as MobilityDB does.

Measured: the generator run before and after the change on the catalog of
the pinned MEOS e87fd59846 registers 10103 and 10106 signatures: three
added, jsonbsetExtractPath and jsonbsetExtractPathText without their null
handling and jsonbsetInsert without its after, and none removed. The new
bodies call jsonbset_extract_path with
null_handle_type_from_string("use_json_null") and jsonbset_insert with
false.

Tests: value_type_sets.test runs each short form against its full form
with the default passed.

Why: a binding registers the SQL surface MobilityDB declares, and a call
leaving a defaulted argument out is part of it.

…ctions

MobilityDB declares jsonbsetExtractPath and jsonbsetExtractPathText with
null_handle text DEFAULT 'use_json_null', and jsonbsetInsert with after
boolean DEFAULT false. shape_text_array registers the path functions over
a set, and shape_sig_call, which registers the forms a default allows,
reads no set operand, so the set functions register their full form
alone.

shape_text_array registers, for a set operand, each form its trailing
defaults allow: text_array_default_forms states each shorter tail, the
omitted argument a literal sig_call_literal converts from its default,
and each form is its own body, Gen_<fn>_v<k>, beside the full one.

Witness: jsonbsetExtractPath(set([jsonb '{"a":{"b":7}}']), ['a','b'])
finds no function on main, where the extension lists the three-argument
form alone; it answers {7}, as MobilityDB does.

Measured: the generator run before and after the change on the catalog of
the pinned MEOS e87fd59846 registers 10103 and 10106 signatures: three
added, jsonbsetExtractPath and jsonbsetExtractPathText without their null
handling and jsonbsetInsert without its after, and none removed. The new
bodies call jsonbset_extract_path with
null_handle_type_from_string("use_json_null") and jsonbset_insert with
false.

Tests: value_type_sets.test runs each short form against its full form
with the default passed.

Why: a binding registers the SQL surface MobilityDB declares, and a call
leaving a defaulted argument out is part of it.
@estebanzimanyi
estebanzimanyi merged commit c61c9c9 into MobilityDB:main Oct 30, 2026
9 checks passed
@estebanzimanyi
estebanzimanyi deleted the fix/jsonbset-path-defaults branch October 30, 2026 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant