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 1v0bQL-00GBmL-Ni for pgsql-hackers@arkaria.postgresql.org; Mon, 22 Sep 2025 07:57:26 +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 1v0bQJ-00HIpO-DW for pgsql-hackers@arkaria.postgresql.org; Mon, 22 Sep 2025 07:57:23 +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.94.2) (envelope-from ) id 1v0bQI-00HIpG-Sd for pgsql-hackers@lists.postgresql.org; Mon, 22 Sep 2025 07:57:23 +0000 Received: from fhigh-b2-smtp.messagingengine.com ([202.12.124.153]) by makus.postgresql.org with smtp (Exim 4.96) (envelope-from ) id 1v0bQG-001jJU-20 for pgsql-hackers@lists.postgresql.org; Mon, 22 Sep 2025 07:57:21 +0000 Received: from phl-compute-09.internal (phl-compute-09.internal [10.202.2.49]) by mailfhigh.stl.internal (Postfix) with ESMTP id 3D20D7A01F1; Mon, 22 Sep 2025 03:57:20 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-09.internal (MEProxy); Mon, 22 Sep 2025 03:57:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm1; t=1758527840; x=1758614240; bh=MmjnaOHr/K 4mtL2HS3GcBucloA8k/VOST79zfTGE4O8=; b=eh0cvRkO3hi3atmv1OwX4XpxID quCnfV4FNNNV7qcCo9f65PFmFkOzOQn3lk19kL+1yOtStDJg3ZBo+vqVk9AYx2Lh QUyvEgMxLztpkSkrIY999eMR4ppvgQnIveojxKJFN+Fuy7IJ8puYPEQSGN5IbhqU aoL4B1rlbubglaD0w3Wbzc3QlAsXqRXreQ8GHy1Ja1jIDuayAH+mgZeqW2s8neN7 0NHWtZukz68eyEnOVUS0/e97q/tUXxX+sRVYl2W0GoDa2elVUydmOzQqA8MWsj3T 7U2/h6NYujzPp+urA/7IfyB7j3sPC+wtB0evcUezhv2Xfj400gh9doWl5/lg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1758527840; x=1758614240; bh=MmjnaOHr/K4mtL2HS3GcBucloA8k/VOST79 zfTGE4O8=; b=ZQQT36xsBfqqbpMQsh5/B+SKAp/pAZ3bnW7MJjfBI5Z+Dc1Woji BMkzQB7YkwzFI/OPrCh1xVmVC5L4VDQE/9946AjnDmJEGNDW8QXyDm6Ip3xaXHeE nUgIctzKhfgeqHn8K6u/pVVlOQTpXc/mzM0+pJGOcnONgTd5pYrY2x3Qc1fcDl3r MAfK8AZMXWfeySHXMnjceZh/LxFhnVyAEYk6GhO+prBXWorTF9do1Nnv5OMWSsHC OGIIgdu2PFa9DG9/JzjjxzX7FFV1eKhPDI4rz0K8LZ2xD75w3OGSn8CALKWrqBHA acyCQJ7Lv2YzbPxRff/2koAt1PwvErmPFLg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggdehjeefudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfghrlh cuvffnffculdejtddmnecujfgurhepfffhvfevuffkfhggtggujgesghdtroertddtvden ucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprghquh hivghrrdighiiiqeenucggtffrrghtthgvrhhnpeffudelheeghfekfefgfedthfekuddt vdfhudekgeegheeikefflefhleekheetfeenucevlhhushhtvghrufhiiigvpedtnecurf grrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiiipdhn sggprhgtphhtthhopeehpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehgrhgvgh essghurhgurdhmvgdprhgtphhtthhopehpghhsqhhlqdhhrggtkhgvrhhssehlihhsthhs rdhpohhsthhgrhgvshhqlhdrohhrghdprhgtphhtthhopehrohgsvghrthhmhhgrrghsse hgmhgrihhlrdgtohhmpdhrtghpthhtohepnhgrthhhrghnuggsohhsshgrrhhtsehgmhgr ihhlrdgtohhmpdhrtghpthhtohepshgrfigruggrrdhmshhhkhesghhmrghilhdrtghomh X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 22 Sep 2025 03:57:17 -0400 (EDT) Date: Mon, 22 Sep 2025 16:57:05 +0900 From: Michael Paquier To: Greg Burd Cc: PostgreSQL Hackers , Robert Haas , Nathan Bossart , Masahiko Sawada Subject: Re: [PATCH] Add tests for Bitmapset Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="6IFE5lqezFA2FA3M" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --6IFE5lqezFA2FA3M Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Sep 19, 2025 at 02:48:43PM -0400, Greg Burd wrote: > I think I've incorporated your feedback which did indeed make the patch > more readable/crisp and maintainable, thank you. >=20 > coverage: HEAD v7 v8 > lines......: 87.1 90.5 92.2 bitmap_match() had some duplicated tests. bms_replace_members() was not covered, and a function was added to the module. I get up to 93.4% for the lines, once added. +PG_FUNCTION_INFO_V1(test_bms_from_array); +PG_FUNCTION_INFO_V1(test_bms_to_array); These two were still declared, are not required. There were a couple of functions that acted as dead code in the module, covered in the tree. As we are trying to cover the gap I think that we should just do the whole thing. Here are the functions:=20 - is_empty - subset_compare - get_singleton_member - nonempty_difference - member_index - join. The test C function had a mistake, because either input may be modified or updated by bms_join(). The code was freeing the right input, leading to errors in the node output function when tested. Mixing the CTEs and the UNION ALL would have been nice if the queries in the UNIONs relied on more than one input value, but none of them did that, so I have removed this part and made the tests leaner. That feels easier for the eye. Testing on equality for the hash functions should be OK, so I have kept these, including the NULL/0 cases. A few incorrect things related to the style, fixed on the way, like an incorrect copyright notice in meson.build, the top of test_bitmapset.c was largely incorrect. It seems like these were copy-pasted from elsewhere. Another thing was testing with -DREALLOCATE_BITMAPSETS, which I've done. A couple of code paths related to the test C functions don't test for NULL input, which is still OK as these don't impact the internal tests or the backend coverage, so I've left these out. The result I had was good enough, so applied. The CI was OK, the buildfarm may have a different opinion. -- Michael --6IFE5lqezFA2FA3M Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmjRAVEACgkQnvQgOdby QH2u7g//cWSsJvIVS/JA4etZ4r7MB2D6gByyjpSsVtgEEKMnEmzlo0tUvP4YRZGB Df4ZNiaPm5uBqxdrSBocNJ/amjnu0kNMH9J1zBIutNwYQun92HiMeQmS2mYjJdWR BkKFACFED5XhmZuZtWX0zdBro1d0x0FeXKK80hxOrihB8dCP5MUNTxtCxBAB+4UP x9zLY7mV5t8JqnMoaOhD2EiYLq/D6Q9zfczUm1464Zup01+V+xVIHKegLW6UbF87 FL9+WUnO9DxINGj+8QOaNc//kHD3TOI8avz9PoSWO0349jv0oKbBDgumskrR4IYF b8mkwp43z3JQKOQsHfWnciEbbJCwDigCHTIt7q3YccxGUomhvZf0mcMikLx+GF4Y Ep5GPbCDH4LFkDziYwMbi2BKSSITTOjrcSmMx/5yOLld8nz5IHFzPi0JYY6PWhV4 qC1th2gRIFa/tVE++TbEWQXyo2rYV9VfA319jdfChQN7PV3EatsMpACfNUMpryVI ILhKw7StOcuqD8H/CAbfTcgDuDhAfuSj0icsb2HQLIxUMRzEgUUlp0/me7VBDie2 ZrUdBfG6ejWv7/Jd2M35g62NbbShoPmXy0iCWWJ1isQ+8Q8Q/Y+MXg2nSMLMm1r7 cjzfL/1rPRP+4VxDHGb4C0UP53UkuhhfsHv7297V5q8x4sC+Bjw= =LcKT -----END PGP SIGNATURE----- --6IFE5lqezFA2FA3M--