mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
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 aee068085d
(MDEV-9238 Wrap create_virtual_tmp_table() into a class, split into different steps)
This commit is contained in:
@ -14,9 +14,9 @@ CREATE TABLE type_conversions (
|
|||||||
Source TEXT,
|
Source TEXT,
|
||||||
Target TEXT,
|
Target TEXT,
|
||||||
Flags TEXT,
|
Flags TEXT,
|
||||||
On_Master TEXT,
|
On_Master LONGTEXT,
|
||||||
On_Slave TEXT,
|
On_Slave LONGTEXT,
|
||||||
Expected TEXT,
|
Expected LONGTEXT,
|
||||||
Compare INT,
|
Compare INT,
|
||||||
Error TEXT);
|
Error TEXT);
|
||||||
|
|
||||||
|
@ -876,5 +876,136 @@ let $can_convert = $if_is_lossy;
|
|||||||
source extra/rpl_tests/check_type.inc;
|
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
|
--source include/rpl_reset.inc
|
||||||
enable_query_log;
|
enable_query_log;
|
||||||
|
@ -7,9 +7,9 @@ TestNo INT AUTO_INCREMENT PRIMARY KEY,
|
|||||||
Source TEXT,
|
Source TEXT,
|
||||||
Target TEXT,
|
Target TEXT,
|
||||||
Flags TEXT,
|
Flags TEXT,
|
||||||
On_Master TEXT,
|
On_Master LONGTEXT,
|
||||||
On_Slave TEXT,
|
On_Slave LONGTEXT,
|
||||||
Expected TEXT,
|
Expected LONGTEXT,
|
||||||
Compare INT,
|
Compare INT,
|
||||||
Error TEXT);
|
Error TEXT);
|
||||||
SELECT @@global.slave_type_conversions;
|
SELECT @@global.slave_type_conversions;
|
||||||
@ -39,18 +39,34 @@ ALL_LOSSY,ALL_NON_LOSSY
|
|||||||
connection slave;
|
connection slave;
|
||||||
SET GLOBAL SLAVE_TYPE_CONVERSIONS='';
|
SET GLOBAL SLAVE_TYPE_CONVERSIONS='';
|
||||||
**** Running tests with @@SLAVE_TYPE_CONVERSIONS = '' ****
|
**** Running tests with @@SLAVE_TYPE_CONVERSIONS = '' ****
|
||||||
|
#
|
||||||
|
# MDEV-15833 Row format replication between LONGBLOB and MEDIUMBLOB does not work for long values
|
||||||
|
#
|
||||||
|
# End of MDEV-15833
|
||||||
include/rpl_reset.inc
|
include/rpl_reset.inc
|
||||||
connection slave;
|
connection slave;
|
||||||
SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_NON_LOSSY';
|
SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_NON_LOSSY';
|
||||||
**** Running tests with @@SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY' ****
|
**** Running tests with @@SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY' ****
|
||||||
|
#
|
||||||
|
# MDEV-15833 Row format replication between LONGBLOB and MEDIUMBLOB does not work for long values
|
||||||
|
#
|
||||||
|
# End of MDEV-15833
|
||||||
include/rpl_reset.inc
|
include/rpl_reset.inc
|
||||||
connection slave;
|
connection slave;
|
||||||
SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY';
|
SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY';
|
||||||
**** Running tests with @@SLAVE_TYPE_CONVERSIONS = 'ALL_LOSSY' ****
|
**** Running tests with @@SLAVE_TYPE_CONVERSIONS = 'ALL_LOSSY' ****
|
||||||
|
#
|
||||||
|
# MDEV-15833 Row format replication between LONGBLOB and MEDIUMBLOB does not work for long values
|
||||||
|
#
|
||||||
|
# End of MDEV-15833
|
||||||
include/rpl_reset.inc
|
include/rpl_reset.inc
|
||||||
connection slave;
|
connection slave;
|
||||||
SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY,ALL_NON_LOSSY';
|
SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY,ALL_NON_LOSSY';
|
||||||
**** Running tests with @@SLAVE_TYPE_CONVERSIONS = 'ALL_LOSSY,ALL_NON_LOSSY' ****
|
**** Running tests with @@SLAVE_TYPE_CONVERSIONS = 'ALL_LOSSY,ALL_NON_LOSSY' ****
|
||||||
|
#
|
||||||
|
# MDEV-15833 Row format replication between LONGBLOB and MEDIUMBLOB does not work for long values
|
||||||
|
#
|
||||||
|
# End of MDEV-15833
|
||||||
include/rpl_reset.inc
|
include/rpl_reset.inc
|
||||||
connection slave;
|
connection slave;
|
||||||
**** Result of conversions ****
|
**** Result of conversions ****
|
||||||
@ -176,6 +192,20 @@ BIT(5) BIT(6) <Correct error>
|
|||||||
BIT(6) BIT(5) <Correct error>
|
BIT(6) BIT(5) <Correct error>
|
||||||
BIT(5) BIT(12) <Correct error>
|
BIT(5) BIT(12) <Correct error>
|
||||||
BIT(12) BIT(5) <Correct error>
|
BIT(12) BIT(5) <Correct error>
|
||||||
|
TINYBLOB BLOB <Correct error>
|
||||||
|
TINYBLOB MEDIUMBLOB <Correct error>
|
||||||
|
TINYBLOB LONGBLOB <Correct error>
|
||||||
|
TINYBLOB VARBINARY(255) <Correct error>
|
||||||
|
BLOB TINYBLOB <Correct error>
|
||||||
|
BLOB MEDIUMBLOB <Correct error>
|
||||||
|
BLOB LONGBLOB <Correct error>
|
||||||
|
BLOB VARBINARY(65500 <Correct error>
|
||||||
|
MEDIUMBLOB TINYBLOB <Correct error>
|
||||||
|
MEDIUMBLOB BLOB <Correct error>
|
||||||
|
MEDIUMBLOB VARBINARY(65500 <Correct error>
|
||||||
|
LONGBLOB TINYBLOB <Correct error>
|
||||||
|
LONGBLOB BLOB <Correct error>
|
||||||
|
LONGBLOB VARBINARY(65500 <Correct error>
|
||||||
TINYBLOB TINYBLOB ALL_NON_LOSSY <Correct value>
|
TINYBLOB TINYBLOB ALL_NON_LOSSY <Correct value>
|
||||||
TINYBLOB BLOB ALL_NON_LOSSY <Correct value>
|
TINYBLOB BLOB ALL_NON_LOSSY <Correct value>
|
||||||
TINYBLOB MEDIUMBLOB ALL_NON_LOSSY <Correct value>
|
TINYBLOB MEDIUMBLOB ALL_NON_LOSSY <Correct value>
|
||||||
@ -297,6 +327,20 @@ BIT(5) BIT(6) ALL_NON_LOSSY <Correct value>
|
|||||||
BIT(6) BIT(5) ALL_NON_LOSSY <Correct error>
|
BIT(6) BIT(5) ALL_NON_LOSSY <Correct error>
|
||||||
BIT(5) BIT(12) ALL_NON_LOSSY <Correct value>
|
BIT(5) BIT(12) ALL_NON_LOSSY <Correct value>
|
||||||
BIT(12) BIT(5) ALL_NON_LOSSY <Correct error>
|
BIT(12) BIT(5) ALL_NON_LOSSY <Correct error>
|
||||||
|
TINYBLOB BLOB ALL_NON_LOSSY <Correct value>
|
||||||
|
TINYBLOB MEDIUMBLOB ALL_NON_LOSSY <Correct value>
|
||||||
|
TINYBLOB LONGBLOB ALL_NON_LOSSY <Correct value>
|
||||||
|
TINYBLOB VARBINARY(255) ALL_NON_LOSSY <Correct value>
|
||||||
|
BLOB TINYBLOB ALL_NON_LOSSY <Correct error>
|
||||||
|
BLOB MEDIUMBLOB ALL_NON_LOSSY <Correct value>
|
||||||
|
BLOB LONGBLOB ALL_NON_LOSSY <Correct value>
|
||||||
|
BLOB VARBINARY(65500 ALL_NON_LOSSY <Correct error>
|
||||||
|
MEDIUMBLOB TINYBLOB ALL_NON_LOSSY <Correct error>
|
||||||
|
MEDIUMBLOB BLOB ALL_NON_LOSSY <Correct error>
|
||||||
|
MEDIUMBLOB VARBINARY(65500 ALL_NON_LOSSY <Correct error>
|
||||||
|
LONGBLOB TINYBLOB ALL_NON_LOSSY <Correct error>
|
||||||
|
LONGBLOB BLOB ALL_NON_LOSSY <Correct error>
|
||||||
|
LONGBLOB VARBINARY(65500 ALL_NON_LOSSY <Correct error>
|
||||||
TINYBLOB TINYBLOB ALL_LOSSY <Correct value>
|
TINYBLOB TINYBLOB ALL_LOSSY <Correct value>
|
||||||
TINYBLOB BLOB ALL_LOSSY <Correct error>
|
TINYBLOB BLOB ALL_LOSSY <Correct error>
|
||||||
TINYBLOB MEDIUMBLOB ALL_LOSSY <Correct error>
|
TINYBLOB MEDIUMBLOB ALL_LOSSY <Correct error>
|
||||||
@ -418,6 +462,20 @@ BIT(5) BIT(6) ALL_LOSSY <Correct error>
|
|||||||
BIT(6) BIT(5) ALL_LOSSY <Correct value>
|
BIT(6) BIT(5) ALL_LOSSY <Correct value>
|
||||||
BIT(5) BIT(12) ALL_LOSSY <Correct error>
|
BIT(5) BIT(12) ALL_LOSSY <Correct error>
|
||||||
BIT(12) BIT(5) ALL_LOSSY <Correct value>
|
BIT(12) BIT(5) ALL_LOSSY <Correct value>
|
||||||
|
TINYBLOB BLOB ALL_LOSSY <Correct error>
|
||||||
|
TINYBLOB MEDIUMBLOB ALL_LOSSY <Correct error>
|
||||||
|
TINYBLOB LONGBLOB ALL_LOSSY <Correct error>
|
||||||
|
TINYBLOB VARBINARY(255) ALL_LOSSY <Correct error>
|
||||||
|
BLOB TINYBLOB ALL_LOSSY <Correct value>
|
||||||
|
BLOB MEDIUMBLOB ALL_LOSSY <Correct error>
|
||||||
|
BLOB LONGBLOB ALL_LOSSY <Correct error>
|
||||||
|
BLOB VARBINARY(65500 ALL_LOSSY <Correct value>
|
||||||
|
MEDIUMBLOB TINYBLOB ALL_LOSSY <Correct value>
|
||||||
|
MEDIUMBLOB BLOB ALL_LOSSY <Correct value>
|
||||||
|
MEDIUMBLOB VARBINARY(65500 ALL_LOSSY <Correct value>
|
||||||
|
LONGBLOB TINYBLOB ALL_LOSSY <Correct value>
|
||||||
|
LONGBLOB BLOB ALL_LOSSY <Correct value>
|
||||||
|
LONGBLOB VARBINARY(65500 ALL_LOSSY <Correct value>
|
||||||
TINYBLOB TINYBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
TINYBLOB TINYBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
TINYBLOB BLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
TINYBLOB BLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
TINYBLOB MEDIUMBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
TINYBLOB MEDIUMBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
@ -539,6 +597,20 @@ BIT(5) BIT(6) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
|||||||
BIT(6) BIT(5) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
BIT(6) BIT(5) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
BIT(5) BIT(12) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
BIT(5) BIT(12) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
BIT(12) BIT(5) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
BIT(12) BIT(5) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
|
TINYBLOB BLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
|
TINYBLOB MEDIUMBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
|
TINYBLOB LONGBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
|
TINYBLOB VARBINARY(255) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
|
BLOB TINYBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
|
BLOB MEDIUMBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
|
BLOB LONGBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
|
BLOB VARBINARY(65500 ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
|
MEDIUMBLOB TINYBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
|
MEDIUMBLOB BLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
|
MEDIUMBLOB VARBINARY(65500 ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
|
LONGBLOB TINYBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
|
LONGBLOB BLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
|
LONGBLOB VARBINARY(65500 ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
DROP TABLE type_conversions;
|
DROP TABLE type_conversions;
|
||||||
call mtr.add_suppression("Slave SQL.*Column 1 of table .test.t1. cannot be converted from type.* error.* 1677");
|
call mtr.add_suppression("Slave SQL.*Column 1 of table .test.t1. cannot be converted from type.* error.* 1677");
|
||||||
connection master;
|
connection master;
|
||||||
|
@ -7,9 +7,9 @@ TestNo INT AUTO_INCREMENT PRIMARY KEY,
|
|||||||
Source TEXT,
|
Source TEXT,
|
||||||
Target TEXT,
|
Target TEXT,
|
||||||
Flags TEXT,
|
Flags TEXT,
|
||||||
On_Master TEXT,
|
On_Master LONGTEXT,
|
||||||
On_Slave TEXT,
|
On_Slave LONGTEXT,
|
||||||
Expected TEXT,
|
Expected LONGTEXT,
|
||||||
Compare INT,
|
Compare INT,
|
||||||
Error TEXT);
|
Error TEXT);
|
||||||
SELECT @@global.slave_type_conversions;
|
SELECT @@global.slave_type_conversions;
|
||||||
@ -39,18 +39,34 @@ ALL_LOSSY,ALL_NON_LOSSY
|
|||||||
connection slave;
|
connection slave;
|
||||||
SET GLOBAL SLAVE_TYPE_CONVERSIONS='';
|
SET GLOBAL SLAVE_TYPE_CONVERSIONS='';
|
||||||
**** Running tests with @@SLAVE_TYPE_CONVERSIONS = '' ****
|
**** Running tests with @@SLAVE_TYPE_CONVERSIONS = '' ****
|
||||||
|
#
|
||||||
|
# MDEV-15833 Row format replication between LONGBLOB and MEDIUMBLOB does not work for long values
|
||||||
|
#
|
||||||
|
# End of MDEV-15833
|
||||||
include/rpl_reset.inc
|
include/rpl_reset.inc
|
||||||
connection slave;
|
connection slave;
|
||||||
SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_NON_LOSSY';
|
SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_NON_LOSSY';
|
||||||
**** Running tests with @@SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY' ****
|
**** Running tests with @@SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY' ****
|
||||||
|
#
|
||||||
|
# MDEV-15833 Row format replication between LONGBLOB and MEDIUMBLOB does not work for long values
|
||||||
|
#
|
||||||
|
# End of MDEV-15833
|
||||||
include/rpl_reset.inc
|
include/rpl_reset.inc
|
||||||
connection slave;
|
connection slave;
|
||||||
SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY';
|
SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY';
|
||||||
**** Running tests with @@SLAVE_TYPE_CONVERSIONS = 'ALL_LOSSY' ****
|
**** Running tests with @@SLAVE_TYPE_CONVERSIONS = 'ALL_LOSSY' ****
|
||||||
|
#
|
||||||
|
# MDEV-15833 Row format replication between LONGBLOB and MEDIUMBLOB does not work for long values
|
||||||
|
#
|
||||||
|
# End of MDEV-15833
|
||||||
include/rpl_reset.inc
|
include/rpl_reset.inc
|
||||||
connection slave;
|
connection slave;
|
||||||
SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY,ALL_NON_LOSSY';
|
SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY,ALL_NON_LOSSY';
|
||||||
**** Running tests with @@SLAVE_TYPE_CONVERSIONS = 'ALL_LOSSY,ALL_NON_LOSSY' ****
|
**** Running tests with @@SLAVE_TYPE_CONVERSIONS = 'ALL_LOSSY,ALL_NON_LOSSY' ****
|
||||||
|
#
|
||||||
|
# MDEV-15833 Row format replication between LONGBLOB and MEDIUMBLOB does not work for long values
|
||||||
|
#
|
||||||
|
# End of MDEV-15833
|
||||||
include/rpl_reset.inc
|
include/rpl_reset.inc
|
||||||
connection slave;
|
connection slave;
|
||||||
**** Result of conversions ****
|
**** Result of conversions ****
|
||||||
@ -176,6 +192,20 @@ BIT(5) BIT(6) <Correct error>
|
|||||||
BIT(6) BIT(5) <Correct error>
|
BIT(6) BIT(5) <Correct error>
|
||||||
BIT(5) BIT(12) <Correct error>
|
BIT(5) BIT(12) <Correct error>
|
||||||
BIT(12) BIT(5) <Correct error>
|
BIT(12) BIT(5) <Correct error>
|
||||||
|
TINYBLOB BLOB <Correct error>
|
||||||
|
TINYBLOB MEDIUMBLOB <Correct error>
|
||||||
|
TINYBLOB LONGBLOB <Correct error>
|
||||||
|
TINYBLOB VARBINARY(255) <Correct error>
|
||||||
|
BLOB TINYBLOB <Correct error>
|
||||||
|
BLOB MEDIUMBLOB <Correct error>
|
||||||
|
BLOB LONGBLOB <Correct error>
|
||||||
|
BLOB VARBINARY(65500 <Correct error>
|
||||||
|
MEDIUMBLOB TINYBLOB <Correct error>
|
||||||
|
MEDIUMBLOB BLOB <Correct error>
|
||||||
|
MEDIUMBLOB VARBINARY(65500 <Correct error>
|
||||||
|
LONGBLOB TINYBLOB <Correct error>
|
||||||
|
LONGBLOB BLOB <Correct error>
|
||||||
|
LONGBLOB VARBINARY(65500 <Correct error>
|
||||||
TINYBLOB TINYBLOB ALL_NON_LOSSY <Correct value>
|
TINYBLOB TINYBLOB ALL_NON_LOSSY <Correct value>
|
||||||
TINYBLOB BLOB ALL_NON_LOSSY <Correct value>
|
TINYBLOB BLOB ALL_NON_LOSSY <Correct value>
|
||||||
TINYBLOB MEDIUMBLOB ALL_NON_LOSSY <Correct value>
|
TINYBLOB MEDIUMBLOB ALL_NON_LOSSY <Correct value>
|
||||||
@ -297,6 +327,20 @@ BIT(5) BIT(6) ALL_NON_LOSSY <Correct value>
|
|||||||
BIT(6) BIT(5) ALL_NON_LOSSY <Correct error>
|
BIT(6) BIT(5) ALL_NON_LOSSY <Correct error>
|
||||||
BIT(5) BIT(12) ALL_NON_LOSSY <Correct value>
|
BIT(5) BIT(12) ALL_NON_LOSSY <Correct value>
|
||||||
BIT(12) BIT(5) ALL_NON_LOSSY <Correct error>
|
BIT(12) BIT(5) ALL_NON_LOSSY <Correct error>
|
||||||
|
TINYBLOB BLOB ALL_NON_LOSSY <Correct value>
|
||||||
|
TINYBLOB MEDIUMBLOB ALL_NON_LOSSY <Correct value>
|
||||||
|
TINYBLOB LONGBLOB ALL_NON_LOSSY <Correct value>
|
||||||
|
TINYBLOB VARBINARY(255) ALL_NON_LOSSY <Correct value>
|
||||||
|
BLOB TINYBLOB ALL_NON_LOSSY <Correct error>
|
||||||
|
BLOB MEDIUMBLOB ALL_NON_LOSSY <Correct value>
|
||||||
|
BLOB LONGBLOB ALL_NON_LOSSY <Correct value>
|
||||||
|
BLOB VARBINARY(65500 ALL_NON_LOSSY <Correct error>
|
||||||
|
MEDIUMBLOB TINYBLOB ALL_NON_LOSSY <Correct error>
|
||||||
|
MEDIUMBLOB BLOB ALL_NON_LOSSY <Correct error>
|
||||||
|
MEDIUMBLOB VARBINARY(65500 ALL_NON_LOSSY <Correct error>
|
||||||
|
LONGBLOB TINYBLOB ALL_NON_LOSSY <Correct error>
|
||||||
|
LONGBLOB BLOB ALL_NON_LOSSY <Correct error>
|
||||||
|
LONGBLOB VARBINARY(65500 ALL_NON_LOSSY <Correct error>
|
||||||
TINYBLOB TINYBLOB ALL_LOSSY <Correct value>
|
TINYBLOB TINYBLOB ALL_LOSSY <Correct value>
|
||||||
TINYBLOB BLOB ALL_LOSSY <Correct error>
|
TINYBLOB BLOB ALL_LOSSY <Correct error>
|
||||||
TINYBLOB MEDIUMBLOB ALL_LOSSY <Correct error>
|
TINYBLOB MEDIUMBLOB ALL_LOSSY <Correct error>
|
||||||
@ -418,6 +462,20 @@ BIT(5) BIT(6) ALL_LOSSY <Correct error>
|
|||||||
BIT(6) BIT(5) ALL_LOSSY <Correct value>
|
BIT(6) BIT(5) ALL_LOSSY <Correct value>
|
||||||
BIT(5) BIT(12) ALL_LOSSY <Correct error>
|
BIT(5) BIT(12) ALL_LOSSY <Correct error>
|
||||||
BIT(12) BIT(5) ALL_LOSSY <Correct value>
|
BIT(12) BIT(5) ALL_LOSSY <Correct value>
|
||||||
|
TINYBLOB BLOB ALL_LOSSY <Correct error>
|
||||||
|
TINYBLOB MEDIUMBLOB ALL_LOSSY <Correct error>
|
||||||
|
TINYBLOB LONGBLOB ALL_LOSSY <Correct error>
|
||||||
|
TINYBLOB VARBINARY(255) ALL_LOSSY <Correct error>
|
||||||
|
BLOB TINYBLOB ALL_LOSSY <Correct value>
|
||||||
|
BLOB MEDIUMBLOB ALL_LOSSY <Correct error>
|
||||||
|
BLOB LONGBLOB ALL_LOSSY <Correct error>
|
||||||
|
BLOB VARBINARY(65500 ALL_LOSSY <Correct value>
|
||||||
|
MEDIUMBLOB TINYBLOB ALL_LOSSY <Correct value>
|
||||||
|
MEDIUMBLOB BLOB ALL_LOSSY <Correct value>
|
||||||
|
MEDIUMBLOB VARBINARY(65500 ALL_LOSSY <Correct value>
|
||||||
|
LONGBLOB TINYBLOB ALL_LOSSY <Correct value>
|
||||||
|
LONGBLOB BLOB ALL_LOSSY <Correct value>
|
||||||
|
LONGBLOB VARBINARY(65500 ALL_LOSSY <Correct value>
|
||||||
TINYBLOB TINYBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
TINYBLOB TINYBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
TINYBLOB BLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
TINYBLOB BLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
TINYBLOB MEDIUMBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
TINYBLOB MEDIUMBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
@ -539,6 +597,20 @@ BIT(5) BIT(6) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
|||||||
BIT(6) BIT(5) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
BIT(6) BIT(5) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
BIT(5) BIT(12) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
BIT(5) BIT(12) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
BIT(12) BIT(5) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
BIT(12) BIT(5) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
|
TINYBLOB BLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
|
TINYBLOB MEDIUMBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
|
TINYBLOB LONGBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
|
TINYBLOB VARBINARY(255) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
|
BLOB TINYBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
|
BLOB MEDIUMBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
|
BLOB LONGBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
|
BLOB VARBINARY(65500 ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
|
MEDIUMBLOB TINYBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
|
MEDIUMBLOB BLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
|
MEDIUMBLOB VARBINARY(65500 ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
|
LONGBLOB TINYBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
|
LONGBLOB BLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
|
LONGBLOB VARBINARY(65500 ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||||
DROP TABLE type_conversions;
|
DROP TABLE type_conversions;
|
||||||
call mtr.add_suppression("Slave SQL.*Column 1 of table .test.t1. cannot be converted from type.* error.* 1677");
|
call mtr.add_suppression("Slave SQL.*Column 1 of table .test.t1. cannot be converted from type.* error.* 1677");
|
||||||
connection master;
|
connection master;
|
||||||
|
@ -548,47 +548,17 @@ Field *Type_handler_varchar::make_conversion_table_field(TABLE *table,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Field *Type_handler_tiny_blob::make_conversion_table_field(TABLE *table,
|
Field *Type_handler_blob_common::make_conversion_table_field(TABLE *table,
|
||||||
uint metadata,
|
uint metadata,
|
||||||
const Field *target)
|
const Field *target)
|
||||||
const
|
const
|
||||||
{
|
{
|
||||||
|
uint pack_length= metadata & 0x00ff;
|
||||||
|
if (pack_length < 1 || pack_length > 4)
|
||||||
|
return NULL; // Broken binary log?
|
||||||
return new(table->in_use->mem_root)
|
return new(table->in_use->mem_root)
|
||||||
Field_blob(NULL, (uchar *) "", 1, Field::NONE, TMPNAME,
|
Field_blob(NULL, (uchar *) "", 1, Field::NONE, TMPNAME,
|
||||||
table->s, 1, target->charset());
|
table->s, pack_length, target->charset());
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Field *Type_handler_blob::make_conversion_table_field(TABLE *table,
|
|
||||||
uint metadata,
|
|
||||||
const Field *target)
|
|
||||||
const
|
|
||||||
{
|
|
||||||
return new(table->in_use->mem_root)
|
|
||||||
Field_blob(NULL, (uchar *) "", 1, Field::NONE, TMPNAME,
|
|
||||||
table->s, 2, target->charset());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Field *Type_handler_medium_blob::make_conversion_table_field(TABLE *table,
|
|
||||||
uint metadata,
|
|
||||||
const Field *target)
|
|
||||||
const
|
|
||||||
{
|
|
||||||
return new(table->in_use->mem_root)
|
|
||||||
Field_blob(NULL, (uchar *) "", 1, Field::NONE, TMPNAME,
|
|
||||||
table->s, 3, target->charset());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Field *Type_handler_long_blob::make_conversion_table_field(TABLE *table,
|
|
||||||
uint metadata,
|
|
||||||
const Field *target)
|
|
||||||
const
|
|
||||||
{
|
|
||||||
return new(table->in_use->mem_root)
|
|
||||||
Field_blob(NULL, (uchar *) "", 1, Field::NONE, TMPNAME,
|
|
||||||
table->s, 4, target->charset());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -416,43 +416,44 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class Type_handler_tiny_blob: public Type_handler_string_result
|
class Type_handler_blob_common: public Type_handler_string_result
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual ~Type_handler_blob_common() { }
|
||||||
|
Field *make_conversion_table_field(TABLE *, uint metadata,
|
||||||
|
const Field *target) const;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class Type_handler_tiny_blob: public Type_handler_blob_common
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~Type_handler_tiny_blob() {}
|
virtual ~Type_handler_tiny_blob() {}
|
||||||
enum_field_types field_type() const { return MYSQL_TYPE_TINY_BLOB; }
|
enum_field_types field_type() const { return MYSQL_TYPE_TINY_BLOB; }
|
||||||
Field *make_conversion_table_field(TABLE *, uint metadata,
|
|
||||||
const Field *target) const;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class Type_handler_medium_blob: public Type_handler_string_result
|
class Type_handler_medium_blob: public Type_handler_blob_common
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~Type_handler_medium_blob() {}
|
virtual ~Type_handler_medium_blob() {}
|
||||||
enum_field_types field_type() const { return MYSQL_TYPE_MEDIUM_BLOB; }
|
enum_field_types field_type() const { return MYSQL_TYPE_MEDIUM_BLOB; }
|
||||||
Field *make_conversion_table_field(TABLE *, uint metadata,
|
|
||||||
const Field *target) const;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class Type_handler_long_blob: public Type_handler_string_result
|
class Type_handler_long_blob: public Type_handler_blob_common
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~Type_handler_long_blob() {}
|
virtual ~Type_handler_long_blob() {}
|
||||||
enum_field_types field_type() const { return MYSQL_TYPE_LONG_BLOB; }
|
enum_field_types field_type() const { return MYSQL_TYPE_LONG_BLOB; }
|
||||||
Field *make_conversion_table_field(TABLE *, uint metadata,
|
|
||||||
const Field *target) const;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class Type_handler_blob: public Type_handler_string_result
|
class Type_handler_blob: public Type_handler_blob_common
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~Type_handler_blob() {}
|
virtual ~Type_handler_blob() {}
|
||||||
enum_field_types field_type() const { return MYSQL_TYPE_BLOB; }
|
enum_field_types field_type() const { return MYSQL_TYPE_BLOB; }
|
||||||
Field *make_conversion_table_field(TABLE *, uint metadata,
|
|
||||||
const Field *target) const;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user