model-writtenrun 4559 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Ayush Tiwari reported a backend crash reproducible across supported versions when a DISTINCT aggregate repeats its argument in ORDER BY with different sort operators #1.
- Ayush traced the failure to confusing input counts with sort-key and DISTINCT-column counts, which could ignore later sort keys or select incorrectly initialized DISTINCT machinery #1.
- His patch restricted Datum sorting to one input with one sort key, allocated uniqslot whenever multiple DISTINCT columns exist, and tested both presorted and non-presorted aggregation #1.
- David Rowley reviewed the patch, refined comments, and added a regression test ensuring that multiple sort keys also work without DISTINCT; these light changes landed as edbe7ffdc8.
- David confirmed that he had pushed the fix and made the necessary adjustments for versions 14 and 15 #2; the commit records backpatching through version 14, and no work remained open in the thread edbe7ffdc8.