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
9source include/master-slave.inc;
10
11# Bug#6391 (binlog-do-db rules ignored)
12# In this case, 'mysqltest_bob' should not be replicated to the slave.
13--disable_warnings
14DROP DATABASE IF EXISTS mysqltest_prometheus;
15DROP DATABASE IF EXISTS mysqltest_sisyfos;
16DROP DATABASE IF EXISTS mysqltest_bob;
17sync_slave_with_master;
18# This database is not replicated
19DROP DATABASE IF EXISTS mysqltest_bob;
20--enable_warnings
21
22connection master;
23CREATE DATABASE mysqltest_prometheus;
24CREATE DATABASE mysqltest_sisyfos;
25CREATE DATABASE mysqltest_bob;
26
27USE mysqltest_sisyfos;
28# These should be replicated
29CREATE TABLE t1 (b int);
30INSERT INTO t1 VALUES(1);
31
32USE mysqltest_bob;
33# These should *not* be replicated
34CREATE TABLE t2 (b int);
35INSERT INTO t2 VALUES(2);
36
37# Current database is now 'mysqltest_bob'
38# The following should be replicated
39ALTER DATABASE mysqltest_sisyfos CHARACTER SET latin1;
40
41USE mysqltest_sisyfos;
42# The following should *not* be replicated
43ALTER DATABASE mysqltest_bob CHARACTER SET latin1;
44
45SHOW DATABASES LIKE 'mysql%';
46sync_slave_with_master;
47SHOW DATABASES LIKE 'mysql%';
48
49connection master;
50DROP DATABASE IF EXISTS mysqltest_sisyfos;
51USE mysqltest_prometheus;
52CREATE TABLE t1 (a INT);
53INSERT INTO t1 VALUES (1);
54CREATE DATABASE mysqltest_sisyfos;
55USE mysqltest_sisyfos;
56CREATE TABLE t2 (a INT);
57let $VERSION=`select version()`;
58SHOW DATABASES LIKE 'mysql%';
59sync_slave_with_master;
60SHOW DATABASES LIKE 'mysql%';
61USE mysqltest_prometheus;
62SHOW TABLES;
63USE mysqltest_sisyfos;
64SHOW TABLES;
65
66connection master;
67DROP DATABASE IF EXISTS mysqltest_prometheus;
68DROP DATABASE IF EXISTS mysqltest_sisyfos;
69DROP DATABASE IF EXISTS mysqltest_bob;
70sync_slave_with_master;
71
72# End of 4.1 tests
73--source include/rpl_end.inc
74