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

Commitec5affd

Browse files
committed
Improve indenting in _hash_pgaddtup
The Assert added ind09dbeb came out rather ugly after having runpgindent on that code. Here we adjust things to use some local variablesso that the Assert remains within the 80-character margin.Author: Ted YuDiscussion:https://postgr.es/m/CALte62wLSir1=x93Jf0xZvHaO009FEJfhVMFwnaR8q=csPP8kQ@mail.gmail.com
1 parent2cf41cd commitec5affd

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

‎src/backend/access/hash/hashinsert.c

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -290,12 +290,20 @@ _hash_pgaddtup(Relation rel, Buffer buf, Size itemsize, IndexTuple itup,
290290
{
291291
itup_off=PageGetMaxOffsetNumber(page)+1;
292292

293+
#ifdefUSE_ASSERT_CHECKING
293294
/* ensure this tuple's hashkey is >= the final existing tuple */
294-
Assert(PageGetMaxOffsetNumber(page)==0||
295-
_hash_get_indextuple_hashkey((IndexTuple)
296-
PageGetItem(page,PageGetItemId(page,
297-
PageGetMaxOffsetNumber(page)))) <=
298-
_hash_get_indextuple_hashkey(itup));
295+
if (PageGetMaxOffsetNumber(page)>0)
296+
{
297+
IndexTuplelasttup;
298+
ItemIditemid;
299+
300+
itemid=PageGetItemId(page,PageGetMaxOffsetNumber(page));
301+
lasttup= (IndexTuple)PageGetItem(page,itemid);
302+
303+
Assert(_hash_get_indextuple_hashkey(lasttup) <=
304+
_hash_get_indextuple_hashkey(itup));
305+
}
306+
#endif
299307
}
300308
else
301309
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp