~clint-fewbar/drizzle/regex-policy-cache-limiter

« back to all changes in this revision

Viewing changes to tests/suite/mysql_migrate/t/destination-database.test

  • Committer: Clint Byrum
  • Date: 2012-03-15 18:05:43 UTC
  • mfrom: (2224.1.302 workspace)
  • Revision ID: clint@ubuntu.com-20120315180543-9jxxm4q10k3np2ws
merging with latest trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
5
 
 
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;
 
9
 
 
10
# test if we should run this test, will skip if we don't have
 
11
# the environment variable set
 
12
--disable_query_log
 
13
--require r/true.require
 
14
SELECT VARIABLE_VALUE AS `TRUE` FROM DATA_DICTIONARY.ENVIRONMENTAL WHERE VARIABLE_NAME="DRIZZLE_MYSQL_MIGRATE_TEST";
 
15
--enable_query_log
 
16
 
 
17
--disable_warnings
 
18
eval DROP SCHEMA IF EXISTS $orig_database;
 
19
eval DROP SCHEMA IF EXISTS $dest_database;
 
20
--enable_warnings
 
21
 
 
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";
 
25
 
 
26
--echo Create test database on MySQL...
 
27
exec $DRIZZLE_CLIENT -uroot --port=$DRIZZLE_MYSQL_MIGRATE_PORT test -e "CREATE SCHEMA $orig_database";
 
28
 
 
29
--echo populating MySQL with test data...
 
30
exec $DRIZZLE_CLIENT -uroot --port=$DRIZZLE_MYSQL_MIGRATE_PORT $orig_database < $datafile;
 
31
 
 
32
--echo calling drizzledump to populate Drizzle...
 
33
 
 
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 ;
 
35
 
 
36
--echo see our schemas
 
37
SHOW SCHEMAS;
 
38
 
 
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;
 
42
 
 
43
--error 1146
 
44
eval SELECT * FROM $orig_database.t1;
 
45
 
 
46
--echo Check if they are in our new location
 
47
eval SHOW CREATE TABLE $dest_database.t1;
 
48
 
 
49
eval SELECT * FROM $dest_database.t1;
 
50
 
 
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";
 
54
 
 
55
eval DROP SCHEMA $dest_database;
 
56