Skip to content

State the order a wrapper reads its SQL arguments in where it is not the C order - #177

Merged
estebanzimanyi merged 1 commit into
MobilityDB:masterfrom
estebanzimanyi:catalog/sql-argument-order
Oct 4, 2026
Merged

estebanzimanyi merged 1 commit into
MobilityDB:masterfrom
estebanzimanyi:catalog/sql-argument-order

Conversation

@estebanzimanyi

Copy link
Copy Markdown
Member

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.

…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
estebanzimanyi force-pushed the catalog/sql-argument-order branch from 52ceade to bc31bf6 Compare October 4, 2026 22:16
@estebanzimanyi
estebanzimanyi merged commit 993b4db into MobilityDB:master Oct 4, 2026
3 checks passed
@estebanzimanyi
estebanzimanyi deleted the catalog/sql-argument-order branch October 4, 2026 22:20
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