Repository navigation
Bind NULL for a nullable parameter a C wrapper derives from another argument - #182
Merged
estebanzimanyi merged 1 commit intoOct 9, 2026
Conversation
…rgument A parameter MEOS documents as possibly NULL that the PostgreSQL wrapper fills from a value it derives from an SQL argument another parameter already carries, and not from an SQL argument of its own, is bound to NULL for a binding: asMFJSON(tgeompoint, ...), whose wrapper Temporal_as_mfjson names the coordinate reference system with srs = get_srs_cache_by_srid(fcinfo, srid, ...) from the SRID of its temporal argument and calls temporal_as_mfjson(temp, ..., srs), states srs as NULL, so a binding calls the function with NULL and MEOS names the system from its own reference systems. A local assigned from an SQL argument, read by PG_GETARG under a running index or converted from an array, and a state threaded through the call's own result keep carrying their argument. Witness: on MobilityDB master 8a9bc20b62 temporal_as_mfjson documents srs as possibly NULL, its wrapper derives srs from the SRID of the temporal value through the table spatial_ref_sys, and master's parser classifies srs as a local the caller supplies, so the catalog states it as an SQL argument the twenty asMFJSON signatures do not carry. Measured: over MobilityDB master 8a9bc20b62 run.py states srs as NULL on 20 of the 20 signatures of temporal_as_mfjson, and every other key of the catalog equals that of master's parser. The suite passes the new tests of tests/test_boundargs.py HostDerivedNullableTests, the first of which fails with master's parser while the three stating that an argument read by a running index, an array converted into two parameters and an aggregate state stay unbound pass with both, with 432 passed and 84 skipped against 428 and 84 with master's parser. Why: a binding calls the C function with the parameters the SQL function carries, and leaving the derived one to MEOS gives it the name MEOS states for the SRID of the value.
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 parameter MEOS documents as possibly NULL that the PostgreSQL wrapper fills from a value it
derives from an SQL argument another parameter already carries, and not from an SQL argument of
its own, is bound to NULL for a binding: asMFJSON(tgeompoint, ...), whose wrapper
Temporal_as_mfjson names the coordinate reference system with srs = get_srs_cache_by_srid(fcinfo,
srid, ...) from the SRID of its temporal argument and calls temporal_as_mfjson(temp, ..., srs),
states srs as NULL, so a binding calls the function with NULL and MEOS names the system from its
own reference systems. A local assigned from an SQL argument, read by PG_GETARG under a running
index or converted from an array, and a state threaded through the call's own result keep
carrying their argument.
Witness: on MobilityDB master 8a9bc20b62 temporal_as_mfjson documents srs as possibly NULL, its
wrapper derives srs from the SRID of the temporal value through the table spatial_ref_sys, and
master's parser classifies srs as a local the caller supplies, so the catalog states it as an SQL
argument the twenty asMFJSON signatures do not carry.
Measured: over MobilityDB master 8a9bc20b62 run.py states srs as NULL on 20 of the 20 signatures of
temporal_as_mfjson, and every other key of the catalog equals that of master's parser. The suite
passes the new tests of tests/test_boundargs.py HostDerivedNullableTests, the first of which fails
with master's parser while the three stating that an argument read by a running index, an array
converted into two parameters and an aggregate state stay unbound pass with both, with 432 passed
and 84 skipped against 428 and 84 with master's parser.
Why: a binding calls the C function with the parameters the SQL function carries, and leaving
the derived one to MEOS gives it the name MEOS states for the SRID of the value.