~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysql-test/suite/rpl/t/rpl_innodb.test

  • 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
# File for specialities regarding replication from or to InnoDB
 
2
# tables.
 
3
 
 
4
source include/master-slave.inc;
 
5
source include/have_innodb.inc;
 
6
 
 
7
#
 
8
# Bug#11401: Load data infile 'REPLACE INTO' fails on slave.
 
9
#
 
10
connection master;
 
11
CREATE TABLE t4 (
 
12
  id INT(5) unsigned NOT NULL auto_increment,
 
13
  name varchar(15) NOT NULL default '',
 
14
  number varchar(35) NOT NULL default 'default',
 
15
  PRIMARY KEY  (id),
 
16
  UNIQUE KEY unique_rec (name,number)
 
17
) ENGINE=InnoDB;
 
18
 
 
19
--disable_warnings
 
20
LOAD DATA
 
21
     INFILE '../std_data_ln/loaddata_pair.dat'  
 
22
     REPLACE INTO TABLE t4 
 
23
     (name,number);
 
24
--enable_warnings
 
25
SELECT * FROM t4;
 
26
 
 
27
sync_slave_with_master;
 
28
SELECT * FROM t4;
 
29
 
 
30
connection master;
 
31
--disable_warnings
 
32
LOAD DATA
 
33
     INFILE '../std_data_ln/loaddata_pair.dat'  
 
34
     REPLACE INTO TABLE t4
 
35
     (name,number);
 
36
--enable_warnings
 
37
SELECT * FROM t4;
 
38
 
 
39
sync_slave_with_master;
 
40
SELECT * FROM t4;
 
41
 
 
42
connection master;
 
43
--disable_query_log
 
44
DROP TABLE t4;
 
45
--enable_query_log
 
46
sync_slave_with_master;
 
47
connection master;
 
48
 
 
49
# End of 4.1 tests
 
50
 
 
51
#
 
52
# Bug #26418: Slave out of sync after CREATE/DROP TEMPORARY TABLE + ROLLBACK
 
53
# on master
 
54
#
 
55
#Note Matthias: to be merged to rpl_ddl.test
 
56
 
 
57
--source include/not_ndb_default.inc
 
58
 
 
59
FLUSH LOGS;
 
60
sync_slave_with_master;
 
61
FLUSH LOGS;
 
62
connection master;
 
63
let $engine_type= "InnoDB";
 
64
 
 
65
--disable_warnings
 
66
DROP DATABASE IF EXISTS mysqltest1;
 
67
--enable_warnings
 
68
 
 
69
CREATE DATABASE mysqltest1;
 
70
CREATE TEMPORARY TABLE mysqltest1.tmp (f1 BIGINT);
 
71
eval CREATE TABLE mysqltest1.t1 (f1 BIGINT) ENGINE=$engine_type;
 
72
SET AUTOCOMMIT = 0;
 
73
 
 
74
sync_slave_with_master;
 
75
--echo -------- switch to slave --------
 
76
connection slave;
 
77
SHOW CREATE TABLE mysqltest1.t1;
 
78
 
 
79
--echo -------- switch to master --------
 
80
connection master;
 
81
INSERT INTO mysqltest1.t1 SET f1= 1;
 
82
DROP TEMPORARY TABLE mysqltest1.tmp;
 
83
ROLLBACK;
 
84
--error ER_NO_SUCH_TABLE
 
85
SHOW CREATE TABLE mysqltest1.tmp;
 
86
# Must return no rows here
 
87
SELECT COUNT(*) FROM mysqltest1.t1;
 
88
 
 
89
INSERT INTO mysqltest1.t1 SET f1= 2;
 
90
CREATE TEMPORARY TABLE mysqltest1.tmp2(a INT);
 
91
ROLLBACK;
 
92
SHOW CREATE TABLE mysqltest1.tmp2;
 
93
# Must return no rows here
 
94
SELECT COUNT(*) FROM mysqltest1.t1;
 
95
 
 
96
sync_slave_with_master;
 
97
--echo -------- switch to slave --------
 
98
connection slave;
 
99
--error ER_NO_SUCH_TABLE
 
100
SHOW CREATE TABLE mysqltest1.tmp;
 
101
--error ER_NO_SUCH_TABLE
 
102
SHOW CREATE TABLE mysqltest1.tmp2;
 
103
# has two rows here : as the default is MyISAM and
 
104
# it can't be rolled back by the master's ROLLBACK.
 
105
SELECT COUNT(*) FROM mysqltest1.t1;
 
106
FLUSH LOGS;
 
107
 
 
108
--echo -------- switch to master --------
 
109
connection master;
 
110
FLUSH LOGS;
 
111
 
 
112
DROP DATABASE mysqltest1;
 
113
-- source include/master-slave-end.inc
 
114
 
 
115
--echo End of 5.1 tests