model-writtenrun 3700 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Holger Reise reported that a LEFT JOIN LATERAL containing WHERE false returned 666 instead of NULL on PostgreSQL 16.1, supplying a reproducer #1.
- Tom Lane initially bisected the visible failure to a 2019 planner change involving empty FROM clauses and suspected unsafe flattening of RTE_RESULT entries #2.
- Tom Lane traced the underlying omission to older lateral-reference handling: existing PlaceHolderVars needed the same additional wrapping as Vars, and he supplied a patch while noting that a regression test was still needed #3.
- Tom Lane committed the patch's logic with added regression coverage in 69c12c4174 and backported the same fix in 29f114b6ff, with the commit message specifying all supported branches.
- After the commits, Richard Guo supplied a table-based reproducer demonstrating that the bug also existed before the 2019 change; this post-commit investigation does not qualify as a pre-commit review #4.
- Tom Lane confirmed that ordinary FROM clauses exposed the older bug, whereas the original FROM-less reproducer depended on later flattening behavior; the thread ended with the fix landed and no further patch requested #5.