]> granicus.if.org Git - postgresql/commit
Remove broken and useless entry-count printing in HASH_DEBUG code.
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 2 Aug 2017 16:16:50 +0000 (12:16 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 2 Aug 2017 16:16:57 +0000 (12:16 -0400)
commitcf9da98600f1874d2046bfbc9439ff311370d7db
tree0997cc43737542c9649072323e7482dd2471ff3f
parentac219b92d3aa94641cc9628b59b478d0e1b7f542
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
src/backend/utils/hash/dynahash.c