@@ -65,7 +65,8 @@ rumReadTuplePointers(RumState * rumstate, OffsetNumber attnum,
6565 * block number is inserted into t_tid.
6666 */
6767static IndexTuple
68- RumFormInteriorTuple (IndexTuple itup , Page page , BlockNumber childblk )
68+ RumFormInteriorTuple (RumBtree btree , IndexTuple itup , Page page ,
69+ BlockNumber childblk )
6970{
7071 IndexTuple nitup ;
7172 RumNullCategory category ;
@@ -92,10 +93,10 @@ RumFormInteriorTuple(IndexTuple itup, Page page, BlockNumber childblk)
9293 /* Now insert the correct downlink */
9394 RumSetDownlink (nitup , childblk );
9495
95- category = RumGetNullCategory (itup );
96- if (category == RUM_CAT_NULL_KEY || category == RUM_CAT_EMPTY_ITEM ||
97- category == RUM_CAT_NULL_ITEM )
96+ rumtuple_get_key (btree -> rumstate , itup , & category );
97+ if (category != RUM_CAT_NORM_KEY )
9898 {
99+ Assert (IndexTupleHasNulls (itup ));
99100 nitup -> t_info |= INDEX_NULL_MASK ;
100101 RumSetNullCategory (nitup , category );
101102 }
@@ -487,7 +488,7 @@ entrySplitPage(RumBtree btree, Buffer lbuf, Buffer rbuf,
487488 ptr += MAXALIGN (IndexTupleSize (itup ));
488489 }
489490
490- btree -> entry = RumFormInteriorTuple (leftrightmost , newlPage ,
491+ btree -> entry = RumFormInteriorTuple (btree , leftrightmost , newlPage ,
491492 BufferGetBlockNumber (lbuf ));
492493
493494 btree -> rightblkno = BufferGetBlockNumber (rbuf );
@@ -499,13 +500,13 @@ entrySplitPage(RumBtree btree, Buffer lbuf, Buffer rbuf,
499500 * return newly allocated rightmost tuple
500501 */
501502IndexTuple
502- rumPageGetLinkItup (Buffer buf , Page page )
503+ rumPageGetLinkItup (RumBtree btree , Buffer buf , Page page )
503504{
504505 IndexTuple itup ,
505506 nitup ;
506507
507508 itup = getRightMostTuple (page );
508- nitup = RumFormInteriorTuple (itup , page , BufferGetBlockNumber (buf ));
509+ nitup = RumFormInteriorTuple (btree , itup , page , BufferGetBlockNumber (buf ));
509510
510511 return nitup ;
511512}
@@ -520,12 +521,12 @@ rumEntryFillRoot(RumBtree btree, Buffer root, Buffer lbuf, Buffer rbuf,
520521{
521522 IndexTuple itup ;
522523
523- itup = rumPageGetLinkItup (lbuf , lpage );
524+ itup = rumPageGetLinkItup (btree , lbuf , lpage );
524525 if (PageAddItem (page , (Item ) itup , IndexTupleSize (itup ), InvalidOffsetNumber , false, false) == InvalidOffsetNumber )
525526 elog (ERROR , "failed to add item to index root page" );
526527 pfree (itup );
527528
528- itup = rumPageGetLinkItup (rbuf , rpage );
529+ itup = rumPageGetLinkItup (btree , rbuf , rpage );
529530 if (PageAddItem (page , (Item ) itup , IndexTupleSize (itup ), InvalidOffsetNumber , false, false) == InvalidOffsetNumber )
530531 elog (ERROR , "failed to add item to index root page" );
531532 pfree (itup );
0 commit comments