Re: A minor correction in comment in heaptuple.c

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Kevin Grittner <kgrittn(at)ymail(dot)com>, "D'Arcy J(dot)M(dot) Cain" <darcy(at)druid(dot)net>, Amit Langote <amitlangote09(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: A minor correction in comment in heaptuple.c
Date: 2014-01-25 22:29:14
Message-ID: 20140125222914.GA7182@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2014-01-25 17:15:01 -0500, Bruce Momjian wrote:
> On Sat, Jan 25, 2014 at 04:56:37PM -0500, Tom Lane wrote:
> > Bruce Momjian <bruce(at)momjian(dot)us> writes:
> > > On Sat, Jan 25, 2014 at 10:40:28PM +0100, Andres Freund wrote:
> > >> I think this style of pinhole copy editing is pretty pointless. There's
> > >> dozen checks just like this around. If somebody wants to change the rules
> > >> or improve comment it takes more than picking a random one.
> >
> > > OK, change made.
> >
> > FWIW, I don't find that an improvement either. As Andres says, this
> > is just applying the same rule that's used in many other places, ie
> > return null if the requested attnum is off the end of the tuple.
>
> OK, I can revert it, but I don't see any other cases of the string
> 'return NULL if' in the executor code. What the code really is doing is
> "Assume NULL so return true if". The code was never returning NULL, it
> was assuming the attribute was NULL and returning true. Am I missing
> something?

The friggin function in which you whacked around the comment is called
"slot_attisnull()". Referring to the functions meaning in a comment
above an early return isn't a novel thing.

Just search for attnum > tupleDesc->natts to find lots of similar chunks
of code, several of them even in the same file.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Marco Atzeri 2014-01-25 22:32:57 Re: Postgresql for cygwin - 3rd
Previous Message Andres Freund 2014-01-25 22:25:26 Re: Changeset Extraction v7.1