~linuxjedi/drizzle/trunk-bug-667053

« back to all changes in this revision

Viewing changes to mysql-test/suite/rpl/t/rpl_temp_table.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
# drop table t1 t2 t3 are included int master-slave.inc
 
2
#  meaningful only in statement-based:
 
3
 
 
4
-- source include/have_binlog_format_mixed_or_statement.inc
 
5
-- source include/master-slave.inc
 
6
 
 
7
 
 
8
create table t2 (n int, PRIMARY KEY(n));
 
9
create temporary table t1 (n int);
 
10
create temporary table t3 (n int not null);
 
11
 
 
12
insert into t1 values(1),(2),(3),(100),(25),(26),(200),(300);
 
13
insert into t2 select * from t1;
 
14
alter table t3 add primary key(n);
 
15
 
 
16
flush logs;
 
17
insert into t3 values (1010);
 
18
insert into t2 select * from t3;
 
19
 
 
20
drop table if exists t3;
 
21
insert into t2 values (1012);
 
22
 
 
23
connection master1;
 
24
create temporary table t1 (n int);
 
25
insert into t1 values (4),(5);
 
26
insert into t2 select * from t1;
 
27
 
 
28
save_master_pos;
 
29
disconnect master;
 
30
 
 
31
connection slave;
 
32
#add 1 to the saved position, so we will catch  drop table on disconnect
 
33
#for sure
 
34
sync_with_master 1;
 
35
 
 
36
connection master1;
 
37
insert into t2 values(61);
 
38
 
 
39
save_master_pos;
 
40
disconnect master1;
 
41
 
 
42
connection slave;
 
43
#same trick - make sure we catch drop of temporary table on disconnect
 
44
sync_with_master 1;
 
45
 
 
46
select * from t2;
 
47
select count(*) from t2;
 
48
select sum(n) from t2;
 
49
show status like 'Slave_open_temp_tables';
 
50
 
 
51
#
 
52
# Clean up
 
53
#
 
54
connect (master2,localhost,root,,);
 
55
connection master2;
 
56
drop table if exists t1,t2;
 
57
save_master_pos;
 
58
connection slave;
 
59
sync_with_master;