~linuxjedi/drizzle/trunk-bug-667053

« back to all changes in this revision

Viewing changes to mysql-test/suite/rpl/include/rpl_mixed_ddl.inc

  • Committer: brian
  • Date: 2008-06-25 05:29:13 UTC
  • Revision ID: brian@localhost.localdomain-20080625052913-6upwo0jsrl4lnapl
clean slate

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#########################################
 
2
# Author: Serge Kozlov skozlov@mysql.com
 
3
# Date: 07/10/2006
 
4
# Purpose: testing the replication in mixed mode
 
5
# Requirements: define binlog format for mysqld as in example below:
 
6
# ./mysql-test-run.pl --mysqld=--binlog-format=mixed
 
7
#########################################
 
8
 
 
9
--source include/master-slave.inc
 
10
 
 
11
# Check MIXED on both master and slave
 
12
connection master;
 
13
--echo ==========MASTER==========
 
14
--source suite/rpl/include/rpl_mixed_show_binlog_format.inc
 
15
connection slave;
 
16
--echo ==========SLAVE===========
 
17
--source suite/rpl/include/rpl_mixed_show_binlog_format.inc
 
18
connection master;
 
19
 
 
20
 
 
21
# DDL for databases
 
22
--echo
 
23
--echo ******************** DDL for database ********************
 
24
--disable_warnings
 
25
DROP DATABASE IF EXISTS test_rpl;
 
26
DROP DATABASE IF EXISTS test_rpl_1;
 
27
--enable_warnings
 
28
CREATE DATABASE test_rpl_1 CHARACTER SET utf8 COLLATE utf8_general_ci;
 
29
ALTER DATABASE test_rpl_1 CHARACTER SET latin1 COLLATE latin1_general_ci;
 
30
DROP DATABASE test_rpl_1;
 
31
CREATE DATABASE test_rpl CHARACTER SET utf8 COLLATE utf8_general_ci;
 
32
ALTER DATABASE test_rpl CHARACTER SET latin1 COLLATE latin1_swedish_ci;
 
33
--source suite/rpl/include/rpl_mixed_check_db.inc
 
34
 
 
35
USE test_rpl;
 
36
 
 
37
# DDL for tables
 
38
--echo
 
39
--echo ******************** DDL for tables ********************
 
40
eval CREATE TABLE t0 (a int auto_increment not null, c int not null, PRIMARY KEY(a), KEY index2 (c)) ENGINE=$engine_type;
 
41
ALTER TABLE t0 DROP INDEX index2;
 
42
ALTER TABLE t0 ADD COLUMN b char(254);
 
43
ALTER TABLE t0 ADD INDEX index1 (b);
 
44
ALTER TABLE t0 DROP COLUMN c;
 
45
RENAME TABLE t0 TO t1;
 
46
CREATE TABLE t2 LIKE t1;
 
47
--source suite/rpl/include/rpl_mixed_check_table.inc
 
48
 
 
49
# DDL for logfiles
 
50
# skipped
 
51
 
 
52
# DDL for tablespaces
 
53
# skipped
 
54
 
 
55
# DDL for indexes
 
56
--echo
 
57
--echo ******************** DDL for indexes ********************
 
58
ALTER TABLE t2 ADD COLUMN d datetime;
 
59
CREATE INDEX index2 on t2 (d);
 
60
CREATE INDEX index3 on t2 (a, d);
 
61
--source suite/rpl/include/rpl_mixed_check_table.inc
 
62
ALTER TABLE t2 DROP COLUMN d;
 
63
 
 
64
 
 
65
# BINLOG EVENTS
 
66
--echo
 
67
--echo
 
68
--echo ******************** SHOW BINLOG EVENTS ********************
 
69
--replace_column 2 # 5 #
 
70
--replace_regex /Server ver: .+/Server ver: #/ /table_id: [0-9]+/table_id: #/
 
71
show binlog events from 1;
 
72
sync_slave_with_master;
 
73
# as we're using UUID we don't SELECT but use "diff" like in rpl_row_UUID
 
74
--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test_rpl > $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql
 
75
--exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test_rpl > $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql
 
76
 
 
77
connection master;
 
78
drop database test_rpl;
 
79
sync_slave_with_master;
 
80
 
 
81
# Let's compare. Note: If they match test will pass, if they do not match
 
82
# the test will show that the diff statement failed and not reject file
 
83
# will be created. You will need to go to the mysql-test dir and diff
 
84
# the files your self to see what is not matching
 
85
 
 
86
--exec diff $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql