agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
pgsql: Fix incorrect comment in JsonTablePlanJoinNextRow()
3+ messages / 1 participants
[nested] [flat]

* pgsql: Fix incorrect comment in JsonTablePlanJoinNextRow()
@ 2026-04-16 04:41  Amit Langote <amitlan@postgresql.org>
  0 siblings, 0 replies; 3+ messages in thread

From: Amit Langote @ 2026-04-16 04:41 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix incorrect comment in JsonTablePlanJoinNextRow()

The comment on the return-false path when both UNION siblings are
exhausted said "there are more rows," which is the opposite of what
the code does. The code itself is correct, returning false to signal
no more rows, but the misleading comment could tempt a reader into
"fixing" the return value, which would cause UNION plans to loop
indefinitely.

Back-patch to 17, where JSON_TABLE was introduced.

Author: Chuanwen Hu <463945512@qq.com>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Discussion: https://postgr.es/m/tencent_4CC6316F02DECA61ACCF22F933FEA5C12806@qq.com
Backpatch-through: 17

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/1a2d60cc0410c19484a389aee5dc41d28541b0f8

Modified Files
--------------
src/backend/utils/adt/jsonpath_exec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* pgsql: Fix incorrect comment in JsonTablePlanJoinNextRow()
@ 2026-04-16 04:42  Amit Langote <amitlan@postgresql.org>
  0 siblings, 0 replies; 3+ messages in thread

From: Amit Langote @ 2026-04-16 04:42 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix incorrect comment in JsonTablePlanJoinNextRow()

The comment on the return-false path when both UNION siblings are
exhausted said "there are more rows," which is the opposite of what
the code does. The code itself is correct, returning false to signal
no more rows, but the misleading comment could tempt a reader into
"fixing" the return value, which would cause UNION plans to loop
indefinitely.

Back-patch to 17, where JSON_TABLE was introduced.

Author: Chuanwen Hu <463945512@qq.com>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Discussion: https://postgr.es/m/tencent_4CC6316F02DECA61ACCF22F933FEA5C12806@qq.com
Backpatch-through: 17

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/f3fb145a0adb2c0ae34f4e36cf55bb1d60df3ddd

Modified Files
--------------
src/backend/utils/adt/jsonpath_exec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* pgsql: Fix incorrect comment in JsonTablePlanJoinNextRow()
@ 2026-04-16 04:45  Amit Langote <amitlan@postgresql.org>
  0 siblings, 0 replies; 3+ messages in thread

From: Amit Langote @ 2026-04-16 04:45 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix incorrect comment in JsonTablePlanJoinNextRow()

The comment on the return-false path when both UNION siblings are
exhausted said "there are more rows," which is the opposite of what
the code does. The code itself is correct, returning false to signal
no more rows, but the misleading comment could tempt a reader into
"fixing" the return value, which would cause UNION plans to loop
indefinitely.

Back-patch to 17, where JSON_TABLE was introduced.

Author: Chuanwen Hu <463945512@qq.com>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Discussion: https://postgr.es/m/tencent_4CC6316F02DECA61ACCF22F933FEA5C12806@qq.com
Backpatch-through: 17

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/b5062a4e57fcdd51949a046314ec90731bdbf92c

Modified Files
--------------
src/backend/utils/adt/jsonpath_exec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2026-04-16 04:45 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-04-16 04:41 pgsql: Fix incorrect comment in JsonTablePlanJoinNextRow() Amit Langote <amitlan@postgresql.org>
2026-04-16 04:42 pgsql: Fix incorrect comment in JsonTablePlanJoinNextRow() Amit Langote <amitlan@postgresql.org>
2026-04-16 04:45 pgsql: Fix incorrect comment in JsonTablePlanJoinNextRow() Amit Langote <amitlan@postgresql.org>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox