Commit 0b3cfbc2 authored by Matthieu Muffato's avatar Matthieu Muffato
Browse files

Since sqlite databases are dropped with "rm -f", the command doesn't fail

parent 16ae937a
......@@ -48,7 +48,11 @@ my $dbc = $hive_dba->dbc();
system( $ENV{'EHIVE_ROOT_DIR'}.'/scripts/db_cmd.pl', '-url', $pipeline_url, '-sql', 'DROP DATABASE' );
is(system( $ENV{'EHIVE_ROOT_DIR'}.'/scripts/db_cmd.pl', '-url', $pipeline_url, '-sql', 'DROP DATABASE IF EXISTS' ), 0, "Don't complain if asked to drop a database that doesn't exist");
is(system( $ENV{'EHIVE_ROOT_DIR'}.'/scripts/db_cmd.pl', '-url', $pipeline_url, '-sql', 'DROP DATABASE' ), 256, "Cannot drop a database that doesn't exist");
if ($dbc->driver ne 'sqlite') {
is(system( $ENV{'EHIVE_ROOT_DIR'}.'/scripts/db_cmd.pl', '-url', $pipeline_url, '-sql', 'DROP DATABASE' ), 256, "Cannot drop a database that doesn't exist");
} else {
is(system( $ENV{'EHIVE_ROOT_DIR'}.'/scripts/db_cmd.pl', '-url', $pipeline_url, '-sql', 'DROP DATABASE' ), 0, "Cannot drop a database that doesn't exist");
}
is(system( $ENV{'EHIVE_ROOT_DIR'}.'/scripts/db_cmd.pl', '-url', $pipeline_url, '-sql', 'CREATE DATABASE' ), 0, 'Can create a database');
is(system( $ENV{'EHIVE_ROOT_DIR'}.'/scripts/db_cmd.pl', '-url', $pipeline_url, '-sql', 'CREATE DATABASE IF NOT EXISTS' ), 0, 'Further CREATE DATABASE statements are ignored') unless $dbc->driver eq 'pgsql';
is(system( $ENV{'EHIVE_ROOT_DIR'}.'/scripts/db_cmd.pl', '-url', $pipeline_url, '-sql', 'DROP DATABASE' ), 0, "Can drop a database that exists");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment