Repository navigation
Read the order of the SQL arguments through an expression a wrapper passes - #205
Merged
estebanzimanyi merged 1 commit intoOct 25, 2026
Conversation
…asses _sql_arg_params of parser/boundargs.py reads the order in which a wrapper reads the SQL arguments for the C parameters off its call, one SQL argument per call argument. An argument passed as an expression over a local, as Raster_make passes (const uint8_t *) VARDATA_ANY(pixels), carries the argument that local carries (#_expr_caller_index, the one argument the locals the expression reads carry, through #_caller_index), and the length of an input array carries none, since it travels with its array: Raster_make reads its bytea first and passes it last with its length, so raster_make states shape.sqlArgParams pixels, width, height, upperleftx, upperlefty, scalex, scaley, skewx, skewy, srid, pixeltype, nodataval, as its twin raquet_make states pixels first. Witness: over MobilityDB master bc6f2729ea the catalog states no sqlArgParams for raster_make, whose bytea argument 0 then carries no parameter, so a binding pairs the SQL arguments with the C parameters in their C order: the typed Spark and Flink surfaces of JMEOS pair the bytea with the width and refuse raster(bytea, integer, integer, float, float, float, float, float, float, integer, text, float). Measured over MobilityDB master bc6f2729ea, its libmeos installed as the provision-meos action installs it: run.py states sqlArgParams for raster_make, and 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 in tests/test_boundargs.py SqlArgParamsTests, a bytea passed last as an expression with its length beside it, which master's parser reads as no order, and an expression reading two arguments, which carries none.
estebanzimanyi
deleted the
catalog/argument-order-through-an-expression
branch
October 25, 2026 17:28
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.
_sql_arg_params of parser/boundargs.py reads the order in which a wrapper reads the SQL arguments for the C parameters off its call, one SQL argument per call argument. An argument passed as an expression over a local, as Raster_make passes (const uint8_t *) VARDATA_ANY(pixels), carries the argument that local carries (#_expr_caller_index, the one argument the locals the expression reads carry, through #_caller_index), and the length of an input array carries none, since it travels with its array: Raster_make reads its bytea first and passes it last with its length, so raster_make states shape.sqlArgParams pixels, width, height, upperleftx, upperlefty, scalex, scaley, skewx, skewy, srid, pixeltype, nodataval, as its twin raquet_make states pixels first.
Witness: over MobilityDB master bc6f2729ea the catalog states no sqlArgParams for raster_make, whose bytea argument 0 then carries no parameter, so a binding pairs the SQL arguments with the C parameters in their C order: the typed Spark and Flink surfaces of JMEOS pair the bytea with the width and refuse raster(bytea, integer, integer, float, float, float, float, float, float, integer, text, float).
Measured over MobilityDB master bc6f2729ea, its libmeos installed as the provision-meos action installs it: run.py states sqlArgParams for raster_make, and 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 in tests/test_boundargs.py SqlArgParamsTests, a bytea passed last as an expression with its length beside it, which master's parser reads as no order, and an expression reading two arguments, which carries none.