From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: zuming.jiang@inf.ethz.ch
Subject: BUG #18260: Unexpected error: "negative bitmapset member not allowed" triggered by multiple JOIN
Date: Wed, 27 Dec 2023 09:33:34 +0000
Message-ID: <18260-1b6a0c4ae311b837@postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 18260
Logged by: Zuming Jiang
Email address: zuming.jiang@inf.ethz.ch
PostgreSQL version: 16.1
Operating system: Ubuntu 20.04
Description:
My fuzzer finds a bug in Postgres 17devel, which triggers an unexpected
error "ERROR: negative bitmapset member not allowed".
--- Set up database ---
create table t0 (vkey int4, c1 numeric);
create table t1 (vkey int4, c9 text, primary key(vkey));
create view t3 as
select
ref_3.c1 as c_0,
ref_3.c1 as c_2,
null::int4 as c_4,
right(ref_2.c9, ref_2.vkey) as c_6
from
((select ref_0.vkey as c_2 from t1 as ref_0) as subq_0
left outer join (t1 as ref_2
right outer join t0 as ref_3
on (ref_2.vkey = ref_3.vkey))
on (subq_0.c_2 = ref_3.vkey));
The fuzzer generates a test case:
--- Test case ---
with cte_1 as (select
ref_1.c_0 as c_2,
ref_1.c_4 as c_3,
case when (nullif(ref_1.c_2, ref_1.c_0) <> (
select
ref_53.c_2 as c_0
from
(t1 as ref_52 left outer join t3 as ref_53 on true)
where (ref_53.c_6) ~~ (ref_53.c_6)
order by c_0 limit 1)
) then null else null end
as c_4
from
t3 as ref_1)
select 1
from
cte_1 as ref_33
where (ref_33.c_2 > (
select
ref_200.c_2 as c_0
from
t3 as ref_200
window w0 as (partition by ref_33.c_3 order by ref_33.c_4 desc)
order by c_0 limit 1));
--- Expected behavior ---
The test case should not trigger any error.
--- Actual behavior ---
The test case trigger an error:
ERROR: negative bitmapset member not allowed
--- Postgres version ---
Github commit: 0eac3c798c2d223d6557a5440d7534317dbd4fa0
Version: PostgreSQL 17devel on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu
9.4.0-1ubuntu1~20.04.1) 9.4.0, 64-bit
--- Platform information ---
Platform: Ubuntu 20.04
Kernel: Linux 5.4.0-147-generic
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-bugs@postgresql.org
Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, zuming.jiang@inf.ethz.ch
Subject: Re: BUG #18260: Unexpected error: "negative bitmapset member not allowed" triggered by multiple JOIN
In-Reply-To: <18260-1b6a0c4ae311b837@postgresql.org>
* 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