pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mark Dilger <mark.dilger@enterprisedb.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Noah Misch <noah@leadboat.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Peter Geoghegan <pg@bowt.ie>
Cc: Thomas Munro <thomas.munro@gmail.com>
Cc: Andrey M. Borodin <x4mmm@yandex-team.ru>
Cc: Stephen Frost <sfrost@snowman.net>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: Amul Sul <sulamul@gmail.com>
Cc: Dilip Kumar <dilipbalaut@gmail.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: pg_amcheck contrib application
Date: Fri, 12 Mar 2021 22:33:29 -0800
Message-ID: <55AC44F2-D4D6-4687-B172-2D48F647DDA1@enterprisedb.com> (raw)
In-Reply-To: <E57D4481-19AB-4291-AB2D-3364CA073AD3@enterprisedb.com>
References: <CA+TgmoZ1DP0pkLyuG9y7Jtn2v7N-+dnVxbvBAT__u4-d=UYmbw@mail.gmail.com>
	<A80D68F6-E38F-482D-9522-E2FB6AAFE8A1@enterprisedb.com>
	<CA+TgmoY3_U=QuQWo4DArBSp+tg2MiCHLwDN_9U2H_iTxj3UcjA@mail.gmail.com>
	<9E76E46A-48B2-4869-BD0C-422204C1F767@enterprisedb.com>
	<F0A1FD70-A2F4-4528-8A03-8650CAEC0554@enterprisedb.com>
	<CA+TgmoYoW2NNQC5qzEfsR9cYWpigqQgP_h5MZCLVt1XRbsXTXQ@mail.gmail.com>
	<C37D28BA-3BA3-4776-B812-17F05F3472D8@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>
	<E57D4481-19AB-4291-AB2D-3364CA073AD3@enterprisedb.com>



> On Mar 12, 2021, at 10:28 PM, Mark Dilger <mark.dilger@enterprisedb.com> wrote:
> 
> 
> 
>> On Mar 12, 2021, at 10:22 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> 
>> Mark Dilger <mark.dilger@enterprisedb.com> writes:
>>> On Mar 12, 2021, at 10:16 PM, Noah Misch <noah@leadboat.com> wrote:
>>>> hoverfly does configure with PERL=perl64.  /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".)
>> 
>> Oh, that's annoying.
>> 
>>>> This test should unpack the field as two 32-bit values, not a
>>>> 64-bit value, to avoid requiring more from the Perl installation.
>> 
>>> I will post a modified test in a bit that avoids using Q/q.
>> 
>> Coping with both endiannesses might be painful.
> 
> 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. 


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.


—
Mark Dilger
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Attachments:

