mirror of
https://github.com/postgres/postgres.git
synced 2025-11-01 21:31:19 +03:00
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 0d861bbb, which added
nbtree deduplication. It would be possible to fix the assertions
directly instead, but they weren't adding much anyway.
This commit is contained in:
@@ -1632,7 +1632,6 @@ _bt_split(Relation rel, BTScanInsert itup_key, Buffer buf, Buffer cbuf,
|
||||
*/
|
||||
leftoff = P_HIKEY;
|
||||
|
||||
Assert(BTreeTupleIsPivot(lefthikey) || !itup_key->heapkeyspace);
|
||||
Assert(BTreeTupleGetNAtts(lefthikey, rel) > 0);
|
||||
Assert(BTreeTupleGetNAtts(lefthikey, rel) <= indnkeyatts);
|
||||
if (PageAddItem(leftpage, (Item) lefthikey, itemsz, leftoff,
|
||||
@@ -1697,7 +1696,6 @@ _bt_split(Relation rel, BTScanInsert itup_key, Buffer buf, Buffer cbuf,
|
||||
itemid = PageGetItemId(origpage, P_HIKEY);
|
||||
itemsz = ItemIdGetLength(itemid);
|
||||
item = (IndexTuple) PageGetItem(origpage, itemid);
|
||||
Assert(BTreeTupleIsPivot(item) || !itup_key->heapkeyspace);
|
||||
Assert(BTreeTupleGetNAtts(item, rel) > 0);
|
||||
Assert(BTreeTupleGetNAtts(item, rel) <= indnkeyatts);
|
||||
if (PageAddItem(rightpage, (Item) item, itemsz, rightoff,
|
||||
|
||||
Reference in New Issue
Block a user