Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wDC78-002hkI-0e for pgsql-hackers@arkaria.postgresql.org; Thu, 16 Apr 2026 02:05:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wDC75-003Eq8-2G for pgsql-hackers@arkaria.postgresql.org; Thu, 16 Apr 2026 02:05:51 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wDC75-003EpT-1I for pgsql-hackers@lists.postgresql.org; Thu, 16 Apr 2026 02:05:51 +0000 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wDC71-00000001F2R-3G1j for pgsql-hackers@lists.postgresql.org; Thu, 16 Apr 2026 02:05:49 +0000 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-82f41fce3e6so1947240b3a.1 for ; Wed, 15 Apr 2026 19:05:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776305147; x=1776909947; darn=lists.postgresql.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=DRsRRWC97qanjn8n9bDycMBIeprp9DnvyuIH6t0E9NY=; b=oXpkENbStwR3MmJrlKJeD0nKbnI7D2Jkc+nMrmnfioh9jCVx5GBdly0uuCLQAQhzCr ahP9wNKcEO3Xc7oWEK6oDUNd5B8/kFIkCVRBqp+sHAjb4c71Z4aFES1Xi76peihlw7O2 ZQXwKkC/HDUZltYk5XJYKer6aNiXtVuL8IuV8LbdW8B5iu1y7qfHHdAyC18RYK+ynsg9 DMUnz7r2eA9GQ09Le/FpvQS8ZoAz3ybLpIIHpyClsrjImlcy8A2BqanCWdS25xDS/L3M oLrSThyfIbbmdBaQ+OPPWwugd6ew8lmkDHbK2ep4kbGF+66tql8SarAehit1eGmc60fv 2WvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776305147; x=1776909947; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=DRsRRWC97qanjn8n9bDycMBIeprp9DnvyuIH6t0E9NY=; b=izVBgSPVjT12He9uDT5GaQQDtsZsovAkBBHyW87IGlWAfqw+3NJZsXeb0fBBJljhf2 MDRIAiD2H66ym2fOyHbdOiZaERWLMPLobI9huyz19FfH3NQQPGgSvbpWKpkRUbzkzHAl ckfgzITL19B92tWWs+Z64bA6tVTCVogO4Oum8hjwkiWxWy9ykf+xEekDXQvyCgQy1ZBY +/80rS53B8BsOLgyxvybtKKBHmZArJsYQYm56jqOQShQGoaHKxX2MaoMOD6uEsQ6Qp8O gSOsCTzdtJy1Y18CKU1D4wqsO6G+R891ioXWTaONbLJJ37C8ZiG7NheOS3K7v5gLjV9h Ty2g== X-Gm-Message-State: AOJu0YxrK+A+lAEEGTs9suwWul6x7SjlO0lnAdBMGSTmzEYRbaWfmVJH BZqmp/QxeZmuXsHVwmhq8dHeJx+2qLobCzbxZEJS0JHjNycHgagZ0IkO X-Gm-Gg: AeBDiev8aNWVnzU9VetWXyIJJNuu6urzUWl/ZbnJbYIwONYyVWY57QNEKxeZ0igxtL/ W2lPyol/kYVNuwzUSHVRwylPekwcclSjNlKEJ22GjRuf7VpOC9Af3UO57gLoMwMbGPUZTLmd0FU ZZcEol3eOBE9fLecnEW6uAW9XwGbzdAyZnIpRmGn8teuQaFxuo3TrDS4v6O9hHk+vs/i/0e3ZUf 2XnCriuDDwYAQbpTHz0lSdqtsmsqY7hCOiUjvpms8t+0Mx9KWVj8a2fPyCmJ8bgd3mMPyGtFsiQ KbCMX1HDmRPqfr6A4jTgMRevGPUvHdsTMDu1XCoMRZ5FhXxHxjJLZ/SlDUlr8XlL7kgXz7jmx8e Z/nKx3XoQRPv5/H5T6Hm2zbj+VFPBN8vPm9hJ7Nq6W5yTWyaSSMeIYDTnCxwh2AlHSerRb2f6Ve NzBZo0LOAZiaS110CPiP1or2lc3tA5bK4= X-Received: by 2002:a05:6a00:e13:b0:823:3079:7c7 with SMTP id d2e1a72fcca58-82f0c2f7a36mr25618880b3a.29.1776305147133; Wed, 15 Apr 2026 19:05:47 -0700 (PDT) Received: from smtpclient.apple ([45.32.121.103]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-82f67078627sm3665374b3a.17.2026.04.15.19.05.45 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Apr 2026 19:05:46 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3864.400.21\)) Subject: Re: [PATCH] Fix wrong comment in JsonTablePlanJoinNextRow() From: Chao Li X-Priority: 3 In-Reply-To: Date: Thu, 16 Apr 2026 10:05:08 +0800 Cc: pgsql-hackers Content-Transfer-Encoding: quoted-printable Message-Id: <9EE922BD-29B2-40AF-A50E-03D7E89C10DB@gmail.com> References: To: =?utf-8?B?6IOh5Lyg5paH?= <463945512@qq.com> X-Mailer: Apple Mail (2.3864.400.21) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Apr 15, 2026, at 16:28, =E8=83=A1=E4=BC=A0=E6=96=87 = <463945512@qq.com> wrote: >=20 > 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" =E2=80=94 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 The fix looks correct to me. I guess =E2=80=9Cno=E2=80=9D was just = unintentionally missed. A small comment, I just feel =E2=80=9Ctoo=E2=80=9D you newly added might = not be needed. Best regards, -- Chao Li (Evan) HighGo Software Co., Ltd. https://www.highgo.com/