Bind the defaults a wrapper hands to the helper laying its state - #153
Merged
estebanzimanyi merged 1 commit intoSep 30, 2026
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.