Debian Codegraph @

mysql-test/suite/rpl/t/rpl_row_col_conversion.test

raw
1 # ==== Purpose ====
2 #
3 # Verify that Bug#22110284 has been fixed, i.e. that replication from a smaller
4 # type to a larger type performs the correct conversion and does not truncate
5 # the columns on the slave.
6 #
7 # ==== Implementation ====
8 #
9 # 1. Set @@global.REPLICA_TYPE_CONVERSIONS to ALL_NON_LOSSY to allow conversions.
10 # 2. Create a table on the master, wait until it has been replicated, drop table
11 # on slave and recreate with a column with greater size.
12 # 3. Insert values that would have be truncated on the master and wait for
13 # them to be replicated.
14 # 4. Verify that the columns have the same length on the master and slave.
15 #
16 # ==== References ====
17 #
18 # Bug#22110284 RBR CONVERSION FROM SMALLER MASTER TYPE TO BIGGER SLAVE TYPE IS BROKEN
19
20 source include/have_binlog_format_row.inc;
21 source include/master-slave.inc;
22
23 --echo # Bug#22110284: RBR CONVERSION FROM SMALLER MASTER TYPE TO BIGGER SLAVE
24 --echo # TYPE IS BROKEN
25 --echo # Verify that 100kb string is not truncated when replicated to LONGTEXT
26 --echo #
27
28 --source include/rpl_connection_slave.inc
29 SET @saved_global_replica_type_conversions = @@global.REPLICA_TYPE_CONVERSIONS;
30 SET @@global.REPLICA_TYPE_CONVERSIONS='ALL_NON_LOSSY';
31
32 --source include/rpl_connection_master.inc
33 CREATE TABLE t1 (col MEDIUMTEXT);
34 --source include/sync_slave_sql_with_master.inc
35
36 --source include/rpl_connection_slave.inc
37 --echo # Drop table on slave and recreate with LONGTEXT
38 DROP TABLE t1;
39 CREATE TABLE t1 (col LONGTEXT);
40
41 --source include/rpl_connection_master.inc
42 INSERT INTO t1(col) VALUES (REPEAT('a',65534)), (REPEAT('b',65535)), (REPEAT('c',65536)), (REPEAT('d',100000));
43 --let $master_lengths=`SELECT LENGTH(col) FROM t1`
44 --source include/sync_slave_sql_with_master.inc
45
46 --source include/rpl_connection_slave.inc
47 --let $slave_lengths=`SELECT LENGTH(col) FROM t1`
48 --let $assert_text= Verify that the column has the same lengths on the slave as on the master
49 --let $assert_cond= "$slave_lengths" = "$master_lengths"
50 --source include/assert.inc
51
52 SET @@global.REPLICA_TYPE_CONVERSIONS = @saved_global_replica_type_conversions;
53
54 --source include/rpl_connection_master.inc
55 DROP TABLE t1;
56
57 source include/rpl_end.inc;
58