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

Commit9d4e566

Browse files
committed
Remove broken and useless entry-count printing in HASH_DEBUG code.
init_htab(), with #define HASH_DEBUG, prints a bunch of hashtableparameters. It used to also print nentries, but commit44ca402 changedthat to "hash_get_num_entries(hctl)", which is wrong (the parameter shouldbe "hashp").Rather than correct the coding, though, let's just remove that field fromthe printout. The table must be empty, since we just finished buildingit, so expensively calculating the number of entries is rather pointless.Moreover hash_get_num_entries makes assumptions (about not needing locks)which we could do without in debugging code.Noted by Choi Doo-Won in bug #14764. Back-patch to 9.6 where thefaulty code was introduced.Discussion:https://postgr.es/m/20170802032353.8424.12274@wrigleys.postgresql.org
1 parentcf65201 commit9d4e566

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

‎src/backend/utils/hash/dynahash.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ init_htab(HTAB *hashp, long nelem)
703703
hctl->nelem_alloc=choose_nelem_alloc(hctl->entrysize);
704704

705705
#ifHASH_DEBUG
706-
fprintf(stderr,"init_htab:\n%s%p\n%s%ld\n%s%ld\n%s%d\n%s%ld\n%s%u\n%s%x\n%s%x\n%s%ld\n%s%ld\n",
706+
fprintf(stderr,"init_htab:\n%s%p\n%s%ld\n%s%ld\n%s%d\n%s%ld\n%s%u\n%s%x\n%s%x\n%s%ld\n",
707707
"TABLE POINTER ",hashp,
708708
"DIRECTORY SIZE ",hctl->dsize,
709709
"SEGMENT SIZE ",hctl->ssize,
@@ -712,8 +712,7 @@ init_htab(HTAB *hashp, long nelem)
712712
"MAX BUCKET ",hctl->max_bucket,
713713
"HIGH MASK ",hctl->high_mask,
714714
"LOW MASK ",hctl->low_mask,
715-
"NSEGS ",hctl->nsegs,
716-
"NENTRIES ",hash_get_num_entries(hctl));
715+
"NSEGS ",hctl->nsegs);
717716
#endif
718717
return true;
719718
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp