Debian Codegraph @

mysql-test/suite/rpl/t/rpl_create_database.test

raw
1 #
2 # Tests for replication of statements that manipulate databases.
3 #
4 # For this test file, we have a number of databases. All databases
5 # with "greek" names will be replicated on the slave, while other names
6 # (e.g., american) will not be replicated.
7 #
8
9 --source include/not_group_replication_plugin.inc
10 source include/master-slave.inc;
11
12 # Bug#6391 (binlog-do-db rules ignored)
13 # In this case, 'mysqltest_bob' should not be replicated to the slave.
14 --disable_warnings
15 DROP DATABASE IF EXISTS mysqltest_prometheus;
16 DROP DATABASE IF EXISTS mysqltest_sisyfos;
17 DROP DATABASE IF EXISTS mysqltest_bob;
18 --source include/sync_slave_sql_with_master.inc
19 # This database is not replicated
20 DROP DATABASE IF EXISTS mysqltest_bob;
21 --enable_warnings
22
23 connection master;
24 CREATE DATABASE mysqltest_prometheus;
25 CREATE DATABASE mysqltest_sisyfos;
26 CREATE DATABASE mysqltest_bob;
27
28 USE mysqltest_sisyfos;
29 # These should be replicated
30 CREATE TABLE t1 (b int);
31 INSERT INTO t1 VALUES(1);
32
33 USE mysqltest_bob;
34 # These should *not* be replicated
35 CREATE TABLE t2 (b int);
36 INSERT INTO t2 VALUES(2);
37
38 # Current database is now 'mysqltest_bob'
39 # The following should be replicated
40 ALTER DATABASE mysqltest_sisyfos CHARACTER SET latin1;
41
42 USE mysqltest_sisyfos;
43 # The following should *not* be replicated
44 ALTER DATABASE mysqltest_bob CHARACTER SET latin1;
45
46 SHOW DATABASES LIKE 'mysql%';
47 --source include/sync_slave_sql_with_master.inc
48 SHOW DATABASES LIKE 'mysql%';
49
50 connection master;
51 DROP DATABASE IF EXISTS mysqltest_sisyfos;
52 USE mysqltest_prometheus;
53 CREATE TABLE t1 (a INT);
54 INSERT INTO t1 VALUES (1);
55 CREATE DATABASE mysqltest_sisyfos;
56 USE mysqltest_sisyfos;
57 CREATE TABLE t2 (a INT);
58 let $VERSION=`select version()`;
59 SHOW DATABASES LIKE 'mysql%';
60 --source include/sync_slave_sql_with_master.inc
61 SHOW DATABASES LIKE 'mysql%';
62 USE mysqltest_prometheus;
63 SHOW TABLES;
64 USE mysqltest_sisyfos;
65 SHOW TABLES;
66
67 connection master;
68 DROP DATABASE IF EXISTS mysqltest_prometheus;
69 DROP DATABASE IF EXISTS mysqltest_sisyfos;
70 DROP DATABASE IF EXISTS mysqltest_bob;
71 --source include/sync_slave_sql_with_master.inc
72
73 # End of 4.1 tests
74 --source include/rpl_end.inc