summaryrefslogtreecommitdiff
path: root/mysql-test/extra
diff options
context:
space:
mode:
authorMats Kindahl <mats@sun.com>2009-12-14 12:04:55 +0100
committerMats Kindahl <mats@sun.com>2009-12-14 12:04:55 +0100
commit571843804c1b22e7ff641f5dfe223958c4af70fc (patch)
tree34709f23bbfd5c150ca52f1e09e38980fd9105eb /mysql-test/extra
parent20674b1a6f65ea73f7afb3648821e7005fb53bf0 (diff)
downloadmariadb-git-571843804c1b22e7ff641f5dfe223958c4af70fc.tar.gz
WL#5151: Conversion between different types when replicating
Row-based replication requires the types of columns on the master and slave to be approximately the same (some safe conversions between strings are allowed), but does not allow safe conversions between fields of similar types such as TINYINT and INT. This patch implement type conversions between similar fields on the master and slave. The conversions are controlled using a new variable SLAVE_TYPE_CONVERSIONS of type SET('ALL_LOSSY','ALL_NON_LOSSY'). Non-lossy conversions are any conversions that do not run the risk of losing any information, while lossy conversions can potentially truncate the value. The column definitions are checked to decide if the conversion is acceptable. If neither conversion is enabled, it is required that the definitions of the columns are identical on master and slave. Conversion is done by creating an internal conversion table, unpacking the master data into it, and then copy the data to the real table on the slave. .bzrignore: New files added client/Makefile.am: New files added client/mysqlbinlog.cc: Functions in rpl_utility.cc is now needed by mysqlbinlog.cc. libmysqld/Makefile.am: New files added mysql-test/extra/rpl_tests/check_type.inc: Test include file to check a single type conversion. mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test: Switching to use INT instead of TEXT for column that should not have matching types. mysql-test/extra/rpl_tests/rpl_row_basic.test: Adding code to enable type conversions for BIT tests since InnoDB cannot handle them properly due to incorrect information stored as metadata. mysql-test/extra/rpl_tests/type_conversions.test: Test file to check a set of type conversions with current settings of slave_type_conversions. mysql-test/suite/rpl/t/rpl_typeconv.test: Test file to test conversions from master to slave with all possible values for slave_type_conversions. The test also checks that the slave_type_conversions variable works as expected. sql/field.cc: Changing definition of compatible_field_size to both check if two field with identical base types are compatible and give an order between them if they are compatible. This only implement checking on the slave, so it will not affect replication from an old master to a new slave. sql/field.h: Changing prototypes for functions: - compatible_field_size() - init_for_tmp_table() - row_pack_length() sql/log_event.cc: Changing compability checks to build a conversion table if the fields are compatible, but does not have the same base type. sql/log_event_old.cc: Changing compability checks to build a conversion table if the fields are compatible, but does not have the same base type. sql/mysql_priv.h: Adding global option variable for SLAVE_TYPE_CONVERSIONS sql/mysqld.cc: Adding SLAVE_TYPE_CONVERSIONS global server variable. sql/rpl_record.cc: Changing unpack_row to use the conversion table if present. sql/rpl_rli.h: Removing function get_tabledef and replacing it with get_table_data(). This function retrieve data for table opened for replication, not just table definition. sql/rpl_utility.cc: Function table_def::compatible_with is changed to compare table on master and slave for compatibility and generate a conversions table if they are compatible. Computing real type of fields from metadata for ENUM and SET types. Computing pack_length correctly for ENUM, SET, and BLOB types. Adding optimization to not check compatibility if no slave type conversions are enabled. sql/rpl_utility.h: Changing prototypes since implementation has changed. Modifying table_def::type() to return real type instead of stored type. sql/set_var.cc: Adding SLAVE_TYPE_CONVERSIONS variable. sql/set_var.h: Adding SLAVE_TYPE_CONVERSIONS variable. sql/share/errmsg.txt: Adding error messages for slave type conversions. sql/sql_class.h: Adding SLAVE_TYPE_CONVERSIONS variable. sql/sql_select.cc: Correcting create_virtual_tmp_table() to compute null bit positions correctly in the presence of bit fields.
Diffstat (limited to 'mysql-test/extra')
-rw-r--r--mysql-test/extra/rpl_tests/check_type.inc52
-rw-r--r--mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test7
-rw-r--r--mysql-test/extra/rpl_tests/rpl_row_basic.test39
-rw-r--r--mysql-test/extra/rpl_tests/type_conversions.test710
4 files changed, 797 insertions, 11 deletions
diff --git a/mysql-test/extra/rpl_tests/check_type.inc b/mysql-test/extra/rpl_tests/check_type.inc
new file mode 100644
index 00000000000..63491d81da4
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/check_type.inc
@@ -0,0 +1,52 @@
+# Helper file to perform one insert of a value into a table with
+# different types on master and slave. The file will insert the
+# result into the type_conversions table *on the slave* to get a
+# summary of failing and succeeding tests.
+
+# Input:
+# $source_type Type on the master
+# $target_type Type on the slave
+# $source_value Value on the master (inserted into the table)
+# $target_value Value on the slave (expected value in the table
+# on the slave)
+# $can_convert True if conversion shall work, false if it
+# shall generate an error
+
+
+connection master;
+disable_warnings;
+DROP TABLE IF EXISTS t1;
+enable_warnings;
+eval CREATE TABLE t1 (a $source_type);
+sync_slave_with_master;
+eval ALTER TABLE t1 MODIFY a $target_type;
+
+connection master;
+eval INSERT INTO t1 VALUES($source_value);
+if ($can_convert) {
+ sync_slave_with_master;
+ eval SELECT a = $target_value into @compare FROM t1;
+ eval INSERT INTO type_conversions SET
+ Source = "$source_type",
+ Target = "$target_type",
+ Flags = @@slave_type_conversions,
+ On_Master = $source_value,
+ Expected = $target_value,
+ Compare = @compare;
+ UPDATE type_conversions
+ SET On_Slave = (SELECT a FROM t1)
+ WHERE TestNo = LAST_INSERT_ID();
+}
+if (!$can_convert) {
+ connection slave;
+ wait_for_slave_to_stop;
+ let $error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
+ eval INSERT INTO type_conversions SET
+ Source = "$source_type",
+ Target = "$target_type",
+ Flags = @@slave_type_conversions,
+ On_Master = $source_value,
+ Error = "$error";
+ SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
+ START SLAVE;
+}
diff --git a/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test b/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test
index a7b02065144..98aac8a0e58 100644
--- a/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test
+++ b/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test
@@ -36,6 +36,9 @@ sync_slave_with_master;
STOP SLAVE;
RESET SLAVE;
+SET @saved_slave_type_conversions = @@slave_type_conversions;
+SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY';
+
eval CREATE TABLE t1 (a INT, b INT PRIMARY KEY, c CHAR(20),
d FLOAT DEFAULT '2.00',
e CHAR(4) DEFAULT 'TEST')
@@ -62,6 +65,8 @@ SELECT * FROM t1 ORDER BY a;
sync_slave_with_master;
SELECT * FROM t1 ORDER BY a;
+SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
+
--echo *** Drop t1 ***
connection master;
DROP TABLE t1;
@@ -495,7 +500,7 @@ sync_slave_with_master;
--echo *** Create t11 on slave ***
STOP SLAVE;
RESET SLAVE;
-eval CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT,
+eval CREATE TABLE t11 (a INT KEY, b BLOB, f INT,
c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE=$engine_type;
--echo *** Create t11 on Master ***
diff --git a/mysql-test/extra/rpl_tests/rpl_row_basic.test b/mysql-test/extra/rpl_tests/rpl_row_basic.test
index 0ba27c69a55..a45527848be 100644
--- a/mysql-test/extra/rpl_tests/rpl_row_basic.test
+++ b/mysql-test/extra/rpl_tests/rpl_row_basic.test
@@ -6,6 +6,7 @@
# First we test tables with only an index.
#
+connection master;
eval CREATE TABLE t1 (C1 CHAR(1), C2 CHAR(1), INDEX (C1)$extra_index_t1) ENGINE = $type ;
SELECT * FROM t1;
sync_slave_with_master;
@@ -156,6 +157,12 @@ SELECT * FROM t5,t2,t3 WHERE t5.C2='Q' AND t2.c12='R' AND t3.C3 ='S' ORDER BY t5
# Testing special column types
#
+if (`select char_length('$bit_field_special') > 0`) {
+ SET @saved_slave_type_conversions = @@SLAVE_TYPE_CONVERSIONS;
+ connection slave;
+ eval SET GLOBAL SLAVE_TYPE_CONVERSIONS = '$bit_field_special';
+}
+
connection master;
eval CREATE TABLE t4 (C1 CHAR(1) PRIMARY KEY, B1 BIT(1), B2 BIT(1) NOT NULL DEFAULT 0, C2 CHAR(1) NOT NULL DEFAULT 'A') ENGINE = $type ;
@@ -164,6 +171,10 @@ SELECT C1,HEX(B1),HEX(B2) FROM t4 ORDER BY C1;
sync_slave_with_master;
SELECT C1,HEX(B1),HEX(B2) FROM t4 ORDER BY C1;
+if (`select char_length('$bit_field_special') > 0`) {
+ SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
+}
+
#
# Testing conflicting operations
#
@@ -350,6 +361,10 @@ eval CREATE TABLE t7 (i INT NOT NULL,
c CHAR(255) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL) ENGINE = $type ;
+connection slave;
+SET @saved_slave_type_conversions = @@slave_type_conversions;
+SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY';
+
--echo [expecting slave to replicate correctly]
connection master;
INSERT INTO t1 VALUES (1, "", 1);
@@ -370,17 +385,9 @@ let $diff_table_1=master:test.t2;
let $diff_table_2=slave:test.t2;
source include/diff_tables.inc;
---echo [expecting slave to stop]
-connection master;
-INSERT INTO t3 VALUES (1, "", 1);
-INSERT INTO t3 VALUES (2, repeat(_utf8'a', 128), 2);
-
connection slave;
-source include/wait_for_slave_sql_to_stop.inc;
-let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
-disable_query_log;
-eval SELECT "$last_error" AS Last_SQL_Error;
-enable_query_log;
+SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
+
connection master;
RESET MASTER;
connection slave;
@@ -600,7 +607,15 @@ sync_slave_with_master;
connection master;
+# Since t1 contain a bit field, we have to do this trick to handle InnoDB
+if (`select char_length('$bit_field_special') > 0`) {
+ SET @saved_slave_type_conversions = @@SLAVE_TYPE_CONVERSIONS;
+ connection slave;
+ eval SET GLOBAL SLAVE_TYPE_CONVERSIONS = '$bit_field_special';
+}
+
--disable_warnings
+connection master;
eval CREATE TABLE t1 (a bit) ENGINE=$type;
INSERT IGNORE INTO t1 VALUES (NULL);
INSERT INTO t1 ( a ) VALUES ( 0 );
@@ -645,6 +660,10 @@ UPDATE t1 SET a = 9 WHERE a < 5 LIMIT 3;
sync_slave_with_master;
+if (`select char_length('$bit_field_special') > 0`) {
+ SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
+}
+
let $diff_table_1=master:test.t1;
let $diff_table_2=slave:test.t1;
source include/diff_tables.inc;
diff --git a/mysql-test/extra/rpl_tests/type_conversions.test b/mysql-test/extra/rpl_tests/type_conversions.test
new file mode 100644
index 00000000000..2be1f6c0bec
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/type_conversions.test
@@ -0,0 +1,710 @@
+# File containing different lossy and non-lossy type conversions.
+
+# Integral conversion testing, we do not reduce the test using
+# transitivity of conversions since the implementation is not using a
+# transitivity strategy. Instead we do an exhaustive testing.
+
+disable_query_log;
+connection slave;
+--let $conv = `select @@slave_type_conversions`
+--echo **** Running tests with @@SLAVE_TYPE_CONVERSIONS = '$conv' ****
+
+let $if_is_lossy = `SELECT FIND_IN_SET('ALL_LOSSY', @@SLAVE_TYPE_CONVERSIONS)`;
+let $if_is_non_lossy = `SELECT FIND_IN_SET('ALL_NON_LOSSY', @@SLAVE_TYPE_CONVERSIONS)`;
+
+let $source_type = BIT(1);
+let $target_type = BIT(1);
+let $source_value = b'1';
+let $target_value = b'1';
+let $can_convert = 1;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type = DATE;
+let $target_type = DATE;
+let $source_value = '2009-11-21';
+let $target_value = '2009-11-21';
+let $can_convert = 1;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type = ENUM('master','slave');
+let $target_type = ENUM('master','slave');
+let $source_value = 'master';
+let $target_value = 'master';
+let $can_convert = 1;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type = CHAR(10);
+let $target_type = ENUM('master','slave');
+let $source_value = 'master';
+let $target_value = 'master';
+let $can_convert = 0;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type = CHAR(10);
+let $target_type = SET('master','slave');
+let $source_value = 'master';
+let $target_value = 'master';
+let $can_convert = 0;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type = ENUM('master','slave');
+let $target_type = CHAR(10);
+let $source_value = 'master';
+let $target_value = 'master';
+let $can_convert = 0;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type = SET('master','slave');
+let $target_type = CHAR(10);
+let $source_value = 'master';
+let $target_value = 'master';
+let $can_convert = 0;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type = SET('master','slave');
+let $target_type = SET('master','slave');
+let $source_value = '';
+let $target_value = '';
+let $can_convert = 1;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type = SET('master','slave');
+let $target_type = SET('master','slave');
+let $source_value = 'master,slave';
+let $target_value = 'master,slave';
+let $can_convert = 1;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type = TINYINT;
+let $target_type = TINYINT;
+let $source_value = 1;
+let $target_value = 1;
+let $can_convert = 1;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type = TINYINT;
+let $target_type = SMALLINT;
+let $source_value = 1;
+let $target_value = 1;
+let $can_convert = $if_is_non_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= TINYINT;
+let $target_type= MEDIUMINT;
+let $source_value= 1;
+let $target_value= 1;
+let $can_convert = $if_is_non_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= TINYINT;
+let $target_type= INT;
+let $source_value= 1;
+let $target_value= 1;
+let $can_convert = $if_is_non_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= TINYINT;
+let $target_type= BIGINT;
+let $source_value= 1;
+let $target_value= 1;
+let $can_convert = $if_is_non_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= SMALLINT;
+let $target_type= TINYINT;
+let $source_value= 1;
+let $target_value= 1;
+let $can_convert = $if_is_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= SMALLINT;
+let $target_type= TINYINT;
+let $source_value= 1 << 9;
+let $target_value= (1 << 7) - 1;
+let $can_convert = $if_is_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= SMALLINT;
+let $target_type= TINYINT UNSIGNED;
+let $source_value= 1 << 9;
+let $target_value= (1 << 8) - 1;
+let $can_convert = $if_is_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= SMALLINT;
+let $target_type= SMALLINT;
+let $source_value= 1;
+let $target_value= 1;
+let $can_convert = 1;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= SMALLINT;
+let $target_type= MEDIUMINT;
+let $source_value= 1;
+let $target_value= 1;
+let $can_convert = $if_is_non_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= SMALLINT;
+let $target_type= INT;
+let $source_value= 1;
+let $target_value= 1;
+let $can_convert = $if_is_non_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= SMALLINT;
+let $target_type= BIGINT;
+let $source_value= 1;
+let $target_value= 1;
+let $can_convert = $if_is_non_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= MEDIUMINT;
+let $target_type= TINYINT;
+let $source_value= 1;
+let $target_value= 1;
+let $can_convert = $if_is_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= MEDIUMINT;
+let $target_type= TINYINT;
+let $source_value= 1 << 20;
+let $target_value= (1 << 7) - 1;
+let $can_convert = $if_is_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= MEDIUMINT;
+let $target_type= TINYINT UNSIGNED;
+let $source_value= 1 << 20;
+let $target_value= (1 << 8) - 1;
+let $can_convert = $if_is_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= MEDIUMINT;
+let $target_type= SMALLINT;
+let $source_value= 1;
+let $target_value= 1;
+let $can_convert = $if_is_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= MEDIUMINT;
+let $target_type= MEDIUMINT;
+let $source_value= 1;
+let $target_value= 1;
+let $can_convert = 1;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= MEDIUMINT;
+let $target_type= INT;
+let $source_value= 1;
+let $target_value= 1;
+let $can_convert = $if_is_non_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= MEDIUMINT;
+let $target_type= BIGINT;
+let $source_value= 1;
+let $target_value= 1;
+let $can_convert = $if_is_non_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= INT;
+let $target_type= TINYINT;
+let $source_value= 1;
+let $target_value= 1;
+let $can_convert = $if_is_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= INT;
+let $target_type= TINYINT;
+let $source_value= (1 << 30);
+let $target_value= (1 << 7) - 1;
+let $can_convert = $if_is_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= INT;
+let $target_type= TINYINT UNSIGNED;
+let $source_value= (1 << 30);
+let $target_value= (1 << 8) - 1;
+let $can_convert = $if_is_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= INT;
+let $target_type= SMALLINT;
+let $source_value= 1;
+let $target_value= 1;
+let $can_convert = $if_is_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= INT;
+let $target_type= MEDIUMINT;
+let $source_value= 1;
+let $target_value= 1;
+let $can_convert = $if_is_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= INT;
+let $target_type= INT;
+let $source_value= 1;
+let $target_value= 1;
+let $can_convert = 1;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= INT;
+let $target_type= BIGINT;
+let $source_value= 1;
+let $target_value= 1;
+let $can_convert = $if_is_non_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= BIGINT;
+let $target_type= TINYINT;
+let $source_value= 1;
+let $target_value= 1;
+let $can_convert = $if_is_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= BIGINT;
+let $target_type= SMALLINT;
+let $source_value= 1;
+let $target_value= 1;
+let $can_convert = $if_is_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= BIGINT;
+let $target_type= MEDIUMINT;
+let $source_value= 1;
+let $target_value= 1;
+let $can_convert = $if_is_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= BIGINT;
+let $target_type= INT;
+let $source_value= 1;
+let $target_value= 1;
+let $can_convert = $if_is_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= BIGINT;
+let $target_type= BIGINT;
+let $source_value= 1;
+let $target_value= 1;
+let $can_convert = 1;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= CHAR(20);
+let $target_type= CHAR(20);
+let $source_value= 'Smoothnoodlemaps';
+let $target_value= 'Smoothnoodlemaps';
+let $can_convert = 1;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= CHAR(20);
+let $target_type= CHAR(30);
+let $source_value= 'Smoothnoodlemaps';
+let $target_value= 'Smoothnoodlemaps';
+let $can_convert = $if_is_non_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= CHAR(20);
+let $target_type= CHAR(10);
+let $source_value= 'Smoothnoodlemaps';
+let $target_value= 'Smoothnood';
+let $can_convert = $if_is_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= CHAR(20);
+let $target_type= VARCHAR(20);
+let $source_value= 'Smoothnoodlemaps';
+let $target_value= 'Smoothnoodlemaps';
+let $can_convert = $if_is_non_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= CHAR(20);
+let $target_type= VARCHAR(30);
+let $source_value= 'Smoothnoodlemaps';
+let $target_value= 'Smoothnoodlemaps';
+let $can_convert = $if_is_non_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= CHAR(20);
+let $target_type= VARCHAR(10);
+let $source_value= 'Smoothnoodlemaps';
+let $target_value= 'Smoothnood';
+let $can_convert = $if_is_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= CHAR(20);
+let $target_type= TINYTEXT;
+let $source_value= 'Smoothnoodlemaps';
+let $target_value= 'Smoothnoodlemaps';
+let $can_convert = $if_is_non_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= CHAR(20);
+let $target_type= TEXT;
+let $source_value= 'Smoothnoodlemaps';
+let $target_value= 'Smoothnoodlemaps';
+let $can_convert = $if_is_non_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= CHAR(20);
+let $target_type= MEDIUMTEXT;
+let $source_value= 'Smoothnoodlemaps';
+let $target_value= 'Smoothnoodlemaps';
+let $can_convert = $if_is_non_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= CHAR(20);
+let $target_type= LONGTEXT;
+let $source_value= 'Smoothnoodlemaps';
+let $target_value= 'Smoothnoodlemaps';
+let $can_convert = $if_is_non_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= VARCHAR(20);
+let $target_type= VARCHAR(20);
+let $source_value= 'Smoothnoodlemaps';
+let $target_value= 'Smoothnoodlemaps';
+let $can_convert = 1;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= VARCHAR(20);
+let $target_type= VARCHAR(30);
+let $source_value= 'Smoothnoodlemaps';
+let $target_value= 'Smoothnoodlemaps';
+let $can_convert = $if_is_non_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= VARCHAR(20);
+let $target_type= VARCHAR(10);
+let $source_value= 'Smoothnoodlemaps';
+let $target_value= 'Smoothnood';
+let $can_convert = $if_is_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= VARCHAR(20);
+let $target_type= CHAR(30);
+let $source_value= 'Smoothnoodlemaps';
+let $target_value= 'Smoothnoodlemaps';
+let $can_convert = $if_is_non_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= VARCHAR(20);
+let $target_type= CHAR(10);
+let $source_value= 'Smoothnoodlemaps';
+let $target_value= 'Smoothnood';
+let $can_convert = $if_is_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= VARCHAR(20);
+let $target_type= TINYTEXT;
+let $source_value= 'Smoothnoodlemaps';
+let $target_value= 'Smoothnoodlemaps';
+let $can_convert = $if_is_non_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= VARCHAR(20);
+let $target_type= TEXT;
+let $source_value= 'Smoothnoodlemaps';
+let $target_value= 'Smoothnoodlemaps';
+let $can_convert = $if_is_non_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= VARCHAR(20);
+let $target_type= MEDIUMTEXT;
+let $source_value= 'Smoothnoodlemaps';
+let $target_value= 'Smoothnoodlemaps';
+let $can_convert = $if_is_non_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= VARCHAR(20);
+let $target_type= LONGTEXT;
+let $source_value= 'Smoothnoodlemaps';
+let $target_value= 'Smoothnoodlemaps';
+let $can_convert = $if_is_non_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $blob = `select repeat('abcd', 125)`;
+let $truncated_blob = `select left('$blob', 255)`;
+
+let $source_type= VARCHAR(500);
+let $target_type= VARCHAR(500);
+let $source_value= '$blob';
+let $target_value= '$blob';
+let $can_convert = 1;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= VARCHAR(500);
+let $target_type= VARCHAR(510);
+let $source_value= '$blob';
+let $target_value= '$blob';
+let $can_convert = $if_is_non_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= VARCHAR(500);
+let $target_type= VARCHAR(255);
+let $source_value= '$blob';
+let $target_value= '$truncated_blob';
+let $can_convert = $if_is_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= VARCHAR(500);
+let $target_type= TINYTEXT;
+let $source_value= '$blob';
+let $target_value= '$truncated_blob';
+let $can_convert = $if_is_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= VARCHAR(500);
+let $target_type= TEXT;
+let $source_value= '$blob';
+let $target_value= '$blob';
+let $can_convert = $if_is_non_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= VARCHAR(500);
+let $target_type= MEDIUMTEXT;
+let $source_value= '$blob';
+let $target_value= '$blob';
+let $can_convert = $if_is_non_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= VARCHAR(500);
+let $target_type= LONGTEXT;
+let $source_value= '$blob';
+let $target_value= '$blob';
+let $can_convert = $if_is_non_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $tiny_blob = `select repeat('tiny blob ', 25)`;
+let $truncated_tiny_blob = `select left('$tiny_blob', 254)`;
+
+let $source_type= TINYTEXT;
+let $target_type= VARCHAR(500);
+let $source_value= '$tiny_blob';
+let $target_value= '$tiny_blob';
+let $can_convert = $if_is_non_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= TEXT;
+let $target_type= VARCHAR(500);
+let $source_value= '$blob';
+let $target_value= '$blob';
+let $can_convert = $if_is_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= MEDIUMTEXT;
+let $target_type= VARCHAR(500);
+let $source_value= '$blob';
+let $target_value= '$blob';
+let $can_convert = $if_is_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= LONGTEXT;
+let $target_type= VARCHAR(500);
+let $source_value= '$blob';
+let $target_value= '$blob';
+let $can_convert = $if_is_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= TINYTEXT;
+let $target_type= CHAR(255);
+let $source_value= '$tiny_blob';
+let $target_value= '$tiny_blob';
+let $can_convert = $if_is_non_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= TINYTEXT;
+let $target_type= CHAR(250);
+let $source_value= '$tiny_blob';
+let $target_value= left('$tiny_blob', 250);
+let $can_convert = $if_is_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= TEXT;
+let $target_type= CHAR(255);
+let $source_value= '$blob';
+let $target_value= left('$blob', 255);
+let $can_convert = $if_is_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= MEDIUMTEXT;
+let $target_type= CHAR(255);
+let $source_value= '$blob';
+let $target_value= left('$blob', 255);
+let $can_convert = $if_is_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= LONGTEXT;
+let $target_type= CHAR(255);
+let $source_value= '$blob';
+let $target_value= left('$blob', 255);
+let $can_convert = $if_is_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= TINYTEXT;
+let $target_type= TINYTEXT;
+let $source_value= '$tiny_blob';
+let $target_value= '$tiny_blob';
+let $can_convert = 1;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= TINYTEXT;
+let $target_type= TEXT;
+let $source_value= '$tiny_blob';
+let $target_value= '$tiny_blob';
+let $can_convert = $if_is_non_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= TEXT;
+let $target_type= TINYTEXT;
+let $source_value= '$blob';
+let $target_value= left('$blob',255);
+let $can_convert = $if_is_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= DECIMAL(10,5);
+let $target_type= DECIMAL(10,5);
+let $source_value= 3.14159;
+let $target_value= 3.14159;
+let $can_convert = 1;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= DECIMAL(10,5);
+let $target_type= DECIMAL(10,6);
+let $source_value= 3.14159;
+let $target_value= 3.141590;
+let $can_convert = $if_is_non_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= DECIMAL(10,5);
+let $target_type= DECIMAL(11,5);
+let $source_value= 3.14159;
+let $target_value= 3.14159;
+let $can_convert = $if_is_non_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= DECIMAL(10,5);
+let $target_type= DECIMAL(11,6);
+let $source_value= 3.14159;
+let $target_value= 3.141590;
+let $can_convert = $if_is_non_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= DECIMAL(10,5);
+let $target_type= DECIMAL(10,4);
+let $source_value= 3.14159;
+let $target_value= 3.1416;
+let $can_convert = $if_is_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= DECIMAL(10,5);
+let $target_type= DECIMAL(9,5);
+let $source_value= 3.14159;
+let $target_value= 3.14159;
+let $can_convert = $if_is_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= DECIMAL(10,5);
+let $target_type= DECIMAL(9,4);
+let $source_value= 3.14159;
+let $target_value= 3.1416;
+let $can_convert = $if_is_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= FLOAT;
+let $target_type= DECIMAL(10,5);
+let $source_value= 3.15625;
+let $target_value= 3.15625;
+let $can_convert = $if_is_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= DOUBLE;
+let $target_type= DECIMAL(10,5);
+let $source_value= 3.15625;
+let $target_value= 3.15625;
+let $can_convert = $if_is_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= DECIMAL(10,5);
+let $target_type= FLOAT;
+let $source_value= 3.15625;
+let $target_value= 3.15625;
+let $can_convert = $if_is_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= DECIMAL(10,5);
+let $target_type= DOUBLE;
+let $source_value= 3.15625;
+let $target_value= 3.15625;
+let $can_convert = $if_is_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= FLOAT;
+let $target_type= FLOAT;
+let $source_value= 3.15625;
+let $target_value= 3.15625;
+let $can_convert = 1;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= DOUBLE;
+let $target_type= DOUBLE;
+let $source_value= 3.15625;
+let $target_value= 3.15625;
+let $can_convert = 1;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= FLOAT;
+let $target_type= DOUBLE;
+let $source_value= 3.15625;
+let $target_value= 3.15625;
+let $can_convert = $if_is_non_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= DOUBLE;
+let $target_type= FLOAT;
+let $source_value= 3.15625;
+let $target_value= 3.15625;
+let $can_convert = $if_is_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= BIT(5);
+let $target_type= BIT(5);
+let $source_value= b'11001';
+let $target_value= b'11001';
+let $can_convert = 1;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= BIT(5);
+let $target_type= BIT(6);
+let $source_value= b'11001';
+let $target_value= b'11001';
+let $can_convert = $if_is_non_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= BIT(6);
+let $target_type= BIT(5);
+let $source_value= b'111001';
+let $target_value= b'11111';
+let $can_convert = $if_is_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= BIT(5);
+let $target_type= BIT(12);
+let $source_value= b'11001';
+let $target_value= b'11001';
+let $can_convert = $if_is_non_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= BIT(12);
+let $target_type= BIT(5);
+let $source_value= b'101100111000';
+let $target_value= b'11111';
+let $can_convert = $if_is_lossy;
+source extra/rpl_tests/check_type.inc;
+
+disable_warnings;
+source include/reset_master_and_slave.inc;
+enable_warnings;
+enable_query_log; \ No newline at end of file