v3-0001-Avoid-use-of-non-portable-option-ordering-in-comm.patch
application/octet-stream
Filename: v3-0001-Avoid-use-of-non-portable-option-ordering-in-comm.patch
Type: application/octet-stream
Part: 0
Message:
Re: pg_amcheck contrib application
Patch
Format: format-patch
Series: patch v3-0001
Subject: Avoid use of non-portable option ordering in command_checks_all().
| File | + | − |
|---|---|---|
| src/bin/pg_amcheck/t/003_check.pl | 13 | 13 |
From db0a3e9b43202aacf1be668e887cfb9f803a6ada Mon Sep 17 00:00:00 2001 From: Mark Dilger <mark.dilger@enterprisedb.com> Date: Fri, 12 Mar 2021 16:56:59 -0800 Subject: [PATCH v3] Avoid use of non-portable option ordering in command_checks_all(). The use of bare command line arguments before switches is not portable and caused failures in the buildfarm. Reordering the arguments to be portable. Failures were observed on drongo and hoverfly. Non-portable usage spotted by Robert Haas. --- src/bin/pg_amcheck/t/003_check.pl | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/bin/pg_amcheck/t/003_check.pl b/src/bin/pg_amcheck/t/003_check.pl index e43ffe7ed6..875a675423 100644 --- a/src/bin/pg_amcheck/t/003_check.pl +++ b/src/bin/pg_amcheck/t/003_check.pl @@ -376,7 +376,7 @@ $node->command_checks_all( # are quiet. # $node->command_checks_all( - [ @cmd, 'db1', '-t', 's1.*', '--no-dependent-indexes' ], + [ @cmd, '-t', 's1.*', '--no-dependent-indexes', 'db1' ], 0, [ $no_output_re ], [ $no_output_re ], @@ -385,7 +385,7 @@ $node->command_checks_all( # Checking db2.s1 should show table corruptions if indexes are excluded # $node->command_checks_all( - [ @cmd, 'db2', '-t', 's1.*', '--no-dependent-indexes' ], + [ @cmd, '-t', 's1.*', '--no-dependent-indexes', 'db2' ], 2, [ $missing_file_re ], [ $no_output_re ], @@ -395,7 +395,7 @@ $node->command_checks_all( # corruption messages on stdout, and nothing on stderr. # $node->command_checks_all( - [ @cmd, 'db1', '-s', 's3' ], + [ @cmd, '-s', 's3', 'db1' ], 2, [ $index_missing_relation_fork_re, $line_pointer_corruption_re, @@ -408,14 +408,14 @@ $node->command_checks_all( # options the toast corruption is reported, but when excluding toast we get no # error reports. $node->command_checks_all( - [ @cmd, 'db1', '-s', 's4' ], + [ @cmd, '-s', 's4', 'db1' ], 2, [ $missing_file_re ], [ $no_output_re ], 'pg_amcheck in schema s4 reports toast corruption'); $node->command_checks_all( - [ @cmd, '--no-dependent-toast', '--exclude-toast-pointers', 'db1', '-s', 's4' ], + [ @cmd, '--no-dependent-toast', '--exclude-toast-pointers', '-s', 's4', 'db1' ], 0, [ $no_output_re ], [ $no_output_re ], @@ -423,7 +423,7 @@ $node->command_checks_all( # Check that no corruption is reported in schema db1.s5 $node->command_checks_all( - [ @cmd, 'db1', '-s', 's5' ], + [ @cmd, '-s', 's5', 'db1' ], 0, [ $no_output_re ], [ $no_output_re ], @@ -433,7 +433,7 @@ $node->command_checks_all( # the indexes, no corruption is reported about the schema. # $node->command_checks_all( - [ @cmd, 'db1', '-s', 's1', '-I', 't1_btree', '-I', 't2_btree' ], + [ @cmd, '-s', 's1', '-I', 't1_btree', '-I', 't2_btree', 'db1' ], 0, [ $no_output_re ], [ $no_output_re ], @@ -444,7 +444,7 @@ $node->command_checks_all( # about the schema. # $node->command_checks_all( - [ @cmd, 'db1', '-t', 's1.*', '--no-dependent-indexes' ], + [ @cmd, '-t', 's1.*', '--no-dependent-indexes', 'db1' ], 0, [ $no_output_re ], [ $no_output_re ], @@ -454,7 +454,7 @@ $node->command_checks_all( # tables that no corruption is reported. # $node->command_checks_all( - [ @cmd, 'db1', '-s', 's2', '-T', 't1', '-T', 't2' ], + [ @cmd, '-s', 's2', '-T', 't1', '-T', 't2', 'db1' ], 0, [ $no_output_re ], [ $no_output_re ], @@ -464,7 +464,7 @@ $node->command_checks_all( # to avoid getting messages about corrupt tables or indexes. # command_fails_like( - [ @cmd, 'db1', '-s', 's5', '--startblock', 'junk' ], + [ @cmd, '-s', 's5', '--startblock', 'junk', 'db1' ], qr/invalid start block/, 'pg_amcheck rejects garbage startblock'); @@ -474,7 +474,7 @@ command_fails_like( 'pg_amcheck rejects garbage endblock'); command_fails_like( - [ @cmd, 'db1', '-s', 's5', '--startblock', '5', '--endblock', '4' ], + [ @cmd, '-s', 's5', '--startblock', '5', '--endblock', '4', 'db1' ], qr/end block precedes start block/, 'pg_amcheck rejects invalid block range'); @@ -483,14 +483,14 @@ command_fails_like( # arguments are handled sensibly. # $node->command_checks_all( - [ @cmd, 'db1', '-s', 's1', '-i', 't1_btree', '--parent-check' ], + [ @cmd, '-s', 's1', '-i', 't1_btree', '--parent-check', 'db1' ], 2, [ $index_missing_relation_fork_re ], [ $no_output_re ], 'pg_amcheck smoke test --parent-check'); $node->command_checks_all( - [ @cmd, 'db1', '-s', 's1', '-i', 't1_btree', '--heapallindexed', '--rootdescend' ], + [ @cmd, '-s', 's1', '-i', 't1_btree', '--heapallindexed', '--rootdescend', 'db1' ], 2, [ $index_missing_relation_fork_re ], [ $no_output_re ], -- 2.21.1 (Apple Git-122.3)