Skip to content

fix parameters and numbers as arguments of CQL2 functions in stored queries - #662

Merged
cportele merged 1 commit into
masterfrom
cql2-function-arguments
Oct 19, 2026
Merged

cportele merged 1 commit into
masterfrom
cql2-function-arguments

Conversation

@cportele

Copy link
Copy Markdown
Contributor

A stored query with a parameter as the argument of a function, e.g. a custom function S_DWITHIN(geometry, $point, $distance), failed with an SQL error, because the parameter was never replaced by its value: the copying visitor returned functions unchanged instead of rebuilding them from the visited arguments. All visitors derived from CqlVisitorCopy now also reach into the arguments of functions.

Numeric and boolean literals as arguments of a function were written to CQL2 JSON as strings, so a filter that is written and read again, as stored and ad-hoc queries are, failed the type check of a function that expects a number. The literals are now written with their type.

…ueries

A stored query with a parameter as the argument of a function, e.g. a
custom function S_DWITHIN(geometry, $point, $distance), failed with an SQL
error, because the parameter was never replaced by its value: the copying
visitor returned functions unchanged instead of rebuilding them from the
visited arguments. All visitors derived from CqlVisitorCopy now also reach
into the arguments of functions.

Numeric and boolean literals as arguments of a function were written to
CQL2 JSON as strings, so a filter that is written and read again, as
stored and ad-hoc queries are, failed the type check of a function that
expects a number. The literals are now written with their type.
@cportele cportele self-assigned this Oct 19, 2026
@cportele
cportele requested a review from azahnen as a code owner October 19, 2026 17:43
@cportele cportele added the bug label Oct 19, 2026
@cportele
cportele merged commit eb9a57d into master Oct 19, 2026
3 checks passed
@cportele
cportele deleted the cql2-function-arguments branch October 19, 2026 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant