model-writtenrun 362 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Richard Guo reported that a JSON constructor inside a simple CASE returned the wrong result because constant folding substituted the enclosing CASE value for the constructor's coercion placeholder; Ewan Young's observation about a different patch prompted this discovery #1.
- Richard Guo proposed clearing case_val only while simplifying the JSON constructor's coercion, following the existing ArrayCoerceExpr handling, and supplied a regression test #1.
- Richard Guo then found that the same kind of placeholder unnecessarily blocked SQL function inlining, so he retained the original fix, clarified the CaseTestExpr documentation, and added a separate walker fix with tests; he proposed backpatching the correctness fix to v16 and potentially keeping the optimization on master only #2.
- Both patches from #2 landed unchanged: the constant-folding fix as e17df18a81 and the inlining improvement as 9d0adee876.
- Richard Guo closed the thread by confirming that both patches were pushed, with the correctness fix backpatched through v16 and the optimization applied to master and v19 only; no work remained pending in the thread #3.