Re: BUG #18465: Wrong results from SELECT DISTINCT MIN in scalar subquery using HashAggregate

Поиск
Список
Период
Сортировка
Искать
От
Dmitry Dolgov
Тема
Re: BUG #18465: Wrong results from SELECT DISTINCT MIN in scalar subquery using HashAggregate
Дата
в 14:18:01
Msg-id
20240518141801.cobd5aup2pnogeo2@ddolgov.remote.csb
Ответ на
Список
Дерево обсуждения
BUG #18465: Wrong results from SELECT DISTINCT MIN in scalar subquery using HashAggregate PG Bug reporting form <noreply@postgresql.org>
Re: BUG #18465: Wrong results from SELECT DISTINCT MIN in scalar subquery using HashAggregate Dmitry Dolgov <9erthalion6@gmail.com>
> On Tue, May 14, 2024 at 09:14:34PM +0000, PG Bug reporting form wrote:
>
> postgres=# SELECT (  SELECT  DISTINCT  MIN( col_int  )  FROM B  AS
> SUBQUERY1_t1  WHERE SUBQUERY1_t1 .col_int  = table1 .col_int  ), table1
> .col_int  FROM CC  AS table1    ;
>   min   | col_int
> --------+---------
>   |  
>   |       1        <------- *** wrong ***
>   |       2
> (3 rows)
>
> postgres=# SELECT (  SELECT  DISTINCT  MIN( col_int  )  FROM B  AS
> SUBQUERY1_t1  WHERE SUBQUERY1_t1 .col_int  = table1 .col_int  ), table1
> .col_int  FROM CC  AS table1    ;
>  min | col_int
> -----+---------
>    1 |       1        <------- *** correct ***
>    1 |       2        <------- *** wrong ***
>    1 |          <------- *** wrong ***
> (3 rows)

Thanks, I could reproduce this in v15 and v16. Interestingly enough it
was fixed in d0d44049d1, but looks like due to lack of error reports the
fix was applied only on the main branch. I assume this one makes it
necessary to back-patch the fix.


В списке pgsql-bugs по дате отправления
От: Sandeep Thakkar
Дата:
От: Tom Lane
Дата:
FAQ