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 1v6T02-0054Yt-AY for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Oct 2025 12:10:30 +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 1v6Szz-009q8g-8F for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Oct 2025 12:10:28 +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 1v6Szy-009q8W-Q2 for pgsql-hackers@lists.postgresql.org; Wed, 08 Oct 2025 12:10:27 +0000 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1v6Szw-000fKG-2F for pgsql-hackers@lists.postgresql.org; Wed, 08 Oct 2025 12:10:26 +0000 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-27eed7bdfeeso12191275ad.0 for ; Wed, 08 Oct 2025 05:10:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1759925425; x=1760530225; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=UTaXObgvgR8HhsqDYJZsqezGe+gDks4B6R5L0bLlQiw=; b=PLw9TLZ2UqR2WYFe8gGm+Y9yHSJ8Mn5oq+ZQWLrTCMRNZXgz7E06W2rvte30mebJp4 mPuLR9uF0vX35Rbk/Ap7MH+jwt3BAKLHSR6qUd/0KKcFg+EYCLwwN9AmtKbWeDJEPXgr S5rxH4rofLjb2sm1eGGtqSP1ZOIdGA+qgdfJAsWdBaFYdN7rQPBYiEytJAlsOvz3gwpQ Oxi/3Eo6kB8FQ5epjgbXuluF05CIn/KGFUHhZItZdCi39ayDKlJWkYAp9A0m45yYpwMH Ik5SPGdcCf7NluALyMDBxFCpQ6njCCXDmNgIPifgK0whsl94W30zZSeD3RclDiiu8Qhr 1Ffw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1759925425; x=1760530225; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=UTaXObgvgR8HhsqDYJZsqezGe+gDks4B6R5L0bLlQiw=; b=hTVsnVLv5Q3CByLNssmHVqtjCp9a+6slykLswFMLo6mRUzi6IuwfOGgKS53dkRsgkp Ewfkv+jhhizGKNyRDo8w1KbayPhKCWgXcWlGZ1K3S3XT5ZAHEFG5eEwLjvxQirf+gl7m //EmDm+RwQHjyol4ntIvdAF3bXuriv+hJ5Vn71V8pLmb5AF3ISKpZ+UKAqwJCzsR2Fxi IzjOjAmsqfVaIENih9PpTe0rG077zr/VTb+RwN6zq84Q8d+uGM+ma55uYTqGO6j8/BQC bWrKpu7QSGhf5ZMepknP0aJH0Ixf49DsLa6x/QjD4n+P9e3fcYmeqxXaNtsZjQWLrPz2 7htw== X-Forwarded-Encrypted: i=1; AJvYcCVYWq9qV0QPYtWkaR/2BubAnjeeLl1kfu5tA1jv+CuFZ79hiq3hC55Qsl7zmdabVFeGkgf9a5fL+o684HmM@lists.postgresql.org X-Gm-Message-State: AOJu0YxSTbmIybOXrTGR+RYXsWUVEFzSlSYrw9/RPh6SowMrqfSl3W+X XIuYybo5oe/p11nYLm5euaBYGpPUa8hNxUvC+QbWgDBOVEKlxo70fuMhrmVERufGRGi2SOuHuzC BpVFaGMayCVnnC5GXm6AROMdRiyPMiy0= X-Gm-Gg: ASbGncs9ZyBdzTRTMGf5CE0t+NN8FIwv9XSAuKwTcWPpuhx8rvqoYj+SGpcE8xun+S+ UWdSXcdD2SVp19thkgsZ2ym+KBbbLp89GAGL8E21Fulefr03l8QraAgGi7y84DJntc3bIpN7rBn CvKpmS7tS06MWPC3XIttpNMEjev8k6tPWRU1KzCHvYADsKJDzwhiSk3gUQ5uyon4P0jCQydQDXy mfLdOuMeZ+luq3aMvGlVQdzDzM9sWw= X-Google-Smtp-Source: AGHT+IFBb+6mBvcoa/jqkNvdFbz7GFelo+vexeFV0DuI4ars+AE/4Nd0rcUNYEEWvAlyqxQXS5G9g9Nm8sqAsc/QShg= X-Received: by 2002:a17:903:1a90:b0:269:7840:de24 with SMTP id d9443c01a7336-28ec9caf018mr86145025ad.21.1759925424682; Wed, 08 Oct 2025 05:10:24 -0700 (PDT) MIME-Version: 1.0 References: <197CAFC2-963B-4414-9A51-08AF648146E4@yesql.se> <3E15C43D-8FDB-454F-A3E3-182210680C58@getmailspring.com> In-Reply-To: <3E15C43D-8FDB-454F-A3E3-182210680C58@getmailspring.com> From: Ranier Vilela Date: Wed, 8 Oct 2025 09:10:16 -0300 X-Gm-Features: AS18NWBiPBzAFhigEB2WMAq7MylnS4wUQvUemh96T2Xs1BMNtYczPL6Jhed3FGo Message-ID: Subject: Re: [PATCH] Add tests for Bitmapset To: Greg Burd Cc: Daniel Gustafsson , David Rowley , Michael Paquier , PostgreSQL Hackers Content-Type: multipart/mixed; boundary="000000000000c50d320640a49158" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000c50d320640a49158 Content-Type: multipart/alternative; boundary="000000000000c50d320640a49156" --000000000000c50d320640a49156 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi. Em sex., 3 de out. de 2025 =C3=A0s 09:13, Greg Burd escreveu= : > > On Oct 3 2025, at 4:25 am, Daniel Gustafsson wrote: > > >> On 3 Oct 2025, at 01:36, David Rowley wrote: > >> > >> On Fri, 3 Oct 2025 at 01:33, Daniel Gustafsson wrote= : > >>> Another nitpick would be to remove the test for NULL in > test_bms_make_singleton > >>> since that is a STRICT function, making the test for NULL > >>> superfluous code: > >> > >> I see test_random_operations() is also strict. Is it worth getting rid > >> of the SQL NULL checks on the inputs there too? Aka, the attached. > > > > Indeed, but reading the code I wonder if STRICT was a mistake and the > intention > > was to allow NULL input? > > Yes, it was an oversight after I re-worked the random function. > > > That being said, the function is never called with > > NULL so that's mostly academic thinking. +1 for removing the NULL > > checks and simplifying the code. > > I agree, and thank you both for the attention to detail and interest in > this test suite. > With the patch attached, there are regression. Is it intentional not to check the return of the function bms_is_member? diff --strip-trailing-cr -U3 C:/dll/postgres_dev/postgres_commit/src/test/modules/test_bitmapset/expecte= d/test_bitmapset.out C:/dll/postgres_dev/postgres_commit/build/testrun/test_bitmapset/regress/re= sults/test_bitmapset.out --- C:/dll/postgres_dev/postgres_commit/src/test/modules/test_bitmapset/expecte= d/test_bitmapset.out 2025-10-02 21:17:53.169515700 -0300 +++ C:/dll/postgres_dev/postgres_commit/build/testrun/test_bitmapset/regress/re= sults/test_bitmapset.out 2025-10-07 21:24:00.534142300 -0300 @@ -1570,9 +1570,5 @@ -- random operations SELECT test_random_operations(-1, 10000, 81920, 0) > 0 AS result; - result --------- - t -(1 row) - +ERROR: union missing member 63904 DROP EXTENSION test_bitmapset; best regards, Ranier Vilela --000000000000c50d320640a49156 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi.

