model-writtenrun 397 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Tender Wang reported that simple CASE comparisons could be pushed below DISTINCT despite incompatible equality semantics, demonstrated a deterministic wrong result with citext and DISTINCT ON, and supplied an operator-compatibility fix in #1.
- Yuhang Qiu confirmed the bug but identified an unsafe assumption in the patch: a WHEN condition can wrap its comparison in a coercion rather than being a bare OpExpr, making the assertion and cast unsafe #2.
- Richard Guo replaced the special-case approach with a walker that binds the CASE argument and resolves CaseTestExpr placeholders through existing operand checks, handles array-coercion placeholders separately, and supplies core regression tests #3.
- Tender Wang endorsed the revised approach and requested coverage for its ArrayCoerceExpr branch #4.
- Ewan Young tested the revision with ICU and confirmed the unsafe cases were blocked, but found that JSON RETURNING coercion placeholders were mistaken for the CASE argument and prevented safe pushdown #5.
- Richard Guo committed 264ddc9a67 from #3, adding JSON-coercion isolation and ICU tests for JSON and array coercions; his closing message confirmed the push and pointed to a separate discussion of a similar eval_const_expressions bug #6.