File: rpl_alter_rollback.test

package info (click to toggle)
mariadb 1%3A11.8.3-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 772,520 kB
  • sloc: ansic: 2,414,714; cpp: 1,791,394; asm: 381,336; perl: 62,905; sh: 49,647; pascal: 40,897; java: 39,363; python: 20,791; yacc: 20,432; sql: 17,907; xml: 12,344; ruby: 8,544; cs: 6,542; makefile: 6,145; ada: 1,879; lex: 1,193; javascript: 996; objc: 80; tcl: 73; awk: 46; php: 22
file content (42 lines) | stat: -rw-r--r-- 1,255 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#
# MENT-662: Lag Free Alter On Slave
#

--echo #
--echo # Test verifies that "ROLLBACK ALTER" is written to binary log upon
--echo #ALTER command execution failure.
--echo #
--source include/have_innodb.inc
--source include/master-slave.inc

--connection master
--let $binlog_alter_two_phase= `select @@binlog_alter_two_phase`
set global binlog_alter_two_phase = ON;
set binlog_alter_two_phase = ON;

create table t1 (f1 int primary key) engine=InnoDB;
--error ER_CANT_CREATE_TABLE
create table t2 (f1 int primary key,
constraint c1 foreign key (f1) references t1(f1),
constraint c1 foreign key (f1) references t1(f1)) engine=InnoDB;
create table t2 (f1 int primary key,
   constraint c1 foreign key (f1) references t1(f1)) engine=innodb;

--error ER_CANT_CREATE_TABLE
alter table t2 add constraint c1 foreign key (f1) references t1(f1);
--source include/show_binlog_events.inc

set foreign_key_checks = 0;
--error ER_DUP_CONSTRAINT_NAME
alter table t2 add constraint c1 foreign key (f1) references t1(f1);
--source include/show_binlog_events.inc
--sync_slave_with_master

--connection master
drop table t2, t1;
--sync_slave_with_master

--connection master
--eval set global binlog_alter_two_phase=$binlog_alter_two_phase;

--source include/rpl_end.inc