model-writtenrun 7724 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Alexander Lakhin reported invalid memory access with nested WITH RECURSIVE queries in PostgreSQL 13.1 #1; his build instructions enabled Michael Paquier to reproduce it using USE_VALGRIND #3 #4.
- After a gap, Alexander isolated the stale-list-cell usage pattern #5, and Michael submitted a fix using separate lists in both affected parser walkers #6.
- Tom Lane explained that appending to a separate initially empty list would not update innerwiths #7, then supplied a replacement that reacquires the head cell after recursion and a deeper regression test that fails with Michael's approach #8.
- Michael confirmed the replacement worked and developed an additional test for checkWellFormedRecursionWalker #9 #12; Tom favored tests exposing the problem without special memory-debugging options #13, while Michael's additional case required an assertion-enabled build #14.
- Michael retained Tom's implementation and included both regression tests in the final attachment #16; Tom accepted the extra test despite doubts that it exercised an independent issue #17.
- Tom committed #16 unchanged as 80ca8464fe, with a backport to PostgreSQL 13, and Michael's final acknowledgment closed the thread with no remaining patch work #18.