Commit fde7172d authored by Heikki Linnakangas's avatar Heikki Linnakangas

Fix setting of right bound at GIN page split.

Broken by my refactoring.
parent 8dace66e
...@@ -548,7 +548,12 @@ dataSplitPage(GinBtree btree, Buffer lbuf, Buffer rbuf, OffsetNumber off, XLogRe ...@@ -548,7 +548,12 @@ dataSplitPage(GinBtree btree, Buffer lbuf, Buffer rbuf, OffsetNumber off, XLogRe
/* set up right bound for left page */ /* set up right bound for left page */
bound = GinDataPageGetRightBound(lpage); bound = GinDataPageGetRightBound(lpage);
*bound = btree->pitem.key; if (GinPageIsLeaf(lpage))
*bound = *GinDataPageGetItemPointer(lpage,
GinPageGetOpaque(lpage)->maxoff);
else
*bound = GinDataPageGetPostingItem(lpage,
GinPageGetOpaque(lpage)->maxoff)->key;
/* set up right bound for right page */ /* set up right bound for right page */
bound = GinDataPageGetRightBound(rpage); bound = GinDataPageGetRightBound(rpage);
...@@ -577,12 +582,7 @@ dataSplitPage(GinBtree btree, Buffer lbuf, Buffer rbuf, OffsetNumber off, XLogRe ...@@ -577,12 +582,7 @@ dataSplitPage(GinBtree btree, Buffer lbuf, Buffer rbuf, OffsetNumber off, XLogRe
/* Prepare a downlink tuple for insertion to the parent */ /* Prepare a downlink tuple for insertion to the parent */
PostingItemSetBlockNumber(&(btree->pitem), BufferGetBlockNumber(lbuf)); PostingItemSetBlockNumber(&(btree->pitem), BufferGetBlockNumber(lbuf));
if (GinPageIsLeaf(lpage)) btree->pitem.key = *GinDataPageGetRightBound(lpage);
btree->pitem.key = *GinDataPageGetItemPointer(lpage,
GinPageGetOpaque(lpage)->maxoff);
else
btree->pitem.key = GinDataPageGetPostingItem(lpage,
GinPageGetOpaque(lpage)->maxoff)->key;
btree->rightblkno = BufferGetBlockNumber(rbuf); btree->rightblkno = BufferGetBlockNumber(rbuf);
return lpage; return lpage;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment