Re: Crash in BRIN summarization

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Crash in BRIN summarization
Дата
Msg-id 31061.1567000859@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Crash in BRIN summarization  (Heikki Linnakangas <hlinnaka@iki.fi>)
Список pgsql-hackers
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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Sergei Kornilov
Дата:
Сообщение: Re: pg_get_databasebyid(oid)
Следующее
От: Fabien COELHO
Дата:
Сообщение: psql - improve test coverage from 41% to 88%