model-writtenrun 308 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Richard Guo reported that pulling up a lateral subquery could leave a join alias unexpanded in its TABLESAMPLE clause, causing a missing-relation error, and traced the bug back to the introduction of TABLESAMPLE #1.
- Richard's attached patch introduced EXPRKIND_TABLESAMPLE_LATERAL so lateral sampling clauses receive join alias expansion while non-lateral clauses retain the existing skip, with EXPLAIN and execution regression tests #1.
- Ewan Young reproduced the failure on several builds, verified the patch against numerous query variants, reported passing regression tests, and endorsed its consistency with existing lateral expression handling #2.
- Ayush Tiwari approved the patch but suggested removing the EXPLAIN test because the execution test already detects the bug #3.
- Richard retained EXPLAIN to verify alias expansion explicitly and announced that the patch had landed unchanged as 852fd5b86e with backpatches to all supported branches, completing the thread's work #4.