@@ -65,7 +65,8 @@ rumReadTuplePointers(RumState * rumstate, OffsetNumber attnum,
65
65
* block number is inserted into t_tid.
66
66
*/
67
67
static IndexTuple
68
- RumFormInteriorTuple (IndexTuple itup ,Page page ,BlockNumber childblk )
68
+ RumFormInteriorTuple (RumBtree btree ,IndexTuple itup ,Page page ,
69
+ BlockNumber childblk )
69
70
{
70
71
IndexTuple nitup ;
71
72
RumNullCategory category ;
@@ -92,10 +93,10 @@ RumFormInteriorTuple(IndexTuple itup, Page page, BlockNumber childblk)
92
93
/* Now insert the correct downlink */
93
94
RumSetDownlink (nitup ,childblk );
94
95
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 )
98
98
{
99
+ Assert (IndexTupleHasNulls (itup ));
99
100
nitup -> t_info |=INDEX_NULL_MASK ;
100
101
RumSetNullCategory (nitup ,category );
101
102
}
@@ -487,7 +488,7 @@ entrySplitPage(RumBtree btree, Buffer lbuf, Buffer rbuf,
487
488
ptr += MAXALIGN (IndexTupleSize (itup ));
488
489
}
489
490
490
- btree -> entry = RumFormInteriorTuple (leftrightmost ,newlPage ,
491
+ btree -> entry = RumFormInteriorTuple (btree , leftrightmost ,newlPage ,
491
492
BufferGetBlockNumber (lbuf ));
492
493
493
494
btree -> rightblkno = BufferGetBlockNumber (rbuf );
@@ -499,13 +500,13 @@ entrySplitPage(RumBtree btree, Buffer lbuf, Buffer rbuf,
499
500
* return newly allocated rightmost tuple
500
501
*/
501
502
IndexTuple
502
- rumPageGetLinkItup (Buffer buf ,Page page )
503
+ rumPageGetLinkItup (RumBtree btree , Buffer buf ,Page page )
503
504
{
504
505
IndexTuple itup ,
505
506
nitup ;
506
507
507
508
itup = getRightMostTuple (page );
508
- nitup = RumFormInteriorTuple (itup ,page ,BufferGetBlockNumber (buf ));
509
+ nitup = RumFormInteriorTuple (btree , itup ,page ,BufferGetBlockNumber (buf ));
509
510
510
511
return nitup ;
511
512
}
@@ -520,12 +521,12 @@ rumEntryFillRoot(RumBtree btree, Buffer root, Buffer lbuf, Buffer rbuf,
520
521
{
521
522
IndexTuple itup ;
522
523
523
- itup = rumPageGetLinkItup (lbuf ,lpage );
524
+ itup = rumPageGetLinkItup (btree , lbuf ,lpage );
524
525
if (PageAddItem (page , (Item )itup ,IndexTupleSize (itup ),InvalidOffsetNumber , false, false)== InvalidOffsetNumber )
525
526
elog (ERROR ,"failed to add item to index root page" );
526
527
pfree (itup );
527
528
528
- itup = rumPageGetLinkItup (rbuf ,rpage );
529
+ itup = rumPageGetLinkItup (btree , rbuf ,rpage );
529
530
if (PageAddItem (page , (Item )itup ,IndexTupleSize (itup ),InvalidOffsetNumber , false, false)== InvalidOffsetNumber )
530
531
elog (ERROR ,"failed to add item to index root page" );
531
532
pfree (itup );