From: Tom Lane <tgl@sss.pgh.pa.us>
To: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: Crash in BRIN summarization
Date: Wed, 28 Aug 2019 10:00:59 -0400
Message-ID: <31061.1567000859@sss.pgh.pa.us> (raw)
In-Reply-To: <e6e1d6eb-0a67-36aa-e779-bcca59167c14@iki.fi>
References: <e6e1d6eb-0a67-36aa-e779-bcca59167c14@iki.fi>
Heikki Linnakangas <hlinnaka@iki.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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, hlinnaka@iki.fi
Subject: Re: Crash in BRIN summarization
In-Reply-To: <31061.1567000859@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox