Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dcw8W-0007X4-U9 for pgsql-bugs@arkaria.postgresql.org; Wed, 02 Aug 2017 16:04:41 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dcw8W-0006id-Gy for pgsql-bugs@arkaria.postgresql.org; Wed, 02 Aug 2017 16:04:40 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dcw8V-0006fl-Qu for pgsql-bugs@postgresql.org; Wed, 02 Aug 2017 16:04:39 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dcw8T-0007JX-8z for pgsql-bugs@postgresql.org; Wed, 02 Aug 2017 16:04:38 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v72G4ZN0009353; Wed, 2 Aug 2017 12:04:35 -0400 From: Tom Lane To: twodragon72@gmail.com cc: pgsql-bugs@postgresql.org Subject: Re: BUG #14764: #if HASH_DEBUG source in dynahash.c is fault. In-reply-to: <20170802032353.8424.12274@wrigleys.postgresql.org> References: <20170802032353.8424.12274@wrigleys.postgresql.org> Comments: In-reply-to twodragon72@gmail.com message dated "Wed, 02 Aug 2017 03:23:53 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <9351.1501689875.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 02 Aug 2017 12:04:35 -0400 Message-ID: <9352.1501689875@sss.pgh.pa.us> List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org 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 --=20 Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs