mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-10-01 14:31:18 +02:00
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/20170802032353.8424.12274@wrigleys.postgresql.org
This commit is contained in:
parent
cf65201833
commit
9d4e566999
@ -703,7 +703,7 @@ init_htab(HTAB *hashp, long nelem)
|
|||||||
hctl->nelem_alloc = choose_nelem_alloc(hctl->entrysize);
|
hctl->nelem_alloc = choose_nelem_alloc(hctl->entrysize);
|
||||||
|
|
||||||
#if HASH_DEBUG
|
#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,
|
"TABLE POINTER ", hashp,
|
||||||
"DIRECTORY SIZE ", hctl->dsize,
|
"DIRECTORY SIZE ", hctl->dsize,
|
||||||
"SEGMENT SIZE ", hctl->ssize,
|
"SEGMENT SIZE ", hctl->ssize,
|
||||||
@ -712,8 +712,7 @@ init_htab(HTAB *hashp, long nelem)
|
|||||||
"MAX BUCKET ", hctl->max_bucket,
|
"MAX BUCKET ", hctl->max_bucket,
|
||||||
"HIGH MASK ", hctl->high_mask,
|
"HIGH MASK ", hctl->high_mask,
|
||||||
"LOW MASK ", hctl->low_mask,
|
"LOW MASK ", hctl->low_mask,
|
||||||
"NSEGS ", hctl->nsegs,
|
"NSEGS ", hctl->nsegs);
|
||||||
"NENTRIES ", hash_get_num_entries(hctl));
|
|
||||||
#endif
|
#endif
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user