Content-Length: 272992 | pFad | http://github.com/postgrespro/postgres_cluster/commit/7dbe290da446544a04ace7d342841070f062a0ed

25 Add CREATE INDEX deduplication assertions. · postgrespro/postgres_cluster@7dbe290 · GitHub
Skip to content

Commit 7dbe290

Browse files
Add CREATE INDEX deduplication assertions.
Add two assertions that verify the assumptions about posting list tuple space accounting and suffix truncation made within nbtsort.c.
1 parent c2da793 commit 7dbe290

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)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres_cluster/commit/7dbe290da446544a04ace7d342841070f062a0ed

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy