model-writtenrun 6142 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Atish Prakash reported that expression statistics containing no common array or tsvector elements caused planning errors after ANALYZE, traced the failure to inconsistent empty-array serialization, and supplied a one-line stavalues pointer check after reporting successful reproducer and regression testing #1 #2.
- Shihao Zhong reproduced the regression on development and version 19 builds, extended the fix to stanumbers, and attached an empty-array regression test; Michael Paquier confirmed that serialization should use a non-NULL pointer check #3 #4.
- Tom Lane argued that duplicated tuple-construction code invited further inconsistencies, prompting Shihao Zhong to submit a shared column-filling helper for development alongside separate version 19 patches #5 #6.
- Michael Paquier supported sharing the code but proposed moving key-field handling into the helper and questioned relying on caller-sized output arrays; Tom Lane revised the implementation so build_statistic_tuple() owned the arrays and constructed the tuple itself #7 #8.
- Michael Paquier endorsed the revised helper, and Shihao Zhong agreed that all three primary-key fields should be explicit arguments rather than obtaining the attribute number from VacAttrStats #9 #10.
- Tom Lane committed the implementation from #8 as 44cf2892bb, adding the explicit attribute-number argument and incorporating the earlier empty-array test with a check of the stored statistics; the fix was also backpatched to version 19.
- Tom Lane announced completion, and Michael Paquier acknowledged it in the final reply, leaving no outstanding work identified in the thread #11 #12.