Debian Codegraph @

mysql-test/suite/rpl/r/rpl_mixed_row_innodb.result

raw
1 stop slave;
2 drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
3 reset master;
4 reset slave;
5 drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
6 start slave;
7 CREATE TABLE t4 (
8 id INT(5) unsigned NOT NULL auto_increment,
9 name varchar(15) NOT NULL default '',
10 number varchar(35) NOT NULL default 'default',
11 PRIMARY KEY (id),
12 UNIQUE KEY unique_rec (name,number)
13 ) ENGINE=InnoDB;
14 LOAD DATA
15 INFILE '../../std_data/loaddata_pair.dat'
16 REPLACE INTO TABLE t4
17 (name,number);
18 SELECT * FROM t4;
19 id name number
20 1 XXX 12345
21 2 XXY 12345
22 SELECT * FROM t4;
23 id name number
24 1 XXX 12345
25 2 XXY 12345
26 LOAD DATA
27 INFILE '../../std_data/loaddata_pair.dat'
28 REPLACE INTO TABLE t4
29 (name,number);
30 SELECT * FROM t4;
31 id name number
32 4 XXX 12345
33 5 XXY 12345
34 SELECT * FROM t4;
35 id name number
36 4 XXX 12345
37 5 XXY 12345
38 FLUSH LOGS;
39 FLUSH LOGS;
40 DROP DATABASE IF EXISTS mysqltest1;
41 CREATE DATABASE mysqltest1;
42 CREATE TEMPORARY TABLE mysqltest1.tmp (f1 BIGINT);
43 CREATE TABLE mysqltest1.t1 (f1 BIGINT) ENGINE="InnoDB";
44 SET AUTOCOMMIT = 0;
45 -------- switch to slave --------
46 ALTER TABLE mysqltest1.t1 ENGINE = MyISAM;
47 SHOW CREATE TABLE mysqltest1.t1;
48 Table Create Table
49 t1 CREATE TABLE `t1` (
50 `f1` bigint(20) DEFAULT NULL
51 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
52 -------- switch to master --------
53 INSERT INTO mysqltest1.t1 SET f1= 1;
54 DROP TEMPORARY TABLE mysqltest1.tmp;
55 ROLLBACK;
56 SHOW CREATE TABLE mysqltest1.tmp;
57 ERROR 42S02: Table 'mysqltest1.tmp' doesn't exist
58 ######### Must return no rows here #########
59 SELECT COUNT(*) FROM mysqltest1.t1;
60 COUNT(*)
61 0
62 INSERT INTO mysqltest1.t1 SET f1= 2;
63 CREATE TEMPORARY TABLE mysqltest1.tmp2(a INT);
64 ROLLBACK;
65 SHOW CREATE TABLE mysqltest1.tmp2;
66 Table Create Table
67 tmp2 CREATE TEMPORARY TABLE `tmp2` (
68 `a` int(11) DEFAULT NULL
69 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
70 ######### Must return no rows here #########
71 SELECT COUNT(*) FROM mysqltest1.t1;
72 COUNT(*)
73 0
74 -------- switch to slave --------
75 SHOW CREATE TABLE mysqltest1.tmp;
76 ERROR 42S02: Table 'mysqltest1.tmp' doesn't exist
77 SHOW CREATE TABLE mysqltest1.tmp2;
78 ERROR 42S02: Table 'mysqltest1.tmp2' doesn't exist
79 ######### t1 has two rows here: the transaction not rolled back since t1 uses MyISAM #########
80 SELECT COUNT(*) FROM mysqltest1.t1;
81 COUNT(*)
82 2
83 FLUSH LOGS;
84 -------- switch to master --------
85 FLUSH LOGS;
86 DROP DATABASE mysqltest1;
87 End of 5.1 tests
88 #
89 # Bug#39675 rename tables on innodb tables with pending
90 # transactions causes slave data issue.
91 #
92 DROP TABLE IF EXISTS t1;
93 DROP TABLE IF EXISTS t2;
94 DROP TABLE IF EXISTS t3;
95 CREATE TABLE t1 (
96 id INT PRIMARY KEY auto_increment,
97 b INT DEFAULT NULL
98 ) ENGINE=InnoDB;
99 CREATE TABLE t2 (
100 id INT PRIMARY KEY auto_increment,
101 b INT DEFAULT NULL
102 ) ENGINE=InnoDB;
103 INSERT INTO t1 (b) VALUES (1),(2),(3);
104 BEGIN;
105 INSERT INTO t1(b) VALUES (4);
106 -------- switch to master1 --------
107 RENAME TABLE t1 TO t3, t2 TO t1;;
108 -------- switch to master --------
109 COMMIT;
110 -------- switch to master1 --------
111 -------- switch to master --------
112 SELECT * FROM t1;
113 id b
114 SELECT * FROM t3;
115 id b
116 1 1
117 2 2
118 3 3
119 4 4
120 -------- switch to slave --------
121 SELECT * FROM t1;
122 id b
123 SELECT * FROM t3;
124 id b
125 1 1
126 2 2
127 3 3
128 4 4
129 -------- switch to master --------
130 DROP TABLE t1;
131 DROP TABLE t3;
132 End of 6.0 tests