summaryrefslogtreecommitdiff
path: root/mysql-test/extra
diff options
context:
space:
mode:
authorunknown <cbell/Chuck@mysql_cab_desk.>2007-08-10 12:48:01 -0400
committerunknown <cbell/Chuck@mysql_cab_desk.>2007-08-10 12:48:01 -0400
commit9ad300d50d531d930c649002ee34123b452ec526 (patch)
treed3ef511f255d489f7a8ebaf7ce57c0512a4a2607 /mysql-test/extra
parent21c55af5a103bcd3133c28073a7cd6e09d0521e3 (diff)
downloadmariadb-git-9ad300d50d531d930c649002ee34123b452ec526.tar.gz
BUG#22086 : Extra Slave Col: Char(5) on slave and Char(10) on master cause mysqld crash
This patch adds functionality to row-based replication to ensure the slave's column sizes are >= to that of the master. It also includes some refactoring for the code from WL#3228. mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test: BUG#22086 : Extra Slave Col: Char(5) on slave and Char(10) on master cause mysqld crash Removed commented out portion of test referenced in bug report. This test supports the original request of the bug report. mysql-test/suite/rpl/r/rpl_extraCol_innodb.result: BUG#22086 : Extra Slave Col: Char(5) on slave and Char(10) on master cause mysqld crash New result file for additional test. mysql-test/suite/rpl/r/rpl_extraCol_myisam.result: BUG#22086 : Extra Slave Col: Char(5) on slave and Char(10) on master cause mysqld crash New result file for additional test. mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result: BUG#22086 : Extra Slave Col: Char(5) on slave and Char(10) on master cause mysqld crash New result file for additional test. sql/field.cc: BUG#22086 : Extra Slave Col: Char(5) on slave and Char(10) on master cause mysqld crash This patch refactors the additions made by this bug patch and those made by WL#3228. The effort consolidates the large switches on type() into functions within the field classes. sql/field.h: BUG#22086 : Extra Slave Col: Char(5) on slave and Char(10) on master cause mysqld crash This patch refactors the additions made by this bug patch and those made by WL#3228. The effort consolidates the large switches on type() into functions within the field classes. sql/log_event.cc: BUG#22086 : Extra Slave Col: Char(5) on slave and Char(10) on master cause mysqld crash This patch refactors the calc_field_size() method to use the new methods implemented in the field classes. It also corrects comments concerning how replication of field metadata works. sql/log_event.h: BUG#22086 : Extra Slave Col: Char(5) on slave and Char(10) on master cause mysqld crash This patch refactors out the calc_field_size() method into the method save_field_metadata(). sql/rpl_utility.cc: BUG#22086 : Extra Slave Col: Char(5) on slave and Char(10) on master cause mysqld crash This patch adds a method to check the size of the field on the master using the field metadata from WL#3228. Each column is checked to ensure the slave's column is >= to the master's column in size. sql/rpl_utility.h: BUG#22086 : Extra Slave Col: Char(5) on slave and Char(10) on master cause mysqld crash This patch changes the table_def class so that it records the size of the metadata. This is a result of refactoring out the calc_field_size() method into the method save_field_metadata(). Prevents access via field_metadata(col) to unitialized memory when there is no metadata transmitted from the master. mysql-test/suite/rpl/r/rpl_row_colSize.result: BUG#22086 : Extra Slave Col: Char(5) on slave and Char(10) on master cause mysqld crash New result file for additional test. mysql-test/suite/rpl/t/rpl_row_colSize.test: BUG#22086 : Extra Slave Col: Char(5) on slave and Char(10) on master cause mysqld crash Added a test file to test each variable type that relies on field metadata from the master. mysql-test/include/test_fieldsize.inc: BUG#22086 : Extra Slave Col: Char(5) on slave and Char(10) on master cause mysqld crash Sub unit file to test each variable type that relies on field metadata from the master.
Diffstat (limited to 'mysql-test/extra')
-rw-r--r--mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test89
1 files changed, 49 insertions, 40 deletions
diff --git a/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test b/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test
index abeef5f2903..a4ac55cc2e8 100644
--- a/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test
+++ b/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test
@@ -71,38 +71,47 @@ sync_slave_with_master;
############################################
## BUG22086
-#--echo *** Create t2 on slave ***
-#STOP SLAVE;
-#RESET SLAVE;
-#eval CREATE TABLE t2 (a INT, b INT PRIMARY KEY, c CHAR(5),
-# d FLOAT DEFAULT '2.00',
-# e CHAR(5) DEFAULT 'TEST2')
-# ENGINE=$engine_type;
-#
-#--echo *** Create t2 on Master ***
-#connection master;
-#eval CREATE TABLE t2 (a INT PRIMARY KEY, b INT, c CHAR(10)
-# ) ENGINE=$engine_type;
-#RESET MASTER;
-#
-#--echo *** Start Slave ***
-#connection slave;
-#START SLAVE;
-#
-#--echo *** Master Data Insert ***
-#connection master;
-#
-#INSERT INTO t2 () VALUES(1,2,'Kyle, TEX'),(2,1,'JOE AUSTIN'),(3,4,'QA TESTING');
-#SELECT * FROM t2 ORDER BY a;
+--echo *** Create t2 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+eval CREATE TABLE t2 (a INT, b INT PRIMARY KEY, c CHAR(5),
+ d FLOAT DEFAULT '2.00',
+ e CHAR(5) DEFAULT 'TEST2')
+ ENGINE=$engine_type;
-#--echo *** Select from slave ***
-#sync_slave_with_master;
-#SELECT * FROM t2 ORDER BY a;
+--echo *** Create t2 on Master ***
+connection master;
+eval CREATE TABLE t2 (a INT PRIMARY KEY, b INT, c CHAR(10)
+ ) ENGINE=$engine_type;
+RESET MASTER;
-#--echo *** Drop t2 ***
-#connection master;
-#DROP TABLE t2;
-#sync_slave_with_master;
+--echo *** Master Data Insert ***
+connection master;
+
+INSERT INTO t2 () VALUES(1,2,'Kyle, TEX'),(2,1,'JOE AUSTIN'),(3,4,'QA TESTING');
+SELECT * FROM t2 ORDER BY a;
+
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+wait_for_slave_to_stop;
+--replace_result $MASTER_MYPORT MASTER_PORT
+--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
+--query_vertical SHOW SLAVE STATUS
+STOP SLAVE;
+RESET SLAVE;
+SELECT * FROM t2 ORDER BY a;
+
+connection master;
+RESET MASTER;
+
+connection slave;
+START SLAVE;
+
+--echo *** Drop t2 ***
+connection master;
+DROP TABLE t2;
+sync_slave_with_master;
####################################
### Try to replicate BLOB to INT ###
@@ -140,7 +149,7 @@ INSERT INTO t3 () VALUES(@b1,2,'Kyle, TEX'),(@b1,1,'JOE AUSTIN'),(@b1,4,'QA TEST
connection slave;
--source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
+--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
--query_vertical SHOW SLAVE STATUS
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
@@ -185,7 +194,7 @@ INSERT INTO t4 () VALUES(100.22,2,'Kyle, TEX'),(200.26,1,'JOE AUSTIN'),
connection slave;
--source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
+--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
--query_vertical SHOW SLAVE STATUS
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
@@ -230,7 +239,7 @@ INSERT INTO t5 () VALUES(1,'Kyle',200.23,1,'b1b1',23.00098),
connection slave;
--source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
+--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
--query_vertical SHOW SLAVE STATUS
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
@@ -276,7 +285,7 @@ INSERT INTO t6 () VALUES(1,'Kyle',200.23,1),
connection slave;
--source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
+--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
--query_vertical SHOW SLAVE STATUS
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3;
#START SLAVE;
@@ -378,7 +387,7 @@ INSERT INTO t8 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
#connection slave;
#wait_for_slave_to_stop;
#--replace_result $MASTER_MYPORT MASTER_PORT
-#--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
+#--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
#--query_vertical SHOW SLAVE STATUS
#SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
#START SLAVE;
@@ -429,7 +438,7 @@ sync_slave_with_master;
#--echo *** Select from T9 ***
#--source include/wait_for_slave_sql_to_stop.inc
#--replace_result $MASTER_MYPORT MASTER_PORT
-#--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
+#--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
#--query_vertical SHOW SLAVE STATUS
#SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
#START SLAVE;
@@ -471,7 +480,7 @@ INSERT INTO t10 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
connection slave;
--source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
+--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
--query_vertical SHOW SLAVE STATUS
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
@@ -515,7 +524,7 @@ INSERT INTO t11 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
connection slave;
--source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
+--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
--query_vertical SHOW SLAVE STATUS
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
@@ -725,7 +734,7 @@ ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5;
connection slave;
--source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
+--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
--query_vertical SHOW SLAVE STATUS
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
@@ -834,7 +843,7 @@ INSERT INTO t17 () VALUES(9223372036854775807,2,'Kyle, TEX');
connection slave;
--source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
+--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
--query_vertical SHOW SLAVE STATUS
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;