| 1 |
include/master-slave.inc |
| 2 |
[connection master] |
| 3 |
create table t2 (n int, PRIMARY KEY(n)); |
| 4 |
create temporary table t1 (n int); |
| 5 |
create temporary table t3 (n int not null); |
| 6 |
insert into t1 values(1),(2),(3),(100),(25),(26),(200),(300); |
| 7 |
insert into t2 select * from t1; |
| 8 |
alter table t3 add primary key(n); |
| 9 |
flush logs; |
| 10 |
insert into t3 values (1010); |
| 11 |
insert into t2 select * from t3; |
| 12 |
drop table if exists t3; |
| 13 |
insert into t2 values (1012); |
| 14 |
connection master1; |
| 15 |
create temporary table t1 (n int); |
| 16 |
insert into t1 values (4),(5); |
| 17 |
insert into t2 select * from t1; |
| 18 |
disconnect master; |
| 19 |
connection slave; |
| 20 |
connection master1; |
| 21 |
insert into t2 values(61); |
| 22 |
disconnect master1; |
| 23 |
connection slave; |
| 24 |
select * from t2; |
| 25 |
n |
| 26 |
1 |
| 27 |
2 |
| 28 |
3 |
| 29 |
4 |
| 30 |
5 |
| 31 |
25 |
| 32 |
26 |
| 33 |
61 |
| 34 |
100 |
| 35 |
200 |
| 36 |
300 |
| 37 |
1010 |
| 38 |
1012 |
| 39 |
select count(*) from t2; |
| 40 |
count(*) |
| 41 |
13 |
| 42 |
select sum(n) from t2; |
| 43 |
sum(n) |
| 44 |
2749 |
| 45 |
show status like 'Slave_open_temp_tables'; |
| 46 |
Variable_name Value |
| 47 |
Slave_open_temp_tables 0 |
| 48 |
*** MDEV-8016: Replication aborts on DROP /*!40005 TEMPORARY */ TABLE IF EXISTS *** |
| 49 |
connect master2,localhost,root,,; |
| 50 |
INSERT INTO t2 VALUES (2000), (2001); |
| 51 |
CREATE FUNCTION f() RETURNS INTEGER RETURN 1; |
| 52 |
CREATE TEMPORARY TABLE t3 AS SELECT f() AS col FROM t2; |
| 53 |
disconnect master2; |
| 54 |
connection default; |
| 55 |
connection slave; |
| 56 |
connect master2,localhost,root,,; |
| 57 |
connection master2; |
| 58 |
drop table if exists t1,t2; |
| 59 |
Warnings: |
| 60 |
Note 1051 Unknown table 'test.t1' |
| 61 |
drop function f; |
| 62 |
connection slave; |
| 63 |
include/rpl_end.inc |