summaryrefslogtreecommitdiff
path: root/mysql-test/extra
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2018-04-10 13:15:57 +0400
committerAlexander Barkov <bar@mariadb.com>2018-04-10 13:15:57 +0400
commit4d9c5844b8b8661c6d61af9871d4c92c68271fd1 (patch)
tree31203a960777070be1895a3c8a0264855bc37c57 /mysql-test/extra
parent141592cedb36a0d7c49b15ee0a90d2701c8cc0b1 (diff)
downloadmariadb-git-4d9c5844b8b8661c6d61af9871d4c92c68271fd1.tar.gz
MDEV-15833 Row format replication between LONGBLOB and MEDIUMBLOB does not work for long values
The code in Type_handler_blob****::make_conversion_table_field() erroneously assumed that row format replication uses MYSQL_TYPE_TINYBLOB, MYSQL_TYPE_BLOB, MYSQL_TYPE_MEDIUMBLOB, MYSQL_TYPE_LONGBLOB type codes to tranfer BLOB variations. In fact, all BLOB variations use MYSQL_TYPE_BLOB as the type code, while the BLOB packlength (1,2,3 or 4) it tranferred in metadata. The bug was introduced by aee068085ddb13f700780eeb61fce29c1e37df63 (MDEV-9238 Wrap create_virtual_tmp_table() into a class, split into different steps)
Diffstat (limited to 'mysql-test/extra')
-rw-r--r--mysql-test/extra/rpl_tests/rpl_typeconv.inc6
-rw-r--r--mysql-test/extra/rpl_tests/type_conversions.test131
2 files changed, 134 insertions, 3 deletions
diff --git a/mysql-test/extra/rpl_tests/rpl_typeconv.inc b/mysql-test/extra/rpl_tests/rpl_typeconv.inc
index 0f078854ec2..a26455fd97b 100644
--- a/mysql-test/extra/rpl_tests/rpl_typeconv.inc
+++ b/mysql-test/extra/rpl_tests/rpl_typeconv.inc
@@ -14,9 +14,9 @@ CREATE TABLE type_conversions (
Source TEXT,
Target TEXT,
Flags TEXT,
- On_Master TEXT,
- On_Slave TEXT,
- Expected TEXT,
+ On_Master LONGTEXT,
+ On_Slave LONGTEXT,
+ Expected LONGTEXT,
Compare INT,
Error TEXT);
diff --git a/mysql-test/extra/rpl_tests/type_conversions.test b/mysql-test/extra/rpl_tests/type_conversions.test
index 0096fda3174..9004cb00c24 100644
--- a/mysql-test/extra/rpl_tests/type_conversions.test
+++ b/mysql-test/extra/rpl_tests/type_conversions.test
@@ -876,5 +876,136 @@ let $can_convert = $if_is_lossy;
source extra/rpl_tests/check_type.inc;
+--echo #
+--echo # MDEV-15833 Row format replication between LONGBLOB and MEDIUMBLOB does not work for long values
+--echo #
+
+# TINYBLOB
+
+let $source_type= TINYBLOB;
+let $target_type= BLOB;
+let $source_value= REPEAT('a',250);
+let $target_value= REPEAT('a',250);
+let $can_convert = $if_is_non_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= TINYBLOB;
+let $target_type= MEDIUMBLOB;
+let $source_value= REPEAT('a',250);
+let $target_value= REPEAT('a',250);
+let $can_convert = $if_is_non_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= TINYBLOB;
+let $target_type= LONGBLOB;
+let $source_value= REPEAT('a',250);
+let $target_value= REPEAT('a',250);
+let $can_convert = $if_is_non_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= TINYBLOB;
+let $target_type= VARBINARY(255);
+let $source_value= REPEAT('a',250);
+let $target_value= REPEAT('a',250);
+let $can_convert = $if_is_non_lossy;
+source extra/rpl_tests/check_type.inc;
+
+
+# BLOB
+
+let $source_type= BLOB;
+let $target_type= TINYBLOB;
+let $source_value= REPEAT('a',64000);
+let $target_value= REPEAT('a',255);
+let $can_convert = $if_is_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= BLOB;
+let $target_type= MEDIUMBLOB;
+let $source_value= REPEAT('a',64000);
+let $target_value= REPEAT('a',64000);
+let $can_convert = $if_is_non_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= BLOB;
+let $target_type= LONGBLOB;
+let $source_value= REPEAT('a',64000);
+let $target_value= REPEAT('a',64000);
+let $can_convert = $if_is_non_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= BLOB;
+let $target_type= VARBINARY(65500);
+let $source_value= REPEAT('a',65535);
+let $target_value= REPEAT('a',65500);
+let $can_convert = $if_is_lossy;
+source extra/rpl_tests/check_type.inc;
+
+
+# MEDIUMBLOB
+
+let $source_type= MEDIUMBLOB;
+let $target_type= TINYBLOB;
+let $source_value= REPEAT('a',66000);
+let $target_value= REPEAT('a',255);
+let $can_convert = $if_is_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= MEDIUMBLOB;
+let $target_type= BLOB;
+let $source_value= REPEAT('a',66000);
+let $target_value= REPEAT('a',65535);
+let $can_convert = $if_is_lossy;
+source extra/rpl_tests/check_type.inc;
+
+# This failed before the fix
+#let $source_type= MEDIUMBLOB;
+#let $target_type= LONGBLOB;
+#let $source_value= REPEAT('a',66000);
+#let $target_value= REPEAT('a',66000);
+#let $can_convert = $if_is_non_lossy;
+#source extra/rpl_tests/check_type.inc;
+
+let $source_type= MEDIUMBLOB;
+let $target_type= VARBINARY(65500);
+let $source_value= REPEAT('a',66000);
+let $target_value= REPEAT('a',65500);
+let $can_convert = $if_is_lossy;
+source extra/rpl_tests/check_type.inc;
+
+
+# LONGBLOB
+
+let $source_type= LONGBLOB;
+let $target_type= TINYBLOB;
+let $source_value= REPEAT('a',66000);
+let $target_value= REPEAT('a',255);
+let $can_convert = $if_is_lossy;
+source extra/rpl_tests/check_type.inc;
+
+let $source_type= LONGBLOB;
+let $target_type= BLOB;
+let $source_value= REPEAT('a',66000);
+let $target_value= REPEAT('a',65535);
+let $can_convert = $if_is_lossy;
+source extra/rpl_tests/check_type.inc;
+
+# This failed before the fix
+#let $source_type= LONGBLOB;
+#let $target_type= BLOB;
+#let $source_value= REPEAT('a',66000);
+#let $target_value= REPEAT('a',66000);
+#let $can_convert = $if_is_lossy;
+#source extra/rpl_tests/check_type.inc;
+
+let $source_type= LONGBLOB;
+let $target_type= VARBINARY(65500);
+let $source_value= REPEAT('a',66000);
+let $target_value= REPEAT('a',65500);
+let $can_convert = $if_is_lossy;
+source extra/rpl_tests/check_type.inc;
+
+--echo # End of MDEV-15833
+
--source include/rpl_reset.inc
enable_query_log;