1
# drizzledump_migrate.inc
2
# include file for the mysql_migrate suite of the Drizzle test-suite
3
# intended to assist with testing drizzledump's ability to migrate
4
# from MySQL databases.
7
# * Running MySQL database
8
# * ENVIRONMENT variables to be set
9
# - DRIZZLE_MYSQL_MIGRATE_TEST
10
# - DRIZZLE_MYSQL_MIGRATE_PORT
13
# * Send a specified file to be executed on the MySQL server
14
# - the file is expected to be valid SQL and should be
15
# CREATE TABLE / INSERTs to create something to migrate
16
# * Call drizzledump from the system under test to populate
18
# * Validation of the datasets via queries against Drizzle
19
# are left to the individual cases
21
# test if we should run this test, will skip if we don't have
22
# the environment variable set
24
--require r/true.require
25
SELECT VARIABLE_VALUE AS `TRUE` FROM DATA_DICTIONARY.ENVIRONMENTAL WHERE VARIABLE_NAME="DRIZZLE_MYSQL_MIGRATE_TEST";
29
eval DROP SCHEMA IF EXISTS $database;
32
# clean up our MySQL server
33
--echo Dropping test database on MySQL...
34
exec $DRIZZLE_CLIENT -uroot --port=$DRIZZLE_MYSQL_MIGRATE_PORT test -e "DROP SCHEMA IF EXISTS $database";
36
--echo Create test database on MySQL...
37
exec $DRIZZLE_CLIENT -uroot --port=$DRIZZLE_MYSQL_MIGRATE_PORT test -e "CREATE SCHEMA $database";
39
--echo populating MySQL with test data...
40
--echo $DRIZZLE_CLIENT -uroot --port=$DRIZZLE_MYSQL_MIGRATE_PORT $database < $datafile
41
exec $DRIZZLE_CLIENT -uroot --port=$DRIZZLE_MYSQL_MIGRATE_PORT $database < $datafile;
43
--echo calling drizzledump to populate Drizzle...
44
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 --destination-database=$database --user=root $database ;