| From: | Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com> |
|---|---|
| To: | 胡传文 <463945512(at)qq(dot)com> |
| Cc: | pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
| Subject: | Re: [PATCH] Fix wrong comment in JsonTablePlanJoinNextRow() |
| Date: | 2026-04-16 02:05:08 |
| Message-ID: | 9EE922BD-29B2-40AF-A50E-03D7E89C10DB@gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
> On Apr 15, 2026, at 16:28, 胡传文 <463945512(at)qq(dot)com> wrote:
>
> Hi,
> Found a misleading comment in JsonTablePlanJoinNextRow() while reading
> the JSON_TABLE execution code.
> The function returns false when both siblings are exhausted (meaning no
> more rows), but the comment says "there are more rows" — the exact
> opposite of what's happening. The code itself is correct.
> if (!JsonTablePlanNextRow(planstate->right))
> {
> /* Right sibling ran out of row, so there are more rows. */ /* wrong */
> return false;
> }
> A reader might reasonably treat this as a bug and flip the return value,
> which would cause JSON_TABLE UNION plans to loop indefinitely.
> Patch attached.
> Regards,
> Chuanwen Hu<fix-jsontable-comment.patch>
The fix looks correct to me. I guess “no” was just unintentionally missed.
A small comment, I just feel “too” you newly added might not be needed.
Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Ashutosh Bapat | 2026-04-16 02:22:37 | Re: First draft of PG 19 release notes |
| Previous Message | Tom Lane | 2026-04-16 01:46:46 | Re: Do we still need gen_node_support.pl's nodetag ABI stability check? |