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.94.2) (envelope-from ) id 1v5R8w-006pTp-T3 for pgsql-hackers@arkaria.postgresql.org; Sun, 05 Oct 2025 15:59:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1v5R8u-002tom-UO for pgsql-hackers@arkaria.postgresql.org; Sun, 05 Oct 2025 15:59:25 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1v5R8u-002toe-Kc for pgsql-hackers@lists.postgresql.org; Sun, 05 Oct 2025 15:59:25 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1v5R8t-000WsL-0C for pgsql-hackers@lists.postgresql.org; Sun, 05 Oct 2025 15:59:24 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 595FxH1q1686756; Sun, 5 Oct 2025 11:59:17 -0400 From: Tom Lane To: Tatsuo Ishii cc: ojford@gmail.com, peter@eisentraut.org, li.evan.chao@gmail.com, krasiyan@gmail.com, vik@postgresfriends.org, andrew@tao11.riddles.org.uk, david@fetter.org, pgsql-hackers@lists.postgresql.org Subject: Re: Add RESPECT/IGNORE NULLS and FROM FIRST/LAST options In-reply-to: <20251003.100606.2086363717963832725.ishii@postgresql.org> References: <20250924.221842.203240336888394367.ishii@postgresql.org> <20251002.211550.1475922457918078317.ishii@postgresql.org> <20251003.100606.2086363717963832725.ishii@postgresql.org> Comments: In-reply-to Tatsuo Ishii message dated "Fri, 03 Oct 2025 10:06:06 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1686754.1759679957.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sun, 05 Oct 2025 11:59:17 -0400 Message-ID: <1686755.1759679957@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Tatsuo Ishii writes: > I have just pushed the patch (plus patches for syntax.sgml and > sql_features.txt. They were missued after I splitted the patch). Coverity is not very happy with this patch. It's complaining that the result of window_gettupleslot is not checked, which seems valid: 1503 { 1504 if (fetch_tuple) >>> CID 1666587: Error handling issues (CHECKED_RETURN) >>> Calling "window_gettupleslot" without checking return value (as is= done elsewhere 8 out of 9 times). 1505 window_gettupleslot(winobj, pos, slot); 1506 if (!are_peers(winstate, slot, winstate->ss.ss_ScanTupleSlot)= ) 1507 return -1; and also that WinGetFuncArgInPartition is dereferencing a possibly-null "isout" pointer at several places, including >>> Dereferencing null pointer "isout". 3806 if (*isout) /* out of partition? */ >>> Dereferencing null pointer "isout". 3817 if (!*isout && set_mark) 3818 WinSetMarkPosition(winobj, abs_pos); >>> Dereferencing null pointer "isout". 3817 if (!*isout && set_mark) 3818 WinSetMarkPosition(winobj, abs_pos); The latter complaints seem to be because some places in WinGetFuncArgInPartition check for nullness of that pointer and some do not. That looks like at least a latent bug to me. If it isn't, the function's comment needs to be expanded to say when it's legal to pass isout =3D=3D NULL. regards, tom lane