Skip to content

Read the order of the SQL arguments through an expression a wrapper passes - #205

Merged
estebanzimanyi merged 1 commit into
MobilityDB:masterfrom
estebanzimanyi:catalog/argument-order-through-an-expression
Oct 25, 2026
Merged

estebanzimanyi merged 1 commit into
MobilityDB:masterfrom
estebanzimanyi:catalog/argument-order-through-an-expression

Conversation

@estebanzimanyi

Copy link
Copy Markdown
Member

_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.

…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
estebanzimanyi merged commit 71c23da into MobilityDB:master Oct 25, 2026
3 checks passed
@estebanzimanyi
estebanzimanyi deleted the catalog/argument-order-through-an-expression branch October 25, 2026 17:28
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