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

Commit7dbe290

Browse files
Add CREATE INDEX deduplication assertions.
Add two assertions that verify the assumptions about posting list tuplespace accounting and suffix truncation made within nbtsort.c.
1 parentc2da793 commit7dbe290

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -908,6 +908,7 @@ _bt_buildadd(BTWriteState *wstate, BTPageState *state, IndexTuple itup,
908908
* assume that suffix truncation neither enlarges nor shrinks new high key
909909
* when applying soft limit, except when last tuple has a posting list.)
910910
*/
911+
Assert(last_truncextra==0||isleaf);
911912
if (pgspc<itupsz+ (isleaf ?MAXALIGN(sizeof(ItemPointerData)) :0)||
912913
(pgspc+last_truncextra<state->btps_full&&last_off>P_FIRSTKEY))
913914
{
@@ -983,6 +984,7 @@ _bt_buildadd(BTWriteState *wstate, BTPageState *state, IndexTuple itup,
983984
ii=PageGetItemId(opage,OffsetNumberPrev(last_off));
984985
lastleft= (IndexTuple)PageGetItem(opage,ii);
985986

987+
Assert(IndexTupleSize(oitup)>last_truncextra);
986988
truncated=_bt_truncate(wstate->index,lastleft,oitup,
987989
wstate->inskey);
988990
if (!PageIndexTupleOverwrite(opage,P_HIKEY, (Item)truncated,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp