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 56 57 58
|
# ==== Purpose ====
#
# Verify that Bug#22110284 has been fixed, i.e. that replication from a smaller
# type to a larger type performs the correct conversion and does not truncate
# the columns on the slave.
#
# ==== Implementation ====
#
# 1. Set @@global.REPLICA_TYPE_CONVERSIONS to ALL_NON_LOSSY to allow conversions.
# 2. Create a table on the master, wait until it has been replicated, drop table
# on slave and recreate with a column with greater size.
# 3. Insert values that would have be truncated on the master and wait for
# them to be replicated.
# 4. Verify that the columns have the same length on the master and slave.
#
# ==== References ====
#
# Bug#22110284 RBR CONVERSION FROM SMALLER MASTER TYPE TO BIGGER SLAVE TYPE IS BROKEN
source include/have_binlog_format_row.inc;
source include/master-slave.inc;
--echo # Bug#22110284: RBR CONVERSION FROM SMALLER MASTER TYPE TO BIGGER SLAVE
--echo # TYPE IS BROKEN
--echo # Verify that 100kb string is not truncated when replicated to LONGTEXT
--echo #
--source include/rpl_connection_slave.inc
SET @saved_global_replica_type_conversions = @@global.REPLICA_TYPE_CONVERSIONS;
SET @@global.REPLICA_TYPE_CONVERSIONS='ALL_NON_LOSSY';
--source include/rpl_connection_master.inc
CREATE TABLE t1 (col MEDIUMTEXT);
--source include/sync_slave_sql_with_master.inc
--source include/rpl_connection_slave.inc
--echo # Drop table on slave and recreate with LONGTEXT
DROP TABLE t1;
CREATE TABLE t1 (col LONGTEXT);
--source include/rpl_connection_master.inc
INSERT INTO t1(col) VALUES (REPEAT('a',65534)), (REPEAT('b',65535)), (REPEAT('c',65536)), (REPEAT('d',100000));
--let $master_lengths=`SELECT LENGTH(col) FROM t1`
--source include/sync_slave_sql_with_master.inc
--source include/rpl_connection_slave.inc
--let $slave_lengths=`SELECT LENGTH(col) FROM t1`
--let $assert_text= Verify that the column has the same lengths on the slave as on the master
--let $assert_cond= "$slave_lengths" = "$master_lengths"
--source include/assert.inc
SET @@global.REPLICA_TYPE_CONVERSIONS = @saved_global_replica_type_conversions;
--source include/rpl_connection_master.inc
DROP TABLE t1;
source include/rpl_end.inc;
|