Repository navigation
Conversation
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.
Fixes #2563
What was wrong
age_tobooleanlist,age_tofloatlist,age_tointegerlistandage_tostringlistare declared withVARIADIC "any". When one of them is called from plain SQL with an untyped literal such as'[true]', the argument is not an agtype, but the C code read it as one. On a cassert build of PostgreSQL 18 this terminated the backend (server closed the connection unexpectedly). Passing'[true]'::agtypeand calling through Cypher were not affected.What changed
Each of the four functions now checks
get_fn_expr_argtype(fcinfo->flinfo, 0) != AGTYPEOIDand raises an ordinary error (for exampletoBooleanList() argument must be of type agtype). This is the same approachage_tailalready uses. I added regression cases toregress/sql/expr.sqlandregress/expected/expr.out: the four failing calls, plus two calls with::agtypethat still work.How tested
Environment: Ubuntu 24.04 container (Bison 3.8.2), PostgreSQL REL_18_STABLE built with
--enable-cassert -O0, AGE built withCOPT=-Werror, thenmake installcheck EXTRA_TESTS="pgvector fuzzystrmatch pg_trgm", followinginstallcheck.yaml.exprtest fails because the server terminates abnormally at the first new call.Not run: the other PostgreSQL versions, the driver workflows (go, jdbc, nodejs, python), and the upgrade-script checks beyond what
make installcheckruns by itself.Thank you for taking a look.