mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge 10.2 into 10.3
This commit is contained in:
@@ -468,7 +468,7 @@ INSERT INTO t10 () VALUES(1,@b1,DEFAULT,'Kyle',DEFAULT),
|
||||
|
||||
connection slave;
|
||||
include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
|
||||
Last_SQL_Error = 'Column 2 of table 'test.t10' cannot be converted from type 'double' to type 'char(5)''
|
||||
Last_SQL_Error = 'Column 2 of table 'test.t10' cannot be converted from type 'double' to type 'char(5 octets) character set latin1''
|
||||
|
||||
*** Drop t10 ***
|
||||
connection master;
|
||||
@@ -510,7 +510,7 @@ INSERT INTO t11 () VALUES(1,@b1,'Testing is fun','Kyle',DEFAULT),
|
||||
|
||||
connection slave;
|
||||
include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
|
||||
Last_SQL_Error = 'Column 2 of table 'test.t11' cannot be converted from type 'tinyblob' to type 'varchar(254)''
|
||||
Last_SQL_Error = 'Column 2 of table 'test.t11' cannot be converted from type 'blob' to type 'varchar(254 octets) character set latin1''
|
||||
|
||||
*** Drop t11 ***
|
||||
connection master;
|
||||
|
@@ -468,7 +468,7 @@ INSERT INTO t10 () VALUES(1,@b1,DEFAULT,'Kyle',DEFAULT),
|
||||
|
||||
connection slave;
|
||||
include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
|
||||
Last_SQL_Error = 'Column 2 of table 'test.t10' cannot be converted from type 'double' to type 'char(5)''
|
||||
Last_SQL_Error = 'Column 2 of table 'test.t10' cannot be converted from type 'double' to type 'char(5 octets) character set latin1''
|
||||
|
||||
*** Drop t10 ***
|
||||
connection master;
|
||||
@@ -510,7 +510,7 @@ INSERT INTO t11 () VALUES(1,@b1,'Testing is fun','Kyle',DEFAULT),
|
||||
|
||||
connection slave;
|
||||
include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
|
||||
Last_SQL_Error = 'Column 2 of table 'test.t11' cannot be converted from type 'tinyblob' to type 'varchar(254)''
|
||||
Last_SQL_Error = 'Column 2 of table 'test.t11' cannot be converted from type 'blob' to type 'varchar(254 octets) character set latin1''
|
||||
|
||||
*** Drop t11 ***
|
||||
connection master;
|
||||
|
@@ -64,7 +64,7 @@ a b c
|
||||
connection slave;
|
||||
START SLAVE;
|
||||
include/wait_for_slave_sql_error.inc [errno=1677]
|
||||
Last_SQL_Error = 'Column 2 of table 'test.t2' cannot be converted from type 'char(10)' to type 'char(5)''
|
||||
Last_SQL_Error = 'Column 2 of table 'test.t2' cannot be converted from type 'char(10 octets)' to type 'char(5 octets) character set latin1''
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
SELECT * FROM t2 ORDER BY a;
|
||||
@@ -102,7 +102,7 @@ INSERT INTO t3 () VALUES(@b1,2,'Kyle, TEX'),(@b1,1,'JOE AUSTIN'),(@b1,4,'QA TEST
|
||||
********************************************
|
||||
connection slave;
|
||||
include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
|
||||
Last_SQL_Error = 'Column 0 of table 'test.t3' cannot be converted from type 'tinyblob' to type 'int(11)''
|
||||
Last_SQL_Error = 'Column 0 of table 'test.t3' cannot be converted from type 'blob' to type 'int(11)''
|
||||
*** Drop t3 ***
|
||||
connection master;
|
||||
DROP TABLE t3;
|
||||
@@ -160,7 +160,7 @@ INSERT INTO t5 () VALUES(1,'Kyle',200.23,1,'b1b1',23.00098),
|
||||
********************************************
|
||||
connection slave;
|
||||
include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
|
||||
Last_SQL_Error = 'Column 1 of table 'test.t5' cannot be converted from type 'varchar(6)' to type 'char(5)''
|
||||
Last_SQL_Error = 'Column 1 of table 'test.t5' cannot be converted from type 'varchar(6 octets)' to type 'char(5 octets) character set latin1''
|
||||
*** Drop t5 ***
|
||||
connection master;
|
||||
DROP TABLE t5;
|
||||
@@ -188,7 +188,7 @@ INSERT INTO t6 () VALUES(1,'Kyle',200.23,1),
|
||||
********************************************
|
||||
connection slave;
|
||||
include/wait_for_slave_sql_error.inc [errno=1677]
|
||||
Last_SQL_Error = 'Column 1 of table 'test.t6' cannot be converted from type 'varchar(6)' to type 'char(5)''
|
||||
Last_SQL_Error = 'Column 1 of table 'test.t6' cannot be converted from type 'varchar(6 octets)' to type 'char(5 octets) character set latin1''
|
||||
*** Drop t6 ***
|
||||
include/rpl_reset.inc
|
||||
connection master;
|
||||
@@ -310,7 +310,7 @@ INSERT INTO t10 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
|
||||
********************************************
|
||||
connection slave;
|
||||
include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
|
||||
Last_SQL_Error = 'Column 2 of table 'test.t10' cannot be converted from type 'char(5)' to type 'double''
|
||||
Last_SQL_Error = 'Column 2 of table 'test.t10' cannot be converted from type 'char(5 octets)' to type 'double''
|
||||
*** Drop t10 ***
|
||||
connection master;
|
||||
DROP TABLE t10;
|
||||
@@ -338,7 +338,7 @@ INSERT INTO t11 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
|
||||
********************************************
|
||||
connection slave;
|
||||
include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
|
||||
Last_SQL_Error = 'Column 2 of table 'test.t11' cannot be converted from type 'varchar(254)' to type 'int(11)''
|
||||
Last_SQL_Error = 'Column 2 of table 'test.t11' cannot be converted from type 'varchar(254 octets)' to type 'int(11)''
|
||||
*** Drop t11 ***
|
||||
connection master;
|
||||
DROP TABLE t11;
|
||||
|
@@ -64,7 +64,7 @@ a b c
|
||||
connection slave;
|
||||
START SLAVE;
|
||||
include/wait_for_slave_sql_error.inc [errno=1677]
|
||||
Last_SQL_Error = 'Column 2 of table 'test.t2' cannot be converted from type 'char(10)' to type 'char(5)''
|
||||
Last_SQL_Error = 'Column 2 of table 'test.t2' cannot be converted from type 'char(10 octets)' to type 'char(5 octets) character set latin1''
|
||||
STOP SLAVE;
|
||||
RESET SLAVE;
|
||||
SELECT * FROM t2 ORDER BY a;
|
||||
@@ -102,7 +102,7 @@ INSERT INTO t3 () VALUES(@b1,2,'Kyle, TEX'),(@b1,1,'JOE AUSTIN'),(@b1,4,'QA TEST
|
||||
********************************************
|
||||
connection slave;
|
||||
include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
|
||||
Last_SQL_Error = 'Column 0 of table 'test.t3' cannot be converted from type 'tinyblob' to type 'int(11)''
|
||||
Last_SQL_Error = 'Column 0 of table 'test.t3' cannot be converted from type 'blob' to type 'int(11)''
|
||||
*** Drop t3 ***
|
||||
connection master;
|
||||
DROP TABLE t3;
|
||||
@@ -160,7 +160,7 @@ INSERT INTO t5 () VALUES(1,'Kyle',200.23,1,'b1b1',23.00098),
|
||||
********************************************
|
||||
connection slave;
|
||||
include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
|
||||
Last_SQL_Error = 'Column 1 of table 'test.t5' cannot be converted from type 'varchar(6)' to type 'char(5)''
|
||||
Last_SQL_Error = 'Column 1 of table 'test.t5' cannot be converted from type 'varchar(6 octets)' to type 'char(5 octets) character set latin1''
|
||||
*** Drop t5 ***
|
||||
connection master;
|
||||
DROP TABLE t5;
|
||||
@@ -188,7 +188,7 @@ INSERT INTO t6 () VALUES(1,'Kyle',200.23,1),
|
||||
********************************************
|
||||
connection slave;
|
||||
include/wait_for_slave_sql_error.inc [errno=1677]
|
||||
Last_SQL_Error = 'Column 1 of table 'test.t6' cannot be converted from type 'varchar(6)' to type 'char(5)''
|
||||
Last_SQL_Error = 'Column 1 of table 'test.t6' cannot be converted from type 'varchar(6 octets)' to type 'char(5 octets) character set latin1''
|
||||
*** Drop t6 ***
|
||||
include/rpl_reset.inc
|
||||
connection master;
|
||||
@@ -310,7 +310,7 @@ INSERT INTO t10 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
|
||||
********************************************
|
||||
connection slave;
|
||||
include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
|
||||
Last_SQL_Error = 'Column 2 of table 'test.t10' cannot be converted from type 'char(5)' to type 'double''
|
||||
Last_SQL_Error = 'Column 2 of table 'test.t10' cannot be converted from type 'char(5 octets)' to type 'double''
|
||||
*** Drop t10 ***
|
||||
connection master;
|
||||
DROP TABLE t10;
|
||||
@@ -338,7 +338,7 @@ INSERT INTO t11 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
|
||||
********************************************
|
||||
connection slave;
|
||||
include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
|
||||
Last_SQL_Error = 'Column 2 of table 'test.t11' cannot be converted from type 'varchar(254)' to type 'int(11)''
|
||||
Last_SQL_Error = 'Column 2 of table 'test.t11' cannot be converted from type 'varchar(254 octets)' to type 'int(11)''
|
||||
*** Drop t11 ***
|
||||
connection master;
|
||||
DROP TABLE t11;
|
||||
|
@@ -560,7 +560,7 @@ INSERT INTO t5 VALUES (1, "", 1);
|
||||
INSERT INTO t5 VALUES (2, repeat(_utf8'a', 255), 2);
|
||||
connection slave;
|
||||
include/wait_for_slave_sql_error.inc [errno=1677]
|
||||
Last_SQL_Error = 'Column 1 of table 'test.t5' cannot be converted from type 'char(255)' to type 'char(16)''
|
||||
Last_SQL_Error = 'Column 1 of table 'test.t5' cannot be converted from type 'char(765 octets)' to type 'char(48 octets) character set utf8''
|
||||
include/rpl_reset.inc
|
||||
[expecting slave to stop]
|
||||
connection master;
|
||||
@@ -568,7 +568,7 @@ INSERT INTO t6 VALUES (1, "", 1);
|
||||
INSERT INTO t6 VALUES (2, repeat(_utf8'a', 255), 2);
|
||||
connection slave;
|
||||
include/wait_for_slave_sql_error.inc [errno=1677]
|
||||
Last_SQL_Error = 'Column 1 of table 'test.t6' cannot be converted from type 'char(255)' to type 'char(128)''
|
||||
Last_SQL_Error = 'Column 1 of table 'test.t6' cannot be converted from type 'char(765 octets)' to type 'char(384 octets) character set utf8''
|
||||
include/rpl_reset.inc
|
||||
[expecting slave to replicate correctly]
|
||||
connection master;
|
||||
|
@@ -565,7 +565,7 @@ INSERT INTO t5 VALUES (1, "", 1);
|
||||
INSERT INTO t5 VALUES (2, repeat(_utf8'a', 255), 2);
|
||||
connection slave;
|
||||
include/wait_for_slave_sql_error.inc [errno=1677]
|
||||
Last_SQL_Error = 'Column 1 of table 'test.t5' cannot be converted from type 'char(255)' to type 'char(16)''
|
||||
Last_SQL_Error = 'Column 1 of table 'test.t5' cannot be converted from type 'char(765 octets)' to type 'char(48 octets) character set utf8''
|
||||
include/rpl_reset.inc
|
||||
[expecting slave to stop]
|
||||
connection master;
|
||||
@@ -573,7 +573,7 @@ INSERT INTO t6 VALUES (1, "", 1);
|
||||
INSERT INTO t6 VALUES (2, repeat(_utf8'a', 255), 2);
|
||||
connection slave;
|
||||
include/wait_for_slave_sql_error.inc [errno=1677]
|
||||
Last_SQL_Error = 'Column 1 of table 'test.t6' cannot be converted from type 'char(255)' to type 'char(128)''
|
||||
Last_SQL_Error = 'Column 1 of table 'test.t6' cannot be converted from type 'char(765 octets)' to type 'char(384 octets) character set utf8''
|
||||
include/rpl_reset.inc
|
||||
[expecting slave to replicate correctly]
|
||||
connection master;
|
||||
|
@@ -185,7 +185,7 @@ INSERT INTO t1 VALUES ('This is a test.');
|
||||
connection slave;
|
||||
START SLAVE;
|
||||
include/wait_for_slave_sql_error.inc [errno=1677]
|
||||
Last_SQL_Error = 'Column 0 of table 'test.t1' cannot be converted from type 'char(20)' to type 'char(10)''
|
||||
Last_SQL_Error = 'Column 0 of table 'test.t1' cannot be converted from type 'char(20 octets)' to type 'char(10 octets) character set latin1''
|
||||
SELECT COUNT(*) FROM t1;
|
||||
COUNT(*)
|
||||
0
|
||||
@@ -264,7 +264,7 @@ INSERT INTO t1 VALUES ('This is a test.');
|
||||
connection slave;
|
||||
START SLAVE;
|
||||
include/wait_for_slave_sql_error.inc [errno=1677]
|
||||
Last_SQL_Error = 'Column 0 of table 'test.t1' cannot be converted from type 'varchar(2000)' to type 'varchar(100)''
|
||||
Last_SQL_Error = 'Column 0 of table 'test.t1' cannot be converted from type 'varchar(2000 octets)' to type 'varchar(100 octets) character set latin1''
|
||||
SELECT COUNT(*) FROM t1;
|
||||
COUNT(*)
|
||||
0
|
||||
@@ -287,7 +287,7 @@ INSERT INTO t1 VALUES ('This is a test.');
|
||||
connection slave;
|
||||
START SLAVE;
|
||||
include/wait_for_slave_sql_error.inc [errno=1677]
|
||||
Last_SQL_Error = 'Column 0 of table 'test.t1' cannot be converted from type 'varchar(200)' to type 'varchar(10)''
|
||||
Last_SQL_Error = 'Column 0 of table 'test.t1' cannot be converted from type 'varchar(200 octets)' to type 'varchar(10 octets) character set latin1''
|
||||
SELECT COUNT(*) FROM t1;
|
||||
COUNT(*)
|
||||
0
|
||||
@@ -310,7 +310,7 @@ INSERT INTO t1 VALUES ('This is a test.');
|
||||
connection slave;
|
||||
START SLAVE;
|
||||
include/wait_for_slave_sql_error.inc [errno=1677]
|
||||
Last_SQL_Error = 'Column 0 of table 'test.t1' cannot be converted from type 'varchar(2000)' to type 'varchar(1000)''
|
||||
Last_SQL_Error = 'Column 0 of table 'test.t1' cannot be converted from type 'varchar(2000 octets)' to type 'varchar(1000 octets) character set latin1''
|
||||
SELECT COUNT(*) FROM t1;
|
||||
COUNT(*)
|
||||
0
|
||||
@@ -334,7 +334,7 @@ INSERT INTO t1 VALUES ('This is a test.');
|
||||
connection slave;
|
||||
START SLAVE;
|
||||
include/wait_for_slave_sql_error.inc [errno=1677]
|
||||
Last_SQL_Error = 'Column 0 of table 'test.t1' cannot be converted from type 'tinyblob' to type 'tinyblob''
|
||||
Last_SQL_Error = 'Column 0 of table 'test.t1' cannot be converted from type 'longblob' to type 'tinyblob''
|
||||
SELECT COUNT(*) FROM t1;
|
||||
COUNT(*)
|
||||
0
|
||||
|
164
mysql-test/suite/rpl/r/rpl_row_type_conv_err_msg.result
Normal file
164
mysql-test/suite/rpl/r/rpl_row_type_conv_err_msg.result
Normal file
@@ -0,0 +1,164 @@
|
||||
include/master-slave.inc
|
||||
[connection master]
|
||||
####################################################################
|
||||
# Test Case1: Improved error message with charset information
|
||||
####################################################################
|
||||
connection master;
|
||||
SET SQL_LOG_BIN=0;
|
||||
CREATE TABLE t1 (c1 VARCHAR(1) CHARACTER SET 'utf8mb3');
|
||||
SET SQL_LOG_BIN=1;
|
||||
connection slave;
|
||||
CREATE TABLE t1 (c1 VARCHAR(1) CHARACTER SET 'utf8mb4');
|
||||
connection master;
|
||||
INSERT INTO t1 VALUES ('a');
|
||||
connection slave;
|
||||
include/wait_for_slave_sql_error.inc [errno=1677]
|
||||
FOUND 1 /\'varchar\(3 octets\)\' to type \'varchar\(4 octets\) character set utf8mb4\'/ in mysqld.2.err
|
||||
connection master;
|
||||
DROP TABLE t1;
|
||||
connection slave;
|
||||
DROP TABLE t1;
|
||||
include/rpl_reset.inc
|
||||
####################################################################
|
||||
# Test Case2: Improved error message with charset information for CHAR
|
||||
# type
|
||||
####################################################################
|
||||
connection master;
|
||||
SET SQL_LOG_BIN=0;
|
||||
CREATE TABLE t1 (c1 CHAR(1) CHARACTER SET 'utf8mb3');
|
||||
SET SQL_LOG_BIN=1;
|
||||
connection slave;
|
||||
CREATE TABLE t1 (c1 CHAR(1) CHARACTER SET 'utf8mb4');
|
||||
connection master;
|
||||
INSERT INTO t1 VALUES ('a');
|
||||
connection slave;
|
||||
include/wait_for_slave_sql_error.inc [errno=1677]
|
||||
FOUND 1 /\'char\(3 octets\)\' to type \'char\(4 octets\) character set utf8mb4\'/ in mysqld.2.err
|
||||
connection master;
|
||||
DROP TABLE t1;
|
||||
connection slave;
|
||||
DROP TABLE t1;
|
||||
include/rpl_reset.inc
|
||||
####################################################################
|
||||
# Test Case3: For BLOB type fileds, when type conversion failed on
|
||||
# slave, the errormessage had incorrect type names.
|
||||
####################################################################
|
||||
connection master;
|
||||
SET SQL_LOG_BIN=0;
|
||||
CREATE TABLE t1 (c1 LONGBLOB);
|
||||
SET SQL_LOG_BIN=1;
|
||||
connection slave;
|
||||
CREATE TABLE t1 (c1 TINYBLOB);
|
||||
connection master;
|
||||
INSERT INTO t1 VALUES ('a');
|
||||
connection slave;
|
||||
include/wait_for_slave_sql_error.inc [errno=1677]
|
||||
FOUND 1 /\'longblob\' to type \'tinyblob\'/ in mysqld.2.err
|
||||
connection master;
|
||||
DROP TABLE t1;
|
||||
connection slave;
|
||||
DROP TABLE t1;
|
||||
include/rpl_reset.inc
|
||||
####################################################################
|
||||
# Test Case4: Verifies varbinary to binary type conversion failure
|
||||
# specific error message.
|
||||
####################################################################
|
||||
connection master;
|
||||
SET SQL_LOG_BIN=0;
|
||||
CREATE TABLE t1 (c1 VARBINARY(10));
|
||||
SET SQL_LOG_BIN=1;
|
||||
connection slave;
|
||||
CREATE TABLE t1 (c1 BINARY(10));
|
||||
connection master;
|
||||
INSERT INTO t1 VALUES ('a');
|
||||
connection slave;
|
||||
include/wait_for_slave_sql_error.inc [errno=1677]
|
||||
FOUND 1 /\'varbinary\(10\)\' to type \'binary\(10\)\'/ in mysqld.2.err
|
||||
connection master;
|
||||
DROP TABLE t1;
|
||||
connection slave;
|
||||
DROP TABLE t1;
|
||||
include/rpl_reset.inc
|
||||
####################################################################
|
||||
# Test Case5: Verifies binary to varbinary type conversion failure
|
||||
# specific error message.
|
||||
####################################################################
|
||||
connection master;
|
||||
SET SQL_LOG_BIN=0;
|
||||
CREATE TABLE t1 (c1 BINARY(10));
|
||||
SET SQL_LOG_BIN=1;
|
||||
connection slave;
|
||||
CREATE TABLE t1 (c1 VARBINARY(10));
|
||||
connection master;
|
||||
INSERT INTO t1 VALUES ('a');
|
||||
connection slave;
|
||||
include/wait_for_slave_sql_error.inc [errno=1677]
|
||||
FOUND 1 /\'binary\(10\)\' to type \'varbinary\(10\)\'/ in mysqld.2.err
|
||||
connection master;
|
||||
DROP TABLE t1;
|
||||
connection slave;
|
||||
DROP TABLE t1;
|
||||
include/rpl_reset.inc
|
||||
####################################################################
|
||||
# Test Case6: Verifies binary to binary type conversion failure
|
||||
# specific error message.
|
||||
####################################################################
|
||||
connection master;
|
||||
SET SQL_LOG_BIN=0;
|
||||
CREATE TABLE t1 (c1 BINARY(1));
|
||||
SET SQL_LOG_BIN=1;
|
||||
connection slave;
|
||||
CREATE TABLE t1 (c1 BINARY(10));
|
||||
connection master;
|
||||
INSERT INTO t1 VALUES ('a');
|
||||
connection slave;
|
||||
include/wait_for_slave_sql_error.inc [errno=1677]
|
||||
FOUND 1 /\'binary\(1\)\' to type \'binary\(10\)\'/ in mysqld.2.err
|
||||
connection master;
|
||||
DROP TABLE t1;
|
||||
connection slave;
|
||||
DROP TABLE t1;
|
||||
include/rpl_reset.inc
|
||||
####################################################################
|
||||
# Test Case7: Verifies char to blob type conversion failure
|
||||
# specific error message. BLOB field on slave has no
|
||||
# associated character set hence the master side field
|
||||
# is also considered as binary.
|
||||
####################################################################
|
||||
connection master;
|
||||
SET SQL_LOG_BIN=0;
|
||||
CREATE TABLE t1 (c1 CHAR(1));
|
||||
SET SQL_LOG_BIN=1;
|
||||
connection slave;
|
||||
CREATE TABLE t1 (c1 BLOB);
|
||||
connection master;
|
||||
INSERT INTO t1 VALUES ('a');
|
||||
connection slave;
|
||||
include/wait_for_slave_sql_error.inc [errno=1677]
|
||||
FOUND 1 /\'binary\(1\)\' to type \'blob\'/ in mysqld.2.err
|
||||
connection master;
|
||||
DROP TABLE t1;
|
||||
connection slave;
|
||||
DROP TABLE t1;
|
||||
include/rpl_reset.inc
|
||||
####################################################################
|
||||
# Test Case8: Verifies char to text type conversion failure
|
||||
# specific error message.
|
||||
####################################################################
|
||||
connection master;
|
||||
SET SQL_LOG_BIN=0;
|
||||
CREATE TABLE t1 (c1 CHAR(1));
|
||||
SET SQL_LOG_BIN=1;
|
||||
connection slave;
|
||||
CREATE TABLE t1 (c1 TEXT);
|
||||
connection master;
|
||||
INSERT INTO t1 VALUES ('a');
|
||||
connection slave;
|
||||
include/wait_for_slave_sql_error.inc [errno=1677]
|
||||
FOUND 1 /\'char\(1 octets\)\' to type \'text\'/ in mysqld.2.err
|
||||
connection master;
|
||||
DROP TABLE t1;
|
||||
connection slave;
|
||||
DROP TABLE t1;
|
||||
include/rpl_reset.inc
|
||||
include/rpl_end.inc
|
356
mysql-test/suite/rpl/t/rpl_row_type_conv_err_msg.test
Normal file
356
mysql-test/suite/rpl/t/rpl_row_type_conv_err_msg.test
Normal file
@@ -0,0 +1,356 @@
|
||||
# ==== Purpose ====
|
||||
#
|
||||
# Test verifies that when slave side type conversion fails in row based
|
||||
# replication, more informative error message is displayed. It also verifies
|
||||
# that in the case of blob fields appropriate type name is displayed in error
|
||||
# message.
|
||||
#
|
||||
# ==== Implementation ====
|
||||
#
|
||||
# Steps:
|
||||
# Test case1:
|
||||
# 1. Create a table on master with VARCHAR filed and charset
|
||||
# 'utf8mb3'.
|
||||
# 2. Create a table on slave with VARCHAR field and charset
|
||||
# 'utf8mb4'.
|
||||
# 3. Insert a tuple on master.
|
||||
# 4. Verify that slave provides more informative error message with
|
||||
# respect to difference in charsets.
|
||||
# Test case2: Repeat same steps as above for CHAR field
|
||||
# Test case3:
|
||||
# 1. Create a table on master with LONGBLOB field.
|
||||
# 2. Create a table on slave with TINYBLOB field.
|
||||
# 3. Insert a tuple on master.
|
||||
# 4. Verify that error message displayed on slave clearly states type
|
||||
# conversion failure from 'longblob' to 'tinyblob'.
|
||||
# 5. Also verify that error message doesn't show additional details
|
||||
# of charset when not required.
|
||||
# Test Case4: Verifies varbinary to binary type conversion failure specific
|
||||
# error message.
|
||||
# Test Case5: Verifies binary to varbinary type conversion failure specific
|
||||
# error message.
|
||||
# Test Case6: Verifies binary to binary type conversion failure specific
|
||||
# error message.
|
||||
# Test Case7: Verifies char to blob type conversion failure specific
|
||||
# error message.
|
||||
# Test Case8: Verifies char to text type conversion failure specific
|
||||
# error message.
|
||||
# ==== References ====
|
||||
#
|
||||
# MDEV-19925: Column ... cannot be converted from type 'varchar(20)' to type
|
||||
# 'varchar(20)'
|
||||
#
|
||||
|
||||
--source include/have_binlog_format_row.inc
|
||||
# Inorder to grep a specific error pattern in error log a fresh error log
|
||||
# needs to be generated.
|
||||
--source include/force_restart.inc
|
||||
--source include/master-slave.inc
|
||||
|
||||
--echo ####################################################################
|
||||
--echo # Test Case1: Improved error message with charset information
|
||||
--echo ####################################################################
|
||||
--connection master
|
||||
SET SQL_LOG_BIN=0;
|
||||
CREATE TABLE t1 (c1 VARCHAR(1) CHARACTER SET 'utf8mb3');
|
||||
SET SQL_LOG_BIN=1;
|
||||
|
||||
--connection slave
|
||||
CREATE TABLE t1 (c1 VARCHAR(1) CHARACTER SET 'utf8mb4');
|
||||
|
||||
--connection master
|
||||
INSERT INTO t1 VALUES ('a');
|
||||
|
||||
--connection slave
|
||||
--let $slave_sql_errno= 1677
|
||||
--source include/wait_for_slave_sql_error.inc
|
||||
|
||||
# Check error log for correct messages.
|
||||
let $log_error_= `SELECT @@GLOBAL.log_error`;
|
||||
if(!$log_error_)
|
||||
{
|
||||
# MySQL Server on windows is started with --console and thus
|
||||
# does not know the location of its .err log, use default location
|
||||
let $log_error_ = $MYSQLTEST_VARDIR/log/mysqld.2.err;
|
||||
}
|
||||
|
||||
# Error msg before: Column 0 of table 'test.t1' cannot be converted from type 'varchar(3)' to type 'varchar(1)'
|
||||
# Error msg after : Column 0 of table 'test.t1' cannot be converted from type 'varchar(3 octets)' to type 'varchar(4 octets) character set utf8mb4'
|
||||
--let SEARCH_FILE=$log_error_
|
||||
--let SEARCH_PATTERN=\'varchar\(3 octets\)\' to type \'varchar\(4 octets\) character set utf8mb4\'
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
--connection master
|
||||
DROP TABLE t1;
|
||||
--connection slave
|
||||
DROP TABLE t1;
|
||||
--let $rpl_only_running_threads= 1
|
||||
--source include/rpl_reset.inc
|
||||
|
||||
--echo ####################################################################
|
||||
--echo # Test Case2: Improved error message with charset information for CHAR
|
||||
--echo # type
|
||||
--echo ####################################################################
|
||||
--connection master
|
||||
SET SQL_LOG_BIN=0;
|
||||
CREATE TABLE t1 (c1 CHAR(1) CHARACTER SET 'utf8mb3');
|
||||
SET SQL_LOG_BIN=1;
|
||||
|
||||
--connection slave
|
||||
CREATE TABLE t1 (c1 CHAR(1) CHARACTER SET 'utf8mb4');
|
||||
|
||||
--connection master
|
||||
INSERT INTO t1 VALUES ('a');
|
||||
|
||||
--connection slave
|
||||
--let $slave_sql_errno= 1677
|
||||
--source include/wait_for_slave_sql_error.inc
|
||||
|
||||
# Error msg before: Column 0 of table 'test.t1' cannot be converted from type 'char(0)' to type 'char(1)'
|
||||
# Error msg after : Column 0 of table 'test.t1' cannot be converted from type 'char(3 octets)' to type 'char(4 octets) character set utf8mb4)'
|
||||
--let SEARCH_FILE=$log_error_
|
||||
--let SEARCH_PATTERN=\'char\(3 octets\)\' to type \'char\(4 octets\) character set utf8mb4\'
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
--connection master
|
||||
DROP TABLE t1;
|
||||
--connection slave
|
||||
DROP TABLE t1;
|
||||
--let $rpl_only_running_threads= 1
|
||||
--source include/rpl_reset.inc
|
||||
|
||||
--echo ####################################################################
|
||||
--echo # Test Case3: For BLOB type fileds, when type conversion failed on
|
||||
--echo # slave, the errormessage had incorrect type names.
|
||||
--echo ####################################################################
|
||||
--connection master
|
||||
SET SQL_LOG_BIN=0;
|
||||
CREATE TABLE t1 (c1 LONGBLOB);
|
||||
SET SQL_LOG_BIN=1;
|
||||
|
||||
--connection slave
|
||||
CREATE TABLE t1 (c1 TINYBLOB);
|
||||
|
||||
--connection master
|
||||
INSERT INTO t1 VALUES ('a');
|
||||
|
||||
--connection slave
|
||||
--let $slave_sql_errno= 1677
|
||||
--source include/wait_for_slave_sql_error.inc
|
||||
|
||||
# Error msg before: Column 0 of table 'test.t1' cannot be converted from type 'tinyblob' to type 'tinyblob'
|
||||
# Error msg after : Column 0 of table 'test.t1' cannot be converted from type 'longblob' to type 'tinyblob'
|
||||
--let SEARCH_FILE=$log_error_
|
||||
--let SEARCH_PATTERN=\'longblob\' to type \'tinyblob\'
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
--connection master
|
||||
DROP TABLE t1;
|
||||
--connection slave
|
||||
DROP TABLE t1;
|
||||
--let $rpl_only_running_threads= 1
|
||||
--source include/rpl_reset.inc
|
||||
|
||||
--echo ####################################################################
|
||||
--echo # Test Case4: Verifies varbinary to binary type conversion failure
|
||||
--echo # specific error message.
|
||||
--echo ####################################################################
|
||||
--connection master
|
||||
SET SQL_LOG_BIN=0;
|
||||
CREATE TABLE t1 (c1 VARBINARY(10));
|
||||
SET SQL_LOG_BIN=1;
|
||||
|
||||
--connection slave
|
||||
CREATE TABLE t1 (c1 BINARY(10));
|
||||
|
||||
--connection master
|
||||
INSERT INTO t1 VALUES ('a');
|
||||
|
||||
--connection slave
|
||||
--let $slave_sql_errno= 1677
|
||||
--source include/wait_for_slave_sql_error.inc
|
||||
|
||||
# Check error log for correct messages.
|
||||
let $log_error_= `SELECT @@GLOBAL.log_error`;
|
||||
if(!$log_error_)
|
||||
{
|
||||
# MySQL Server on windows is started with --console and thus
|
||||
# does not know the location of its .err log, use default location
|
||||
let $log_error_ = $MYSQLTEST_VARDIR/log/mysqld.2.err;
|
||||
}
|
||||
|
||||
# Expected Error : Column 0 of table 'test.t1' cannot be converted from type 'varbinary(10)' to type 'binary(10)'
|
||||
--let SEARCH_FILE=$log_error_
|
||||
--let SEARCH_PATTERN=\'varbinary\(10\)\' to type \'binary\(10\)\'
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
--connection master
|
||||
DROP TABLE t1;
|
||||
--connection slave
|
||||
DROP TABLE t1;
|
||||
--let $rpl_only_running_threads= 1
|
||||
--source include/rpl_reset.inc
|
||||
|
||||
--echo ####################################################################
|
||||
--echo # Test Case5: Verifies binary to varbinary type conversion failure
|
||||
--echo # specific error message.
|
||||
--echo ####################################################################
|
||||
--connection master
|
||||
SET SQL_LOG_BIN=0;
|
||||
CREATE TABLE t1 (c1 BINARY(10));
|
||||
SET SQL_LOG_BIN=1;
|
||||
|
||||
--connection slave
|
||||
CREATE TABLE t1 (c1 VARBINARY(10));
|
||||
|
||||
--connection master
|
||||
INSERT INTO t1 VALUES ('a');
|
||||
|
||||
--connection slave
|
||||
--let $slave_sql_errno= 1677
|
||||
--source include/wait_for_slave_sql_error.inc
|
||||
|
||||
# Check error log for correct messages.
|
||||
let $log_error_= `SELECT @@GLOBAL.log_error`;
|
||||
if(!$log_error_)
|
||||
{
|
||||
# MySQL Server on windows is started with --console and thus
|
||||
# does not know the location of its .err log, use default location
|
||||
let $log_error_ = $MYSQLTEST_VARDIR/log/mysqld.2.err;
|
||||
}
|
||||
|
||||
# Expected Error : Column 0 of table 'test.t1' cannot be converted from type 'binary(10)' to type 'varbinary(10)'
|
||||
--let SEARCH_FILE=$log_error_
|
||||
--let SEARCH_PATTERN=\'binary\(10\)\' to type \'varbinary\(10\)\'
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
--connection master
|
||||
DROP TABLE t1;
|
||||
--connection slave
|
||||
DROP TABLE t1;
|
||||
--let $rpl_only_running_threads= 1
|
||||
--source include/rpl_reset.inc
|
||||
|
||||
--echo ####################################################################
|
||||
--echo # Test Case6: Verifies binary to binary type conversion failure
|
||||
--echo # specific error message.
|
||||
--echo ####################################################################
|
||||
--connection master
|
||||
SET SQL_LOG_BIN=0;
|
||||
CREATE TABLE t1 (c1 BINARY(1));
|
||||
SET SQL_LOG_BIN=1;
|
||||
|
||||
--connection slave
|
||||
CREATE TABLE t1 (c1 BINARY(10));
|
||||
|
||||
--connection master
|
||||
INSERT INTO t1 VALUES ('a');
|
||||
|
||||
--connection slave
|
||||
--let $slave_sql_errno= 1677
|
||||
--source include/wait_for_slave_sql_error.inc
|
||||
|
||||
# Check error log for correct messages.
|
||||
let $log_error_= `SELECT @@GLOBAL.log_error`;
|
||||
if(!$log_error_)
|
||||
{
|
||||
# MySQL Server on windows is started with --console and thus
|
||||
# does not know the location of its .err log, use default location
|
||||
let $log_error_ = $MYSQLTEST_VARDIR/log/mysqld.2.err;
|
||||
}
|
||||
|
||||
# Expected Error : Column 0 of table 'test.t1' cannot be converted from type 'binary(1)' to type 'binary(10)'
|
||||
--let SEARCH_FILE=$log_error_
|
||||
--let SEARCH_PATTERN=\'binary\(1\)\' to type \'binary\(10\)\'
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
--connection master
|
||||
DROP TABLE t1;
|
||||
--connection slave
|
||||
DROP TABLE t1;
|
||||
--let $rpl_only_running_threads= 1
|
||||
--source include/rpl_reset.inc
|
||||
|
||||
--echo ####################################################################
|
||||
--echo # Test Case7: Verifies char to blob type conversion failure
|
||||
--echo # specific error message. BLOB field on slave has no
|
||||
--echo # associated character set hence the master side field
|
||||
--echo # is also considered as binary.
|
||||
--echo ####################################################################
|
||||
--connection master
|
||||
SET SQL_LOG_BIN=0;
|
||||
CREATE TABLE t1 (c1 CHAR(1));
|
||||
SET SQL_LOG_BIN=1;
|
||||
|
||||
--connection slave
|
||||
CREATE TABLE t1 (c1 BLOB);
|
||||
|
||||
--connection master
|
||||
INSERT INTO t1 VALUES ('a');
|
||||
|
||||
--connection slave
|
||||
--let $slave_sql_errno= 1677
|
||||
--source include/wait_for_slave_sql_error.inc
|
||||
|
||||
# Check error log for correct messages.
|
||||
let $log_error_= `SELECT @@GLOBAL.log_error`;
|
||||
if(!$log_error_)
|
||||
{
|
||||
# MySQL Server on windows is started with --console and thus
|
||||
# does not know the location of its .err log, use default location
|
||||
let $log_error_ = $MYSQLTEST_VARDIR/log/mysqld.2.err;
|
||||
}
|
||||
|
||||
# Expected Error : Column 0 of table 'test.t1' cannot be converted from type 'binary(1)' to type 'binary(10)'
|
||||
--let SEARCH_FILE=$log_error_
|
||||
--let SEARCH_PATTERN=\'binary\(1\)\' to type \'blob\'
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
--connection master
|
||||
DROP TABLE t1;
|
||||
--connection slave
|
||||
DROP TABLE t1;
|
||||
--let $rpl_only_running_threads= 1
|
||||
--source include/rpl_reset.inc
|
||||
|
||||
--echo ####################################################################
|
||||
--echo # Test Case8: Verifies char to text type conversion failure
|
||||
--echo # specific error message.
|
||||
--echo ####################################################################
|
||||
--connection master
|
||||
SET SQL_LOG_BIN=0;
|
||||
CREATE TABLE t1 (c1 CHAR(1));
|
||||
SET SQL_LOG_BIN=1;
|
||||
|
||||
--connection slave
|
||||
CREATE TABLE t1 (c1 TEXT);
|
||||
|
||||
--connection master
|
||||
INSERT INTO t1 VALUES ('a');
|
||||
|
||||
--connection slave
|
||||
--let $slave_sql_errno= 1677
|
||||
--source include/wait_for_slave_sql_error.inc
|
||||
|
||||
# Check error log for correct messages.
|
||||
let $log_error_= `SELECT @@GLOBAL.log_error`;
|
||||
if(!$log_error_)
|
||||
{
|
||||
# MySQL Server on windows is started with --console and thus
|
||||
# does not know the location of its .err log, use default location
|
||||
let $log_error_ = $MYSQLTEST_VARDIR/log/mysqld.2.err;
|
||||
}
|
||||
|
||||
# Expected Error : Column 0 of table 'test.t1' cannot be converted from type 'binary(1)' to type 'binary(10)'
|
||||
--let SEARCH_FILE=$log_error_
|
||||
--let SEARCH_PATTERN=\'char\(1 octets\)\' to type \'text\'
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
--connection master
|
||||
DROP TABLE t1;
|
||||
--connection slave
|
||||
DROP TABLE t1;
|
||||
--let $rpl_only_running_threads= 1
|
||||
--source include/rpl_reset.inc
|
||||
|
||||
--source include/rpl_end.inc
|
Reference in New Issue
Block a user