Details
-
Bug
-
Status: Stalled (View Workflow)
-
Critical
-
Resolution: Unresolved
-
10.6.8
-
None
-
Only tested on 10.6.8 so far, but it's probably on all versions
Description
Consider the following replication situation:
- binlog_format=ROW
- slave_type_conversions is empty, so tables should be defined the same on master and slave for replication to work
- a column on the master is created with "NULL", but on the slave it has same type and size, but "NOT NULL DEFAULT ..." instead
E.g.:
- on master: CREATE TABLE t1(id int not null primary key, msg varchar(100) NULL);
- on slave: ALTER TABLE t1 MODIFY COLUMN msg varchar(100) NOT NULL DEFAULT 'abc';
- on master: INSERT INTO TABLE t1 VALUES(1, NULL); SELECT * FROM t1;
- -> result id:1; msg: NULL
- on slave: SELECT * FROM t1;
- -> result id: 1; msg: 'abc'
So now we have a data inconsistency between master and slave even though slave_type_conversions='' should have prevented this.
Double check to see that slave type conversion checks are indeed in effect:
- on master CREATE TABLE t2(id int not null primary key, msg varchar(100));
- on slave ALTER TABLE t2 MODIFY COLUMN msg varchar(200);
- on master: INSERT INTO t2 VALUES(1, NULL);
- on slave -> Last_SQL_Error: Column 1 of table 'test.t2' cannot be converted from type 'varchar(400 octets)' to type 'varchar(800 octets) character set utf8mb4'