akashchamp opened a new pull request, #2589:
URL: https://github.com/apache/age/pull/2589
Fixes #2562.
`SELECT 'null'::agtype ? '"a"'::agtype;` crashes the backend with SIGSEGV.
In `agtype_exists_agtype()`, `extract_entity_properties(agt, false)` returns
NULL for an agtype null scalar (and for an entity with null properties), and
that NULL goes straight into `agtype_value_to_agtype()`.
The fix checks for NULL and returns false, which is what `?` already returns
for other non-container scalars like `'1'` or `'"s"'`. I left `?|` / `?&` alone
since they already raise a clean error for this input. I also added two cases
to `regress/sql/jsonb_operators.sql`.
Testing, against PostgreSQL 18.6 built from source:
- Before the fix, the query from the issue kills the backend ("terminated by
signal 11: Segmentation fault"). With the new test cases and no C change, `make
installcheck` crashes in `jsonb_operators` (17 of 44 failed).
- With the fix, both cases return `f`. `'1' ? '"a"'` still returns `f`, and
the vertex and object cases still return `t`.
- `make installcheck`: all 44 tests passed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]