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

Commit77b88bd

Browse files
Add assertions to _bt_update_posting().
Copy some assertions from _bt_form_posting() to its sibling function,_bt_update_posting().Discussion:https://postgr.es/m/CAH2-WzkPR8KMwkL0ap976kmXwBCeukTeHz6fB-U__wvuP1S9Zg@mail.gmail.com
1 parented0d883 commit77b88bd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -688,6 +688,9 @@ _bt_update_posting(BTVacuumPosting vacposting)
688688
else
689689
newsize=keysize;
690690

691+
Assert(newsize <=INDEX_SIZE_MASK);
692+
Assert(newsize==MAXALIGN(newsize));
693+
691694
/* Allocate memory using palloc0() (matches index_form_tuple()) */
692695
itup=palloc0(newsize);
693696
memcpy(itup,origtuple,keysize);
@@ -721,6 +724,7 @@ _bt_update_posting(BTVacuumPosting vacposting)
721724
Assert(ui==nhtids);
722725
Assert(d==vacposting->ndeletedtids);
723726
Assert(nhtids==1||_bt_posting_valid(itup));
727+
Assert(nhtids>1||ItemPointerIsValid(&itup->t_tid));
724728

725729
/* vacposting arg's itup will now point to updated version */
726730
vacposting->itup=itup;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp