summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane2017-08-02 16:16:50 +0000
committerTom Lane2017-08-02 16:17:08 +0000
commit9d4e56699957b261390c50dcda7f947470017484 (patch)
tree2a3bcfa45d9fb8e0846633df75dc62f949519b68
parentcf652018332819716b10c9de9ce80c81284d6815 (diff)
Remove broken and useless entry-count printing in HASH_DEBUG code.
init_htab(), with #define HASH_DEBUG, prints a bunch of hashtable parameters. It used to also print nentries, but commit 44ca4022f changed that to "hash_get_num_entries(hctl)", which is wrong (the parameter should be "hashp"). Rather than correct the coding, though, let's just remove that field from the printout. The table must be empty, since we just finished building it, 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 the faulty code was introduced. Discussion: https://postgr.es/m/[email protected]
-rw-r--r--src/backend/utils/hash/dynahash.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/backend/utils/hash/dynahash.c b/src/backend/utils/hash/dynahash.c
index a58a479ae5..6f6b03c815 100644
--- a/src/backend/utils/hash/dynahash.c
+++ b/src/backend/utils/hash/dynahash.c
@@ -703,7 +703,7 @@ init_htab(HTAB *hashp, long nelem)
hctl->nelem_alloc = choose_nelem_alloc(hctl->entrysize);
#if HASH_DEBUG
- 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",
+ 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",
"TABLE POINTER ", hashp,
"DIRECTORY SIZE ", hctl->dsize,
"SEGMENT SIZE ", hctl->ssize,
@@ -712,8 +712,7 @@ init_htab(HTAB *hashp, long nelem)
"MAX BUCKET ", hctl->max_bucket,
"HIGH MASK ", hctl->high_mask,
"LOW MASK ", hctl->low_mask,
- "NSEGS ", hctl->nsegs,
- "NENTRIES ", hash_get_num_entries(hctl));
+ "NSEGS ", hctl->nsegs);
#endif
return true;
}