Skip to content

Bind the defaults a wrapper hands to the helper laying its state - #153

Merged
estebanzimanyi merged 1 commit into
MobilityDB:masterfrom
estebanzimanyi:catalog/guarded-defaults-through-helpers
Sep 30, 2026
Merged

estebanzimanyi merged 1 commit into
MobilityDB:masterfrom
estebanzimanyi:catalog/guarded-defaults-through-helpers

Conversation

@estebanzimanyi

Copy link
Copy Markdown
Member

A set-returning wrapper can read an argument under a PG_NARGS guard and
pass the local to a helper taking its FunctionCallInfo, which calls MEOS
for the state the wrapper then streams. Tgeo_space_split reads ysize only
when PG_NARGS() > 5 and zsize only when PG_NARGS() > 6, starting both from
0, and hands them to Tgeo_split_start, which calls
tgeo_space_time_split_init. A helper parameter fed by such a local is
bound on each signature omitting that argument, as a local the wrapper
passes to MEOS itself is. A helper is recognised by its FunctionCallInfo
parameter whatever it returns: void for Tgeo_split_start and
Stbox_tiles_start, Datum for the helpers answering for their wrapper.

The helper calls none of the members of the function group but their
initialiser, which takes the members' parameters under the same names
among others of its own. Each argument of that call binds to the member
parameter of its name, as the generic twin a wrapper calls binds by name.
The initialiser's parameters no member has, duration and torigin for
tgeo_space_split, bind nothing.

Why. A binding generating the short forms of a split or a tiling reads
which sizes the call leaves out, and with what value, from boundArgs. The
wrappers keep streaming the grid state; the catalog reads them as they are.

Measured. Over MobilityDB 27c952dcc5, 34 SQL signatures gain boundArgs and
none loses or changes one. 16 are the one-size and two-size forms of
tgeo_space_split, tgeo_space_time_split, stbox_space_tiles and
stbox_space_time_tiles, so every one-size signature of the ten functions
taking ysize and zsize states {ysize: 0, zsize: 0}, every two-size one
{zsize: 0}, and every full one nothing. The other 18 are the atStbox and
minusStbox signatures of tgeoinst_restrict_stbox, tgeoseq_restrict_stbox
and tgeoseqset_restrict_stbox, whose wrappers pass REST_AT and REST_MINUS
through a helper: atfunc is REST_AT and REST_MINUS respectively.

Witness. tests/test_boundargs.py binds each short form of a wrapper shaped
as Tgeo_space_split to the sizes it omits, binds nothing for the
initialiser's own parameters, for an initialiser sharing no parameter name
with the member, or without the MEOS sources. The suite floor goes from
337 to 341.

A set-returning wrapper can read an argument under a PG_NARGS guard and
pass the local to a helper taking its FunctionCallInfo, which calls MEOS
for the state the wrapper then streams. Tgeo_space_split reads ysize only
when PG_NARGS() > 5 and zsize only when PG_NARGS() > 6, starting both from
0, and hands them to Tgeo_split_start, which calls
tgeo_space_time_split_init. A helper parameter fed by such a local is
bound on each signature omitting that argument, as a local the wrapper
passes to MEOS itself is. A helper is recognised by its FunctionCallInfo
parameter whatever it returns: void for Tgeo_split_start and
Stbox_tiles_start, Datum for the helpers answering for their wrapper.

The helper calls none of the members of the function group but their
initialiser, which takes the members' parameters under the same names
among others of its own. Each argument of that call binds to the member
parameter of its name, as the generic twin a wrapper calls binds by name.
The initialiser's parameters no member has, duration and torigin for
tgeo_space_split, bind nothing.

Why. A binding generating the short forms of a split or a tiling reads
which sizes the call leaves out, and with what value, from boundArgs. The
wrappers keep streaming the grid state; the catalog reads them as they are.

Measured. Over MobilityDB 27c952dcc5, 34 SQL signatures gain boundArgs and
none loses or changes one. 16 are the one-size and two-size forms of
tgeo_space_split, tgeo_space_time_split, stbox_space_tiles and
stbox_space_time_tiles, so every one-size signature of the ten functions
taking ysize and zsize states {ysize: 0, zsize: 0}, every two-size one
{zsize: 0}, and every full one nothing. The other 18 are the atStbox and
minusStbox signatures of tgeoinst_restrict_stbox, tgeoseq_restrict_stbox
and tgeoseqset_restrict_stbox, whose wrappers pass REST_AT and REST_MINUS
through a helper: atfunc is REST_AT and REST_MINUS respectively.

Witness. tests/test_boundargs.py binds each short form of a wrapper shaped
as Tgeo_space_split to the sizes it omits, binds nothing for the
initialiser's own parameters, for an initialiser sharing no parameter name
with the member, or without the MEOS sources. The suite floor goes from
337 to 341.
@estebanzimanyi
estebanzimanyi merged commit 0455a59 into MobilityDB:master Sep 30, 2026
3 checks passed
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