gregfelice commented on PR #2347:
URL: https://github.com/apache/age/pull/2347#issuecomment-4276203468

   Pushed a one-line-helper fix (6c61a4a3) for the PG18-cassert build failure.
   
   **Root cause:** In `exec_cypher_merge`, four sites call 
`ExecStoreVirtualTuple(econtext->ecxt_scantuple)` after `process_path` writes 
directly to the scan slot. `ExecStoreVirtualTuple` asserts `TTS_EMPTY(slot)` 
(`execTuples.c:1748`), but the scan slot already holds the subquery's output 
tuple and is not empty. Release PG silently clears the flag and proceeds; 
`--enable-cassert` aborts with `TRAP: failed Assert("TTS_EMPTY(slot)")`. The 
failing test under cassert is the `issue_1634` case (`MERGE (v:PERSION {id: 
'1'}) SET v=map`).
   
   **Fix:** a 4-line static helper `mark_scan_slot_valid()` that does the 
bookkeeping half of `ExecStoreVirtualTuple` (clear `TTS_FLAG_EMPTY`, set 
`tts_nvalid = natts`) without the precondition assertion. Replace the 4 call 
sites. Release-build behavior is byte-identical since `Assert()` compiles out; 
cassert now matches release.
   
   All 32 regression tests pass locally under `--enable-cassert`.
   
   Caught locally by the cassert-enabled regression suite we reinstated after 
#2380.


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