v5-0001-pg_amcheck-continuing-to-fix-portability-problems.patch (application/octet-stream, 3.2K) download From 41a0b3155b27b8fa989ee53f1bcbc2faf867af6f Mon Sep 17 00:00:00 2001 From: Mark Dilger <mark.dilger@enterprisedb.com> Date: Fri, 12 Mar 2021 22:30:48 -0800 Subject: [PATCH v5] pg_amcheck: continuing to fix portability problems Fixing a problem in the tests depending on Q/q perl pack codes, but they don't work on all versions of perl. --- src/bin/pg_amcheck/t/004_verify_heapam.pl | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/bin/pg_amcheck/t/004_verify_heapam.pl b/src/bin/pg_amcheck/t/004_verify_heapam.pl index 4cb34a0e01..6cff3b9343 100644 --- a/src/bin/pg_amcheck/t/004_verify_heapam.pl +++ b/src/bin/pg_amcheck/t/004_verify_heapam.pl @@ -57,7 +57,6 @@ use Test::More; # L = "Unsigned 32-bit Long", # S = "Unsigned 16-bit Short", # C = "Unsigned 8-bit Octet", -# q = "signed 64-bit quadword" # # Each tuple in our table has a layout as follows: # @@ -71,7 +70,7 @@ use Test::More; # xx xx t_infomask: xx offset = 20 S # xx t_hoff: x offset = 22 C # xx t_bits: x offset = 23 C -# xx xx xx xx xx xx xx xx 'a': xxxxxxxx offset = 24 q +# xx xx xx xx xx xx xx xx 'a': xxxxxxxx offset = 24 LL # xx xx xx xx xx xx xx xx 'b': xxxxxxxx offset = 32 CCCCCCCC # xx xx xx xx xx xx xx xx 'c': xxxxxxxx offset = 40 CCllLL # xx xx xx xx xx xx xx xx : xxxxxxxx ...continued @@ -81,7 +80,7 @@ use Test::More; # it is convenient enough to do it this way. We define packing code # constants here, where they can be compared easily against the layout. -use constant HEAPTUPLE_PACK_CODE => 'LLLSSSSSCCqCCCCCCCCCCllLL'; +use constant HEAPTUPLE_PACK_CODE => 'LLLSSSSSCCLLCCCCCCCCCCllLL'; use constant HEAPTUPLE_PACK_LENGTH => 58; # Total size # Read a tuple of our table from a heap page. @@ -112,7 +111,8 @@ sub read_tuple t_infomask => shift, t_hoff => shift, t_bits => shift, - a => shift, + a_1 => shift, + a_2 => shift, b_header => shift, b_body1 => shift, b_body2 => shift, @@ -156,7 +156,8 @@ sub write_tuple $tup->{t_infomask}, $tup->{t_hoff}, $tup->{t_bits}, - $tup->{a}, + $tup->{a_1}, + $tup->{a_2}, $tup->{b_header}, $tup->{b_body1}, $tup->{b_body2}, @@ -227,7 +228,7 @@ use constant ROWCOUNT => 16; $node->safe_psql('postgres', qq( INSERT INTO public.test (a, b, c) VALUES ( - 12345678, + 0, 'abcdefg', repeat('w', 10000) ); @@ -275,13 +276,14 @@ for (my $tupidx = 0; $tupidx < ROWCOUNT; $tupidx++) my $tup = read_tuple($file, $offset); # Sanity-check that the data appears on the page where we expect. - my $a = $tup->{a}; + my $a_1 = $tup->{a_1}; + my $a_2 = $tup->{a_2}; my $b = $tup->{b}; - if ($a ne '12345678' || $b ne 'abcdefg') + if ($a_1 ne '0' || $a_2 ne '0' || $b ne 'abcdefg') { close($file); # ignore errors on close; we're exiting anyway $node->clean_node; - plan skip_all => qq(Page layout differs from our expectations: expected (12345678, "abcdefg"), got ($a, "$b")); + plan skip_all => qq(Page layout differs from our expectations: expected (0, 0, "abcdefg"), got ($a_1, $a_2, "$b")); exit; } -- 2.21.1 (Apple Git-122.3) =

view thread (161+ messages)  latest in thread

Message-ID: <55AC44F2-D4D6-4687-B172-2D48F647DDA1@enterprisedb.com>
Permalink:  ../55AC44F2-D4D6-4687-B172-2D48F647DDA1@enterprisedb.com/
Also on:    postgresql.org/message-id/55AC44F2-D4D6-4687-B172-2D48F647DDA1@enterprisedb.com

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: mark.dilger@enterprisedb.com, tgl@sss.pgh.pa.us, noah@leadboat.com, robertmhaas@gmail.com, pg@bowt.ie, thomas.munro@gmail.com, x4mmm@yandex-team.ru, sfrost@snowman.net, michael@paquier.xyz, sulamul@gmail.com, dilipbalaut@gmail.com, andres@anarazel.de
  Subject: Re: pg_amcheck contrib application
  In-Reply-To: <55AC44F2-D4D6-4687-B172-2D48F647DDA1@enterprisedb.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox