Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2b46914

Browse files
committed
Compatibility with random access tuplesort interface changes in v15
Also update tuplesort15.c according to vanilla changes.
1 parent7c4c0f2 commit2b46914

File tree

2 files changed

+324
-72
lines changed

2 files changed

+324
-72
lines changed

‎src/rumsort.c

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,11 @@ writetup_rum_internal(RumTuplesortstate * state, LT_TYPE LT_ARG, SortTuple *stup
222222
(void*)&writtenlen,sizeof(writtenlen));
223223
LogicalTapeWrite(TAPE(state,LT_ARG),
224224
(void*)item,size);
225-
if (state->randomAccess)/* need trailing length word? */
225+
#ifPG_VERSION_NUM >=150000
226+
if (state->sortopt&TUPLESORT_RANDOMACCESS)/* need trailing length word? */
227+
#else
228+
if (state->randomAccess)/* need trailing length word? */
229+
#endif
226230
LogicalTapeWrite(TAPE(state,LT_ARG),
227231
(void*)&writtenlen,sizeof(writtenlen));
228232
}
@@ -260,11 +264,11 @@ readtup_rum_internal(RumTuplesortstate * state, SortTuple *stup,
260264

261265
if (!is_item)
262266
stup->datum1=Float8GetDatum(state->nKeys>0 ? ((RumSortItem*)item)->data[0] :0);
263-
264-
if (state->randomAccess)/* need trailing length word? */
265267
#ifPG_VERSION_NUM >=150000
268+
if (state->sortopt&TUPLESORT_RANDOMACCESS)/* need trailing length word? */
266269
LogicalTapeReadExact(LT_ARG,&tuplen,sizeof(tuplen));
267270
#else
271+
if (state->randomAccess)
268272
LogicalTapeReadExact(state->tapeset,LT_ARG,&tuplen,sizeof(tuplen));
269273
#endif
270274
}
@@ -291,7 +295,14 @@ RumTuplesortstate *
291295
rum_tuplesort_begin_rum(intworkMem,intnKeys,boolrandomAccess,
292296
boolcompareItemPointer)
293297
{
298+
#ifPG_VERSION_NUM >=150000
299+
RumTuplesortstate*state=tuplesort_begin_common(workMem,
300+
randomAccess ?
301+
TUPLESORT_RANDOMACCESS :
302+
TUPLESORT_NONE);
303+
#else
294304
RumTuplesortstate*state=tuplesort_begin_common(workMem,randomAccess);
305+
#endif
295306
MemoryContextoldcontext;
296307

297308
oldcontext=MemoryContextSwitchTo(state->sortcontext);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp