State the order a wrapper reads its SQL arguments in where it is not the C order - #177
Merged
estebanzimanyi merged 1 commit intoOct 4, 2026
Conversation
…the C order A wrapper can read its SQL arguments in an order other than the parameters of the MEOS function it calls: tgeogpointSeq(tgeogpoint[], text, boolean, boolean) reads the instants, the interpolation and the two inclusions, while tsequence_make takes the instants, their count, the two inclusions and then the interpolation, and tdistance(geometry, tgeometry) passes its second argument first to tdistance_tgeo_geo(temp, gs). The catalog states the C parameters in SQL argument order as shape.sqlArgParams, read from the wrapper body by parser/boundargs.py: a call argument reading PG_GETARG_<T>(k), or a local whose assignments read it, as interp = input_interp_string(fcinfo, 1) or instants from the array PG_GETARG_ARRAYTYPE_P(0), carries argument k. Each SQL signature is traced to the wrapper whose CREATE FUNCTION states it, as the bound literals are; a function whose signatures read different orders states them on each signature. The order is stated for the exception alone, as boundArgs is: where it is absent the SQL arguments follow the C parameters. Witness: over MobilityDB master 8600f6905a a binding pairing the SQL arguments of tgeogpointSeq with the parameters of tsequence_make by position passes the interpolation text to lower_inc; the catalog states no order a binding can read, so the typed Spark and Flink surfaces leave the 4.7 constructors, the raster value restrictions and every commuted distance out. Measured over MobilityDB master 8600f6905a and the installed headers of a libmeos built from it: 13 functions state the order for every signature (tsequence_make, tsequenceset_make_gaps, pose_apply_geo, tpose_apply_geo, raquet_make and the eight raster value restrictions, which read the value span before the band) and 71 signatures of 52 functions state their own (the commuted forms, geometry or box first); the catalog differs from master's in these fields alone. The suite passes, 25 tests skipped as on master, tests/test_boundargs.py stating the constructor and a commuted wrapper on synthetic bodies and the constructor over the generated catalog. Why: the wrapper body is where the pairing of a SQL argument with a C parameter is written, so the catalog reads it there.
estebanzimanyi
force-pushed
the
catalog/sql-argument-order
branch
from
October 4, 2026 22:16
52ceade to
bc31bf6
Compare
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 wrapper can read its SQL arguments in an order other than the parameters of the MEOS function
it calls: tgeogpointSeq(tgeogpoint[], text, boolean, boolean) reads the instants, the
interpolation and the two inclusions, while tsequence_make takes the instants, their count, the
two inclusions and then the interpolation, and tdistance(geometry, tgeometry) passes its second
argument first to tdistance_tgeo_geo(temp, gs). The catalog states the C parameters in SQL
argument order as shape.sqlArgParams, read from the wrapper body by parser/boundargs.py: a call
argument reading PG_GETARG_(k), or a local whose assignments read it, as
interp = input_interp_string(fcinfo, 1) or instants from the array PG_GETARG_ARRAYTYPE_P(0),
carries argument k. Each SQL signature is traced to the wrapper whose CREATE FUNCTION states it,
as the bound literals are; a function whose signatures read different orders states them on each
signature. The order is stated for the exception alone, as boundArgs is: where it is absent the
SQL arguments follow the C parameters.
Witness: over MobilityDB master 8600f6905a a binding pairing the SQL arguments of tgeogpointSeq
with the parameters of tsequence_make by position passes the interpolation text to lower_inc;
the catalog states no order a binding can read, so the typed Spark and Flink surfaces leave the
4.7 constructors, the raster value restrictions and every commuted distance out.
Measured over MobilityDB master 8600f6905a and the installed headers of a libmeos built from it:
13 functions state the order for every signature (tsequence_make, tsequenceset_make_gaps,
pose_apply_geo, tpose_apply_geo, raquet_make and the eight raster value restrictions, which read
the value span before the band) and 71 signatures of 52 functions state their own (the commuted
forms, geometry or box first); the catalog differs from master's in these fields alone. The suite
passes, 25 tests skipped as on master, tests/test_boundargs.py stating the constructor and a
commuted wrapper on synthetic bodies and the constructor over the generated catalog.
Why: the wrapper body is where the pairing of a SQL argument with a C parameter is written, so
the catalog reads it there.