Re: Dereferenced pointers checked as NULL in btree_utils_var.c

From: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Dereferenced pointers checked as NULL in btree_utils_var.c
Date: 2015-01-28 08:07:00
Message-ID: 54C898A4.2010704@vmware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 01/28/2015 02:47 AM, Michael Paquier wrote:
> On Wed, Jan 28, 2015 at 3:15 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> So I'm fine with taking out both this documentation text and the dead
>> null-pointer checks; but let's do that all in one patch not piecemeal.
>> In any case, this is just cosmetic cleanup; there's no actual hazard
>> here.
> Attached is a patch with all those things done.

Thanks, applied.

> I added as well an assertion in gistKeyIsEQ checking if the input
> datums are NULL. I believe that this is still useful for developers,
> feel free to rip it out from the patch if you think otherwise.

I ripped it out because I think was wrong. It assumed that the input
Datums are pass-by-reference, which is not a given. It looks that's true
for all the current opclasses, so I wouldn't be surprised if there are
hidden assumptions on that elsewhere in the code, but it was wrong
nevertheless.

- Heikki

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Erik Rijkers 2015-01-28 08:16:49 ya comment typo
Previous Message Michael Paquier 2015-01-28 07:41:37 Re: Hot Standby WAL reply uses heavyweight session locks, but doesn't have enough infrastructure set up