From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Manuel Rigger <rigger.manuel@gmail.com>
Cc: PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Cc: Tomas Vondra <tomas.vondra@2ndquadrant.com>
Subject: Re: ERROR: negative bitmapset member not allowed in SELECT
Date: Wed, 10 Jul 2019 16:17:56 -0400
Message-ID: <13246.1562789876@sss.pgh.pa.us> (raw)
In-Reply-To: <20190710200958.GA13132@alvherre.pgsql>
References: <20190710200958.GA13132@alvherre.pgsql>
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
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, alvherre@2ndquadrant.com, rigger.manuel@gmail.com, tomas.vondra@2ndquadrant.com
Subject: Re: ERROR: negative bitmapset member not allowed in SELECT
In-Reply-To: <13246.1562789876@sss.pgh.pa.us>
References: <20190710200958.GA13132@alvherre.pgsql> <13246.1562789876@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