Commit b3516ff7 authored by Mats Kindahl's avatar Mats Kindahl

WL#5151: Conversion between different types when

         replicating

Fixes to make mysqlbinlog work correctly and updates
to rpl_ndb result files.
parent d107a4ce
......@@ -2365,7 +2365,7 @@ BEGIN
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO test.t1
### SET
### @1=b'00000000' /* BIT(8) meta=256 nullable=1 is_null=0 */
### @1=b'0' /* BIT(1) meta=1 nullable=1 is_null=0 */
### @2=b'0000000000000000000000000000000000000000000000000000000000000000' /* BIT(64) meta=2048 nullable=1 is_null=0 */
### @3=-128 (128) /* TINYINT meta=0 nullable=1 is_null=0 */
### @4=0 /* TINYINT meta=0 nullable=1 is_null=0 */
......@@ -2458,7 +2458,7 @@ BEGIN
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO test.t1
### SET
### @1=b'00000001' /* BIT(8) meta=256 nullable=1 is_null=0 */
### @1=b'1' /* BIT(1) meta=1 nullable=1 is_null=0 */
### @2=b'1111111111111111111111111111111111111111111111111111111111111111' /* BIT(64) meta=2048 nullable=1 is_null=0 */
### @3=127 /* TINYINT meta=0 nullable=1 is_null=0 */
### @4=-1 (255) /* TINYINT meta=0 nullable=1 is_null=0 */
......@@ -2553,7 +2553,7 @@ BEGIN
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO test.t1
### SET
### @1=NULL /* type=16 meta=256 nullable=1 is_null=1 */
### @1=NULL /* type=16 meta=1 nullable=1 is_null=1 */
### @2=NULL /* type=16 meta=2048 nullable=1 is_null=1 */
### @3=NULL /* type=1 meta=0 nullable=1 is_null=1 */
### @4=NULL /* type=1 meta=0 nullable=1 is_null=1 */
......@@ -2580,7 +2580,7 @@ BEGIN
### @25=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
### @26=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
### @27=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
### @28=NULL /* type=10 meta=0 nullable=1 is_null=1 */
### @28=NULL /* type=14 meta=0 nullable=1 is_null=1 */
### @29=NULL /* type=12 meta=0 nullable=1 is_null=1 */
### @30=1000000000 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
### @31=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
......@@ -2634,7 +2634,7 @@ BEGIN
### @79=3 /* INT meta=0 nullable=1 is_null=0 */
### INSERT INTO test.t1
### SET
### @1=b'00000001' /* BIT(8) meta=256 nullable=1 is_null=0 */
### @1=b'1' /* BIT(1) meta=1 nullable=1 is_null=0 */
### @2=b'1111111111111111111111111111111111111111111111111111111111111111' /* BIT(64) meta=2048 nullable=1 is_null=0 */
### @3=127 /* TINYINT meta=0 nullable=1 is_null=0 */
### @4=0 /* TINYINT meta=0 nullable=1 is_null=0 */
......@@ -2727,7 +2727,7 @@ BEGIN
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
### UPDATE test.t1
### WHERE
### @1=b'00000000' /* BIT(8) meta=256 nullable=1 is_null=0 */
### @1=b'0' /* BIT(1) meta=1 nullable=1 is_null=0 */
### @2=b'0000000000000000000000000000000000000000000000000000000000000000' /* BIT(64) meta=2048 nullable=1 is_null=0 */
### @3=-128 (128) /* TINYINT meta=0 nullable=1 is_null=0 */
### @4=0 /* TINYINT meta=0 nullable=1 is_null=0 */
......@@ -2807,7 +2807,7 @@ BEGIN
### @78=b'00000000' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=1 /* INT meta=0 nullable=1 is_null=0 */
### SET
### @1=b'00000001' /* BIT(8) meta=256 nullable=1 is_null=0 */
### @1=b'1' /* BIT(1) meta=1 nullable=1 is_null=0 */
### @2=b'1111111111111111111111111111111111111111111111111111111111111111' /* BIT(64) meta=2048 nullable=1 is_null=0 */
### @3=127 /* TINYINT meta=0 nullable=1 is_null=0 */
### @4=-1 (255) /* TINYINT meta=0 nullable=1 is_null=0 */
......@@ -2900,7 +2900,7 @@ BEGIN
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
### UPDATE test.t1
### WHERE
### @1=b'00000001' /* BIT(8) meta=256 nullable=1 is_null=0 */
### @1=b'1' /* BIT(1) meta=1 nullable=1 is_null=0 */
### @2=b'1111111111111111111111111111111111111111111111111111111111111111' /* BIT(64) meta=2048 nullable=1 is_null=0 */
### @3=127 /* TINYINT meta=0 nullable=1 is_null=0 */
### @4=-1 (255) /* TINYINT meta=0 nullable=1 is_null=0 */
......@@ -2980,7 +2980,7 @@ BEGIN
### @78=b'00000111' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=2 /* INT meta=0 nullable=1 is_null=0 */
### SET
### @1=b'00000000' /* BIT(8) meta=256 nullable=1 is_null=0 */
### @1=b'0' /* BIT(1) meta=1 nullable=1 is_null=0 */
### @2=b'0000000000000000000000000000000000000000000000000000000000000000' /* BIT(64) meta=2048 nullable=1 is_null=0 */
### @3=-128 (128) /* TINYINT meta=0 nullable=1 is_null=0 */
### @4=0 /* TINYINT meta=0 nullable=1 is_null=0 */
......@@ -3073,7 +3073,7 @@ BEGIN
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
### UPDATE test.t1
### WHERE
### @1=NULL /* type=16 meta=256 nullable=1 is_null=1 */
### @1=NULL /* type=16 meta=1 nullable=1 is_null=1 */
### @2=NULL /* type=16 meta=2048 nullable=1 is_null=1 */
### @3=NULL /* type=1 meta=0 nullable=1 is_null=1 */
### @4=NULL /* type=1 meta=0 nullable=1 is_null=1 */
......@@ -3100,7 +3100,7 @@ BEGIN
### @25=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
### @26=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
### @27=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
### @28=NULL /* type=10 meta=0 nullable=1 is_null=1 */
### @28=NULL /* type=14 meta=0 nullable=1 is_null=1 */
### @29=NULL /* type=12 meta=0 nullable=1 is_null=1 */
### @30=1000000000 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
### @31=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
......@@ -3153,7 +3153,7 @@ BEGIN
### @78=NULL /* TIMESTAMP meta=63489 nullable=1 is_null=1 */
### @79=3 /* INT meta=0 nullable=1 is_null=0 */
### SET
### @1=b'00000001' /* BIT(8) meta=256 nullable=1 is_null=0 */
### @1=b'1' /* BIT(1) meta=1 nullable=1 is_null=0 */
### @2=b'1111111111111111111111111111111111111111111111111111111111111111' /* BIT(64) meta=2048 nullable=1 is_null=0 */
### @3=127 /* TINYINT meta=0 nullable=1 is_null=0 */
### @4=0 /* TINYINT meta=0 nullable=1 is_null=0 */
......@@ -3246,7 +3246,7 @@ BEGIN
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
### UPDATE test.t1
### WHERE
### @1=b'00000001' /* BIT(8) meta=256 nullable=1 is_null=0 */
### @1=b'1' /* BIT(1) meta=1 nullable=1 is_null=0 */
### @2=b'1111111111111111111111111111111111111111111111111111111111111111' /* BIT(64) meta=2048 nullable=1 is_null=0 */
### @3=127 /* TINYINT meta=0 nullable=1 is_null=0 */
### @4=0 /* TINYINT meta=0 nullable=1 is_null=0 */
......@@ -3326,7 +3326,7 @@ BEGIN
### @78=b'00000110' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=4 /* INT meta=0 nullable=1 is_null=0 */
### SET
### @1=NULL /* type=16 meta=256 nullable=1 is_null=1 */
### @1=NULL /* type=16 meta=1 nullable=1 is_null=1 */
### @2=NULL /* type=16 meta=2048 nullable=1 is_null=1 */
### @3=NULL /* type=1 meta=0 nullable=1 is_null=1 */
### @4=NULL /* type=1 meta=0 nullable=1 is_null=1 */
......@@ -3353,7 +3353,7 @@ BEGIN
### @25=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
### @26=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
### @27=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
### @28=NULL /* type=10 meta=0 nullable=1 is_null=1 */
### @28=NULL /* type=14 meta=0 nullable=1 is_null=1 */
### @29=NULL /* type=12 meta=0 nullable=1 is_null=1 */
### @30=1000000000 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
### @31=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
......@@ -3419,7 +3419,7 @@ BEGIN
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM test.t1
### WHERE
### @1=b'00000001' /* BIT(8) meta=256 nullable=1 is_null=0 */
### @1=b'1' /* BIT(1) meta=1 nullable=1 is_null=0 */
### @2=b'1111111111111111111111111111111111111111111111111111111111111111' /* BIT(64) meta=2048 nullable=1 is_null=0 */
### @3=127 /* TINYINT meta=0 nullable=1 is_null=0 */
### @4=-1 (255) /* TINYINT meta=0 nullable=1 is_null=0 */
......@@ -3512,7 +3512,7 @@ BEGIN
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM test.t1
### WHERE
### @1=b'00000000' /* BIT(8) meta=256 nullable=1 is_null=0 */
### @1=b'0' /* BIT(1) meta=1 nullable=1 is_null=0 */
### @2=b'0000000000000000000000000000000000000000000000000000000000000000' /* BIT(64) meta=2048 nullable=1 is_null=0 */
### @3=-128 (128) /* TINYINT meta=0 nullable=1 is_null=0 */
### @4=0 /* TINYINT meta=0 nullable=1 is_null=0 */
......@@ -3605,7 +3605,7 @@ BEGIN
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM test.t1
### WHERE
### @1=b'00000001' /* BIT(8) meta=256 nullable=1 is_null=0 */
### @1=b'1' /* BIT(1) meta=1 nullable=1 is_null=0 */
### @2=b'1111111111111111111111111111111111111111111111111111111111111111' /* BIT(64) meta=2048 nullable=1 is_null=0 */
### @3=127 /* TINYINT meta=0 nullable=1 is_null=0 */
### @4=0 /* TINYINT meta=0 nullable=1 is_null=0 */
......@@ -3698,7 +3698,7 @@ BEGIN
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM test.t1
### WHERE
### @1=NULL /* type=16 meta=256 nullable=1 is_null=1 */
### @1=NULL /* type=16 meta=1 nullable=1 is_null=1 */
### @2=NULL /* type=16 meta=2048 nullable=1 is_null=1 */
### @3=NULL /* type=1 meta=0 nullable=1 is_null=1 */
### @4=NULL /* type=1 meta=0 nullable=1 is_null=1 */
......@@ -3725,7 +3725,7 @@ BEGIN
### @25=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
### @26=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
### @27=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
### @28=NULL /* type=10 meta=0 nullable=1 is_null=1 */
### @28=NULL /* type=14 meta=0 nullable=1 is_null=1 */
### @29=NULL /* type=12 meta=0 nullable=1 is_null=1 */
### @30=1000000000 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
### @31=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
......
......@@ -2584,7 +2584,7 @@ BEGIN
### @25=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
### @26=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
### @27=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
### @28=NULL /* type=10 meta=0 nullable=1 is_null=1 */
### @28=NULL /* type=14 meta=0 nullable=1 is_null=1 */
### @29=NULL /* type=12 meta=0 nullable=1 is_null=1 */
### @30=1000000000 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
### @31=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
......@@ -3110,7 +3110,7 @@ BEGIN
### @25=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
### @26=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
### @27=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
### @28=NULL /* type=10 meta=0 nullable=1 is_null=1 */
### @28=NULL /* type=14 meta=0 nullable=1 is_null=1 */
### @29=NULL /* type=12 meta=0 nullable=1 is_null=1 */
### @30=1000000000 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
### @31=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
......@@ -3365,7 +3365,7 @@ BEGIN
### @25=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
### @26=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
### @27=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
### @28=NULL /* type=10 meta=0 nullable=1 is_null=1 */
### @28=NULL /* type=14 meta=0 nullable=1 is_null=1 */
### @29=NULL /* type=12 meta=0 nullable=1 is_null=1 */
### @30=1000000000 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
### @31=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
......@@ -3745,7 +3745,7 @@ BEGIN
### @25=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
### @26=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
### @27=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
### @28=NULL /* type=10 meta=0 nullable=1 is_null=1 */
### @28=NULL /* type=14 meta=0 nullable=1 is_null=1 */
### @29=NULL /* type=12 meta=0 nullable=1 is_null=1 */
### @30=1000000000 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
### @31=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
......
......@@ -9,6 +9,8 @@ call mtr.add_suppression("Slave: Unknown table 't6' Error_code: 1051");
*** On Slave ***
STOP SLAVE;
RESET SLAVE;
SET @saved_slave_type_conversions = @@slave_type_conversions;
SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY';
CREATE TABLE t1 (a INT, b INT PRIMARY KEY, c CHAR(20),
d FLOAT DEFAULT '2.00',
e CHAR(4) DEFAULT 'TEST')
......@@ -32,6 +34,7 @@ a b c d e
1 2 TEXAS NULL NULL
2 1 AUSTIN NULL NULL
3 4 QA NULL NULL
SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
*** Drop t1 ***
DROP TABLE t1;
*** Create t2 on slave ***
......@@ -73,8 +76,8 @@ Replicate_Do_Table
Replicate_Ignore_Table #
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 1535
Last_Error Table definition on master and slave does not match: Column 2 size mismatch - master has size 10, test.t2 on slave has size 6. Master's column size should be <= the slave's column size.
Last_Errno 1641
Last_Error Column 2 of table 'test.t2' cannot be converted from type 'char(10)' to type 'char(5)'
Skip_Counter 0
Exec_Master_Log_Pos #
Relay_Log_Space #
......@@ -91,8 +94,8 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 2 size mismatch - master has size 10, test.t2 on slave has size 6. Master's column size should be <= the slave's column size.
Last_SQL_Errno 1641
Last_SQL_Error Column 2 of table 'test.t2' cannot be converted from type 'char(10)' to type 'char(5)'
STOP SLAVE;
RESET SLAVE;
SELECT * FROM t2 ORDER BY a;
......@@ -140,8 +143,8 @@ Replicate_Do_Table
Replicate_Ignore_Table #
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 1535
Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 252, test.t3 has type 3
Last_Errno 1641
Last_Error Column 0 of table 'test.t3' cannot be converted from type 'tinyblob' to type 'int(11)'
Skip_Counter 0
Exec_Master_Log_Pos #
Relay_Log_Space #
......@@ -158,8 +161,8 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 252, test.t3 has type 3
Last_SQL_Errno 1641
Last_SQL_Error Column 0 of table 'test.t3' cannot be converted from type 'tinyblob' to type 'int(11)'
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
*** Drop t3 ***
......@@ -202,8 +205,8 @@ Replicate_Do_Table
Replicate_Ignore_Table #
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 1535
Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 246, test.t4 has type 3
Last_Errno 1641
Last_Error Column 0 of table 'test.t4' cannot be converted from type 'decimal(8,2)' to type 'int(11)'
Skip_Counter 0
Exec_Master_Log_Pos #
Relay_Log_Space #
......@@ -220,8 +223,8 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 246, test.t4 has type 3
Last_SQL_Errno 1641
Last_SQL_Error Column 0 of table 'test.t4' cannot be converted from type 'decimal(8,2)' to type 'int(11)'
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
*** Drop t4 ***
......@@ -264,8 +267,8 @@ Replicate_Do_Table
Replicate_Ignore_Table #
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 1535
Last_Error Table definition on master and slave does not match: Column 5 type mismatch - received type 4, test.t5 has type 246
Last_Errno 1641
Last_Error Column 1 of table 'test.t5' cannot be converted from type 'varchar(6)' to type 'char(5)'
Skip_Counter 0
Exec_Master_Log_Pos #
Relay_Log_Space #
......@@ -282,8 +285,8 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 5 type mismatch - received type 4, test.t5 has type 246
Last_SQL_Errno 1641
Last_SQL_Error Column 1 of table 'test.t5' cannot be converted from type 'varchar(6)' to type 'char(5)'
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
*** Drop t5 ***
......@@ -325,8 +328,8 @@ Replicate_Do_Table
Replicate_Ignore_Table #
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 1535
Last_Error Table definition on master and slave does not match: Column 3 type mismatch - received type 16, test.t6 has type 3
Last_Errno 1641
Last_Error Column 1 of table 'test.t6' cannot be converted from type 'varchar(6)' to type 'char(5)'
Skip_Counter 0
Exec_Master_Log_Pos #
Relay_Log_Space #
......@@ -343,8 +346,8 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 3 type mismatch - received type 16, test.t6 has type 3
Last_SQL_Errno 1641
Last_SQL_Error Column 1 of table 'test.t6' cannot be converted from type 'varchar(6)' to type 'char(5)'
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3;
*** Drop t6 ***
DROP TABLE t6;
......@@ -493,8 +496,8 @@ Replicate_Do_Table
Replicate_Ignore_Table #
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 1535
Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 254, test.t10 has type 5
Last_Errno 1641
Last_Error Column 2 of table 'test.t10' cannot be converted from type 'char(5)' to type 'double'
Skip_Counter 0
Exec_Master_Log_Pos #
Relay_Log_Space #
......@@ -511,8 +514,8 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 254, test.t10 has type 5
Last_SQL_Errno 1641
Last_SQL_Error Column 2 of table 'test.t10' cannot be converted from type 'char(5)' to type 'double'
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
*** Drop t10 ***
......@@ -520,7 +523,7 @@ DROP TABLE t10;
*** Create t11 on slave ***
STOP SLAVE;
RESET SLAVE;
CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT,
CREATE TABLE t11 (a INT KEY, b BLOB, f INT,
c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='NDB';
*** Create t11 on Master ***
CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254)
......@@ -554,8 +557,8 @@ Replicate_Do_Table
Replicate_Ignore_Table #
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 1535
Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 15, test.t11 has type 252
Last_Errno 1641
Last_Error Column 2 of table 'test.t11' cannot be converted from type 'varchar(254)' to type 'int(11)'
Skip_Counter 0
Exec_Master_Log_Pos #
Relay_Log_Space #
......@@ -572,8 +575,8 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 15, test.t11 has type 252
Last_SQL_Errno 1641
Last_SQL_Error Column 2 of table 'test.t11' cannot be converted from type 'varchar(254)' to type 'int(11)'
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
*** Drop t11 ***
......@@ -944,8 +947,8 @@ Replicate_Do_Table
Replicate_Ignore_Table #
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 1535
Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 8, test.t17 has type 2
Last_Errno 1641
Last_Error Column 0 of table 'test.t17' cannot be converted from type 'bigint' to type 'smallint(6)'
Skip_Counter 0
Exec_Master_Log_Pos #
Relay_Log_Space #
......@@ -962,8 +965,8 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 8, test.t17 has type 2
Last_SQL_Errno 1641
Last_SQL_Error Column 0 of table 'test.t17' cannot be converted from type 'bigint' to type 'smallint(6)'
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
** DROP table t17 ***
......
......@@ -476,6 +476,8 @@ ALTER TABLE t6 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL;
CREATE TABLE t7 (i INT NOT NULL,
c CHAR(255) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL) ENGINE = 'NDB' ;
SET @saved_slave_type_conversions = @@slave_type_conversions;
SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY';
[expecting slave to replicate correctly]
INSERT INTO t1 VALUES (1, "", 1);
INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 2);
......@@ -484,11 +486,7 @@ Comparing tables master:test.t1 and slave:test.t1
INSERT INTO t2 VALUES (1, "", 1);
INSERT INTO t2 VALUES (2, repeat(_utf8'a', 16), 2);
Comparing tables master:test.t2 and slave:test.t2
[expecting slave to stop]
INSERT INTO t3 VALUES (1, "", 1);
INSERT INTO t3 VALUES (2, repeat(_utf8'a', 128), 2);
Last_SQL_Error
Table definition on master and slave does not match: Column 1 size mismatch - master has size 384, test.t3 on slave has size 49. Master's column size should be <= the slave's column size.
SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
RESET MASTER;
STOP SLAVE;
RESET SLAVE;
......@@ -501,7 +499,7 @@ Comparing tables master:test.t4 and slave:test.t4
INSERT INTO t5 VALUES (1, "", 1);
INSERT INTO t5 VALUES (2, repeat(_utf8'a', 255), 2);
Last_SQL_Error
Table definition on master and slave does not match: Column 1 size mismatch - master has size 765, test.t5 on slave has size 49. Master's column size should be <= the slave's column size.
Column 1 of table 'test.t5' cannot be converted from type 'char(255)' to type 'char(16)'
RESET MASTER;
STOP SLAVE;
RESET SLAVE;
......@@ -510,7 +508,7 @@ START SLAVE;
INSERT INTO t6 VALUES (1, "", 1);
INSERT INTO t6 VALUES (2, repeat(_utf8'a', 255), 2);
Last_SQL_Error
Table definition on master and slave does not match: Column 1 size mismatch - master has size 765, test.t6 on slave has size 385. Master's column size should be <= the slave's column size.
Column 1 of table 'test.t6' cannot be converted from type 'char(255)' to type 'char(128)'
RESET MASTER;
STOP SLAVE;
RESET SLAVE;
......
......@@ -1570,37 +1570,14 @@ log_event_print_value(IO_CACHE *file, const uchar *ptr,
/* a long CHAR() field: see #37426 */
length= byte1 | (((byte0 & 0x30) ^ 0x30) << 4);
type= byte0 | 0x30;
goto beg;
}
switch (byte0)
{
case MYSQL_TYPE_SET:
case MYSQL_TYPE_ENUM:
case MYSQL_TYPE_STRING:
type= byte0;
length= byte1;
break;
default:
{
char tmp[5];
my_snprintf(tmp, sizeof(tmp), "%04X", meta);
my_b_printf(file,
"!! Don't know how to handle column type=%d meta=%d (%s)",
type, meta, tmp);
return 0;
}
}
else
length = meta & 0xFF;
}
else
length= meta;
}
beg:
switch (type) {
case MYSQL_TYPE_LONG:
{
......@@ -1737,6 +1714,33 @@ beg:
return 3;
}
case MYSQL_TYPE_NEWDATE:
{
uint32 tmp= uint3korr(ptr);
int part;
char buf[10];
char *pos= &buf[10];
/* Copied from field.cc */
*pos--=0; // End NULL
part=(int) (tmp & 31);
*pos--= (char) ('0'+part%10);
*pos--= (char) ('0'+part/10);
*pos--= ':';
part=(int) (tmp >> 5 & 15);
*pos--= (char) ('0'+part%10);
*pos--= (char) ('0'+part/10);
*pos--= ':';
part=(int) (tmp >> 9);
*pos--= (char) ('0'+part%10); part/=10;
*pos--= (char) ('0'+part%10); part/=10;
*pos--= (char) ('0'+part%10); part/=10;
*pos= (char) ('0'+part);
my_b_printf(file , "'%s'", buf);
my_snprintf(typestr, typestr_length, "DATE");
return 3;
}
case MYSQL_TYPE_DATE:
{
uint i32= uint3korr(ptr);
......@@ -1755,7 +1759,7 @@ beg:
}
case MYSQL_TYPE_ENUM:
switch (length) {
switch (meta & 0xFF) {
case 1:
my_b_printf(file, "%d", (int) *ptr);
my_snprintf(typestr, typestr_length, "ENUM(1 byte)");
......@@ -1768,15 +1772,15 @@ beg:
return 2;
}
default:
my_b_printf(file, "!! Unknown ENUM packlen=%d", length);
my_b_printf(file, "!! Unknown ENUM packlen=%d", meta & 0xFF);
return 0;
}
break;
case MYSQL_TYPE_SET:
my_b_write_bit(file, ptr , length * 8);
my_snprintf(typestr, typestr_length, "SET(%d bytes)", length);
return length;
my_b_write_bit(file, ptr , (meta & 0xFF) * 8);
my_snprintf(typestr, typestr_length, "SET(%d bytes)", meta & 0xFF);
return meta & 0xFF;
case MYSQL_TYPE_BLOB:
switch (meta) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment