Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lKxqF-0007Zj-OU for pgsql-hackers@arkaria.postgresql.org; Sat, 13 Mar 2021 06:33:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lKxqE-0006J1-N8 for pgsql-hackers@arkaria.postgresql.org; Sat, 13 Mar 2021 06:33:38 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lKxqE-0006Is-BN for pgsql-hackers@lists.postgresql.org; Sat, 13 Mar 2021 06:33:38 +0000 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lKxqB-00081p-TY for pgsql-hackers@postgresql.org; Sat, 13 Mar 2021 06:33:37 +0000 Received: by mail-wm1-x335.google.com with SMTP id g8so5026163wmd.4 for ; Fri, 12 Mar 2021 22:33:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=zGH8w9wwHjErqKZ0hY14vn6iam/8mkD7Nldix+6ar5Q=; b=gjtsGmeRZ/bHpkQv5FGS6ofeypsd4Minzuiy3mHeSL2fA67Y4TmQTFx4E/rkHTzSc3 +sqP8qAiCyRE1r0GTui72aP25tl2b2XHpPtvKfq3GLWjRFI5MlCMkgHd8GhU3wcsMXfl oC61bCCZ84RuLsmnw58AkoDxjO7OjxfgSKfKgvGU6vT9BhRyPJae3b0XBtvnpZobTpI/ YQ3wvPosG/S3qSqUTrkh/D8yB7DsTGfKC8fr1snbY7twILfLgPHAY4zh5OnRsXn9boyk wBneNQfMwC6HyqkcOYv8A0u4pWIxWSBxHWpMAaJSswWJelWnSupZ2b6OLmR459aId1ha Fs3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=zGH8w9wwHjErqKZ0hY14vn6iam/8mkD7Nldix+6ar5Q=; b=qN37P0jTAQ7tz4l9qrPnp3Czgoee1ABJQfa0TqLIMVpGWlQRDNbPeGdsT4yJ8+5QCh vHPMEdeyNyoD4NxcanRK2WxV4pU/6mpvGJsCK+x7dh5/VewpIwUcbB4X7/iF6XMS7cj/ OrKwkVi4Q2Q/CsoHErZIWEF1t1JD5JvO4MfQmQhx/7idIIqr/ZzkUge3U3MP049MUwN5 W5skdF6+ua05cmjlidMbBh5F9GbB07C6CksUqq9eGgcYlqK1LB3ccMy/VFcEnPylarOO msnCRz3h1bJUJXpSqQMIUvu+vbj6HozJzz+xzzVxpN1y7wJgaSB55NsOrz9oASHC9dJs R2xQ== X-Gm-Message-State: AOAM530JoTv4bDnxUEm2DMhLoYA9/GvJb6qVSeQEFtd26cT0V2jAG0EO o8XoZN8/GcEQbKjA5Y9iaUlY1Qt/YHqb1G31+f7NMRpU/JgkQsO3Wm7SYYbCaltDHUBQY+AaVyf yGlbhDUKOHjFPceuqgV6xaZQaAMGc7feQa6fyAEsZEtTnfBgwCyvheJPBZV8qeCgSWE88s4V8YB t2ouYXwB6Tk1iYwmEuxIJQkvjUOXLbNLqxbiMA X-Google-Smtp-Source: ABdhPJxRTHfD0t1KPeDHZf0dGRI/I6KRDwJmFc/z3WIlrtvys/B+1uhOX4ume3AeJSV2i6rcVMnzQQ== X-Received: by 2002:a1c:1f8f:: with SMTP id f137mr16279024wmf.66.1615617214513; Fri, 12 Mar 2021 22:33:34 -0800 (PST) Received: from [192.168.0.29] (24-113-193-150.wavecable.com. [24.113.193.150]) by smtp.gmail.com with ESMTPSA id g5sm10873402wrq.30.2021.03.12.22.33.31 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Mar 2021 22:33:33 -0800 (PST) From: Mark Dilger Message-Id: <55AC44F2-D4D6-4687-B172-2D48F647DDA1@enterprisedb.com> Content-Type: multipart/mixed; boundary="Apple-Mail=_6DDC949A-7FCC-4AFB-8E5A-F6E8D4688F05" Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.1\)) Subject: Re: pg_amcheck contrib application Date: Fri, 12 Mar 2021 22:33:29 -0800 In-Reply-To: Cc: Noah Misch , Robert Haas , Peter Geoghegan , Thomas Munro , "Andrey M. Borodin" , Stephen Frost , Michael Paquier , Amul Sul , Dilip Kumar , Andres Freund , PostgreSQL-development To: Tom Lane References: <9E76E46A-48B2-4869-BD0C-422204C1F767@enterprisedb.com> <2574324.1615611372@sss.pgh.pa.us> <2588078.1615613250@sss.pgh.pa.us> <2589781.1615615635@sss.pgh.pa.us> <20210313061655.GC3099026@rfd.leadboat.com> <6BBDE6C1-3F40-4009-896D-9CA9D87BEC9A@enterprisedb.com> <2590503.1615616574@sss.pgh.pa.us> X-Mailer: Apple Mail (2.3608.120.23.2.1) X-CLOUD-SEC-AV-Info: enterprisedb,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Apple-Mail=_6DDC949A-7FCC-4AFB-8E5A-F6E8D4688F05 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Mar 12, 2021, at 10:28 PM, Mark Dilger = wrote: >=20 >=20 >=20 >> On Mar 12, 2021, at 10:22 PM, Tom Lane wrote: >>=20 >> Mark Dilger writes: >>> On Mar 12, 2021, at 10:16 PM, Noah Misch wrote: >>>> hoverfly does configure with PERL=3Dperl64. /usr/bin/prove is from = the 32-bit >>>> Perl, so I suspect the TAP suites get 32-bit Perl that way. = (There's no >>>> "prove64".) >>=20 >> Oh, that's annoying. >>=20 >>>> This test should unpack the field as two 32-bit values, not a >>>> 64-bit value, to avoid requiring more from the Perl installation. >>=20 >>> I will post a modified test in a bit that avoids using Q/q. >>=20 >> Coping with both endiannesses might be painful. >=20 > Not too bad if the bigint value is zero, as both the low and high = 32bits will be zero, regardless of endianness. The question is whether = that gives up too much in terms of what the test is trying to do. I'm = not sure that it does, but if you'd rather solve this by upgrading perl, = that's ok by me.=20 I'm not advocating that this be the solution, but if we don't fix up the = perl end of it, then this test change might be used instead. --Apple-Mail=_6DDC949A-7FCC-4AFB-8E5A-F6E8D4688F05 Content-Disposition: attachment; filename=v5-0001-pg_amcheck-continuing-to-fix-portability-problems.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="v5-0001-pg_amcheck-continuing-to-fix-portability-problems.patch" Content-Transfer-Encoding: quoted-printable =46rom=2041a0b3155b27b8fa989ee53f1bcbc2faf867af6f=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Mark=20Dilger=20=0A= Date:=20Fri,=2012=20Mar=202021=2022:30:48=20-0800=0ASubject:=20[PATCH=20= v5]=20pg_amcheck:=20continuing=20to=20fix=20portability=20problems=0A=0A= Fixing=20a=20problem=20in=20the=20tests=20depending=20on=20Q/q=20perl=20= pack=20codes,=20but=0Athey=20don't=20work=20on=20all=20versions=20of=20= perl.=0A---=0A=20src/bin/pg_amcheck/t/004_verify_heapam.pl=20|=2020=20= +++++++++++---------=0A=201=20file=20changed,=2011=20insertions(+),=209=20= deletions(-)=0A=0Adiff=20--git=20= a/src/bin/pg_amcheck/t/004_verify_heapam.pl=20= b/src/bin/pg_amcheck/t/004_verify_heapam.pl=0Aindex=20= 4cb34a0e01..6cff3b9343=20100644=0A---=20= a/src/bin/pg_amcheck/t/004_verify_heapam.pl=0A+++=20= b/src/bin/pg_amcheck/t/004_verify_heapam.pl=0A@@=20-57,7=20+57,6=20@@=20= use=20Test::More;=0A=20#=09L=20=3D=20"Unsigned=2032-bit=20Long",=0A=20#=09= S=20=3D=20"Unsigned=2016-bit=20Short",=0A=20#=09C=20=3D=20"Unsigned=20= 8-bit=20Octet",=0A-#=09q=20=3D=20"signed=2064-bit=20quadword"=0A=20#=0A=20= #=20Each=20tuple=20in=20our=20table=20has=20a=20layout=20as=20follows:=0A= =20#=0A@@=20-71,7=20+70,7=20@@=20use=20Test::More;=0A=20#=20=20=20=20xx=20= xx=20=20=20=20=20=20=20=20=20=20=20=20=20=20t_infomask:=20xx=09=09=09= offset=20=3D=2020=09=09S=0A=20#=20=20=20=20xx=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20t_hoff:=20x=09=09=09offset=20=3D=2022=09= =09C=0A=20#=20=20=20=20xx=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20t_bits:=20x=09=09=09offset=20=3D=2023=09=09C=0A-#=20=20=20= =20xx=20xx=20xx=20xx=20xx=20xx=20xx=20xx=20=20=20'a':=20xxxxxxxx=09= offset=20=3D=2024=09=09q=0A+#=20=20=20=20xx=20xx=20xx=20xx=20xx=20xx=20= xx=20xx=20=20=20'a':=20xxxxxxxx=09offset=20=3D=2024=09=09LL=0A=20#=20=20=20= =20xx=20xx=20xx=20xx=20xx=20xx=20xx=20xx=20=20=20'b':=20xxxxxxxx=09= offset=20=3D=2032=09=09CCCCCCCC=0A=20#=20=20=20=20xx=20xx=20xx=20xx=20xx=20= xx=20xx=20xx=20=20=20'c':=20xxxxxxxx=09offset=20=3D=2040=09=09CCllLL=0A=20= #=20=20=20=20xx=20xx=20xx=20xx=20xx=20xx=20xx=20xx=20=20=20=20=20=20:=20= xxxxxxxx=09=20...continued=0A@@=20-81,7=20+80,7=20@@=20use=20Test::More;=0A= =20#=20it=20is=20convenient=20enough=20to=20do=20it=20this=20way.=20=20= We=20define=20packing=20code=0A=20#=20constants=20here,=20where=20they=20= can=20be=20compared=20easily=20against=20the=20layout.=0A=20=0A-use=20= constant=20HEAPTUPLE_PACK_CODE=20=3D>=20'LLLSSSSSCCqCCCCCCCCCCllLL';=0A= +use=20constant=20HEAPTUPLE_PACK_CODE=20=3D>=20= 'LLLSSSSSCCLLCCCCCCCCCCllLL';=0A=20use=20constant=20= HEAPTUPLE_PACK_LENGTH=20=3D>=2058;=20=20=20=20=20#=20Total=20size=0A=20=0A= =20#=20Read=20a=20tuple=20of=20our=20table=20from=20a=20heap=20page.=0A= @@=20-112,7=20+111,8=20@@=20sub=20read_tuple=0A=20=09=09=09t_infomask=20= =3D>=20shift,=0A=20=09=09=09t_hoff=20=3D>=20shift,=0A=20=09=09=09t_bits=20= =3D>=20shift,=0A-=09=09=09a=20=3D>=20shift,=0A+=09=09=09a_1=20=3D>=20= shift,=0A+=09=09=09a_2=20=3D>=20shift,=0A=20=09=09=09b_header=20=3D>=20= shift,=0A=20=09=09=09b_body1=20=3D>=20shift,=0A=20=09=09=09b_body2=20=3D>=20= shift,=0A@@=20-156,7=20+156,8=20@@=20sub=20write_tuple=0A=20=09=09=09=09=09= $tup->{t_infomask},=0A=20=09=09=09=09=09$tup->{t_hoff},=0A=20=09=09=09=09= =09$tup->{t_bits},=0A-=09=09=09=09=09$tup->{a},=0A+=09=09=09=09=09= $tup->{a_1},=0A+=09=09=09=09=09$tup->{a_2},=0A=20=09=09=09=09=09= $tup->{b_header},=0A=20=09=09=09=09=09$tup->{b_body1},=0A=20=09=09=09=09=09= $tup->{b_body2},=0A@@=20-227,7=20+228,7=20@@=20use=20constant=20ROWCOUNT=20= =3D>=2016;=0A=20$node->safe_psql('postgres',=20qq(=0A=20=09INSERT=20INTO=20= public.test=20(a,=20b,=20c)=0A=20=09=09VALUES=20(=0A-=09=09=0912345678,=0A= +=09=09=090,=0A=20=09=09=09'abcdefg',=0A=20=09=09=09repeat('w',=2010000)=0A= =20=09=09);=0A@@=20-275,13=20+276,14=20@@=20for=20(my=20$tupidx=20=3D=20= 0;=20$tupidx=20<=20ROWCOUNT;=20$tupidx++)=0A=20=09my=20$tup=20=3D=20= read_tuple($file,=20$offset);=0A=20=0A=20=09#=20Sanity-check=20that=20= the=20data=20appears=20on=20the=20page=20where=20we=20expect.=0A-=09my=20= $a=20=3D=20$tup->{a};=0A+=09my=20$a_1=20=3D=20$tup->{a_1};=0A+=09my=20= $a_2=20=3D=20$tup->{a_2};=0A=20=09my=20$b=20=3D=20$tup->{b};=0A-=09if=20= ($a=20ne=20'12345678'=20||=20$b=20ne=20'abcdefg')=0A+=09if=20($a_1=20ne=20= '0'=20||=20$a_2=20ne=20'0'=20||=20$b=20ne=20'abcdefg')=0A=20=09{=0A=20=09= =09close($file);=20=20#=20ignore=20errors=20on=20close;=20we're=20= exiting=20anyway=0A=20=09=09$node->clean_node;=0A-=09=09plan=20skip_all=20= =3D>=20qq(Page=20layout=20differs=20from=20our=20expectations:=20= expected=20(12345678,=20"abcdefg"),=20got=20($a,=20"$b"));=0A+=09=09plan=20= skip_all=20=3D>=20qq(Page=20layout=20differs=20from=20our=20= expectations:=20expected=20(0,=200,=20"abcdefg"),=20got=20($a_1,=20$a_2,=20= "$b"));=0A=20=09=09exit;=0A=20=09}=0A=20=0A--=20=0A2.21.1=20(Apple=20= Git-122.3)=0A=0A= --Apple-Mail=_6DDC949A-7FCC-4AFB-8E5A-F6E8D4688F05 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 =E2=80=94 Mark Dilger EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company --Apple-Mail=_6DDC949A-7FCC-4AFB-8E5A-F6E8D4688F05--