8000 PGPRO-10316 Fix compiler error by alexandervpotapov · Pull Request #124 · postgrespro/rum · GitHub
[go: up one dir, main page]

Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions expected/array.out
Original file line number Diff line number Diff line change
Expand Up @@ -869,15 +869,15 @@ SELECT i,
---------------------+------------------
{20,23,51} | 1.73205080756888
{33,51,20,77,23,65} | 2.44948974278318
{23,76,34,23,2,20} | -1
{20,60,45,23,29} | -1
{23,89,38,20,40,95} | -1
{23,20,72} | -1
{73,23,20} | -1
{6,97,20,89,23} | -1
{20,98,30,23,1,66} | -1
{57,23,39,46,50,20} | -1
{81,20,26,22,23} | -1
{73,23,20} | -1
{18,23,10,90,15,20} | -1
{23,76,34,23,2,20} | -1
{20,60,45,23,29} | -1
{23,89,38,20,40,95} | -1
{23,20,72} | -1
(12 rows)

8 changes: 4 additions & 4 deletions expected/array_1.out
8000
Original file line number Diff line number Diff line change
Expand Up @@ -862,15 +862,15 @@ SELECT i,
---------------------+------------------
{20,23,51} | 1.73205080756888
{33,51,20,77,23,65} | 2.44948974278318
{18,23,10,90,15,20} | -1
{23,76,34,23,2,20} | -1
{20,60,45,23,29} | -1
{73,23,20} | -1
{23,89,38,20,40,95} | -1
{23,20,72} | -1
{73,23,20} | -1
{20,60,45,23,29} | -1
{81,20,26,22,23} | -1
{6,97,20,89,23} | -1
{20,98,30,23,1,66} | -1
{57,23,39,46,50,20} | -1
{81,20,26,22,23} | -1
{18,23,10,90,15,20} | -1
(12 rows)

28 changes: 26 additions & 2 deletions src/rumsort.c
Original file line number Diff line number Diff line change
Expand Up @@ -488,11 +488,23 @@ rum_tuplesort_putrum(RumTuplesortstate *state, RumSortItem *item)
{
MemoryContext oldcontext;
SortTuple stup;
#if PG_VERSION_NUM >= 170000
MinimalTuple tuple = (MinimalTuple)item;
Size tuplen;
TuplesortPublic *base = TuplesortstateGetPublic((TuplesortPublic *)state);
#endif

oldcontext = MemoryContextSwitchTo(rum_tuplesort_get_memorycontext(state));
copytup_rum(state, &stup, item);

#if PG_VERSION_NUM >= 160000
#if PG_VERSION_NUM >= 170000
/* GetMemoryChunkSpace is not supported for bump contexts */
if (TupleSortUseBumpTupleCxt(base->sortopt))
tuplen = MAXALIGN(tuple->t_len);
else
tuplen = GetMemoryChunkSpace(tuple);
tuplesort_puttuple_common(state, &stup, false, tuplen);
#elif PG 8000 _VERSION_NUM >= 160000
tuplesort_puttuple_common(state, &stup, false);
#else
puttuple_common(state, &stup);
Expand All @@ -506,11 +518,23 @@ rum_tuplesort_putrumitem(RumTuplesortstate *state, RumScanItem *item)
{
MemoryContext oldcontext;
SortTuple stup;
#if PG_VERSION_NUM >= 170000
MinimalTuple tuple = (MinimalTuple)item;
Size tuplen;
TuplesortPublic *base = TuplesortstateGetPublic((TuplesortPublic *)state);
#endif

oldcontext = MemoryContextSwitchTo(rum_tuplesort_get_memorycontext(state));
copytup_rumitem(state, &stup, item);

#if PG_VERSION_NUM >= 160000
#if PG_VERSION_NUM >= 170000
/* GetMemoryChunkSpace is not supported for bump contexts */
if (TupleSortUseBumpTupleCxt(base->sortopt))
tuplen = MAXALIGN(tuple->t_len);
else
tuplen = GetMemoryChunkSpace(tuple);
tuplesort_puttuple_common(state, &stup, false, tuplen);
#elif PG_VERSION_NUM >= 160000
tuplesort_puttuple_common(state, &stup, false);
#else
puttuple_common(state, &stup);
Expand Down
3 changes: 2 additions & 1 deletion travis/docker-compose.yml
3EA2
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
tests:
services:
tests:
build: .
0