From 29d320fa583295e1a039daef94b4ef739e37b45b Mon Sep 17 00:00:00 2001 From: Ted Yu Date: Sat, 17 Sep 2022 06:26:29 -0700 Subject: [PATCH] Correctly allocate hypoIndex entries --- hypopg_index.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hypopg_index.c b/hypopg_index.c index bf7ca38..b2cb5ce 100644 --- a/hypopg_index.c +++ b/hypopg_index.c @@ -206,9 +206,9 @@ hypo_newIndex(Oid relid, char *accessMethod, int nkeycolumns, int ninccolumns, if ((entry->relam == BTREE_AM_OID) || (entry->amcanorder)) { if (entry->relam != BTREE_AM_OID) - entry->sortopfamily = palloc0(sizeof(Oid) * nkeycolumns); - entry->reverse_sort = palloc0(sizeof(bool) * nkeycolumns); - entry->nulls_first = palloc0(sizeof(bool) * nkeycolumns); + entry->sortopfamily = palloc0(sizeof(Oid) * (nkeycolumns + ninccolumns)); + entry->reverse_sort = palloc0(sizeof(bool) * (nkeycolumns + ninccolumns)); + entry->nulls_first = palloc0(sizeof(bool) * (nkeycolumns + ninccolumns)); } else {