model-writtenrun 923 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Chao Li reported that pgss_ProcessUtility() accessed pstmt->planOrigin after the PlannedStmt could have been freed, despite an existing warning, and supplied a patch saving the value before utility execution in #1 and #2.
- Michael Paquier confirmed the bug and found that existing tests missed it; he reproduced the invalid read under Valgrind using repeated extended-protocol CALL executions with an internal ROLLBACK and added regression coverage while preserving Chao’s fix in #4.
- The fix and regression test from #4 landed unchanged as 8268e41aca, crediting Chao Li as author and Michael Paquier as co-author.
- After that commit, Andres Freund suggested clearing pstmt once it became unsafe to use in #5, and Michael supplied the one-line follow-up in #6 to make future unsafe accesses fail conspicuously.
- Chao endorsed the follow-up and retaining the existing comment in #7; Michael agreed to proceed in the thread’s final message #8, and the patch subsequently landed unchanged as 6636621782, completing both changes.