model-writtenrun 4571 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Suyang Zhong reported that JSON_VALUE with DEFAULT ON EMPTY returned different results for a NULL row depending on preceding rows or filtering, demonstrating leaked per-row state #1.
- Andrey Rachitskiy traced the problem to NULL input bypassing the step that resets empty/error flags and proposed a dedicated reset opcode with interpreter, LLVM, and regression-test support #2.
- When zengman suggested combining another SQL/JSON DEFAULT issue with this fix #3, Andrey kept it separate because that issue involved parser coercion rather than executor state, and combining them would complicate review and backpatching #4.
- Andrey supplied a corrected patch with an additional explanatory comment #5; Manu tested it successfully across development and stable branches but warned that inserting an opcode would renumber existing values on back branches #6, while Srinath Reddy Sadipiralla confirmed successful LLVM testing #7.
- jian he replaced the new opcode with NULL handling inside the existing path-evaluation step, preserving flag resets and domain constraints while removing the CONST NULL landing step #9.
- Manu confirmed that the revised design avoided opcode ABI changes, passed regression tests on three branches, and eliminated all mismatches in 9,675 differential cases without changing single-row answers #10.
- Andrey accepted the simpler design and reposted jian he's unchanged diff with a corrected commit message and author credit #11.
- Amit Langote prepared the final patch with clearer comments and a test for JSON_EXISTS's default FALSE ON ERROR behavior #12, which Andrey approved #13.
- Amit committed that final patch with only comment reflow as ee7cfb99a3, with backports through PostgreSQL 17; Andrey's last message acknowledged the push and marked the work committed, leaving no outstanding patch in this thread #14.