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

Commitd874e22

Browse files
committed
Port RUM to current master
1 parent1b80a14 commitd874e22

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

‎src/rumsort.c

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3443,7 +3443,11 @@ comparetup_cluster(const SortTuple *a, const SortTuple *b,
34433443
int32compare;
34443444

34453445
/* Compare the leading sort key, if it's simple */
3446+
#ifPG_VERSION_NUM >=110000
3447+
if (state->indexInfo->ii_IndexAttrNumbers[0]!=0)
3448+
#else
34463449
if (state->indexInfo->ii_KeyAttrNumbers[0]!=0)
3450+
#endif
34473451
{
34483452
compare=inlineApplySortFunction(&scanKey->sk_func,scanKey->sk_flags,
34493453
scanKey->sk_collation,
@@ -3472,7 +3476,11 @@ comparetup_cluster(const SortTuple *a, const SortTuple *b,
34723476

34733477
for (;nkey<state->nKeys;nkey++,scanKey++)
34743478
{
3479+
#ifPG_VERSION_NUM >=110000
3480+
AttrNumberattno=state->indexInfo->ii_IndexAttrNumbers[nkey];
3481+
#else
34753482
AttrNumberattno=state->indexInfo->ii_KeyAttrNumbers[nkey];
3483+
#endif
34763484
Datumdatum1,
34773485
datum2;
34783486
boolisnull1,
@@ -3538,15 +3546,20 @@ static void
35383546
copytup_cluster(RumTuplesortstate*state,SortTuple*stup,void*tup)
35393547
{
35403548
HeapTupletuple= (HeapTuple)tup;
3549+
#ifPG_VERSION_NUM >=110000
3550+
AttrNumberattno=state->indexInfo->ii_IndexAttrNumbers[0];
3551+
#else
3552+
AttrNumberattno=state->indexInfo->ii_KeyAttrNumbers[0];
3553+
#endif
35413554

35423555
/* copy the tuple into sort storage */
35433556
tuple=heap_copytuple(tuple);
35443557
stup->tuple= (void*)tuple;
35453558
USEMEM(state,GetMemoryChunkSpace(tuple));
35463559
/* set up first-column key value, if it's a simple column */
3547-
if (state->indexInfo->ii_KeyAttrNumbers[0]!=0)
3560+
if (attno!=0)
35483561
stup->datum1=heap_getattr(tuple,
3549-
state->indexInfo->ii_KeyAttrNumbers[0],
3562+
attno,
35503563
state->tupDesc,
35513564
&stup->isnull1);
35523565
}
@@ -3578,6 +3591,11 @@ readtup_cluster(RumTuplesortstate *state, SortTuple *stup,
35783591
{
35793592
unsignedintt_len=tuplen-sizeof(ItemPointerData)-sizeof(int);
35803593
HeapTupletuple= (HeapTuple)palloc(t_len+HEAPTUPLESIZE);
3594+
#ifPG_VERSION_NUM >=110000
3595+
AttrNumberattno=state->indexInfo->ii_IndexAttrNumbers[0];
3596+
#else
3597+
AttrNumberattno=state->indexInfo->ii_KeyAttrNumbers[0];
3598+
#endif
35813599

35823600
USEMEM(state,GetMemoryChunkSpace(tuple));
35833601
/* Reconstruct the HeapTupleData header */
@@ -3595,9 +3613,9 @@ readtup_cluster(RumTuplesortstate *state, SortTuple *stup,
35953613
&tuplen,sizeof(tuplen));
35963614
stup->tuple= (void*)tuple;
35973615
/* set up first-column key value, if it's a simple column */
3598-
if (state->indexInfo->ii_KeyAttrNumbers[0]!=0)
3616+
if (attno!=0)
35993617
stup->datum1=heap_getattr(tuple,
3600-
state->indexInfo->ii_KeyAttrNumbers[0],
3618+
attno,
36013619
state->tupDesc,
36023620
&stup->isnull1);
36033621
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp