diff options
Diffstat (limited to 'src/bin/scripts/t/090_reindexdb.pl')
-rw-r--r-- | src/bin/scripts/t/090_reindexdb.pl | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/bin/scripts/t/090_reindexdb.pl b/src/bin/scripts/t/090_reindexdb.pl index 42628c25e2b..fd4eac347e1 100644 --- a/src/bin/scripts/t/090_reindexdb.pl +++ b/src/bin/scripts/t/090_reindexdb.pl @@ -1,5 +1,7 @@ use strict; use warnings; + +use PostgresNode; use TestLib; use Test::More tests => 20; @@ -7,35 +9,36 @@ program_help_ok('reindexdb'); program_version_ok('reindexdb'); program_options_handling_ok('reindexdb'); -my $tempdir = tempdir; -start_test_server $tempdir; +my $node = get_new_node(); +$node->init; +$node->start; $ENV{PGOPTIONS} = '--client-min-messages=WARNING'; -issues_sql_like( +$node->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( +$node->psql('postgres', + 'CREATE TABLE test1 (a int); CREATE INDEX test1x ON test1 (a);'); +$node->issues_sql_like( [ 'reindexdb', '-t', 'test1', 'postgres' ], qr/statement: REINDEX TABLE test1;/, 'reindex specific table'); -issues_sql_like( +$node->issues_sql_like( [ 'reindexdb', '-i', 'test1x', 'postgres' ], qr/statement: REINDEX INDEX test1x;/, 'reindex specific index'); -issues_sql_like( +$node->issues_sql_like( [ 'reindexdb', '-S', 'pg_catalog', 'postgres' ], qr/statement: REINDEX SCHEMA pg_catalog;/, 'reindex specific schema'); -issues_sql_like( +$node->issues_sql_like( [ 'reindexdb', '-s', 'postgres' ], qr/statement: REINDEX SYSTEM postgres;/, 'reindex system tables'); -issues_sql_like( +$node->issues_sql_like( [ 'reindexdb', '-v', '-t', 'test1', 'postgres' ], qr/statement: REINDEX \(VERBOSE\) TABLE test1;/, 'reindex with verbose output'); |