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

Commit91a33ce

Browse files
committed
Force insertion of new items to the end of page.
It is necessary if curent item is greater than last item of the page.
1 parent187309b commit91a33ce

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

‎src/rumdatapage.c

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ convertIndexToKey(RumDataLeafItemIndex *src, RumKey *dst)
520520
}
521521
}
522522

523-
/**
523+
/*
524524
* Find item pointer in leaf data page. Returns true if given item pointer is
525525
* found and false if it's not. Sets offset and iptrOut to last item pointer
526526
* which is less than given one. Sets ptrOut ahead that item pointer.
@@ -874,6 +874,13 @@ dataPlaceToPage(RumBtree btree, Page page, OffsetNumber off)
874874
copyPtr=pageCopy+ (ptr-page);
875875
copyItem.iptr=iptr;
876876
}
877+
else
878+
{
879+
/*
880+
* Force insertion of new items until insertion items are less than
881+
* right bound.
882+
*/
883+
}
877884

878885
freespace=RumPageGetOpaque(page)->freespace;
879886

@@ -907,7 +914,7 @@ dataPlaceToPage(RumBtree btree, Page page, OffsetNumber off)
907914
{
908915
/* we copied all old items but we have to add more new items */
909916
if (stopAppend)
910-
/* there is no free space on page */
917+
/* there is no free space on page */
911918
break;
912919
elseif (RumPageRightMost(page))
913920
/* force insertion of new item */
@@ -916,7 +923,13 @@ dataPlaceToPage(RumBtree btree, Page page, OffsetNumber off)
916923
RumDataPageGetRightBound(page),
917924
btree->items+btree->curitem)) >=0)
918925
{
919-
/* force insertion of new item */
926+
/*
927+
* Force insertion if current item is greater than last item
928+
* of the page but less than right bound.
929+
*/
930+
if (off>maxoff)
931+
/* force insertion of new item */
932+
cmp=1;
920933
}
921934
else
922935
/* new items should be inserted on next page */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp