1
# mysql_migrate.destination-database
2
# test of drizzledump's destination-database option
3
# We test with a different destination name than the
4
# source database and do positive and negative checks
6
let $datafile = $DRIZZLETEST_VARDIR/std_data_ln/mysqlmigrate_basic.dat;
7
let $orig_database = drizzledump_migrate_test_orig;
8
let $dest_database = drizzledump_migrate_test_dest;
10
# test if we should run this test, will skip if we don't have
11
# the environment variable set
13
--require r/true.require
14
SELECT VARIABLE_VALUE AS `TRUE` FROM DATA_DICTIONARY.ENVIRONMENTAL WHERE VARIABLE_NAME="DRIZZLE_MYSQL_MIGRATE_TEST";
18
eval DROP SCHEMA IF EXISTS $orig_database;
19
eval DROP SCHEMA IF EXISTS $dest_database;
22
# clean up our MySQL server
23
--echo Dropping test database on MySQL...
24
exec $DRIZZLE_CLIENT -uroot --port=$DRIZZLE_MYSQL_MIGRATE_PORT test -e "DROP SCHEMA IF EXISTS $orig_database";
26
--echo Create test database on MySQL...
27
exec $DRIZZLE_CLIENT -uroot --port=$DRIZZLE_MYSQL_MIGRATE_PORT test -e "CREATE SCHEMA $orig_database";
29
--echo populating MySQL with test data...
30
exec $DRIZZLE_CLIENT -uroot --port=$DRIZZLE_MYSQL_MIGRATE_PORT $orig_database < $datafile;
32
--echo calling drizzledump to populate Drizzle...
34
exec $DRIZZLE_DUMP_CLIENT --compact --host=127.0.0.1 --port=$DRIZZLE_MYSQL_MIGRATE_PORT --destination-type=database --destination-host=localhost --destination-port=$MASTER_MYPORT --destination-user=root --user=root --destination-database=$dest_database $orig_database ;
36
--echo see our schemas
39
--echo test our table:
40
--echo Make sure our tables don't exist under the orig. name
41
eval SHOW CREATE TABLE $orig_database.t1;
44
eval SELECT * FROM $orig_database.t1;
46
--echo Check if they are in our new location
47
eval SHOW CREATE TABLE $dest_database.t1;
49
eval SELECT * FROM $dest_database.t1;
51
# clean up our MySQL server
52
--echo Dropping test database on MySQL...
53
exec $DRIZZLE_CLIENT -uroot --port=$DRIZZLE_MYSQL_MIGRATE_PORT test -e "DROP SCHEMA IF EXISTS $orig_database";
55
eval DROP SCHEMA $dest_database;