diff options
author | Bruce Momjian | 2014-05-06 16:12:18 +0000 |
---|---|---|
committer | Bruce Momjian | 2014-05-06 16:12:18 +0000 |
commit | 0a7832005792fa6dad171f9cadb8d587fe0dd800 (patch) | |
tree | 365cfc42c521a52607e41394b08ef44d338d8fc1 /src/bin/scripts | |
parent | fb85cd4320414c3f6e9c8bc69ec944200ae1e493 (diff) |
pgindent run for 9.4
This includes removing tabs after periods in C comments, which was
applied to back branches, so this change should not effect backpatching.
Diffstat (limited to 'src/bin/scripts')
-rw-r--r-- | src/bin/scripts/common.c | 2 | ||||
-rw-r--r-- | src/bin/scripts/createuser.c | 1 | ||||
-rw-r--r-- | src/bin/scripts/pg_isready.c | 2 | ||||
-rw-r--r-- | src/bin/scripts/t/010_clusterdb.pl | 16 | ||||
-rw-r--r-- | src/bin/scripts/t/011_clusterdb_all.pl | 5 | ||||
-rw-r--r-- | src/bin/scripts/t/020_createdb.pl | 12 | ||||
-rw-r--r-- | src/bin/scripts/t/030_createlang.pl | 12 | ||||
-rw-r--r-- | src/bin/scripts/t/040_createuser.pl | 30 | ||||
-rw-r--r-- | src/bin/scripts/t/050_dropdb.pl | 7 | ||||
-rw-r--r-- | src/bin/scripts/t/060_droplang.pl | 9 | ||||
-rw-r--r-- | src/bin/scripts/t/070_dropuser.pl | 7 | ||||
-rw-r--r-- | src/bin/scripts/t/090_reindexdb.pl | 23 | ||||
-rw-r--r-- | src/bin/scripts/t/091_reindexdb_all.pl | 5 | ||||
-rw-r--r-- | src/bin/scripts/t/100_vacuumdb.pl | 25 | ||||
-rw-r--r-- | src/bin/scripts/t/101_vacuumdb_all.pl | 5 | ||||
-rw-r--r-- | src/bin/scripts/t/102_vacuumdb_stages.pl | 7 | ||||
-rw-r--r-- | src/bin/scripts/vacuumdb.c | 10 |
17 files changed, 126 insertions, 52 deletions
diff --git a/src/bin/scripts/common.c b/src/bin/scripts/common.c index 7a7e8d9fdcc..311fed5090b 100644 --- a/src/bin/scripts/common.c +++ b/src/bin/scripts/common.c @@ -244,7 +244,7 @@ executeMaintenanceCommand(PGconn *conn, const char *query, bool echo) } /* - * Check yes/no answer in a localized way. 1=yes, 0=no, -1=neither. + * Check yes/no answer in a localized way. 1=yes, 0=no, -1=neither. */ /* translator: abbreviation for "yes" */ diff --git a/src/bin/scripts/createuser.c b/src/bin/scripts/createuser.c index 24c4beb2437..2d49bc2f1e8 100644 --- a/src/bin/scripts/createuser.c +++ b/src/bin/scripts/createuser.c @@ -310,6 +310,7 @@ main(int argc, char *argv[]) if (roles.head != NULL) { SimpleStringListCell *cell; + appendPQExpBufferStr(&sql, " IN ROLE "); for (cell = roles.head; cell; cell = cell->next) diff --git a/src/bin/scripts/pg_isready.c b/src/bin/scripts/pg_isready.c index e1fbc544969..7707bf13ea1 100644 --- a/src/bin/scripts/pg_isready.c +++ b/src/bin/scripts/pg_isready.c @@ -41,7 +41,7 @@ main(int argc, char **argv) bool quiet = false; - PGPing rv; + PGPing rv; PQconninfoOption *opts = NULL; PQconninfoOption *defs = NULL; PQconninfoOption *opt; diff --git a/src/bin/scripts/t/010_clusterdb.pl b/src/bin/scripts/t/010_clusterdb.pl index 371b2dd2d3d..fe22cdbb4e4 100644 --- a/src/bin/scripts/t/010_clusterdb.pl +++ b/src/bin/scripts/t/010_clusterdb.pl @@ -10,9 +10,17 @@ program_options_handling_ok('clusterdb'); my $tempdir = tempdir; start_test_server $tempdir; -issues_sql_like(['clusterdb', 'postgres'], qr/statement: CLUSTER;/, 'SQL CLUSTER run'); +issues_sql_like( + [ 'clusterdb', 'postgres' ], + qr/statement: CLUSTER;/, + 'SQL CLUSTER run'); -command_fails(['clusterdb', '-t', 'nonexistent', 'postgres'], 'fails with nonexistent table'); +command_fails([ 'clusterdb', '-t', 'nonexistent', 'postgres' ], + 'fails with nonexistent table'); -psql 'postgres', 'CREATE TABLE test1 (a int); CREATE INDEX test1x ON test1 (a); CLUSTER test1 USING test1x'; -issues_sql_like(['clusterdb', 'postgres', '-t', 'test1'], qr/statement: CLUSTER test1;/, 'cluster specific table'); +psql 'postgres', +'CREATE TABLE test1 (a int); CREATE INDEX test1x ON test1 (a); CLUSTER test1 USING test1x'; +issues_sql_like( + [ 'clusterdb', 'postgres', '-t', 'test1' ], + qr/statement: CLUSTER test1;/, + 'cluster specific table'); diff --git a/src/bin/scripts/t/011_clusterdb_all.pl b/src/bin/scripts/t/011_clusterdb_all.pl index 304c4befa55..eb2016497e3 100644 --- a/src/bin/scripts/t/011_clusterdb_all.pl +++ b/src/bin/scripts/t/011_clusterdb_all.pl @@ -6,4 +6,7 @@ use Test::More tests => 1; my $tempdir = tempdir; start_test_server $tempdir; -issues_sql_like(['clusterdb', '-a'], qr/statement: CLUSTER.*statement: CLUSTER/s, 'cluster all databases'); +issues_sql_like( + [ 'clusterdb', '-a' ], + qr/statement: CLUSTER.*statement: CLUSTER/s, + 'cluster all databases'); diff --git a/src/bin/scripts/t/020_createdb.pl b/src/bin/scripts/t/020_createdb.pl index 8b82a2bd96c..a8e8f3b4d12 100644 --- a/src/bin/scripts/t/020_createdb.pl +++ b/src/bin/scripts/t/020_createdb.pl @@ -10,7 +10,13 @@ program_options_handling_ok('createdb'); my $tempdir = tempdir; start_test_server $tempdir; -issues_sql_like(['createdb', 'foobar1'], qr/statement: CREATE DATABASE foobar1/, 'SQL CREATE DATABASE run'); -issues_sql_like(['createdb', 'foobar2', '-l', 'C', '-E', 'LATIN1', '-T', 'template0'], qr/statement: CREATE DATABASE foobar2 ENCODING 'LATIN1'/, 'create database with encoding'); +issues_sql_like( + [ 'createdb', 'foobar1' ], + qr/statement: CREATE DATABASE foobar1/, + 'SQL CREATE DATABASE run'); +issues_sql_like( + [ 'createdb', 'foobar2', '-l', 'C', '-E', 'LATIN1', '-T', 'template0' ], + qr/statement: CREATE DATABASE foobar2 ENCODING 'LATIN1'/, + 'create database with encoding'); -command_fails(['createdb', 'foobar1'], 'fails if database already exists'); +command_fails([ 'createdb', 'foobar1' ], 'fails if database already exists'); diff --git a/src/bin/scripts/t/030_createlang.pl b/src/bin/scripts/t/030_createlang.pl index 9a87f4c89c6..292021611b6 100644 --- a/src/bin/scripts/t/030_createlang.pl +++ b/src/bin/scripts/t/030_createlang.pl @@ -10,9 +10,15 @@ program_options_handling_ok('createlang'); my $tempdir = tempdir; start_test_server $tempdir; -command_fails(['createlang', 'plpgsql', 'postgres'], 'fails if language already exists'); +command_fails( + [ 'createlang', 'plpgsql', 'postgres' ], + 'fails if language already exists'); psql 'postgres', 'DROP EXTENSION plpgsql'; -issues_sql_like(['createlang', 'plpgsql', 'postgres'], qr/statement: CREATE EXTENSION "plpgsql"/, 'SQL CREATE EXTENSION run'); +issues_sql_like( + [ 'createlang', 'plpgsql', 'postgres' ], + qr/statement: CREATE EXTENSION "plpgsql"/, + 'SQL CREATE EXTENSION run'); -command_like(['createlang', '--list', 'postgres'], qr/plpgsql/, 'list output'); +command_like([ 'createlang', '--list', 'postgres' ], + qr/plpgsql/, 'list output'); diff --git a/src/bin/scripts/t/040_createuser.pl b/src/bin/scripts/t/040_createuser.pl index 922873ab374..8837c2b6e99 100644 --- a/src/bin/scripts/t/040_createuser.pl +++ b/src/bin/scripts/t/040_createuser.pl @@ -10,17 +10,21 @@ program_options_handling_ok('createuser'); my $tempdir = tempdir; start_test_server $tempdir; -issues_sql_like(['createuser', 'user1'], - qr/statement: CREATE ROLE user1 NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT LOGIN;/, - 'SQL CREATE USER run'); -issues_sql_like(['createuser', '-L', 'role1'], - qr/statement: CREATE ROLE role1 NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT NOLOGIN;/, - 'create a non-login role'); -issues_sql_like(['createuser', '-r', 'user2'], - qr/statement: CREATE ROLE user2 NOSUPERUSER NOCREATEDB CREATEROLE INHERIT LOGIN;/, - 'create a CREATEROLE user'); -issues_sql_like(['createuser', '-s', 'user3'], - qr/statement: CREATE ROLE user3 SUPERUSER CREATEDB CREATEROLE INHERIT LOGIN;/, - 'create a superuser'); +issues_sql_like( + [ 'createuser', 'user1' ], +qr/statement: CREATE ROLE user1 NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT LOGIN;/, + 'SQL CREATE USER run'); +issues_sql_like( + [ 'createuser', '-L', 'role1' ], +qr/statement: CREATE ROLE role1 NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT NOLOGIN;/, + 'create a non-login role'); +issues_sql_like( + [ 'createuser', '-r', 'user2' ], +qr/statement: CREATE ROLE user2 NOSUPERUSER NOCREATEDB CREATEROLE INHERIT LOGIN;/, + 'create a CREATEROLE user'); +issues_sql_like( + [ 'createuser', '-s', 'user3' ], +qr/statement: CREATE ROLE user3 SUPERUSER CREATEDB CREATEROLE INHERIT LOGIN;/, + 'create a superuser'); -command_fails(['createuser', 'user1'], 'fails if role already exists'); +command_fails([ 'createuser', 'user1' ], 'fails if role already exists'); diff --git a/src/bin/scripts/t/050_dropdb.pl b/src/bin/scripts/t/050_dropdb.pl index 3662dd01c1d..04a8789d887 100644 --- a/src/bin/scripts/t/050_dropdb.pl +++ b/src/bin/scripts/t/050_dropdb.pl @@ -11,6 +11,9 @@ my $tempdir = tempdir; start_test_server $tempdir; psql 'postgres', 'CREATE DATABASE foobar1'; -issues_sql_like(['dropdb', 'foobar1'], qr/statement: DROP DATABASE foobar1/, 'SQL DROP DATABASE run'); +issues_sql_like( + [ 'dropdb', 'foobar1' ], + qr/statement: DROP DATABASE foobar1/, + 'SQL DROP DATABASE run'); -command_fails(['dropdb', 'nonexistent'], 'fails with nonexistent database'); +command_fails([ 'dropdb', 'nonexistent' ], 'fails with nonexistent database'); diff --git a/src/bin/scripts/t/060_droplang.pl b/src/bin/scripts/t/060_droplang.pl index 47cb48f1171..09fb2f3b077 100644 --- a/src/bin/scripts/t/060_droplang.pl +++ b/src/bin/scripts/t/060_droplang.pl @@ -10,6 +10,11 @@ program_options_handling_ok('droplang'); my $tempdir = tempdir; start_test_server $tempdir; -issues_sql_like(['droplang', 'plpgsql', 'postgres'], qr/statement: DROP EXTENSION "plpgsql"/, 'SQL DROP EXTENSION run'); +issues_sql_like( + [ 'droplang', 'plpgsql', 'postgres' ], + qr/statement: DROP EXTENSION "plpgsql"/, + 'SQL DROP EXTENSION run'); -command_fails(['droplang', 'nonexistent', 'postgres'], 'fails with nonexistent language'); +command_fails( + [ 'droplang', 'nonexistent', 'postgres' ], + 'fails with nonexistent language'); diff --git a/src/bin/scripts/t/070_dropuser.pl b/src/bin/scripts/t/070_dropuser.pl index 495636ae846..9e0587d68f9 100644 --- a/src/bin/scripts/t/070_dropuser.pl +++ b/src/bin/scripts/t/070_dropuser.pl @@ -11,6 +11,9 @@ my $tempdir = tempdir; start_test_server $tempdir; psql 'postgres', 'CREATE ROLE foobar1'; -issues_sql_like(['dropuser', 'foobar1'], qr/statement: DROP ROLE foobar1/, 'SQL DROP ROLE run'); +issues_sql_like( + [ 'dropuser', 'foobar1' ], + qr/statement: DROP ROLE foobar1/, + 'SQL DROP ROLE run'); -command_fails(['dropuser', 'nonexistent'], 'fails with nonexistent user'); +command_fails([ 'dropuser', 'nonexistent' ], 'fails with nonexistent user'); diff --git a/src/bin/scripts/t/090_reindexdb.pl b/src/bin/scripts/t/090_reindexdb.pl index 18756e86aac..24b927ce223 100644 --- a/src/bin/scripts/t/090_reindexdb.pl +++ b/src/bin/scripts/t/090_reindexdb.pl @@ -12,10 +12,23 @@ start_test_server $tempdir; $ENV{PGOPTIONS} = '--client-min-messages=WARNING'; -issues_sql_like(['reindexdb', 'postgres'], qr/statement: REINDEX DATABASE postgres;/, 'SQL REINDEX run'); +issues_sql_like( + [ 'reindexdb', 'postgres' ], + qr/statement: REINDEX DATABASE postgres;/, + 'SQL REINDEX run'); -psql 'postgres', 'CREATE TABLE test1 (a int); CREATE INDEX test1x ON test1 (a);'; -issues_sql_like(['reindexdb', 'postgres', '-t', 'test1'], qr/statement: REINDEX TABLE test1;/, 'reindex specific table'); -issues_sql_like(['reindexdb', 'postgres', '-i', 'test1x'], qr/statement: REINDEX INDEX test1x;/, 'reindex specific index'); +psql 'postgres', + 'CREATE TABLE test1 (a int); CREATE INDEX test1x ON test1 (a);'; +issues_sql_like( + [ 'reindexdb', 'postgres', '-t', 'test1' ], + qr/statement: REINDEX TABLE test1;/, + 'reindex specific table'); +issues_sql_like( + [ 'reindexdb', 'postgres', '-i', 'test1x' ], + qr/statement: REINDEX INDEX test1x;/, + 'reindex specific index'); -issues_sql_like(['reindexdb', 'postgres', '-s'], qr/statement: REINDEX SYSTEM postgres;/, 'reindex system tables'); +issues_sql_like( + [ 'reindexdb', 'postgres', '-s' ], + qr/statement: REINDEX SYSTEM postgres;/, + 'reindex system tables'); diff --git a/src/bin/scripts/t/091_reindexdb_all.pl b/src/bin/scripts/t/091_reindexdb_all.pl index eee8ba8ed9c..6c5c59e7492 100644 --- a/src/bin/scripts/t/091_reindexdb_all.pl +++ b/src/bin/scripts/t/091_reindexdb_all.pl @@ -8,4 +8,7 @@ start_test_server $tempdir; $ENV{PGOPTIONS} = '--client-min-messages=WARNING'; -issues_sql_like(['reindexdb', '-a'], qr/statement: REINDEX.*statement: REINDEX/s, 'reindex all databases'); +issues_sql_like( + [ 'reindexdb', '-a' ], + qr/statement: REINDEX.*statement: REINDEX/s, + 'reindex all databases'); diff --git a/src/bin/scripts/t/100_vacuumdb.pl b/src/bin/scripts/t/100_vacuumdb.pl index 39f1cec8a14..78a40fa791a 100644 --- a/src/bin/scripts/t/100_vacuumdb.pl +++ b/src/bin/scripts/t/100_vacuumdb.pl @@ -10,8 +10,23 @@ program_options_handling_ok('vacuumdb'); my $tempdir = tempdir; start_test_server $tempdir; -issues_sql_like(['vacuumdb', 'postgres'], qr/statement: VACUUM;/, 'SQL VACUUM run'); -issues_sql_like(['vacuumdb', '-f', 'postgres'], qr/statement: VACUUM \(FULL\);/, 'vacuumdb -f'); -issues_sql_like(['vacuumdb', '-F', 'postgres'], qr/statement: VACUUM \(FREEZE\);/, 'vacuumdb -F'); -issues_sql_like(['vacuumdb', '-z', 'postgres'], qr/statement: VACUUM \(ANALYZE\);/, 'vacuumdb -z'); -issues_sql_like(['vacuumdb', '-Z', 'postgres'], qr/statement: ANALYZE;/, 'vacuumdb -z'); +issues_sql_like( + [ 'vacuumdb', 'postgres' ], + qr/statement: VACUUM;/, + 'SQL VACUUM run'); +issues_sql_like( + [ 'vacuumdb', '-f', 'postgres' ], + qr/statement: VACUUM \(FULL\);/, + 'vacuumdb -f'); +issues_sql_like( + [ 'vacuumdb', '-F', 'postgres' ], + qr/statement: VACUUM \(FREEZE\);/, + 'vacuumdb -F'); +issues_sql_like( + [ 'vacuumdb', '-z', 'postgres' ], + qr/statement: VACUUM \(ANALYZE\);/, + 'vacuumdb -z'); +issues_sql_like( + [ 'vacuumdb', '-Z', 'postgres' ], + qr/statement: ANALYZE;/, + 'vacuumdb -z'); diff --git a/src/bin/scripts/t/101_vacuumdb_all.pl b/src/bin/scripts/t/101_vacuumdb_all.pl index b5779bcf12c..f2120e0bff3 100644 --- a/src/bin/scripts/t/101_vacuumdb_all.pl +++ b/src/bin/scripts/t/101_vacuumdb_all.pl @@ -6,4 +6,7 @@ use Test::More tests => 1; my $tempdir = tempdir; start_test_server $tempdir; -issues_sql_like(['vacuumdb', '-a'], qr/statement: VACUUM.*statement: VACUUM/s, 'vacuum all databases'); +issues_sql_like( + [ 'vacuumdb', '-a' ], + qr/statement: VACUUM.*statement: VACUUM/s, + 'vacuum all databases'); diff --git a/src/bin/scripts/t/102_vacuumdb_stages.pl b/src/bin/scripts/t/102_vacuumdb_stages.pl index 743743edba5..4b032d3abac 100644 --- a/src/bin/scripts/t/102_vacuumdb_stages.pl +++ b/src/bin/scripts/t/102_vacuumdb_stages.pl @@ -6,11 +6,12 @@ use Test::More tests => 1; my $tempdir = tempdir; start_test_server $tempdir; -issues_sql_like(['vacuumdb', '--analyze-in-stages', 'postgres'], - qr/.*statement:\ SET\ default_statistics_target=1;\ SET\ vacuum_cost_delay=0; +issues_sql_like( + [ 'vacuumdb', '--analyze-in-stages', 'postgres' ], +qr/.*statement:\ SET\ default_statistics_target=1;\ SET\ vacuum_cost_delay=0; .*statement:\ ANALYZE.* .*statement:\ SET\ default_statistics_target=10;\ RESET\ vacuum_cost_delay; .*statement:\ ANALYZE.* .*statement:\ RESET\ default_statistics_target; .*statement:\ ANALYZE/sx, - 'analyze three times'); + 'analyze three times'); diff --git a/src/bin/scripts/vacuumdb.c b/src/bin/scripts/vacuumdb.c index 1e288ef978c..0cfe5b0bc95 100644 --- a/src/bin/scripts/vacuumdb.c +++ b/src/bin/scripts/vacuumdb.c @@ -16,7 +16,7 @@ static void vacuum_one_database(const char *dbname, bool full, bool verbose, - bool and_analyze, bool analyze_only, bool analyze_in_stages, bool freeze, + bool and_analyze, bool analyze_only, bool analyze_in_stages, bool freeze, const char *table, const char *host, const char *port, const char *username, enum trivalue prompt_password, const char *progname, bool echo); @@ -254,7 +254,7 @@ run_vacuum_command(PGconn *conn, const char *sql, bool echo, const char *dbname, static void vacuum_one_database(const char *dbname, bool full, bool verbose, bool and_analyze, - bool analyze_only, bool analyze_in_stages, bool freeze, const char *table, + bool analyze_only, bool analyze_in_stages, bool freeze, const char *table, const char *host, const char *port, const char *username, enum trivalue prompt_password, const char *progname, bool echo) @@ -334,7 +334,7 @@ vacuum_one_database(const char *dbname, bool full, bool verbose, bool and_analyz gettext_noop("Generating medium optimizer statistics (10 targets)"), gettext_noop("Generating default (full) optimizer statistics") }; - int i; + int i; for (i = 0; i < 3; i++) { @@ -353,7 +353,7 @@ vacuum_one_database(const char *dbname, bool full, bool verbose, bool and_analyz static void vacuum_all_databases(bool full, bool verbose, bool and_analyze, bool analyze_only, - bool analyze_in_stages, bool freeze, const char *maintenance_db, + bool analyze_in_stages, bool freeze, const char *maintenance_db, const char *host, const char *port, const char *username, enum trivalue prompt_password, const char *progname, bool echo, bool quiet) @@ -406,7 +406,7 @@ help(const char *progname) printf(_(" -z, --analyze update optimizer statistics\n")); printf(_(" -Z, --analyze-only only update optimizer statistics\n")); printf(_(" --analyze-in-stages only update optimizer statistics, in multiple\n" - " stages for faster results\n")); + " stages for faster results\n")); printf(_(" -?, --help show this help, then exit\n")); printf(_("\nConnection options:\n")); printf(_(" -h, --host=HOSTNAME database server host or socket directory\n")); |