From e47984e6161094018d67fb094fbcbc80f8ca3f0c Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Sat, 24 Aug 2024 22:10:26 -0700 Subject: [PATCH] Reset tuple sort for Postgres 12 [skip ci] --- src/ivfscan.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ivfscan.c b/src/ivfscan.c index 91ff3cc..0a5fea5 100644 --- a/src/ivfscan.c +++ b/src/ivfscan.c @@ -292,10 +292,15 @@ ivfflatrescan(IndexScanDesc scan, ScanKey keys, int nkeys, ScanKey orderbys, int { IvfflatScanOpaque so = (IvfflatScanOpaque) scan->opaque; -#if PG_VERSION_NUM >= 130000 if (!so->first) + { +#if PG_VERSION_NUM >= 130000 tuplesort_reset(so->sortstate); +#else + tuplesort_end(so->sortstate); + so->sortstate = InitScanSortState(so->tupdesc); #endif + } so->first = true; pairingheap_reset(so->listQueue);