Em sex., 3 de ou= t. de 2025 =C3=A0s 09:13, Greg Burd <gre= g@burd.me> escreveu:

On Oct 3 2025, at 4:25 am, Daniel Gustafsson <daniel@yesql.se> wrote:

>> On 3 Oct 2025, at 01:36, David Rowley <dgrowleyml@gmail.com> wrote:
>>
>> On Fri, 3 Oct 2025 at 01:33, Daniel Gustafsson <daniel@yesql.se> wrote:
>>> Another nitpick would be to remove the test for NULL in test_b= ms_make_singleton
>>> since that is a STRICT function, making the test for NULL
>>> superfluous code:
>>
>> I see test_random_operations() is also strict. Is it worth getting= rid
>> of the SQL NULL checks on the inputs there too? Aka, the attached.=
>
> Indeed, but reading the code I wonder if STRICT was a mistake and the = intention
> was to allow NULL input?

Yes, it was an oversight after I re-worked the random function.

> That being said, the function is never called with
> NULL so that's mostly academic thinking.=C2=A0 +1 for removing the= NULL
> checks and simplifying the code.

I agree, and thank you both for the attention to detail and interest in
this test suite.
With the patch attached, there are re= gression.
Is it intentional not to check the return of the functi= on bms_is_member?

diff --strip-trailing-cr -U3 C:/= dll/postgres_dev/postgres_commit/src/test/modules/test_bitmapset/expected/t= est_bitmapset.out C:/dll/postgres_dev/postgres_commit/build/testrun/test_bi= tmapset/regress/results/test_bitmapset.out
--- C:/dll/postgres_dev/postg= res_commit/src/test/modules/test_bitmapset/expected/test_bitmapset.out 2025= -10-02 21:17:53.169515700 -0300
+++ C:/dll/postgres_dev/postgres_commit/= build/testrun/test_bitmapset/regress/results/test_bitmapset.out 2025-10-07 = 21:24:00.534142300 -0300
@@ -1570,9 +1570,5 @@
=C2=A0
=C2=A0-- ran= dom operations
=C2=A0SELECT test_random_operations(-1, 10000, 81920, 0) = > 0 AS result;
- result
---------
- t
-(1 row)
-
+ERR= OR: =C2=A0union missing member 63904
=C2=A0DROP EXTENSION test_bitmapset= ;
=C2=A0
best regards,
Ranier Vilela
--000000000000c50d320640a49156-- --000000000000c50d320640a49158 Content-Type: text/plain; charset="US-ASCII"; name="check-function-return-bms_is_member.txt" Content-Disposition: attachment; filename="check-function-return-bms_is_member.txt" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_mghy5bha0 ZGlmZiAtLWdpdCBhL3NyYy90ZXN0L21vZHVsZXMvdGVzdF9iaXRtYXBzZXQvdGVzdF9iaXRtYXBz ZXQuYyBiL3NyYy90ZXN0L21vZHVsZXMvdGVzdF9iaXRtYXBzZXQvdGVzdF9iaXRtYXBzZXQuYwpp bmRleCA4YmM5YjFmNDhlLi45ZTc1NzczMmM1IDEwMDY0NAotLS0gYS9zcmMvdGVzdC9tb2R1bGVz L3Rlc3RfYml0bWFwc2V0L3Rlc3RfYml0bWFwc2V0LmMKKysrIGIvc3JjL3Rlc3QvbW9kdWxlcy90 ZXN0X2JpdG1hcHNldC90ZXN0X2JpdG1hcHNldC5jCkBAIC03MDAsNyArNzAwLDggQEAgdGVzdF9y YW5kb21fb3BlcmF0aW9ucyhQR19GVU5DVElPTl9BUkdTKQogCQkJY2FzZSAyOgkJCQkvKiB0ZXN0 IG1lbWJlcnNoaXAgKi8KIAkJCQlpZiAoYm1zICE9IE5VTEwpCiAJCQkJewotCQkJCQlibXNfaXNf bWVtYmVyKG1lbWJlciwgYm1zKTsKKwkJCQkJaWYgKCFibXNfaXNfbWVtYmVyKG1lbWJlciwgYm1z KSkKKwkJCQkJCWVsb2coRVJST1IsICJ1bmlvbiBtaXNzaW5nIG1lbWJlciAlZCIsIG1lbWJlcik7 CiAJCQkJfQogCQkJCWJyZWFrOwogCQl9Cg== --000000000000c50d320640a49158--