2
# Tests for replication of statements that manipulate databases.
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.
9
source include/master-slave.inc;
11
# Bug#6391 (binlog-do-db rules ignored)
12
# In this case, 'mysqltest_bob' should not be replicated to the slave.
14
DROP DATABASE IF EXISTS mysqltest_prometheus;
15
DROP DATABASE IF EXISTS mysqltest_sisyfos;
16
DROP DATABASE IF EXISTS mysqltest_bob;
17
sync_slave_with_master;
18
# This database is not replicated
19
DROP DATABASE IF EXISTS mysqltest_bob;
23
CREATE DATABASE mysqltest_prometheus;
24
CREATE DATABASE mysqltest_sisyfos;
25
CREATE DATABASE mysqltest_bob;
27
USE mysqltest_sisyfos;
28
# These should be replicated
29
CREATE TABLE t1 (b int);
30
INSERT INTO t1 VALUES(1);
33
# These should *not* be replicated
34
CREATE TABLE t2 (b int);
35
INSERT INTO t2 VALUES(2);
37
# Current database is now 'mysqltest_bob'
38
# The following should be replicated
39
ALTER DATABASE mysqltest_sisyfos CHARACTER SET latin1;
41
USE mysqltest_sisyfos;
42
# The following should *not* be replicated
43
ALTER DATABASE mysqltest_bob CHARACTER SET latin1;
45
SHOW DATABASES LIKE 'mysql%';
46
sync_slave_with_master;
47
SHOW DATABASES LIKE 'mysql%';
50
DROP DATABASE IF EXISTS mysqltest_sisyfos;
51
USE mysqltest_prometheus;
52
CREATE TABLE t1 (a INT);
53
INSERT INTO t1 VALUES (1);
54
CREATE DATABASE mysqltest_sisyfos;
55
USE mysqltest_sisyfos;
56
CREATE TABLE t2 (a INT);
57
let $VERSION=`select version()`;
58
SHOW DATABASES LIKE 'mysql%';
59
sync_slave_with_master;
60
SHOW DATABASES LIKE 'mysql%';
61
USE mysqltest_prometheus;
63
USE mysqltest_sisyfos;
67
DROP DATABASE IF EXISTS mysqltest_prometheus;
68
DROP DATABASE IF EXISTS mysqltest_sisyfos;
69
DROP DATABASE IF EXISTS mysqltest_bob;
70
sync_slave_with_master;