SAY-5 opened a new pull request, #2400:
URL: https://github.com/apache/age/pull/2400

   Fixes #2392.
   
   `agtype_access_slice()` decides what to do with each bound in two steps:
   
   1. If the SQL argument is NULL (`PG_ARGISNULL(1|2)`), the caller did not 
supply that bound at all (e.g. `list[..2]`) — treat it as "no bound" and fall 
back to `0` / `array_size`. This is correct.
   2. Otherwise the argument is non-NULL agtype. If *the agtype value* inside 
happens to be `AGTV_NULL` (e.g. `list[null..2]`), the existing code also 
treated it as "no bound" and returned the full slice. This is wrong. Under 
Cypher null-propagation semantics `list[a..b]` is null whenever either bound is 
null; Neo4j and Memgraph both return null, and differential testing against 
both flagged the divergence.
   
   This PR changes step 2 to `PG_RETURN_NULL()` when the supplied bound is 
`AGTV_NULL`. Step 1 is untouched, so `[..n]` / `[n..]` still work as before.
   
   Regression tests are updated accordingly:
   
   - The two pre-existing `agtype_access_slice()` calls with an explicit 
`'null'::agtype` argument now expect the null result.
   - New bracket-syntax cases cover `[1,2,3][1..null]` and `[1,2,3][null..2]`, 
which were the minimal repros on the issue.


-- 
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]

Reply via email to