pgsql: Fix incorrect comment in JsonTablePlanJoinNextRow() - Mailing list pgsql-committers

From Amit Langote
Subject pgsql: Fix incorrect comment in JsonTablePlanJoinNextRow()
Date
Msg-id E1wDEbu-001C8s-2m@gemulon.postgresql.org
Whole thread
List pgsql-committers
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(-)


pgsql-committers by date:

Previous
From: Amit Langote
Date:
Subject: pgsql: Fix incorrect comment in JsonTablePlanJoinNextRow()
Next
From: Amit Langote
Date:
Subject: pgsql: Fix pg_overexplain to emit valid output with RANGE_TABLE option.