| 1 |
# |
| 2 |
# MENT-662: Lag Free Alter On Slave |
| 3 |
# |
| 4 |
|
| 5 |
--echo # |
| 6 |
--echo # Test verifies that "ROLLBACK ALTER" is written to binary log upon |
| 7 |
--echo #ALTER command execution failure. |
| 8 |
--echo # |
| 9 |
--source include/have_innodb.inc |
| 10 |
--source include/master-slave.inc |
| 11 |
|
| 12 |
--connection master |
| 13 |
--let $binlog_alter_two_phase= `select @@binlog_alter_two_phase` |
| 14 |
set global binlog_alter_two_phase = ON; |
| 15 |
set binlog_alter_two_phase = ON; |
| 16 |
|
| 17 |
create table t1 (f1 int primary key) engine=InnoDB; |
| 18 |
--error ER_CANT_CREATE_TABLE |
| 19 |
create table t2 (f1 int primary key, |
| 20 |
constraint c1 foreign key (f1) references t1(f1), |
| 21 |
constraint c1 foreign key (f1) references t1(f1)) engine=InnoDB; |
| 22 |
create table t2 (f1 int primary key, |
| 23 |
constraint c1 foreign key (f1) references t1(f1)) engine=innodb; |
| 24 |
|
| 25 |
--error ER_CANT_CREATE_TABLE |
| 26 |
alter table t2 add constraint c1 foreign key (f1) references t1(f1); |
| 27 |
--source include/show_binlog_events.inc |
| 28 |
|
| 29 |
set foreign_key_checks = 0; |
| 30 |
--error ER_DUP_CONSTRAINT_NAME |
| 31 |
alter table t2 add constraint c1 foreign key (f1) references t1(f1); |
| 32 |
--source include/show_binlog_events.inc |
| 33 |
--sync_slave_with_master |
| 34 |
|
| 35 |
--connection master |
| 36 |
drop table t2, t1; |
| 37 |
--sync_slave_with_master |
| 38 |
|
| 39 |
--connection master |
| 40 |
--eval set global binlog_alter_two_phase=$binlog_alter_two_phase; |
| 41 |
|
| 42 |
--source include/rpl_end.inc |