Skip to content

Commit 1e07f5e

Browse files
Remove overzealous _bt_split() assertions.
_bt_split() is passed NULL as its insertion scankey for internal page splits. Two recently added Assert() statements failed to consider this, leading to a crash with pg_upgrade'd BREE_VERSION < 4 indexes. Remove the assertions. The assertions in question were added by commit 0d861bb, which added nbtree deduplication. It would be possible to fix the assertions directly instead, but they weren't adding much anyway.
1 parent 0b48f13 commit 1e07f5e

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

src/backend/access/nbtree/nbtinsert.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1632,7 +1632,6 @@ _bt_split(Relation rel, BTScanInsert itup_key, Buffer buf, Buffer cbuf,
16321632
*/
16331633
leftoff = P_HIKEY;
16341634

1635-
Assert(BTreeTupleIsPivot(lefthikey) || !itup_key->heapkeyspace);
16361635
Assert(BTreeTupleGetNAtts(lefthikey, rel) > 0);
16371636
Assert(BTreeTupleGetNAtts(lefthikey, rel) <= indnkeyatts);
16381637
if (PageAddItem(leftpage, (Item) lefthikey, itemsz, leftoff,
@@ -1697,7 +1696,6 @@ _bt_split(Relation rel, BTScanInsert itup_key, Buffer buf, Buffer cbuf,
16971696
itemid = PageGetItemId(origpage, P_HIKEY);
16981697
itemsz = ItemIdGetLength(itemid);
16991698
item = (IndexTuple) PageGetItem(origpage, itemid);
1700-
Assert(BTreeTupleIsPivot(item) || !itup_key->heapkeyspace);
17011699
Assert(BTreeTupleGetNAtts(item, rel) > 0);
17021700
Assert(BTreeTupleGetNAtts(item, rel) <= indnkeyatts);
17031701
if (PageAddItem(rightpage, (Item) item, itemsz, rightoff,

0 commit comments

Comments
 (0)