| 1 |
# Test of a transaction mixing the two engines |
| 2 |
|
| 3 |
-- source include/have_ndb.inc |
| 4 |
-- source suite/ndb_rpl/ndb_master-slave.inc |
| 5 |
|
| 6 |
create table t1 (a int, b int, unique(b)) engine=ndbcluster; |
| 7 |
create table t2 (a int, b int, unique(b)) engine=innodb; |
| 8 |
|
| 9 |
|
| 10 |
begin; |
| 11 |
insert into t1 values(1,1); |
| 12 |
insert into t2 values(1,1); |
| 13 |
rollback; |
| 14 |
|
| 15 |
select count(*) from t1; |
| 16 |
select count(*) from t2; |
| 17 |
sync_slave_with_master; |
| 18 |
select count(*) from t1; |
| 19 |
select count(*) from t2; |
| 20 |
connection master; |
| 21 |
|
| 22 |
begin; |
| 23 |
load data infile '../../../std_data/rpl_loaddata.dat' into table t2; |
| 24 |
load data infile '../../../std_data/rpl_loaddata.dat' into table t1; |
| 25 |
rollback; |
| 26 |
|
| 27 |
select count(*) from t1; |
| 28 |
select count(*) from t2; |
| 29 |
sync_slave_with_master; |
| 30 |
select count(*) from t1; |
| 31 |
select count(*) from t2; |
| 32 |
connection master; |
| 33 |
|
| 34 |
delete from t1; |
| 35 |
delete from t2; |
| 36 |
begin; |
| 37 |
load data infile '../../../std_data/rpl_loaddata.dat' into table t2; |
| 38 |
load data infile '../../../std_data/rpl_loaddata.dat' into table t1; |
| 39 |
rollback; |
| 40 |
|
| 41 |
select count(*) from t1; |
| 42 |
select count(*) from t2; |
| 43 |
sync_slave_with_master; |
| 44 |
select count(*) from t1; |
| 45 |
select count(*) from t2; |
| 46 |
connection master; |
| 47 |
|
| 48 |
delete from t1; |
| 49 |
delete from t2; |
| 50 |
begin; |
| 51 |
insert into t2 values(3,3),(4,4); |
| 52 |
insert into t1 values(3,3),(4,4); |
| 53 |
load data infile '../../../std_data/rpl_loaddata.dat' into table t2; |
| 54 |
load data infile '../../../std_data/rpl_loaddata.dat' into table t1; |
| 55 |
rollback; |
| 56 |
|
| 57 |
select count(*) from t1; |
| 58 |
select count(*) from t2; |
| 59 |
sync_slave_with_master; |
| 60 |
select count(*) from t1; |
| 61 |
select count(*) from t2; |
| 62 |
connection master; |
| 63 |
|
| 64 |
drop table t1,t2; |
| 65 |
sync_slave_with_master; |
| 66 |
--source include/rpl_end.inc |