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 1tsQuN-001tnD-Ak for pgsql-hackers@arkaria.postgresql.org; Wed, 12 Mar 2025 18:34:23 +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 1tsQuL-00As28-Th for pgsql-hackers@arkaria.postgresql.org; Wed, 12 Mar 2025 18:34:21 +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 1tsQuL-00As1z-Ho for pgsql-hackers@lists.postgresql.org; Wed, 12 Mar 2025 18:34:21 +0000 Received: from fout-a4-smtp.messagingengine.com ([103.168.172.147]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tsQuJ-002TPk-0v for pgsql-hackers@postgresql.org; Wed, 12 Mar 2025 18:34:20 +0000 Received: from phl-compute-12.internal (phl-compute-12.phl.internal [10.202.2.52]) by mailfout.phl.internal (Postfix) with ESMTP id 830541382C51; Wed, 12 Mar 2025 14:34:18 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-12.internal (MEProxy); Wed, 12 Mar 2025 14:34:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1741804458; x=1741890858; bh=h bfnLGmMeUUQI0ReMF41UoBkHMA4VD4SHVxDLjUj3pg=; b=L9SV0XFXKuSPSGSqn Pee8XL7pTOLzK0DBrqO2+B1gkpCAbUXwYLd1rJ+0QE0Lp9Ej/fGfG152WJ9qQEQF cP7OTOirmpGnysMDSbKHtBwIbGOz5QFaWagiCu5DQHVdFjUC0GVDwKeNh7SUgR27 DZQFjhqiUytyp8zZ7ROxl/CAdnTnSe6PXtR7qeyYMQy792HM6UC0ClPRrh4MAwYl GSvvajhfer6TesRoApwGp/gIGocJBEleZ+0Tt4s6/JwqVFJzDnLY1jOpdntag3dr mfWMDP8ojKiqfu+HtRf9dd9sq6xwRp/ZhrYchfD+ZWzeKB5aPNifct/fhFRgbZvJ rdztA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduvdehkedtucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnegoufhushhpvggtthffohhmrghinhculdegledmnecujfgu rhepfffhvfevuffkgggtugfgjgesthekredttddtjeenucfhrhhomheplmhlvhgrrhhouc fjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgheqnecu ggftrfgrthhtvghrnhepgeetgfevgeeuveefjeevvddtgeefvefgudehfeelheegkeelue evhfeuveeludfgnecuffhomhgrihhnpehpohhsthhgrhgvshhqlhdrohhrghdpvghnthgv rhhprhhishgvuggsrdgtohhmpdhgohhoghhlvgdrtghomhenucevlhhushhtvghrufhiii gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhvhhgvrhhrvgesrghlvhhhrdhn ohdqihhprdhorhhgpdhnsggprhgtphhtthhopedvpdhmohguvgepshhmthhpohhuthdprh gtphhtthhopehnrghthhgrnhgusghoshhsrghrthesghhmrghilhdrtghomhdprhgtphht thhopehpghhsqhhlqdhhrggtkhgvrhhssehpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 12 Mar 2025 14:34:18 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1741804456; bh=58NCV3NNkjH7X5bzq58ENjyLQBbiP8DoNPO5Y/gn9Hs=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=hoC8tERTN6BOuCc8vIvXTEnGTrnkRf5HFOu0FiFugtHw7VSwAdsdxNpjRzBCjmkHB fSVeI39/vLwWo/VQcqrYD5ZlBwL8HrYjhRIjvoZwx6PIYEK/PPD6GpkLoCRoeEkdMv wSz5BSiE2nnLHJaKOxnEAnj3NlQf9EYvom+4/H2MCnsmV81XtFTuOBr4ZZlz6ZjqAc E0G00UZC+Itlz2I4s9MjH1LFPbi028CgJPVXXjr/CoF6ceV4sQIsmgPHKXN7dXZ59p ZSBL0hkBey+v2nyOHucOP3NXko+fCI0Sf6pbuN4DMAEvDQ9A2SNYkwFnPTR5iGqFVL 3WmSdupb7NFjA== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id 4F87691; Wed, 12 Mar 2025 19:34:16 +0100 (CET) Date: Wed, 12 Mar 2025 19:34:16 +0100 From: =?utf-8?Q?=C3=81lvaro?= Herrera To: Nathan Bossart Cc: pgsql-hackers@postgresql.org Subject: Re: remove open-coded popcount in acl.c Message-ID: <202503121834.nrw4lp5mwd7v@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2025-Mar-12, Nathan Bossart wrote: > On Wed, Mar 12, 2025 at 05:23:25PM +0100, Álvaro Herrera wrote: > > Strange: this code is not covered by any tests. > > > > https://coverage.postgresql.org/src/backend/utils/adt/acl.c.gcov.html#5533 > > https://coverage.postgresql.org/src/backend/utils/adt/acl.c.gcov.html#5438 > > Huh. Well, it's easy enough to add some basic tests for the grantor > selection machinery. Here's a first try. Thanks :-) I confirm that this covers the code in select_best_grantor that you're modifying. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ "Ed is the standard text editor." http://groups.google.com/group/alt.religion.emacs/msg/8d94ddab6a9b0ad3