Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id EE30B1337999 for ; Wed, 19 Jan 2011 06:06:25 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 10984-10 for ; Wed, 19 Jan 2011 10:06:18 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from outmail149113.authsmtp.com (outmail149113.authsmtp.com [62.13.149.113]) by mail.postgresql.org (Postfix) with ESMTP id 0D7C713364DE for ; Wed, 19 Jan 2011 06:06:17 -0400 (AST) Received: from mail-c187.authsmtp.com (mail-c187.authsmtp.com [62.13.128.33]) by punt5.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id p0JA6CP8010406; Wed, 19 Jan 2011 10:06:12 GMT Received: from [192.168.0.2] ([81.5.146.37]) (authenticated bits=0) by mail.authsmtp.com (8.14.2/8.14.2) with ESMTP id p0JA6A4M032184; Wed, 19 Jan 2011 10:06:10 GMT Subject: Re: Confusing comment in TransactionIdIsInProgress From: Simon Riggs To: Heikki Linnakangas Cc: Jim Nasby , pgsql-hackers Hackers In-Reply-To: <4D3554A0.5040205@enterprisedb.com> References: <60BA971A-52A4-4A11-9AA1-0839BB6F15A3@nasby.net> <4D3554A0.5040205@enterprisedb.com> Content-Type: text/plain; charset="UTF-8" Date: Wed, 19 Jan 2011 10:06:09 +0000 Message-ID: <1295431569.3282.8710.camel@ebony> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Content-Transfer-Encoding: 7bit X-Server-Quench: bd74ec8b-23b3-11e0-ab46-001185d377ca X-AuthReport-Spam: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-AuthRoute: OCdxZQATClZOTQEd DAteCiN5VAwpPBRK HVkIKg5MJUcNSQVJ NksadRtFaQxbZ1hf HGQLWlVEUV17WWV/ agofZQRDZ1RPWwN0 U09WR1pVCwUmQRx7 dxhvVmRydAdHcHo+ YUNhWD4JCEN+IBV1 EFNWFj8FeGZhPWAC ARJccR5UcAJLdhoR aVd4ByJDAzANdhEY NiQQEgoKCH10LyJb XxoMK11aSkEOGzM6 W1gDG30TB0QDXCw4 Mx0hLH8QPV0wNH0o NlQ7VEkDWwgB X-Authentic-SMTP: 61633235383639.1000:706 X-AuthFastPath: 0 (Was 255) X-AuthVirus-Status: No virus detected - but ensure you scan with your own anti-virus system. X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201101/1762 X-Sequence-Number: 179599 On Tue, 2011-01-18 at 10:51 +0200, Heikki Linnakangas wrote: > On 18.01.2011 07:15, Jim Nasby wrote: > > Shouldn't the comment read "If first time through"? > > > > /* > > * If not first time through, get workspace to remember main XIDs in. We > > * malloc it permanently to avoid repeated palloc/pfree overhead. > > */ > > if (xids == NULL) > > { > > ... > > xids = (TransactionId *) malloc(maxxids * sizeof(TransactionId)); > > Huh, yes, I'm amazed that no-one have noticed. I must've read that piece > of code dozens of times in the last couple of years myself, and that > sentence was even copy-pasted to GetConflictingVirtualXIDs() later in > that file, including that thinko. Yes, I laughed when I saw that, having camped out in that code many nights. -- Simon Riggs http://www.2ndQuadrant.com/books/ PostgreSQL Development, 24x7 Support, Training and Services