BUG #19633: Unexpected results of IN (subquery) with a non-deterministic collation - Mailing list pgsql-bugs

From PG Bug reporting form
Subject BUG #19633: Unexpected results of IN (subquery) with a non-deterministic collation
Date
Msg-id 19633-647cd4c73a84b085@postgresql.org
Whole thread
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      19633
Logged by:          Suyang Zhong
Email address:      syzhong16@gmail.com
PostgreSQL version: 19beta3
Operating system:   Ubuntu 22.04
Description:

Hi,

Consider the following test case:

```
CREATE COLLATION ci (provider = icu, locale = 'und-u-ks-level1',
deterministic = false);

CREATE TABLE t_lhs(c1 text COLLATE ci);
CREATE TABLE t_rhs(c0 text);
INSERT INTO t_lhs VALUES ('a'), ('x'), ('y');
INSERT INTO t_rhs VALUES ('a'), ('a');
ANALYZE t_lhs;
ANALYZE t_rhs;
INSERT INTO t_rhs VALUES ('A');

SELECT c1, c1 IN (SELECT c0 FROM t_rhs) AS p FROM t_lhs;
-- a | t
-- x | f
-- y | f

SELECT count(*) FROM t_lhs WHERE c1 IN (SELECT c0 FROM t_rhs);
-- Expected: 1, Actual: 2
```

The predicate evaluates to true for one row, so filtering on the same
predicate should return one row.

Reproduced on 20devel and 19beta3.





pgsql-bugs by date:

Previous
From: Michael Paquier
Date:
Subject: Re: BUG #19623: Postmaster livelocks respawning io workers when children die after crash restart; pg_ctl stop fails
Next
From: Michael Paquier
Date:
Subject: Re: BUG #19623: Postmaster livelocks respawning io workers when children die after crash restart; pg_ctl stop fails