Re: ERROR: negative bitmapset member not allowed in SELECT

Поиск
Список
Период
Сортировка
От Manuel Rigger
Тема Re: ERROR: negative bitmapset member not allowed in SELECT
Дата
Msg-id CA+u7OA7fmtm3kR+Y6Mgr9djU3WeOsMzQLWtNPMvoEVSm=r9XaQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: ERROR: negative bitmapset member not allowed in SELECT  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: ERROR: negative bitmapset member not allowed in SELECT  (Manuel Rigger <rigger.manuel@gmail.com>)
Список pgsql-bugs
I found another, maybe simpler statement sequence to reproduce the
error "ERROR:  negative bitmapset member not allowed":

CREATE TABLE t0(c0 BOOLEAN, c1 BOOLEAN, UNIQUE(c1));
CREATE STATISTICS s1 ON c0, c1 FROM t0;
INSERT INTO t0(c0) VALUES(TRUE);
ANALYZE t0;
SELECT * FROM t0 WHERE (t0.c0 AND t0.c1) >= TRUE; -- ERROR:  negative
bitmapset member not allowed

I assume that the error is caused by the same underlying bug, right?

Best,
Manuel

On Wed, Jul 10, 2019 at 10:18 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> > On 2019-Jul-10, Manuel Rigger wrote:
> >> CREATE TABLE t0(c0 serial, c1 boolean);
> >> CREATE STATISTICS s1 ON c0, c1 FROM t0;
> >> INSERT INTO t0(c1) VALUES(TRUE);
> >> ANALYZE;
> >> CREATE INDEX i0 ON t0(c0, (t0.c1 AND t0.c1));
> >> SELECT * FROM (SELECT t0.c0 FROM t0 WHERE (((t0.c1) AND (t0.c1)) OR
> >> FALSE) IS TRUE) as result WHERE result.c0 IS NULL; -- unexpected:
> >> ERROR:  negative bitmapset member not allowed
>
> > Backtrace:
>
> I'd say that mcv_get_match_bitmap has a completely misplaced level of
> faith that any OpExpr it's handed will have a plain Var on one side
> or the other.
>
> Not to mention an untenable assumption that the other side is a plain
> Const.
>
>                         regards, tom lane



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

Предыдущее
От: Magnus Hagander
Дата:
Сообщение: Re: BUG #15888: Bogus "idle in transaction" state for logicaldecoding client after creating a slot
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: BUG #15888: Bogus "idle in transaction" state for logicaldecoding client after creating a slot