Fix typalign in rangetypes statistics
authorAlexander Korotkov <[email protected]>
Sun, 20 Dec 2020 21:26:13 +0000 (00:26 +0300)
committerAlexander Korotkov <[email protected]>
Sun, 20 Dec 2020 21:31:11 +0000 (00:31 +0300)
6df7a9698b introduces multirange types, whose typanalyze function shares
infrastructure with range types typanalyze function.  Since 6df7a9698b,
information about type gathered by statistics is filled from typcache.
But typalign is mistakenly always set to double.  This commit fixes this
oversight.

src/backend/utils/adt/rangetypes_typanalyze.c

index 1376cf06940994d75196ea1ce79f053097ce77de..d5fa36b6ff0d977526e5123588454f2a743c3e92 100644 (file)
@@ -330,7 +330,7 @@ compute_range_stats(VacAttrStats *stats, AnalyzeAttrFetchFunc fetchfunc,
            stats->statypid[slot_idx] = typcache->type_id;
            stats->statyplen[slot_idx] = typcache->typlen;
            stats->statypbyval[slot_idx] = typcache->typbyval;
-           stats->statypalign[slot_idx] = 'd';
+           stats->statypalign[slot_idx] =  typcache->typalign;
 
            slot_idx++;
        }