Repository navigation
State the value and the presence flag a NULL default argument feeds - #204
Merged
estebanzimanyi merged 1 commit intoOct 25, 2026
Conversation
A wrapper may read an argument declared DEFAULT NULL as two C parameters, its value and a flag stating whether it is given: Raster_reclass passes has_nodata = ! PG_ARGISNULL(4) and nodataval = has_nodata ? PG_GETARG_FLOAT8(4) : 0.0, and Raquet_constructor, Raster_make and Raster_add_band do the same. attach_null_default_binds of parser/boundargs.py reads such a local as a parameter the argument feeds (#_presence_flag, every assignment of it `! PG_ARGISNULL(k)` or `PG_ARGISNULL(k)`), and #_null_value reads the value a flag holds when the argument is NULL and the branch `x = flag ? ... : literal` takes then. The signature states both parameters in nullDefaultBinds, and the value the flag takes when the argument is given in presentBinds: reclass(rast, nband, reclassexpr, pixeltype, nodataval float DEFAULT NULL) states nullDefaultBinds {4: {has_nodata: false, nodataval: 0.0}} and presentBinds {4: {has_nodata: true}}.
Witness: over MobilityDB master bc6f2729ea the catalog states argDefaults NULL for the nodata argument of raquet, raster, addBand and reclass and nothing of what their wrappers pass for it, so a binding pairs one SQL argument with two C parameters: the typed Spark and Flink surfaces of JMEOS register none of the four, each refused as arity:sql, and MobilityDB#185 names raquet and reclass among the signatures whose NULL argument the rules do not read.
Measured over MobilityDB master bc6f2729ea, its libmeos installed as the provision-meos action installs it: run.py states the two maps for the 4 signatures, raquet_make, raster_make, raster_add_band and raster_reclass, each value the one its wrapper passes; every other key of the 5359 functions, and every top-level section but the path of the checkout the object model names, equals that of master's parser. The suite passes 558 tests with 26 skipped, the engine tests needing MEOS_LIBRARY_PATH, as master's passes 556 with the same 26 skipped; the two new ones are tests/test_boundargs.py PresenceFlagTests, a flag stating the argument given and one stating it absent.
Why: a call answers as PostgreSQL does only when the binding passes what the wrapper passes, for the flag as for the value, and those values are the catalog's to state.
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 may read an argument declared DEFAULT NULL as two C parameters, its value and a flag stating whether it is given: Raster_reclass passes has_nodata = ! PG_ARGISNULL(4) and nodataval = has_nodata ? PG_GETARG_FLOAT8(4) : 0.0, and Raquet_constructor, Raster_make and Raster_add_band do the same. attach_null_default_binds of parser/boundargs.py reads such a local as a parameter the argument feeds (#_presence_flag, every assignment of it
! PG_ARGISNULL(k)orPG_ARGISNULL(k)), and #_null_value reads the value a flag holds when the argument is NULL and the branchx = flag ? ... : literaltakes then. The signature states both parameters in nullDefaultBinds, and the value the flag takes when the argument is given in presentBinds: reclass(rast, nband, reclassexpr, pixeltype, nodataval float DEFAULT NULL) states nullDefaultBinds {4: {has_nodata: false, nodataval: 0.0}} and presentBinds {4: {has_nodata: true}}.Witness: over MobilityDB master bc6f2729ea the catalog states argDefaults NULL for the nodata argument of raquet, raster, addBand and reclass and nothing of what their wrappers pass for it, so a binding pairs one SQL argument with two C parameters: the typed Spark and Flink surfaces of JMEOS register none of the four, each refused as arity:sql, and #185 names raquet and reclass among the signatures whose NULL argument the rules do not read.
Measured over MobilityDB master bc6f2729ea, its libmeos installed as the provision-meos action installs it: run.py states the two maps for the 4 signatures, raquet_make, raster_make, raster_add_band and raster_reclass, each value the one its wrapper passes; every other key of the 5359 functions, and every top-level section but the path of the checkout the object model names, equals that of master's parser. The suite passes 558 tests with 26 skipped, the engine tests needing MEOS_LIBRARY_PATH, as master's passes 556 with the same 26 skipped; the two new ones are tests/test_boundargs.py PresenceFlagTests, a flag stating the argument given and one stating it absent.
Why: a call answers as PostgreSQL does only when the binding passes what the wrapper passes, for the flag as for the value, and those values are the catalog's to state.