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 43 44 45 46 47 48 49 50 51 52 53 54 55
|
include/master-slave.inc
Warnings:
Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
Note #### Storing MySQL user name or password information in the connection metadata repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START REPLICA; see the 'START REPLICA Syntax' in the MySQL Manual for more information.
[connection master]
CALL mtr.add_suppression("Check constraint 't1_chk_2' is violated.");
CALL mtr.add_suppression("The replica coordinator and worker threads are stopped, possibly leaving data in inconsistent state");
CREATE TABLE t1 (f1 int primary key, CHECK(f1 < 100));
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f1` int NOT NULL,
PRIMARY KEY (`f1`),
CONSTRAINT `t1_chk_1` CHECK ((`f1` < 100))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
INSERT INTO t1 (f1) VALUES(20);
include/sync_slave_sql_with_master.inc
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f1` int NOT NULL,
PRIMARY KEY (`f1`),
CONSTRAINT `t1_chk_1` CHECK ((`f1` < 100))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
ALTER TABLE t1 ADD CONSTRAINT CHECK(f1 < 50);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f1` int NOT NULL,
PRIMARY KEY (`f1`),
CONSTRAINT `t1_chk_1` CHECK ((`f1` < 100)),
CONSTRAINT `t1_chk_2` CHECK ((`f1` < 50))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
[connection master]
update t1 set f1 = 80;
[connection slave]
# t1_chk_2 check constraint validation for update fails at slave.
include/wait_for_slave_sql_error.inc [errno=3819]
SELECT * from t1;
f1
20
[connection master]
insert into t1 values(90);
[connection slave]
# t1_chk_2 check constraint validation for insert fails at slave.
include/wait_for_slave_sql_error.inc [errno=3819]
SELECT * from t1;
f1
20
[connection master]
DROP TABLE t1;
[connection slave]
DROP TABLE t1;
include/rpl_reset.inc
include/rpl_end.inc
|