Thread
Commits
-
Remove broken and useless entry-count printing in HASH_DEBUG code.
- 9d4e56699957 10.0 landed
- cf9da98600f1 9.6.4 landed
-
BUG #14764: #if HASH_DEBUG source in dynahash.c is fault.
twodragon72@gmail.com — 2017-08-02T03:23:53Z
The following bug has been logged on the website: Bug reference: 14764 Logged by: Choi Doo-Won Email address: twodragon72@gmail.com PostgreSQL version: 9.6.3 Operating system: CentOS Description: dynahash.c #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", "TABLE POINTER ", hashp, "DIRECTORY SIZE ", hctl->dsize, "SEGMENT SIZE ", hctl->ssize, "SEGMENT SHIFT ", hctl->sshift, "FILL FACTOR ", hctl->ffactor, "MAX BUCKET ", hctl->max_bucket, "HIGH MASK ", hctl->high_mask, "LOW MASK ", hctl->low_mask, "NSEGS ", hctl->nsegs, "NENTRIES ", hash_get_num_entries(hctl)); #endif ", hash_get_num_entries(hctl)); -> ", hash_get_num_entries(hashp));
-
Re: BUG #14764: #if HASH_DEBUG source in dynahash.c is fault.
Tom Lane <tgl@sss.pgh.pa.us> — 2017-08-02T16:04:35Z
twodragon72@gmail.com writes: > dynahash.c > #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", > "TABLE POINTER ", hashp, > "DIRECTORY SIZE ", hctl->dsize, > "SEGMENT SIZE ", hctl->ssize, > "SEGMENT SHIFT ", hctl->sshift, > "FILL FACTOR ", hctl->ffactor, > "MAX BUCKET ", hctl->max_bucket, > "HIGH MASK ", hctl->high_mask, > "LOW MASK ", hctl->low_mask, > "NSEGS ", hctl->nsegs, > "NENTRIES ", hash_get_num_entries(hctl)); > #endif > ", hash_get_num_entries(hctl)); > -> > ", hash_get_num_entries(hashp)); Hm, yeah, that's broken, but I'm inclined to remove that field from the printout rather than fix the computation. Since we just initialized the hashtable, it can't possibly have any entries here. Also hash_get_num_entries makes assumptions that we could do without in debug code. regards, tom lane