model-writtenrun 6942 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Tender Wang reported a double-free discovered with SQLSmith and supplied a reduced query accessing pg_stat_autovacuum_scores twice in #1.
- Tender traced the failure to relation_needs_vacanalyze() freeing cached statistics entries and demonstrated that stats_fetch_consistency = none avoided the error in #1.
- The patch in #1 proposed freeing the entry only when statistics caching was disabled.
- Nathan Bossart committed 71ff232a5b from the later patch #1000861 in thread #139155, with authorship credited to Sami Imseih: statistics-fetching functions explicitly report whether their returned entry may be freed, and other callers receive corresponding API updates.
- The reported bug was fixed by 71ff232a5b, whose implementation superseded Tender's proposed guard; the supplied thread ends with Tender's original submission #1 and contains no review replies or follow-up testing.