Skip to content

Commit 0c1aca4

Browse files
committed
Cleanup perl code from unused variables and routines
This commit removes unused variables and routines from some perl code that have accumulated across the years. This touches the following areas: - Wait event generation script. - AdjustUpgrade.pm. - TAP perl code Author: Alexander Lakhin Reviewed-by: Dagfinn Ilmari Mannsåker Discussion: https://postgr.es/m/70b340bc-244a-589d-ef8b-d8aebb707a84@gmail.com
1 parent 978f38c commit 0c1aca4

File tree

11 files changed

+3
-31
lines changed

11 files changed

+3
-31
lines changed

contrib/amcheck/t/001_verify_heapam.pl

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
use Test::More;
1111

12-
my ($node, $result);
12+
my $node;
1313

1414
#
1515
# Test set-up
@@ -87,19 +87,6 @@ sub relation_filepath
8787
return "$pgdata/$rel";
8888
}
8989

90-
# Returns the fully qualified name of the toast table for the named relation
91-
sub get_toast_for
92-
{
93-
my ($relname) = @_;
94-
95-
return $node->safe_psql(
96-
'postgres', qq(
97-
SELECT 'pg_toast.' || t.relname
98-
FROM pg_catalog.pg_class c, pg_catalog.pg_class t
99-
WHERE c.relname = '$relname'
100-
AND c.reltoastrelid = t.oid));
101-
}
102-
10390
# (Re)create and populate a test table of the given name.
10491
sub fresh_test_table
10592
{

contrib/amcheck/t/002_cic.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
use Test::More;
1212

13-
my ($node, $result);
13+
my $node;
1414

1515
#
1616
# Test set-up

src/backend/utils/activity/generate-wait_event_types.pl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@
4242
my @lines;
4343
my $abi_compatibility = 0;
4444
my $section_name;
45-
my $note;
46-
my $note_name;
4745

4846
# Remove comments and empty lines and add waitclassname based on the section
4947
while (<$wait_event_names>)

src/bin/pg_dump/t/003_pg_dump_with_server.pl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
$node->safe_psql('postgres', "CREATE SERVER s2 FOREIGN DATA WRAPPER dummy");
2727
$node->safe_psql('postgres', "CREATE FOREIGN TABLE t0 (a int) SERVER s0");
2828
$node->safe_psql('postgres', "CREATE FOREIGN TABLE t1 (a int) SERVER s1");
29-
my ($cmd, $stdout, $stderr, $result);
3029

3130
command_fails_like(
3231
[ "pg_dump", '-p', $port, '--include-foreign-data=s0', 'postgres' ],

src/bin/pg_dump/t/005_pg_dump_filterfile.pl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@
8181
#
8282
# Test interaction of correctly specified filter file
8383
#
84-
my ($cmd, $stdout, $stderr, $result);
8584

8685
# Empty filterfile
8786
open $inputfile, '>', "$tempdir/inputfile.txt"

src/test/modules/ldap_password_func/t/001_mutated_bindpasswd.pl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@
1212
use lib "$FindBin::RealBin/../../../ldap";
1313
use LdapServer;
1414

15-
my ($slapd, $ldap_bin_dir, $ldap_schema_dir);
16-
17-
$ldap_bin_dir = undef; # usually in PATH
18-
1915
if ($ENV{with_ldap} ne 'yes')
2016
{
2117
plan skip_all => 'LDAP not supported by this build';

src/test/modules/ssl_passphrase_callback/t/001_testfunc.pl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
plan skip_all => 'OpenSSL not supported by this build';
1616
}
1717

18-
my $clearpass = "FooBaR1";
1918
my $rot13pass = "SbbOnE1";
2019

2120
# see the Makefile for how the certificate and key have been generated

src/test/perl/PostgreSQL/Test/AdjustUpgrade.pm

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,6 @@ sub _mash_view_qualifiers
534534
{
535535
my @thischunks = split /;/, $chunk, 2;
536536
my $stmt = shift(@thischunks);
537-
my $ostmt = $stmt;
538537

539538
# now $stmt is just the body of the CREATE [MATERIALIZED] VIEW
540539
$stmt =~ s/$qualifier\.//g;

src/test/recovery/t/021_row_visibility.pl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@
168168
sub send_query_and_wait
169169
{
170170
my ($psql, $query, $untl) = @_;
171-
my $ret;
172171

173172
# send query
174173
$$psql{stdin} .= $query;

src/test/recovery/t/032_relfilenode_reuse.pl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,6 @@ sub cause_eviction
205205
sub send_query_and_wait
206206
{
207207
my ($psql, $query, $untl) = @_;
208-
my $ret;
209208

210209
# For each query we run, we'll restart the timeout. Otherwise the timeout
211210
# would apply to the whole test script, and would need to be set very high

src/test/recovery/t/035_standby_logical_decoding.pl

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@
1010
use PostgreSQL::Test::Utils;
1111
use Test::More;
1212

13-
my ($stdin, $stdout, $stderr,
14-
$cascading_stdout, $cascading_stderr, $subscriber_stdin,
15-
$subscriber_stdout, $subscriber_stderr, $ret,
16-
$handle, $slot);
13+
my ($stdout, $stderr, $cascading_stdout, $cascading_stderr, $handle);
1714

1815
my $node_primary = PostgreSQL::Test::Cluster->new('primary');
1916
my $node_standby = PostgreSQL::Test::Cluster->new('standby');

0 commit comments

Comments
 (0)