mirror of https://github.com/postgres/postgres
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
This commit is contained in:
parent
978f38c771
commit
0c1aca4614
|
@ -9,7 +9,7 @@ use PostgreSQL::Test::Utils;
|
|||
|
||||
use Test::More;
|
||||
|
||||
my ($node, $result);
|
||||
my $node;
|
||||
|
||||
#
|
||||
# Test set-up
|
||||
|
@ -87,19 +87,6 @@ sub relation_filepath
|
|||
return "$pgdata/$rel";
|
||||
}
|
||||
|
||||
# Returns the fully qualified name of the toast table for the named relation
|
||||
sub get_toast_for
|
||||
{
|
||||
my ($relname) = @_;
|
||||
|
||||
return $node->safe_psql(
|
||||
'postgres', qq(
|
||||
SELECT 'pg_toast.' || t.relname
|
||||
FROM pg_catalog.pg_class c, pg_catalog.pg_class t
|
||||
WHERE c.relname = '$relname'
|
||||
AND c.reltoastrelid = t.oid));
|
||||
}
|
||||
|
||||
# (Re)create and populate a test table of the given name.
|
||||
sub fresh_test_table
|
||||
{
|
||||
|
|
|
@ -10,7 +10,7 @@ use PostgreSQL::Test::Utils;
|
|||
|
||||
use Test::More;
|
||||
|
||||
my ($node, $result);
|
||||
my $node;
|
||||
|
||||
#
|
||||
# Test set-up
|
||||
|
|
|
@ -42,8 +42,6 @@ my @abi_compatibility_lines;
|
|||
my @lines;
|
||||
my $abi_compatibility = 0;
|
||||
my $section_name;
|
||||
my $note;
|
||||
my $note_name;
|
||||
|
||||
# Remove comments and empty lines and add waitclassname based on the section
|
||||
while (<$wait_event_names>)
|
||||
|
|
|
@ -26,7 +26,6 @@ $node->safe_psql('postgres', "CREATE SERVER s1 FOREIGN DATA WRAPPER dummy");
|
|||
$node->safe_psql('postgres', "CREATE SERVER s2 FOREIGN DATA WRAPPER dummy");
|
||||
$node->safe_psql('postgres', "CREATE FOREIGN TABLE t0 (a int) SERVER s0");
|
||||
$node->safe_psql('postgres', "CREATE FOREIGN TABLE t1 (a int) SERVER s1");
|
||||
my ($cmd, $stdout, $stderr, $result);
|
||||
|
||||
command_fails_like(
|
||||
[ "pg_dump", '-p', $port, '--include-foreign-data=s0', 'postgres' ],
|
||||
|
|
|
@ -81,7 +81,6 @@ $node->safe_psql('sourcedb',
|
|||
#
|
||||
# Test interaction of correctly specified filter file
|
||||
#
|
||||
my ($cmd, $stdout, $stderr, $result);
|
||||
|
||||
# Empty filterfile
|
||||
open $inputfile, '>', "$tempdir/inputfile.txt"
|
||||
|
|
|
@ -12,10 +12,6 @@ use Test::More;
|
|||
use lib "$FindBin::RealBin/../../../ldap";
|
||||
use LdapServer;
|
||||
|
||||
my ($slapd, $ldap_bin_dir, $ldap_schema_dir);
|
||||
|
||||
$ldap_bin_dir = undef; # usually in PATH
|
||||
|
||||
if ($ENV{with_ldap} ne 'yes')
|
||||
{
|
||||
plan skip_all => 'LDAP not supported by this build';
|
||||
|
|
|
@ -15,7 +15,6 @@ unless (($ENV{with_ssl} || "") eq 'openssl')
|
|||
plan skip_all => 'OpenSSL not supported by this build';
|
||||
}
|
||||
|
||||
my $clearpass = "FooBaR1";
|
||||
my $rot13pass = "SbbOnE1";
|
||||
|
||||
# see the Makefile for how the certificate and key have been generated
|
||||
|
|
|
@ -534,7 +534,6 @@ sub _mash_view_qualifiers
|
|||
{
|
||||
my @thischunks = split /;/, $chunk, 2;
|
||||
my $stmt = shift(@thischunks);
|
||||
my $ostmt = $stmt;
|
||||
|
||||
# now $stmt is just the body of the CREATE [MATERIALIZED] VIEW
|
||||
$stmt =~ s/$qualifier\.//g;
|
||||
|
|
|
@ -168,7 +168,6 @@ $node_standby->stop;
|
|||
sub send_query_and_wait
|
||||
{
|
||||
my ($psql, $query, $untl) = @_;
|
||||
my $ret;
|
||||
|
||||
# send query
|
||||
$$psql{stdin} .= $query;
|
||||
|
|
|
@ -205,7 +205,6 @@ sub cause_eviction
|
|||
sub send_query_and_wait
|
||||
{
|
||||
my ($psql, $query, $untl) = @_;
|
||||
my $ret;
|
||||
|
||||
# For each query we run, we'll restart the timeout. Otherwise the timeout
|
||||
# would apply to the whole test script, and would need to be set very high
|
||||
|
|
|
@ -10,10 +10,7 @@ use PostgreSQL::Test::Cluster;
|
|||
use PostgreSQL::Test::Utils;
|
||||
use Test::More;
|
||||
|
||||
my ($stdin, $stdout, $stderr,
|
||||
$cascading_stdout, $cascading_stderr, $subscriber_stdin,
|
||||
$subscriber_stdout, $subscriber_stderr, $ret,
|
||||
$handle, $slot);
|
||||
my ($stdout, $stderr, $cascading_stdout, $cascading_stderr, $handle);
|
||||
|
||||
my $node_primary = PostgreSQL::Test::Cluster->new('primary');
|
||||
my $node_standby = PostgreSQL::Test::Cluster->new('standby');
|
||||
|
|
Loading…
Reference in New Issue