Re: Crash in BRIN summarization

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Crash in BRIN summarization
Date: 2019-08-28 14:00:59
Message-ID: 31061.1567000859@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Heikki Linnakangas <hlinnaka(at)iki(dot)fi> writes:
> I bumped into a little bug in BRIN, while hacking on something
> unrelated. This causes a segfault, or an assertion failure if assertions
> are enabled:

Good catch.

> Fix attached.

Hm, I don't particularly care for directly comparing Datum values
like that. We don't do that elsewhere (I think) and it feels like
a type violation to me. Since you've already tested for !attbyval,
I think it'd be legitimate to extract the pointer values and compare
those, eg

if (!attr->attbyval &&
DatumGetPointer(result) != DatumGetPointer(column->bv_values[INCLUSION_UNION]))

I realize that this makes no difference in terms of the machine
code (at least for most machines?) but it avoids breaking the
Datum abstraction.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Fabien COELHO 2019-08-28 14:31:00 psql - improve test coverage from 41% to 88%
Previous Message Sergei Kornilov 2019-08-28 13:05:07 Re: pg_get_databasebyid(oid)