Fix tuplesort optimization for CLUSTER-on-expression.
Thomas Munro <tmunro@postgresql.org>
Fix tuplesort optimization for CLUSTER-on-expression. When dispatching sort operations to specialized variants, commit 69749243 failed to handle the case where CLUSTER-sort decides not to initialize datum1 and isnull1. Fix by hoisting that decision up a level and advertising whether datum1 can be relied on, in the Tuplesortstate object. Per reports from UBsan and Valgrind build farm animals, while running the cluster.sql test. Reviewed-by: Andres Freund <andres@anarazel.de> Discussion: https://postgr.es/m/CAFBsxsF1TeK5Fic0M%2BTSJXzbKsY6aBqJGNj6ptURuB09ZF6k_w%40mail.gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/utils/sort/tuplesort.c | modified | +56 −22 |
Discussion
- A qsort template 85 messages · 2021-02-18 → 2022-05-23