BUG #19046: Incorrect result when using json_array() with column reference in subquery combined with RIGHT JOIN
В списке pgsql-bugs по дате отправления:
| От | PG Bug reporting form |
|---|---|
| Тема | BUG #19046: Incorrect result when using json_array() with column reference in subquery combined with RIGHT JOIN |
| Дата | |
| Msg-id | 19046-765b6602b0a8cfdf@postgresql.org обсуждение исходный текст |
| Ответы |
Re: BUG #19046: Incorrect result when using json_array() with column reference in subquery combined with RIGHT JOIN
|
| Список | pgsql-bugs |
The following bug has been logged on the website: Bug reference: 19046 Logged by: Runyuan He Email address: runyuan@berkeley.edu PostgreSQL version: 18rc1 Operating system: Linux (x86) Description: Bug Description: When using json_array() function with a column reference from table t inside a subquery, and then performing a RIGHT JOIN with condition FALSE, the result incorrectly returns [3, 2] instead of the expected NULL value. Reproducible Example: CREATE TABLE t(c INT); INSERT INTO t VALUES (1); SELECT sub.c FROM (SELECT json_array(3, 2, t.c) AS c FROM t) AS sub RIGHT JOIN t ON FALSE; -- PostgreSQL 16.x: Returns NULL (CORRECT) -- PostgreSQL 17.6, 17.rc1: Returns [3, 2] (INCORRECT) -- PostgreSQL 18rc1: Returns [3, 2] (INCORRECT) SELECT sub.c FROM (SELECT json_array(3, 2, t.c) AS c FROM t) AS sub; -- Returns [3, 2, 1] (CORRECT) SELECT sub.c FROM (SELECT json_array(3, 2, 1) AS c FROM t) AS sub RIGHT JOIN t ON FALSE; -- Returns Null (CORRECT)
В списке pgsql-bugs по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера