Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf762b2f

Browse files
Add defensive "split_only_page" nbtree assertion.
Clearly it's not okay for nbtree to split a page that is the only pageon its level, and then find that it has to split the parent one level upin turn. There is simply no code to handle the split_only_page case inthe _bt_insertonpg() "newitem won't fit" branch (only the "newitem fits"branch handles split_only_page). Add a defensive assertion that willfail if a split_only_page call to _bt_insertonpg() somehow ends upsplitting the target/parent page.I (pgeoghegan) believe that we don't need split_only_page handling forthe "newitem won't fit" branch because anybody calling _bt_insertonpg()like this would have to hold a lock on the same one and only child page.
1 parenta6fea12 commitf762b2f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

‎src/backend/access/nbtree/nbtinsert.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,6 +1183,8 @@ _bt_insertonpg(Relation rel,
11831183
boolis_only=P_LEFTMOST(lpageop)&&P_RIGHTMOST(lpageop);
11841184
Bufferrbuf;
11851185

1186+
Assert(!split_only_page);
1187+
11861188
/* split the buffer into left and right halves */
11871189
rbuf=_bt_split(rel,itup_key,buf,cbuf,newitemoff,itemsz,itup,
11881190
origitup,nposting,postingoff);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp