summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <lars@black.(none)>2006-11-13 12:45:31 +0100
committerunknown <lars@black.(none)>2006-11-13 12:45:31 +0100
commit36dfa434cc4f0aa31ef29f1a78f20c510bd93e9b (patch)
treeeb796a1a532ee9d10c8c44e5cd764977260d29a0 /mysql-test
parentce963d0c8e3243b558ea54c11e8c5824b8dcf3b8 (diff)
parent421f4c090739cc993ce336048df7c0284896e886 (diff)
downloadmariadb-git-36dfa434cc4f0aa31ef29f1a78f20c510bd93e9b.tar.gz
Merge mysql.com:/home/bkroot/mysql-5.1-new-rpl
into mysql.com:/home/bk/MERGE/mysql-5.1-merge BitKeeper/etc/collapsed: auto-union mysql-test/r/view.result: Auto merged mysql-test/t/view.test: Auto merged sql/Makefile.am: Auto merged sql/handler.cc: Auto merged sql/log.cc: Auto merged sql/mysql_priv.h: Auto merged sql/mysqld.cc: Auto merged sql/slave.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_view.cc: Auto merged
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/extra/binlog_tests/binlog.test13
-rw-r--r--mysql-test/extra/rpl_tests/rpl_deadlock.test42
-rw-r--r--mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test853
-rw-r--r--mysql-test/extra/rpl_tests/rpl_ndb_ddl.test507
-rw-r--r--mysql-test/include/strict_autoinc.inc4
-rw-r--r--mysql-test/r/binlog_row_binlog.result26
-rw-r--r--mysql-test/r/binlog_stm_binlog.result20
-rw-r--r--mysql-test/r/ctype_recoding.result4
-rw-r--r--mysql-test/r/ctype_ucs.result22
-rw-r--r--mysql-test/r/ctype_utf8.result32
-rw-r--r--mysql-test/r/fulltext.result8
-rw-r--r--mysql-test/r/func_gconcat.result70
-rw-r--r--mysql-test/r/lowercase_table.result24
-rw-r--r--mysql-test/r/rpl_deadlock_innodb.result36
-rw-r--r--mysql-test/r/rpl_do_grant.result2
-rw-r--r--mysql-test/r/rpl_extraCol_innodb.result741
-rw-r--r--mysql-test/r/rpl_extraCol_myisam.result741
-rw-r--r--mysql-test/r/rpl_ignore_table.result16
-rw-r--r--mysql-test/r/rpl_ndb_dd_advance.result16
-rw-r--r--mysql-test/r/rpl_ndb_ddl.result25
-rw-r--r--mysql-test/r/rpl_ndb_extraCol.result742
-rw-r--r--mysql-test/r/strict_autoinc_1myisam.result1
-rw-r--r--mysql-test/r/strict_autoinc_2innodb.result1
-rw-r--r--mysql-test/r/strict_autoinc_3heap.result1
-rw-r--r--mysql-test/r/strict_autoinc_4bdb.result1
-rw-r--r--mysql-test/r/strict_autoinc_5ndb.result1
-rw-r--r--mysql-test/r/view.result19
-rw-r--r--mysql-test/r/xml.result73
-rw-r--r--mysql-test/t/ctype_ucs.test17
-rw-r--r--mysql-test/t/ctype_utf8.test24
-rw-r--r--mysql-test/t/disabled.def2
-rw-r--r--mysql-test/t/func_gconcat.test35
-rw-r--r--mysql-test/t/lowercase_table.test20
-rw-r--r--mysql-test/t/rpl_do_grant.test10
-rw-r--r--mysql-test/t/rpl_extraCol_innodb-master.opt1
-rw-r--r--mysql-test/t/rpl_extraCol_innodb-slave.opt1
-rw-r--r--mysql-test/t/rpl_extraCol_innodb.test13
-rw-r--r--mysql-test/t/rpl_extraCol_myisam.test12
-rw-r--r--mysql-test/t/rpl_ignore_table-slave.opt2
-rw-r--r--mysql-test/t/rpl_ignore_table.test24
-rw-r--r--mysql-test/t/rpl_ndb_dd_advance.test16
-rw-r--r--mysql-test/t/rpl_ndb_ddl.test3
-rw-r--r--mysql-test/t/rpl_ndb_extraCol.test13
-rw-r--r--mysql-test/t/view.test19
-rw-r--r--mysql-test/t/xml.test30
45 files changed, 4209 insertions, 74 deletions
diff --git a/mysql-test/extra/binlog_tests/binlog.test b/mysql-test/extra/binlog_tests/binlog.test
index 81c813e78d0..48d9b859c26 100644
--- a/mysql-test/extra/binlog_tests/binlog.test
+++ b/mysql-test/extra/binlog_tests/binlog.test
@@ -59,4 +59,17 @@ insert into t1 values(null);
select * from t1;
drop table t1;
+# bug#22027
+create table t1 (a int);
+create table if not exists t2 select * from t1;
+
+# bug#22762
+create temporary table tt1 (a int);
+create table if not exists t3 like tt1;
+
+--replace_column 2 # 5 #
+--replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\//
+show binlog events from 102;
+drop table t1,t2,t3,tt1;
+
-- source extra/binlog_tests/binlog_insert_delayed.test
diff --git a/mysql-test/extra/rpl_tests/rpl_deadlock.test b/mysql-test/extra/rpl_tests/rpl_deadlock.test
index 64df1f272cc..526925d6a83 100644
--- a/mysql-test/extra/rpl_tests/rpl_deadlock.test
+++ b/mysql-test/extra/rpl_tests/rpl_deadlock.test
@@ -15,7 +15,8 @@
connection master;
eval CREATE TABLE t1 (a INT NOT NULL, KEY(a)) ENGINE=$engine_type;
eval CREATE TABLE t2 (a INT NOT NULL, KEY(a)) ENGINE=$engine_type;
-eval CREATE TABLE t3 (a INT) ENGINE=$engine_type;
+# requiring 'unique' for the timeout part of the test
+eval CREATE TABLE t3 (a INT UNIQUE) ENGINE=$engine_type;
eval CREATE TABLE t4 (a INT) ENGINE=$engine_type;
show variables like 'slave_transaction_retries';
sync_slave_with_master;
@@ -30,7 +31,9 @@ stop slave;
connection master;
begin;
# Let's keep BEGIN and the locked statement in two different relay logs.
-let $1=200;
+insert into t2 values (0); # t2,t1 actors of deadlock in repl-ed ta
+#insert into t3 select * from t2 for update;
+let $1=10;
disable_query_log;
while ($1)
{
@@ -38,16 +41,14 @@ while ($1)
dec $1;
}
enable_query_log;
-insert into t3 select * from t2 for update;
insert into t1 values(1);
commit;
save_master_pos;
connection slave;
begin;
-# Let's make our transaction large so that it's slave who is chosen as
-# victim
-let $1=1000;
+# Let's make our transaction large so that it's repl-ed msta that's victim
+let $1=100;
disable_query_log;
while ($1)
{
@@ -55,14 +56,21 @@ while ($1)
dec $1;
}
enable_query_log;
-select * from t1 for update;
+select * from t1 for update; # t1,t2 on local slave's
start slave;
+
+# bad option, todo: replicate a non-transactional t_sync with the transaction
+# and use wait_until_rows_count macro below
--real_sleep 3 # hope that slave is blocked now
-insert into t2 values(22); # provoke deadlock, slave should be victim
+#let $count=11;
+#let $table=t_sync;
+#--include wait_until_rows_count.inc
+
+select * from t2 for update /* dl */; # provoke deadlock, repl-ed should be victim
commit;
sync_with_master;
-select * from t1; # check that slave succeeded finally
-select * from t2;
+select * from t1; # check that repl-ed succeeded finally
+select * from t2 /* must be 1 */;
# check that no error is reported
--replace_column 1 # 7 # 8 # 9 # 16 # 22 # 23 # 33 #
--replace_result $MASTER_MYPORT MASTER_MYPORT
@@ -73,14 +81,16 @@ show slave status;
# 2) Test lock wait timeout
stop slave;
-change master to master_log_pos=536; # the BEGIN log event
+delete from t3;
+change master to master_log_pos=544; # the BEGIN log event
begin;
select * from t2 for update; # hold lock
start slave;
---real_sleep 10 # slave should have blocked, and be retrying
+--real_sleep 10 # repl-ed should have blocked, and be retrying
+select count(*) from t3 /* must be zero */; # replaying begins after rollback
commit;
sync_with_master;
-select * from t1; # check that slave succeeded finally
+select * from t1; # check that repl-ed succeeded finally
select * from t2;
# check that no error is reported
--replace_column 1 # 7 # 8 # 9 # 11 # 16 # 22 # 23 # 33 #
@@ -96,11 +106,13 @@ set global max_relay_log_size=0;
# This is really copy-paste of 2) of above
stop slave;
-change master to master_log_pos=536;
+delete from t3;
+change master to master_log_pos=544;
begin;
select * from t2 for update;
start slave;
--real_sleep 10
+select count(*) from t3 /* must be zero */; # replaying begins after rollback
commit;
sync_with_master;
select * from t1;
@@ -115,4 +127,4 @@ connection master;
drop table t1,t2,t3,t4;
sync_slave_with_master;
-# End of 4.1 tests
+--echo End of 5.1 tests
diff --git a/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test b/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test
new file mode 100644
index 00000000000..34e01b7a675
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test
@@ -0,0 +1,853 @@
+#################################################
+# Author: Jeb
+# Date: 2006-09-07
+# Purpose: To test having extra columns on the slave.
+##################################################
+
+########### Clean up ################
+--disable_warnings
+--disable_query_log
+DROP TABLE IF EXISTS t1, t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17;
+--enable_query_log
+--enable_warnings
+
+#################################################
+############ Different Table Def Test ###########
+#################################################
+# Purpose: To have different table def on the #
+# master and slave. Most of these tests#
+# should stop the slave. #
+#################################################
+
+--echo **** Diff Table Def Start ****
+
+##############################################
+### Try to replicate w/ PK on diff columns ###
+### Should Stop Slave ###
+##############################################
+
+--echo *** On Slave ***
+sync_slave_with_master;
+STOP SLAVE;
+RESET SLAVE;
+
+eval CREATE TABLE t1 (a INT, b INT PRIMARY KEY, c CHAR(20),
+ d FLOAT DEFAULT '2.00',
+ e CHAR(4) DEFAULT 'TEST')
+ ENGINE=$engine_type;
+
+--echo *** Create t1 on Master ***
+connection master;
+eval CREATE TABLE t1 (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 t1 () VALUES(1,2,'TEXAS'),(2,1,'AUSTIN'),(3,4,'QA');
+SELECT * FROM t1 ORDER BY a;
+
+--echo *** Select from slave ***
+sync_slave_with_master;
+SELECT * FROM t1 ORDER BY a;
+
+--echo *** Drop t1 ***
+connection master;
+DROP TABLE t1;
+sync_slave_with_master;
+
+############################################
+### Try to replicate CHAR(10) to CHAR(5) ###
+### Should Stop Slave or truncate value ###
+############################################
+
+## 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 *** Select from slave ***
+#sync_slave_with_master;
+#SELECT * FROM t2 ORDER BY a;
+
+#--echo *** Drop t2 ***
+#connection master;
+#DROP TABLE t2;
+#sync_slave_with_master;
+
+####################################
+### Try to replicate BLOB to INT ###
+### Should Stop Slave ###
+####################################
+--echo *** Create t3 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+eval CREATE TABLE t3 (a INT, b INT PRIMARY KEY, c CHAR(20),
+ d FLOAT DEFAULT '2.00',
+ e CHAR(5) DEFAULT 'TEST2')
+ ENGINE=$engine_type;
+
+--echo *** Create t3 on Master ***
+connection master;
+eval CREATE TABLE t3 (a BLOB, b INT PRIMARY KEY, c CHAR(20)
+ ) ENGINE=$engine_type;
+RESET MASTER;
+
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+--echo *** Master Data Insert ***
+connection master;
+
+set @b1 = 'b1';
+set @b1 = concat(@b1,@b1);
+
+INSERT INTO t3 () VALUES(@b1,2,'Kyle, TEX'),(@b1,1,'JOE AUSTIN'),(@b1,4,'QA TESTING');
+
+--echo ********************************************
+--echo *** Expect slave to fail with Error 1522 ***
+--echo ********************************************
+connection slave;
+wait_for_slave_to_stop;
+--replace_result $MASTER_MYPORT MASTER_PORT
+--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
+--query_vertical SHOW SLAVE STATUS
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+
+--echo *** Drop t3 ***
+connection master;
+DROP TABLE t3;
+sync_slave_with_master;
+
+#####################################################
+# Columns with different types, more columns at end #
+# Expect: proper error message (wrong types) #
+#####################################################
+
+--echo *** Create t4 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+eval CREATE TABLE t4 (a INT, b INT PRIMARY KEY, c CHAR(20),
+ d FLOAT DEFAULT '2.00',
+ e CHAR(5) DEFAULT 'TEST2')
+ ENGINE=$engine_type;
+
+--echo *** Create t4 on Master ***
+connection master;
+eval CREATE TABLE t4 (a DECIMAL(8,2), b INT PRIMARY KEY, c CHAR(20)
+ ) ENGINE=$engine_type;
+RESET MASTER;
+
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+--echo *** Master Data Insert ***
+connection master;
+
+INSERT INTO t4 () VALUES(100.22,2,'Kyle, TEX'),(200.26,1,'JOE AUSTIN'),
+ (30000.22,4,'QA TESTING');
+
+--echo ********************************************
+--echo *** Expect slave to fail with Error 1522 ***
+--echo ********************************************
+connection slave;
+wait_for_slave_to_stop;
+--replace_result $MASTER_MYPORT MASTER_PORT
+--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
+--query_vertical SHOW SLAVE STATUS
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+
+--echo *** Drop t4 ***
+connection master;
+DROP TABLE t4;
+sync_slave_with_master;
+
+#######################################################
+# Columns with different types, same number of colums #
+# Expect: Proper error message #
+#######################################################
+
+--echo *** Create t5 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+eval CREATE TABLE t5 (a INT PRIMARY KEY, b CHAR(5),
+ c FLOAT, d INT, e DOUBLE,
+ f DECIMAL(8,2))ENGINE=$engine_type;
+
+--echo *** Create t5 on Master ***
+connection master;
+eval CREATE TABLE t5 (a INT PRIMARY KEY, b VARCHAR(6),
+ c DECIMAL(8,2), d BIT, e BLOB,
+ f FLOAT) ENGINE=$engine_type;
+RESET MASTER;
+
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+--echo *** Master Data Insert ***
+connection master;
+
+INSERT INTO t5 () VALUES(1,'Kyle',200.23,1,'b1b1',23.00098),
+ (2,'JOE',300.01,0,'b2b2',1.0000009);
+
+--echo ********************************************
+--echo *** Expect slave to fail with Error 1522 ***
+--echo ********************************************
+connection slave;
+wait_for_slave_to_stop;
+--replace_result $MASTER_MYPORT MASTER_PORT
+--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
+--query_vertical SHOW SLAVE STATUS
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+
+--echo *** Drop t5 ***
+connection master;
+DROP TABLE t5;
+sync_slave_with_master;
+
+#######################################################
+################## Continued ##########################
+#######################################################
+# Columns with different types, same number of colums #
+# Expect: Proper error message #
+#######################################################
+
+--echo *** Create t6 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+eval CREATE TABLE t6 (a INT PRIMARY KEY, b CHAR(5),
+ c FLOAT, d INT)ENGINE=$engine_type;
+
+--echo *** Create t6 on Master ***
+connection master;
+eval CREATE TABLE t6 (a INT PRIMARY KEY, b VARCHAR(6),
+ c DECIMAL(8,2), d BIT
+ ) ENGINE=$engine_type;
+RESET MASTER;
+
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+--echo *** Master Data Insert ***
+connection master;
+
+INSERT INTO t6 () VALUES(1,'Kyle',200.23,1),
+ (2,'JOE',300.01,0);
+
+--echo ********************************************
+--echo *** Expect slave to fail with Error 1522 ***
+--echo ********************************************
+connection slave;
+wait_for_slave_to_stop;
+--replace_result $MASTER_MYPORT MASTER_PORT
+--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
+--query_vertical SHOW SLAVE STATUS
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3;
+#START SLAVE;
+
+--echo *** Drop t6 ***
+connection master;
+DROP TABLE t6;
+connection slave;
+DROP TABLE t6;
+START SLAVE;
+#sync_slave_with_master;
+
+
+--echo **** Diff Table Def End ****
+
+#######################################
+#### Extra Column on Slave Testing ####
+#######################################
+# Purpose: To test extra colums on the#
+# Slave #
+#######################################
+
+--echo **** Extra Colums Start ****
+
+##########################################
+# More columns in slave at end of table, #
+# added columns have default values #
+# Expect: it should work, default values #
+# should be used #
+##########################################
+
+--echo *** Create t7 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+eval CREATE TABLE t7 (a INT KEY, b BLOB, c CHAR(5),
+ d TIMESTAMP NULL DEFAULT '0000-00-00 00:00:00',
+ e CHAR(20) DEFAULT 'Extra Column Testing')
+ ENGINE=$engine_type;
+
+--echo *** Create t7 on Master ***
+connection master;
+eval CREATE TABLE t7 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
+ ) ENGINE=$engine_type;
+RESET MASTER;
+
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+--echo *** Master Data Insert ***
+connection master;
+set @b1 = 'b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t7 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+SELECT * FROM t7 ORDER BY a;
+
+--echo *** Select from slave ***
+sync_slave_with_master;
+SELECT * FROM t7 ORDER BY a;
+
+--echo *** Drop t7 ***
+connection master;
+DROP TABLE t7;
+sync_slave_with_master;
+
+###########################################
+# More columns in slave at end of table, #
+# added columns do not have default values#
+# Expect: Proper error message #
+###########################################
+# NOTE: This should fail but currently #
+# works. BUG#22101 #
+###########################################
+--echo *** Create t8 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+eval CREATE TABLE t8 (a INT KEY, b BLOB, c CHAR(5),
+ d TIMESTAMP NULL DEFAULT '0000-00-00 00:00:00',
+ e INT)ENGINE=$engine_type;
+
+--echo *** Create t8 on Master ***
+connection master;
+eval CREATE TABLE t8 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
+ ) ENGINE=$engine_type;
+RESET MASTER;
+
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+--echo *** Master Data Insert ***
+connection master;
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t8 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+
+### Uncomment once bug is fixed
+
+#connection slave;
+#wait_for_slave_to_stop;
+#--replace_result $MASTER_MYPORT MASTER_PORT
+#--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
+#--query_vertical SHOW SLAVE STATUS
+#SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+#START SLAVE;
+
+--echo *** Drop t8 ***
+connection master;
+DROP TABLE t8;
+sync_slave_with_master;
+
+###########################################
+############# Continued ###################
+# More columns in slave at end of table, #
+# added columns do not have default values#
+# Expect: Proper error message #
+###########################################
+# Commented out due to Bug #23907 Extra Slave Col is not
+# erroring on extra col with no default values.
+########################################################
+#--echo *** Create t9 on slave ***
+#STOP SLAVE;
+#RESET SLAVE;
+#eval CREATE TABLE t9 (a INT KEY, b BLOB, c CHAR(5),
+# d TIMESTAMP,
+# e INT DEFAULT '1')ENGINE=$engine_type;
+
+#--echo *** Create t9 on Master ***
+#connection master;
+#eval CREATE TABLE t9 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
+# ) ENGINE=$engine_type;
+#RESET MASTER;
+
+#--echo *** Start Slave ***
+#connection slave;
+#START SLAVE;
+
+#--echo *** Master Data Insert ***
+#connection master;
+#set @b1 = 'b1b1b1b1';
+#set @b1 = concat(@b1,@b1);
+#INSERT INTO t9 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+
+#--echo *************************************************
+#--echo ** Currently giving wrong error see bug#22234 ***
+#--echo *************************************************
+#sync_slave_with_master;
+#connection slave;
+
+#--echo *** Select from T9 ***
+#wait_for_slave_to_stop;
+#--replace_result $MASTER_MYPORT MASTER_PORT
+#--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
+#--query_vertical SHOW SLAVE STATUS
+#SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+#START SLAVE;
+
+#--echo *** Drop t9 ***
+#connection master;
+#DROP TABLE t9;
+#sync_slave_with_master;
+
+############################################
+# More columns in slave at middle of table #
+# Expect: Proper error message #
+############################################
+--echo *** Create t10 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+eval CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233',
+ c CHAR(5), e INT DEFAULT '1')ENGINE=$engine_type;
+
+--echo *** Create t10 on Master ***
+connection master;
+eval CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
+ ) ENGINE=$engine_type;
+RESET MASTER;
+
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+--echo *** Master Data Insert ***
+connection master;
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t10 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+
+--echo ********************************************
+--echo *** Expect slave to fail with Error 1522 ***
+--echo ********************************************
+connection slave;
+wait_for_slave_to_stop;
+--replace_result $MASTER_MYPORT MASTER_PORT
+--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
+--query_vertical SHOW SLAVE STATUS
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+
+--echo *** Drop t10 ***
+connection master;
+DROP TABLE t10;
+sync_slave_with_master;
+
+############################################
+############## Continued ###################
+############################################
+# More columns in slave at middle of table #
+# Expect: Proper error message #
+############################################
+--echo *** Create t11 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+eval CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT,
+ c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE=$engine_type;
+
+--echo *** Create t11 on Master ***
+connection master;
+eval CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254)
+ ) ENGINE=$engine_type;
+RESET MASTER;
+
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+--echo *** Master Data Insert ***
+connection master;
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t11 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+
+--echo ********************************************
+--echo *** Expect slave to fail with Error 1522 ***
+--echo ********************************************
+connection slave;
+wait_for_slave_to_stop;
+--replace_result $MASTER_MYPORT MASTER_PORT
+--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
+--query_vertical SHOW SLAVE STATUS
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+
+--echo *** Drop t11 ***
+connection master;
+DROP TABLE t11;
+sync_slave_with_master;
+
+############################################
+############## Continued ###################
+############################################
+# More columns in slave at middle of table #
+# Expect: This one should pass blob-text #
+############################################
+--echo *** Create t12 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+eval CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT,
+ c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE=$engine_type;
+
+--echo *** Create t12 on Master ***
+connection master;
+eval CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB
+ ) ENGINE=$engine_type;
+RESET MASTER;
+
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+--echo *** Master Data Insert ***
+connection master;
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t12 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+SELECT * FROM t12 ORDER BY a;
+
+--echo *** Select on Slave ***
+sync_slave_with_master;
+SELECT * FROM t12 ORDER BY a;
+
+--echo *** Drop t12 ***
+connection master;
+DROP TABLE t12;
+sync_slave_with_master;
+
+--echo **** Extra Colums End ****
+
+###############################
+# BUG#22177 CURRENT_TIMESTAMP #
+# Sould work with ^ #
+###############################
+--echo *** BUG 22177 Start ***
+--echo *** Create t13 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+eval CREATE TABLE t13 (a INT KEY, b BLOB, c CHAR(5),
+ d INT DEFAULT '1',
+ e TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+ )ENGINE=$engine_type;
+
+--echo *** Create t13 on Master ***
+connection master;
+eval CREATE TABLE t13 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
+ ) ENGINE=$engine_type;
+RESET MASTER;
+
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+--echo *** Master Data Insert ***
+connection master;
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t13 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+SELECT * FROM t13 ORDER BY a;
+
+--echo *** Select on Slave ****
+sync_slave_with_master;
+--replace_column 5 CURRENT_TIMESTAMP
+SELECT * FROM t13 ORDER BY a;
+
+--echo *** Drop t13 ***
+connection master;
+DROP TABLE t13;
+sync_slave_with_master;
+
+--echo *** 22117 END ***
+
+##############################
+# ALTER MASTER TABLE TESTING #
+##############################
+
+--echo *** Alter Master Table Testing Start ***
+
+####################################################
+# - Alter Master adding columns at middle of table #
+# Expect: columns added #
+####################################################
+
+--echo *** Create t14 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+eval CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
+ c6 INT DEFAULT '1',
+ c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+ )ENGINE=$engine_type;
+
+--echo *** Create t14 on Master ***
+connection master;
+eval CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
+ ) ENGINE=$engine_type;
+RESET MASTER;
+
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+--echo *** Master Data Insert ***
+connection master;
+ALTER TABLE t14 ADD COLUMN c2 DECIMAL(8,2) AFTER c1;
+ALTER TABLE t14 ADD COLUMN c3 TEXT AFTER c2;
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t14 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle'),
+ (2,2.00,'This Test Should work',@b1,'JOE'),
+ (3,3.00,'If is does not, I will open a bug',@b1,'QA');
+SELECT * FROM t14 ORDER BY c1;
+
+
+--echo *** Select on Slave ****
+sync_slave_with_master;
+--replace_column 7 CURRENT_TIMESTAMP
+SELECT * FROM t14 ORDER BY c1;
+
+
+####################################################
+# - Alter Master Dropping columns from the middle. #
+# Expect: columns dropped #
+####################################################
+
+--echo *** connect to master and drop columns ***
+connection master;
+ALTER TABLE t14 DROP COLUMN c2;
+ALTER TABLE t14 DROP COLUMN c4;
+--echo *** Select from Master ***
+SELECT * FROM t14 ORDER BY c1;
+
+--echo *** Select from Slave ***
+sync_slave_with_master;
+--replace_column 5 CURRENT_TIMESTAMP
+SELECT * FROM t14 ORDER BY c1;
+
+--echo *** Drop t14 ***
+connection master;
+DROP TABLE t14;
+sync_slave_with_master;
+
+##############################################################
+# - Alter Master adding columns that already exist on slave. #
+# Expect: proper error message #
+##############################################################
+
+--echo *** Create t15 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+eval CREATE TABLE t15 (c1 INT KEY, c2 DECIMAL(8,2), c3 TEXT,
+ c4 BLOB, c5 CHAR(5),
+ c6 INT DEFAULT '1',
+ c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+ )ENGINE=$engine_type;
+
+--echo *** Create t15 on Master ***
+connection master;
+eval CREATE TABLE t15 (c1 INT PRIMARY KEY, c2 DECIMAL(8,2), c3 TEXT,
+ c4 BLOB, c5 CHAR(5)) ENGINE=$engine_type;
+RESET MASTER;
+
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+--echo *** Master Data Insert ***
+connection master;
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t15 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle'),
+ (2,2.00,'This Test Should work',@b1,'JOE'),
+ (3,3.00,'If is does not, I will open a bug',@b1,'QA');
+SELECT * FROM t15 ORDER BY c1;
+
+
+--echo *** Select on Slave ****
+sync_slave_with_master;
+--replace_column 7 CURRENT_TIMESTAMP
+SELECT * FROM t15 ORDER BY c1;
+
+--echo *** Add column on master that is a Extra on Slave ***
+connection master;
+ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5;
+
+--echo ********************************************
+--echo *** Expect slave to fail with Error 1060 ***
+--echo ********************************************
+connection slave;
+wait_for_slave_to_stop;
+--replace_result $MASTER_MYPORT MASTER_PORT
+--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
+--query_vertical SHOW SLAVE STATUS
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+
+--echo *** Try to insert in master ****
+connection master;
+INSERT INTO t15 () VALUES(5,2.00,'Replication Testing',@b1,'Buda',2);
+SELECT * FROM t15 ORDER BY c1;
+
+--echo *** Try to select from slave ****
+sync_slave_with_master;
+--replace_column 7 CURRENT_TIMESTAMP
+SELECT * FROM t15 ORDER BY c1;
+
+--echo *** DROP TABLE t15 ***
+connection master;
+DROP TABLE t15;
+sync_slave_with_master;
+
+####################################
+# - Alter Master and ADD PARTITION #
+# Expect:? #
+####################################
+
+--echo *** Create t16 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+eval CREATE TABLE t16 (c1 INT KEY, c2 DECIMAL(8,2), c3 TEXT,
+ c4 BLOB, c5 CHAR(5),
+ c6 INT DEFAULT '1',
+ c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+ )ENGINE=$engine_type;
+
+--echo *** Create t16 on Master ***
+connection master;
+eval CREATE TABLE t16 (c1 INT PRIMARY KEY, c2 DECIMAL(8,2), c3 TEXT,
+ c4 BLOB, c5 CHAR(5))ENGINE=$engine_type;
+RESET MASTER;
+
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+--echo *** Master Data Insert ***
+connection master;
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t16 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle'),
+ (2,2.00,'This Test Should work',@b1,'JOE'),
+ (3,3.00,'If is does not, I will open a bug',@b1,'QA');
+SELECT * FROM t16 ORDER BY c1;
+
+--echo *** Select on Slave ****
+sync_slave_with_master;
+--replace_column 7 CURRENT_TIMESTAMP
+SELECT * FROM t16 ORDER BY c1;
+
+--echo *** Add Partition on master ***
+connection master;
+ALTER TABLE t16 PARTITION BY KEY(c1) PARTITIONS 4;
+INSERT INTO t16 () VALUES(4,1.00,'Replication Rocks',@b1,'Omer');
+SHOW CREATE TABLE t16;
+
+--echo *** Show table on Slave ****
+sync_slave_with_master;
+SHOW CREATE TABLE t16;
+
+--echo *** DROP TABLE t16 ***
+connection master;
+DROP TABLE t16;
+sync_slave_with_master;
+
+--echo *** Alter Master End ***
+
+############################################
+### Try to replicate BIGINT to SMALLINT ###
+### Should Stop Slave ###
+############################################
+
+--echo *** Create t17 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+eval CREATE TABLE t17 (a SMALLINT, b INT PRIMARY KEY, c CHAR(5),
+ d FLOAT DEFAULT '2.00',
+ e CHAR(5) DEFAULT 'TEST2')
+ ENGINE=$engine_type;
+
+--echo *** Create t17 on Master ***
+connection master;
+eval CREATE TABLE t17 (a BIGINT 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 t17 () VALUES(9223372036854775807,2,'Kyle, TEX');
+
+--echo ********************************************
+--echo *** Expect slave to fail with Error 1522 ***
+--echo ********************************************
+connection slave;
+wait_for_slave_to_stop;
+--replace_result $MASTER_MYPORT MASTER_PORT
+--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
+--query_vertical SHOW SLAVE STATUS
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+
+--echo ** DROP table t17 ***
+connection master;
+DROP TABLE t17;
+sync_slave_with_master;
+
+#### Clean Up ####
+--disable_warnings
+--disable_query_log
+DROP TABLE IF EXISTS t1, t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17;
+--enable_query_log
+--enable_warnings
+
+# END 5.1 Test Case
+
+
diff --git a/mysql-test/extra/rpl_tests/rpl_ndb_ddl.test b/mysql-test/extra/rpl_tests/rpl_ndb_ddl.test
new file mode 100644
index 00000000000..26c368589ba
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_ndb_ddl.test
@@ -0,0 +1,507 @@
+######################## rpl_ddl.test ########################
+# #
+# DDL statements (sometimes with implicit COMMIT) executed #
+# by the master and it's propagation into the slave #
+# #
+##############################################################
+
+#
+# NOTE, PLEASE BE CAREFUL, WHEN MODIFYING THE TESTS !!
+#
+# 1. !All! objects to be dropped, renamed, altered ... must be created
+# in AUTOCOMMIT= 1 mode before AUTOCOMMIT is set to 0 and the test
+# sequences start.
+#
+# 2. Never use a test object, which was direct or indirect affected by a
+# preceeding test sequence again.
+# Except table d1.t1 where ONLY DML is allowed.
+#
+# If one preceeding test sequence hits a (sometimes not good visible,
+# because the sql error code of the statement might be 0) bug
+# and these rules are ignored, a following test sequence might earn ugly
+# effects like failing 'sync_slave_with_master', crashes of the slave or
+# abort of the test case etc..
+#
+# 3. The assignment of the DDL command to be tested to $my_stmt can
+# be a bit difficult. "'" must be avoided, because the test
+# routine "include/rpl_stmt_seq.inc" performs a
+# eval SELECT CONCAT('######## ','$my_stmt',' ########') as "";
+#
+
+###############################################################
+# Some preparations
+###############################################################
+# The sync_slave_with_master is needed to make the xids deterministic.
+sync_slave_with_master;
+connection master;
+
+SET AUTOCOMMIT = 1;
+#
+# 1. DROP all objects, which probably already exist, but must be created here
+#
+--disable_warnings
+DROP DATABASE IF EXISTS mysqltest1;
+DROP DATABASE IF EXISTS mysqltest2;
+DROP DATABASE IF EXISTS mysqltest3;
+--enable_warnings
+#
+# 2. CREATE all objects needed
+# working database is mysqltest1
+# working (transactional!) is mysqltest1.t1
+#
+CREATE DATABASE mysqltest1;
+CREATE DATABASE mysqltest2;
+eval CREATE TABLE mysqltest1.t1 (f1 BIGINT) ENGINE=$engine_type;
+INSERT INTO mysqltest1.t1 SET f1= 0;
+eval CREATE TABLE mysqltest1.t2 (f1 BIGINT) ENGINE=$engine_type;
+eval CREATE TABLE mysqltest1.t3 (f1 BIGINT) ENGINE=$engine_type;
+eval CREATE TABLE mysqltest1.t4 (f1 BIGINT) ENGINE=$engine_type;
+eval CREATE TABLE mysqltest1.t5 (f1 BIGINT) ENGINE=$engine_type;
+eval CREATE TABLE mysqltest1.t6 (f1 BIGINT) ENGINE=$engine_type;
+CREATE INDEX my_idx6 ON mysqltest1.t6(f1);
+eval CREATE TABLE mysqltest1.t7 (f1 BIGINT) ENGINE=$engine_type;
+INSERT INTO mysqltest1.t7 SET f1= 0;
+eval CREATE TABLE mysqltest1.t8 (f1 BIGINT) ENGINE=$engine_type;
+eval CREATE TABLE mysqltest1.t9 (f1 BIGINT) ENGINE=$engine_type;
+eval CREATE TABLE mysqltest1.t10 (f1 BIGINT) ENGINE=$engine_type;
+eval CREATE TABLE mysqltest1.t11 (f1 BIGINT) ENGINE=$engine_type;
+eval CREATE TABLE mysqltest1.t12 (f1 BIGINT) ENGINE=$engine_type;
+eval CREATE TABLE mysqltest1.t13 (f1 BIGINT) ENGINE=$engine_type;
+eval CREATE TABLE mysqltest1.t14 (f1 BIGINT) ENGINE=$engine_type;
+eval CREATE TABLE mysqltest1.t15 (f1 BIGINT) ENGINE=$engine_type;
+eval CREATE TABLE mysqltest1.t16 (f1 BIGINT) ENGINE=$engine_type;
+eval CREATE TABLE mysqltest1.t17 (f1 BIGINT) ENGINE=$engine_type;
+eval CREATE TABLE mysqltest1.t18 (f1 BIGINT) ENGINE=$engine_type;
+eval CREATE TABLE mysqltest1.t19 (f1 BIGINT) ENGINE=$engine_type;
+CREATE TEMPORARY TABLE mysqltest1.t23 (f1 BIGINT);
+
+#
+# 3. master sessions: never do AUTOCOMMIT
+# slave sessions: never do AUTOCOMMIT
+#
+SET AUTOCOMMIT = 0;
+use mysqltest1;
+sync_slave_with_master;
+connection slave;
+--disable_query_log
+SELECT '-------- switch to slave --------' as "";
+--enable_query_log
+SET AUTOCOMMIT = 0;
+use mysqltest1;
+connection master;
+--disable_query_log
+SELECT '-------- switch to master -------' as "";
+--enable_query_log
+
+
+# We don't want to abort the whole test if one statement sent
+# to the server gets an error, because the following test
+# sequences are nearly independend of the previous statements.
+--disable_abort_on_error
+
+###############################################################
+# Banal case: (explicit) COMMIT and ROLLBACK
+# Just for checking if the test sequence is usable
+###############################################################
+
+let $my_stmt= COMMIT;
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+
+let $my_stmt= ROLLBACK;
+let $my_master_commit= false;
+let $my_slave_commit= false;
+--source include/rpl_stmt_seq.inc
+
+###############################################################
+# Cases with commands very similar to COMMIT
+###############################################################
+
+let $my_stmt= SET AUTOCOMMIT=1;
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+SET AUTOCOMMIT=0;
+
+let $my_stmt= START TRANSACTION;
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+
+let $my_stmt= BEGIN;
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+
+###############################################################
+# Cases with (BASE) TABLES and (UPDATABLE) VIEWs
+###############################################################
+
+let $my_stmt= DROP TABLE mysqltest1.t2;
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+SHOW TABLES LIKE 't2';
+connection slave;
+--disable_query_log
+SELECT '-------- switch to slave --------' as "";
+--enable_query_log
+SHOW TABLES LIKE 't2';
+connection master;
+--disable_query_log
+SELECT '-------- switch to master -------' as "";
+--enable_query_log
+
+# Note: Since this test is executed with a skip-innodb slave, the
+# slave incorrectly commits the insert. One can *not* have InnoDB on
+# master and MyISAM on slave and expect that a transactional rollback
+# after a CREATE TEMPORARY TABLE should work correctly on the slave.
+# For this to work properly the handler on the slave must be able to
+# handle transactions (e.g. InnoDB or NDB).
+let $my_stmt= DROP TEMPORARY TABLE mysqltest1.t23;
+let $my_master_commit= false;
+let $my_slave_commit= false;
+--source include/rpl_stmt_seq.inc
+SHOW TABLES LIKE 't23';
+connection slave;
+--disable_query_log
+SELECT '-------- switch to slave --------' as "";
+--enable_query_log
+SHOW TABLES LIKE 't23';
+connection master;
+--disable_query_log
+SELECT '-------- switch to master -------' as "";
+--enable_query_log
+
+let $my_stmt= RENAME TABLE mysqltest1.t3 to mysqltest1.t20;
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+SHOW TABLES LIKE 't20';
+connection slave;
+--disable_query_log
+SELECT '-------- switch to slave --------' as "";
+--enable_query_log
+SHOW TABLES LIKE 't20';
+connection master;
+--disable_query_log
+SELECT '-------- switch to master -------' as "";
+--enable_query_log
+
+let $my_stmt= ALTER TABLE mysqltest1.t4 ADD column f2 BIGINT;
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+describe mysqltest1.t4;
+connection slave;
+--disable_query_log
+SELECT '-------- switch to slave --------' as "";
+--enable_query_log
+describe mysqltest1.t4;
+connection master;
+--disable_query_log
+SELECT '-------- switch to master -------' as "";
+--enable_query_log
+
+let $my_stmt= CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE=;
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq2.inc
+
+# Note: Since this test is executed with a skip-innodb slave, the
+# slave incorrectly commits the insert. One can *not* have InnoDB on
+# master and MyISAM on slave and expect that a transactional rollback
+# after a CREATE TEMPORARY TABLE should work correctly on the slave.
+# For this to work properly the handler on the slave must be able to
+# handle transactions (e.g. InnoDB or NDB).
+let $engine='';
+let $eng_type='';
+
+let $my_stmt= CREATE TEMPORARY TABLE mysqltest1.t22 (f1 BIGINT);
+let $my_master_commit= false;
+let $my_slave_commit= false;
+--source include/rpl_stmt_seq.inc
+
+let $my_stmt= TRUNCATE TABLE mysqltest1.t7;
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+SELECT * FROM mysqltest1.t7;
+--echo -------- switch to slave --------
+sync_slave_with_master;
+SELECT * FROM mysqltest1.t7;
+--echo -------- switch to master -------
+connection master;
+
+###############################################################
+# Cases with LOCK/UNLOCK
+###############################################################
+
+# MySQL insists in locking mysqltest1.t1, because rpl_stmt_seq performs an
+# INSERT into this table.
+let $my_stmt= LOCK TABLES mysqltest1.t1 WRITE, mysqltest1.t8 READ;
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+UNLOCK TABLES;
+
+# No prior locking
+let $my_stmt= UNLOCK TABLES;
+let $my_master_commit= false;
+let $my_slave_commit= false;
+--source include/rpl_stmt_seq.inc
+
+# With prior read locking
+# Note that this test generate an error since the rpl_stmt_seq.inc
+# tries to insert into t1.
+LOCK TABLES mysqltest1.t1 READ;
+let $my_stmt= UNLOCK TABLES;
+let $my_master_commit= false;
+let $my_slave_commit= false;
+--source include/rpl_stmt_seq.inc
+
+# With prior write locking
+LOCK TABLES mysqltest1.t1 WRITE, mysqltest1.t8 READ;
+let $my_stmt= UNLOCK TABLES;
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+
+###############################################################
+# Cases with INDEXES
+###############################################################
+
+let $my_stmt= DROP INDEX my_idx6 ON mysqltest1.t6;
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+SHOW INDEX FROM mysqltest1.t6;
+connection slave;
+--disable_query_log
+SELECT '-------- switch to slave --------' as "";
+--enable_query_log
+SHOW INDEX FROM mysqltest1.t6;
+connection master;
+--disable_query_log
+SELECT '-------- switch to master -------' as "";
+--enable_query_log
+
+let $my_stmt= CREATE INDEX my_idx5 ON mysqltest1.t5(f1);
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+SHOW INDEX FROM mysqltest1.t5;
+connection slave;
+--disable_query_log
+SELECT '-------- switch to slave --------' as "";
+--enable_query_log
+SHOW INDEX FROM mysqltest1.t5;
+connection master;
+--disable_query_log
+SELECT '-------- switch to master -------' as "";
+--enable_query_log
+
+###############################################################
+# Cases with DATABASE
+###############################################################
+
+let $my_stmt= DROP DATABASE mysqltest2;
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+SHOW DATABASES LIKE "mysqltest2";
+connection slave;
+--disable_query_log
+SELECT '-------- switch to slave --------' as "";
+--enable_query_log
+SHOW DATABASES LIKE "mysqltest2";
+connection master;
+--disable_query_log
+SELECT '-------- switch to master -------' as "";
+--enable_query_log
+
+let $my_stmt= CREATE DATABASE mysqltest3;
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+SHOW DATABASES LIKE "mysqltest3";
+connection slave;
+--disable_query_log
+SELECT '-------- switch to slave --------' as "";
+--enable_query_log
+SHOW DATABASES LIKE "mysqltest3";
+connection master;
+--disable_query_log
+SELECT '-------- switch to master -------' as "";
+--enable_query_log
+
+# End of 4.1 tests
+
+###############################################################
+# Cases with stored procedures
+###############################################################
+let $my_stmt= CREATE PROCEDURE p1() READS SQL DATA SELECT "this is p1";
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+--vertical_results
+--replace_column 5 # 6 #
+SHOW PROCEDURE STATUS LIKE 'p1';
+--disable_query_log
+SELECT '-------- switch to slave -------' as "";
+--enable_query_log
+connection slave;
+--replace_column 5 # 6 #
+SHOW PROCEDURE STATUS LIKE 'p1';
+connection master;
+--horizontal_results
+
+let $my_stmt= ALTER PROCEDURE p1 COMMENT "I have been altered";
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+--vertical_results
+--replace_column 5 # 6 #
+SHOW PROCEDURE STATUS LIKE 'p1';
+--disable_query_log
+SELECT '-------- switch to slave -------' as "";
+--enable_query_log
+connection slave;
+--replace_column 5 # 6 #
+SHOW PROCEDURE STATUS LIKE 'p1';
+connection master;
+--horizontal_results
+
+let $my_stmt= DROP PROCEDURE p1;
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+--vertical_results
+SHOW PROCEDURE STATUS LIKE 'p1';
+--disable_query_log
+SELECT '-------- switch to slave -------' as "";
+--enable_query_log
+connection slave;
+SHOW PROCEDURE STATUS LIKE 'p1';
+connection master;
+--horizontal_results
+
+###############################################################
+# Cases with VIEWs
+###############################################################
+let $my_stmt= CREATE OR REPLACE VIEW v1 as select * from t1;
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+SHOW CREATE VIEW v1;
+--disable_query_log
+SELECT '-------- switch to slave -------' as "";
+--enable_query_log
+connection slave;
+SHOW CREATE VIEW v1;
+connection master;
+
+let $my_stmt= ALTER VIEW v1 AS select f1 from t1;
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+SHOW CREATE VIEW v1;
+--disable_query_log
+SELECT '-------- switch to slave -------' as "";
+--enable_query_log
+connection slave;
+SHOW CREATE VIEW v1;
+connection master;
+
+let $my_stmt= DROP VIEW IF EXISTS v1;
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+--error 1146
+SHOW CREATE VIEW v1;
+--disable_query_log
+SELECT '-------- switch to slave -------' as "";
+--enable_query_log
+connection slave;
+--error 1146
+SHOW CREATE VIEW v1;
+connection master;
+
+###############################################################
+# Cases with TRIGGERs
+###############################################################
+let $my_stmt= CREATE TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW SET @a:=1;
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+SHOW TRIGGERS;
+--disable_query_log
+SELECT '-------- switch to slave -------' as "";
+--enable_query_log
+connection slave;
+SHOW TRIGGERS;
+connection master;
+
+let $my_stmt= DROP TRIGGER trg1;
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+SHOW TRIGGERS;
+--disable_query_log
+SELECT '-------- switch to slave -------' as "";
+--enable_query_log
+connection slave;
+SHOW TRIGGERS;
+connection master;
+
+###############################################################
+# Cases with USERs
+###############################################################
+let $my_stmt= CREATE USER user1@localhost;
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+SELECT user FROM mysql.user WHERE user = 'user1';
+--disable_query_log
+SELECT '-------- switch to slave -------' as "";
+--enable_query_log
+connection slave;
+SELECT user FROM mysql.user WHERE user = 'user1';
+connection master;
+
+let $my_stmt= RENAME USER user1@localhost TO rename1@localhost;
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+SELECT user FROM mysql.user WHERE user = 'rename1';
+--disable_query_log
+SELECT '-------- switch to slave -------' as "";
+--enable_query_log
+connection slave;
+SELECT user FROM mysql.user WHERE user = 'rename1';
+connection master;
+
+let $my_stmt= DROP USER rename1@localhost;
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+SELECT user FROM mysql.user WHERE user = 'rename1';
+--disable_query_log
+SELECT '-------- switch to slave -------' as "";
+--enable_query_log
+connection slave;
+SELECT user FROM mysql.user WHERE user = 'rename1';
+connection master;
+
+###############################################################
+# Cleanup
+###############################################################
+--disable_warnings
+DROP DATABASE IF EXISTS mysqltest1;
+DROP DATABASE IF EXISTS mysqltest2;
+DROP DATABASE IF EXISTS mysqltest3;
+--enable_warnings
+
+-- source include/master-slave-end.inc
+
diff --git a/mysql-test/include/strict_autoinc.inc b/mysql-test/include/strict_autoinc.inc
index 6960440f3a7..823efcc2040 100644
--- a/mysql-test/include/strict_autoinc.inc
+++ b/mysql-test/include/strict_autoinc.inc
@@ -2,6 +2,10 @@
# Test for strict-mode autoincrement
#
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
set @org_mode=@@sql_mode;
eval create table t1
(
diff --git a/mysql-test/r/binlog_row_binlog.result b/mysql-test/r/binlog_row_binlog.result
index 7cbfa525798..aee270bd7f6 100644
--- a/mysql-test/r/binlog_row_binlog.result
+++ b/mysql-test/r/binlog_row_binlog.result
@@ -245,6 +245,24 @@ select * from t1;
id
127
drop table t1;
+create table t1 (a int);
+create table if not exists t2 select * from t1;
+create temporary table tt1 (a int);
+create table if not exists t3 like tt1;
+show binlog events from 102;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query 1 # use `test`; create table t1 (id tinyint auto_increment primary key)
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Query 1 # use `test`; drop table t1
+master-bin.000001 # Query 1 # use `test`; create table t1 (a int)
+master-bin.000001 # Query 1 # use `test`; CREATE TABLE IF NOT EXISTS `t2` (
+ `a` int(11) DEFAULT NULL
+)
+master-bin.000001 # Query 1 # use `test`; CREATE TABLE IF NOT EXISTS `t3` (
+ `a` int(11) DEFAULT NULL
+)
+drop table t1,t2,t3,tt1;
create table t1 (a int not null auto_increment, primary key (a)) engine=myisam;
set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1;
insert delayed into t1 values (207);
@@ -256,6 +274,14 @@ master-bin.000001 # Query 1 # use `test`; create table t1 (id tinyint auto_incre
master-bin.000001 # Table_map 1 # table_id: # (test.t1)
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
master-bin.000001 # Query 1 # use `test`; drop table t1
+master-bin.000001 # Query 1 # use `test`; create table t1 (a int)
+master-bin.000001 # Query 1 # use `test`; CREATE TABLE IF NOT EXISTS `t2` (
+ `a` int(11) DEFAULT NULL
+)
+master-bin.000001 # Query 1 # use `test`; CREATE TABLE IF NOT EXISTS `t3` (
+ `a` int(11) DEFAULT NULL
+)
+master-bin.000001 # Query 1 # use `test`; DROP TABLE `t1`,`t2`,`t3` /* generated by server */
master-bin.000001 # Query 1 # use `test`; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam
master-bin.000001 # Table_map 1 # table_id: # (test.t1)
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
diff --git a/mysql-test/r/binlog_stm_binlog.result b/mysql-test/r/binlog_stm_binlog.result
index eed2df28d1f..a9b3f69ecee 100644
--- a/mysql-test/r/binlog_stm_binlog.result
+++ b/mysql-test/r/binlog_stm_binlog.result
@@ -155,6 +155,21 @@ select * from t1;
id
127
drop table t1;
+create table t1 (a int);
+create table if not exists t2 select * from t1;
+create temporary table tt1 (a int);
+create table if not exists t3 like tt1;
+show binlog events from 102;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query 1 # use `test`; create table t1 (id tinyint auto_increment primary key)
+master-bin.000001 # Intvar 1 # INSERT_ID=127
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(null)
+master-bin.000001 # Query 1 # use `test`; drop table t1
+master-bin.000001 # Query 1 # use `test`; create table t1 (a int)
+master-bin.000001 # Query 1 # use `test`; create table if not exists t2 select * from t1
+master-bin.000001 # Query 1 # use `test`; create temporary table tt1 (a int)
+master-bin.000001 # Query 1 # use `test`; create table if not exists t3 like tt1
+drop table t1,t2,t3,tt1;
create table t1 (a int not null auto_increment, primary key (a)) engine=myisam;
set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1;
insert delayed into t1 values (207);
@@ -166,6 +181,11 @@ master-bin.000001 # Query 1 # use `test`; create table t1 (id tinyint auto_incre
master-bin.000001 # Intvar 1 # INSERT_ID=127
master-bin.000001 # Query 1 # use `test`; insert into t1 values(null)
master-bin.000001 # Query 1 # use `test`; drop table t1
+master-bin.000001 # Query 1 # use `test`; create table t1 (a int)
+master-bin.000001 # Query 1 # use `test`; create table if not exists t2 select * from t1
+master-bin.000001 # Query 1 # use `test`; create temporary table tt1 (a int)
+master-bin.000001 # Query 1 # use `test`; create table if not exists t3 like tt1
+master-bin.000001 # Query 1 # use `test`; drop table t1,t2,t3,tt1
master-bin.000001 # Query 1 # use `test`; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam
master-bin.000001 # Table_map 1 # table_id: # (test.t1)
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
diff --git a/mysql-test/r/ctype_recoding.result b/mysql-test/r/ctype_recoding.result
index d0087b03c17..e85d379c932 100644
--- a/mysql-test/r/ctype_recoding.result
+++ b/mysql-test/r/ctype_recoding.result
@@ -171,8 +171,8 @@ create table t1 (a char(10) character set koi8r, b text character set koi8r);
insert into t1 values ('test','test');
insert into t1 values ('ÊÃÕË','ÊÃÕË');
Warnings:
-Warning 1265 Data truncated for column 'a' at row 1
-Warning 1265 Data truncated for column 'b' at row 1
+Warning 1366 Incorrect string value: '\xCA\xC3\xD5\xCB' for column 'a' at row 1
+Warning 1366 Incorrect string value: '\xCA\xC3\xD5\xCB' for column 'b' at row 1
drop table t1;
set names koi8r;
create table t1 (a char(10) character set cp1251);
diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result
index 4f08b97492f..a65b19695ec 100644
--- a/mysql-test/r/ctype_ucs.result
+++ b/mysql-test/r/ctype_ucs.result
@@ -723,6 +723,28 @@ lily
river
drop table t1;
deallocate prepare stmt;
+create table t1 (
+a char(10) unicode not null,
+index a (a)
+) engine=myisam;
+insert into t1 values (repeat(0x201f, 10));
+insert into t1 values (repeat(0x2020, 10));
+insert into t1 values (repeat(0x2021, 10));
+explain select hex(a) from t1 order by a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL a 20 NULL 3 Using index
+select hex(a) from t1 order by a;
+hex(a)
+201F201F201F201F201F201F201F201F201F201F
+2020202020202020202020202020202020202020
+2021202120212021202120212021202120212021
+alter table t1 drop index a;
+select hex(a) from t1 order by a;
+hex(a)
+201F201F201F201F201F201F201F201F201F201F
+2020202020202020202020202020202020202020
+2021202120212021202120212021202120212021
+drop table t1;
CREATE TABLE t1 (id int, s char(5) CHARACTER SET ucs2 COLLATE ucs2_unicode_ci);
INSERT INTO t1 VALUES (1, 'ZZZZZ'), (1, 'ZZZ'), (2, 'ZZZ'), (2, 'ZZZZZ');
SELECT id, MIN(s) FROM t1 GROUP BY id;
diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result
index 4ae19fc8f7c..4aa22944b9b 100644
--- a/mysql-test/r/ctype_utf8.result
+++ b/mysql-test/r/ctype_utf8.result
@@ -197,7 +197,7 @@ drop table t1;
create table t1 (s1 char(10) character set utf8);
insert into t1 values (0x41FF);
Warnings:
-Warning 1265 Data truncated for column 's1' at row 1
+Warning 1366 Incorrect string value: '\xFF' for column 's1' at row 1
select hex(s1) from t1;
hex(s1)
41
@@ -205,7 +205,7 @@ drop table t1;
create table t1 (s1 varchar(10) character set utf8);
insert into t1 values (0x41FF);
Warnings:
-Warning 1265 Data truncated for column 's1' at row 1
+Warning 1366 Incorrect string value: '\xFF' for column 's1' at row 1
select hex(s1) from t1;
hex(s1)
41
@@ -213,7 +213,7 @@ drop table t1;
create table t1 (s1 text character set utf8);
insert into t1 values (0x41FF);
Warnings:
-Warning 1265 Data truncated for column 's1' at row 1
+Warning 1366 Incorrect string value: '\xFF' for column 's1' at row 1
select hex(s1) from t1;
hex(s1)
41
@@ -1536,6 +1536,32 @@ set @a:=null;
execute my_stmt using @a;
a b
drop table if exists t1;
+drop table if exists t1;
+drop view if exists v1, v2;
+set names utf8;
+create table t1(col1 varchar(12) character set utf8 collate utf8_unicode_ci);
+insert into t1 values('t1_val');
+create view v1 as select 'v1_val' as col1;
+select coercibility(col1), collation(col1) from v1;
+coercibility(col1) collation(col1)
+4 utf8_general_ci
+create view v2 as select col1 from v1 union select col1 from t1;
+select coercibility(col1), collation(col1)from v2;
+coercibility(col1) collation(col1)
+2 utf8_unicode_ci
+2 utf8_unicode_ci
+drop view v1, v2;
+create view v1 as select 'v1_val' collate utf8_swedish_ci as col1;
+select coercibility(col1), collation(col1) from v1;
+coercibility(col1) collation(col1)
+0 utf8_swedish_ci
+create view v2 as select col1 from v1 union select col1 from t1;
+select coercibility(col1), collation(col1) from v2;
+coercibility(col1) collation(col1)
+0 utf8_swedish_ci
+0 utf8_swedish_ci
+drop view v1, v2;
+drop table t1;
CREATE TABLE t1 (
colA int(11) NOT NULL,
colB varchar(255) character set utf8 NOT NULL,
diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result
index 457155b4299..829cf25a896 100644
--- a/mysql-test/r/fulltext.result
+++ b/mysql-test/r/fulltext.result
@@ -381,10 +381,10 @@ t collation(t) FORMAT(MATCH t AGAINST ('Osnabruck'),6)
aus Osnabrück utf8_general_ci 1.591140
alter table t1 modify t varchar(200) collate latin1_german2_ci not null;
Warnings:
-Warning 1265 Data truncated for column 't' at row 3
-Warning 1265 Data truncated for column 't' at row 4
-Warning 1265 Data truncated for column 't' at row 5
-Warning 1265 Data truncated for column 't' at row 6
+Warning 1366 Incorrect string value: '\xD0\xAD\xD1\x82\xD0\xBE...' for column 't' at row 3
+Warning 1366 Incorrect string value: '\xD0\x9E\xD1\x82\xD0\xBB...' for column 't' at row 4
+Warning 1366 Incorrect string value: '\xD0\x9D\xD0\xB5 \xD0...' for column 't' at row 5
+Warning 1366 Incorrect string value: '\xD0\xB8 \xD0\xB1\xD1...' for column 't' at row 6
SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrück');
t collation(t)
aus Osnabrück latin1_german2_ci
diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result
index 619c8dafeae..57b0a2aec25 100644
--- a/mysql-test/r/func_gconcat.result
+++ b/mysql-test/r/func_gconcat.result
@@ -664,3 +664,73 @@ GROUP_CONCAT(a) x
2 1,2
1 2,3
DROP TABLE t1;
+set names utf8;
+create table t1
+(
+x text character set utf8 not null,
+y integer not null
+);
+insert into t1 values (repeat('a', 1022), 0), (repeat(_utf8 0xc3b7, 4), 0);
+set group_concat_max_len= 1022 + 10;
+select @x:=group_concat(x) from t1 group by y;
+select @@group_concat_max_len, length(@x), char_length(@x), right(@x,12), right(HEX(@x),12);
+@@group_concat_max_len length(@x) char_length(@x) right(@x,12) right(HEX(@x),12)
+1032 1031 1027 aaaaaaa,÷÷÷÷ C3B7C3B7C3B7
+set group_concat_max_len= 1022 + 9;
+select @x:=group_concat(x) from t1 group by y;
+select @@group_concat_max_len, length(@x), char_length(@x), right(@x,12), right(HEX(@x),12);
+@@group_concat_max_len length(@x) char_length(@x) right(@x,12) right(HEX(@x),12)
+1031 1031 1027 aaaaaaa,÷÷÷÷ C3B7C3B7C3B7
+set group_concat_max_len= 1022 + 8;
+select @x:=group_concat(x) from t1 group by y;
+select @@group_concat_max_len, length(@x), char_length(@x), right(@x,12), right(HEX(@x),12);
+@@group_concat_max_len length(@x) char_length(@x) right(@x,12) right(HEX(@x),12)
+1030 1029 1026 aaaaaaaa,÷÷÷ C3B7C3B7C3B7
+set group_concat_max_len= 1022 + 7;
+select @x:=group_concat(x) from t1 group by y;
+select @@group_concat_max_len, length(@x), char_length(@x), right(@x,12), right(HEX(@x),12);
+@@group_concat_max_len length(@x) char_length(@x) right(@x,12) right(HEX(@x),12)
+1029 1029 1026 aaaaaaaa,÷÷÷ C3B7C3B7C3B7
+set group_concat_max_len= 1022 + 6;
+select @x:=group_concat(x) from t1 group by y;
+select @@group_concat_max_len, length(@x), char_length(@x), right(@x,12), right(HEX(@x),12);
+@@group_concat_max_len length(@x) char_length(@x) right(@x,12) right(HEX(@x),12)
+1028 1027 1025 aaaaaaaaa,÷÷ 612CC3B7C3B7
+set group_concat_max_len= 1022 + 5;
+select @x:=group_concat(x) from t1 group by y;
+select @@group_concat_max_len, length(@x), char_length(@x), right(@x,12), right(HEX(@x),12);
+@@group_concat_max_len length(@x) char_length(@x) right(@x,12) right(HEX(@x),12)
+1027 1027 1025 aaaaaaaaa,÷÷ 612CC3B7C3B7
+set group_concat_max_len= 1022 + 4;
+select @x:=group_concat(x) from t1 group by y;
+select @@group_concat_max_len, length(@x), char_length(@x), right(@x,12), right(HEX(@x),12);
+@@group_concat_max_len length(@x) char_length(@x) right(@x,12) right(HEX(@x),12)
+1026 1025 1024 aaaaaaaaaa,÷ 6161612CC3B7
+set group_concat_max_len= 1022 + 3;
+select @x:=group_concat(x) from t1 group by y;
+select @@group_concat_max_len, length(@x), char_length(@x), right(@x,12), right(HEX(@x),12);
+@@group_concat_max_len length(@x) char_length(@x) right(@x,12) right(HEX(@x),12)
+1025 1025 1024 aaaaaaaaaa,÷ 6161612CC3B7
+set group_concat_max_len= 1022 + 2;
+select @x:=group_concat(x) from t1 group by y;
+select @@group_concat_max_len, length(@x), char_length(@x), right(@x,12), right(HEX(@x),12);
+@@group_concat_max_len length(@x) char_length(@x) right(@x,12) right(HEX(@x),12)
+1024 1023 1023 aaaaaaaaaaa, 61616161612C
+set group_concat_max_len= 1022 + 1;
+select @x:=group_concat(x) from t1 group by y;
+select @@group_concat_max_len, length(@x), char_length(@x), right(@x,12), right(HEX(@x),12);
+@@group_concat_max_len length(@x) char_length(@x) right(@x,12) right(HEX(@x),12)
+1023 1023 1023 aaaaaaaaaaa, 61616161612C
+drop table t1;
+set group_concat_max_len=1024;
+set names latin1;
+create table t1 (f1 int unsigned, f2 varchar(255));
+insert into t1 values (1,repeat('a',255)),(2,repeat('b',255));
+select f2,group_concat(f1) from t1 group by f2;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def test t1 t1 f2 f2 253 255 255 Y 0 0 8
+def group_concat(f1) 252 1024 1 Y 128 0 63
+f2 group_concat(f1)
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 1
+bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 2
+drop table t1;
diff --git a/mysql-test/r/lowercase_table.result b/mysql-test/r/lowercase_table.result
index 7705961d08d..464f423fa92 100644
--- a/mysql-test/r/lowercase_table.result
+++ b/mysql-test/r/lowercase_table.result
@@ -84,3 +84,27 @@ create table t2 like T1;
drop table t1, t2;
show tables;
Tables_in_test
+set names utf8;
+drop table if exists Ä°,Ä°Ä°;
+create table Ä° (s1 int);
+show create table Ä°;
+Table Create Table
+Ä° CREATE TABLE `i` (
+ `s1` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+show tables;
+Tables_in_test
+i
+drop table Ä°;
+create table Ä°Ä° (s1 int);
+show create table Ä°Ä°;
+Table Create Table
+Ä°Ä° CREATE TABLE `ii` (
+ `s1` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+show tables;
+Tables_in_test
+ii
+drop table Ä°Ä°;
+set names latin1;
+End of 5.0 tests
diff --git a/mysql-test/r/rpl_deadlock_innodb.result b/mysql-test/r/rpl_deadlock_innodb.result
index b9a23950ed8..9a67391cd4d 100644
--- a/mysql-test/r/rpl_deadlock_innodb.result
+++ b/mysql-test/r/rpl_deadlock_innodb.result
@@ -6,7 +6,7 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
CREATE TABLE t1 (a INT NOT NULL, KEY(a)) ENGINE=innodb;
CREATE TABLE t2 (a INT NOT NULL, KEY(a)) ENGINE=innodb;
-CREATE TABLE t3 (a INT) ENGINE=innodb;
+CREATE TABLE t3 (a INT UNIQUE) ENGINE=innodb;
CREATE TABLE t4 (a INT) ENGINE=innodb;
show variables like 'slave_transaction_retries';
Variable_name Value
@@ -28,21 +28,22 @@ Variable_name Value
slave_transaction_retries 2
stop slave;
begin;
-insert into t3 select * from t2 for update;
+insert into t2 values (0);
insert into t1 values(1);
commit;
begin;
select * from t1 for update;
a
start slave;
-insert into t2 values(22);
+select * from t2 for update /* dl */;
+a
commit;
select * from t1;
a
1
-select * from t2;
+select * from t2 /* must be 1 */;
a
-22
+0
show slave status;
Slave_IO_State #
Master_Host 127.0.0.1
@@ -78,12 +79,16 @@ Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
stop slave;
-change master to master_log_pos=536;
+delete from t3;
+change master to master_log_pos=544;
begin;
select * from t2 for update;
a
-22
+0
start slave;
+select count(*) from t3 /* must be zero */;
+count(*)
+0
commit;
select * from t1;
a
@@ -91,7 +96,8 @@ a
1
select * from t2;
a
-22
+0
+0
show slave status;
Slave_IO_State #
Master_Host 127.0.0.1
@@ -128,12 +134,17 @@ Master_SSL_Key
Seconds_Behind_Master #
set global max_relay_log_size=0;
stop slave;
-change master to master_log_pos=536;
+delete from t3;
+change master to master_log_pos=544;
begin;
select * from t2 for update;
a
-22
+0
+0
start slave;
+select count(*) from t3 /* must be zero */;
+count(*)
+0
commit;
select * from t1;
a
@@ -142,7 +153,9 @@ a
1
select * from t2;
a
-22
+0
+0
+0
show slave status;
Slave_IO_State #
Master_Host 127.0.0.1
@@ -178,3 +191,4 @@ Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
drop table t1,t2,t3,t4;
+End of 5.1 tests
diff --git a/mysql-test/r/rpl_do_grant.result b/mysql-test/r/rpl_do_grant.result
index 8bf8e615448..50d181be0ca 100644
--- a/mysql-test/r/rpl_do_grant.result
+++ b/mysql-test/r/rpl_do_grant.result
@@ -23,6 +23,8 @@ password<>_binary''
delete from mysql.user where user=_binary'rpl_do_grant';
delete from mysql.db where user=_binary'rpl_do_grant';
flush privileges;
+delete from mysql.user where user=_binary'rpl_do_grant';
+delete from mysql.db where user=_binary'rpl_do_grant';
flush privileges;
show grants for rpl_do_grant@localhost;
ERROR 42000: There is no such grant defined for user 'rpl_do_grant' on host 'localhost'
diff --git a/mysql-test/r/rpl_extraCol_innodb.result b/mysql-test/r/rpl_extraCol_innodb.result
new file mode 100644
index 00000000000..7f681aef4be
--- /dev/null
+++ b/mysql-test/r/rpl_extraCol_innodb.result
@@ -0,0 +1,741 @@
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+**** Diff Table Def Start ****
+*** On Slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t1 (a INT, b INT PRIMARY KEY, c CHAR(20),
+d FLOAT DEFAULT '2.00',
+e CHAR(4) DEFAULT 'TEST')
+ENGINE='InnoDB';
+*** Create t1 on Master ***
+CREATE TABLE t1 (a INT PRIMARY KEY, b INT, c CHAR(10)
+) ENGINE='InnoDB';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+INSERT INTO t1 () VALUES(1,2,'TEXAS'),(2,1,'AUSTIN'),(3,4,'QA');
+SELECT * FROM t1 ORDER BY a;
+a b c
+1 2 TEXAS
+2 1 AUSTIN
+3 4 QA
+*** Select from slave ***
+SELECT * FROM t1 ORDER BY a;
+a b c d e
+1 2 TEXAS 2 TEST
+2 1 AUSTIN 2 TEST
+3 4 QA 2 TEST
+*** Drop t1 ***
+DROP TABLE t1;
+*** Create t3 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t3 (a INT, b INT PRIMARY KEY, c CHAR(20),
+d FLOAT DEFAULT '2.00',
+e CHAR(5) DEFAULT 'TEST2')
+ENGINE='InnoDB';
+*** Create t3 on Master ***
+CREATE TABLE t3 (a BLOB, b INT PRIMARY KEY, c CHAR(20)
+) ENGINE='InnoDB';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+set @b1 = 'b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t3 () VALUES(@b1,2,'Kyle, TEX'),(@b1,1,'JOE AUSTIN'),(@b1,4,'QA TESTING');
+********************************************
+*** Expect slave to fail with Error 1522 ***
+********************************************
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port MASTER_PORT
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+Slave_SQL_Running No
+Replicate_Do_DB
+Replicate_Ignore_DB
+Replicate_Do_Table
+Replicate_Ignore_Table
+Replicate_Wild_Do_Table
+Replicate_Wild_Ignore_Table
+Last_Errno 1522
+Last_Error Column 0 type mismatch - received type 252, test.t3 has type 3
+Skip_Counter 0
+Exec_Master_Log_Pos #
+Relay_Log_Space #
+Until_Condition None
+Until_Log_File
+Until_Log_Pos 0
+Master_SSL_Allowed No
+Master_SSL_CA_File
+Master_SSL_CA_Path
+Master_SSL_Cert
+Master_SSL_Cipher
+Master_SSL_Key
+Seconds_Behind_Master #
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+*** Drop t3 ***
+DROP TABLE t3;
+*** Create t4 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t4 (a INT, b INT PRIMARY KEY, c CHAR(20),
+d FLOAT DEFAULT '2.00',
+e CHAR(5) DEFAULT 'TEST2')
+ENGINE='InnoDB';
+*** Create t4 on Master ***
+CREATE TABLE t4 (a DECIMAL(8,2), b INT PRIMARY KEY, c CHAR(20)
+) ENGINE='InnoDB';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+INSERT INTO t4 () VALUES(100.22,2,'Kyle, TEX'),(200.26,1,'JOE AUSTIN'),
+(30000.22,4,'QA TESTING');
+********************************************
+*** Expect slave to fail with Error 1522 ***
+********************************************
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port MASTER_PORT
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+Slave_SQL_Running No
+Replicate_Do_DB
+Replicate_Ignore_DB
+Replicate_Do_Table
+Replicate_Ignore_Table
+Replicate_Wild_Do_Table
+Replicate_Wild_Ignore_Table
+Last_Errno 1522
+Last_Error Column 0 type mismatch - received type 246, test.t4 has type 3
+Skip_Counter 0
+Exec_Master_Log_Pos #
+Relay_Log_Space #
+Until_Condition None
+Until_Log_File
+Until_Log_Pos 0
+Master_SSL_Allowed No
+Master_SSL_CA_File
+Master_SSL_CA_Path
+Master_SSL_Cert
+Master_SSL_Cipher
+Master_SSL_Key
+Seconds_Behind_Master #
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+*** Drop t4 ***
+DROP TABLE t4;
+*** Create t5 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t5 (a INT PRIMARY KEY, b CHAR(5),
+c FLOAT, d INT, e DOUBLE,
+f DECIMAL(8,2))ENGINE='InnoDB';
+*** Create t5 on Master ***
+CREATE TABLE t5 (a INT PRIMARY KEY, b VARCHAR(6),
+c DECIMAL(8,2), d BIT, e BLOB,
+f FLOAT) ENGINE='InnoDB';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+INSERT INTO t5 () VALUES(1,'Kyle',200.23,1,'b1b1',23.00098),
+(2,'JOE',300.01,0,'b2b2',1.0000009);
+********************************************
+*** Expect slave to fail with Error 1522 ***
+********************************************
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port MASTER_PORT
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+Slave_SQL_Running No
+Replicate_Do_DB
+Replicate_Ignore_DB
+Replicate_Do_Table
+Replicate_Ignore_Table
+Replicate_Wild_Do_Table
+Replicate_Wild_Ignore_Table
+Last_Errno 1522
+Last_Error Column 5 type mismatch - received type 4, test.t5 has type 246
+Skip_Counter 0
+Exec_Master_Log_Pos #
+Relay_Log_Space #
+Until_Condition None
+Until_Log_File
+Until_Log_Pos 0
+Master_SSL_Allowed No
+Master_SSL_CA_File
+Master_SSL_CA_Path
+Master_SSL_Cert
+Master_SSL_Cipher
+Master_SSL_Key
+Seconds_Behind_Master #
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+*** Drop t5 ***
+DROP TABLE t5;
+*** Create t6 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t6 (a INT PRIMARY KEY, b CHAR(5),
+c FLOAT, d INT)ENGINE='InnoDB';
+*** Create t6 on Master ***
+CREATE TABLE t6 (a INT PRIMARY KEY, b VARCHAR(6),
+c DECIMAL(8,2), d BIT
+) ENGINE='InnoDB';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+INSERT INTO t6 () VALUES(1,'Kyle',200.23,1),
+(2,'JOE',300.01,0);
+********************************************
+*** Expect slave to fail with Error 1522 ***
+********************************************
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port MASTER_PORT
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+Slave_SQL_Running No
+Replicate_Do_DB
+Replicate_Ignore_DB
+Replicate_Do_Table
+Replicate_Ignore_Table
+Replicate_Wild_Do_Table
+Replicate_Wild_Ignore_Table
+Last_Errno 1522
+Last_Error Column 3 type mismatch - received type 16, test.t6 has type 3
+Skip_Counter 0
+Exec_Master_Log_Pos #
+Relay_Log_Space #
+Until_Condition None
+Until_Log_File
+Until_Log_Pos 0
+Master_SSL_Allowed No
+Master_SSL_CA_File
+Master_SSL_CA_Path
+Master_SSL_Cert
+Master_SSL_Cipher
+Master_SSL_Key
+Seconds_Behind_Master #
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3;
+*** Drop t6 ***
+DROP TABLE t6;
+DROP TABLE t6;
+START SLAVE;
+**** Diff Table Def End ****
+**** Extra Colums Start ****
+*** Create t7 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t7 (a INT KEY, b BLOB, c CHAR(5),
+d TIMESTAMP NULL DEFAULT '0000-00-00 00:00:00',
+e CHAR(20) DEFAULT 'Extra Column Testing')
+ENGINE='InnoDB';
+*** Create t7 on Master ***
+CREATE TABLE t7 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
+) ENGINE='InnoDB';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+set @b1 = 'b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t7 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+SELECT * FROM t7 ORDER BY a;
+a b c
+1 b1b1 Kyle
+2 b1b1 JOE
+3 b1b1 QA
+*** Select from slave ***
+SELECT * FROM t7 ORDER BY a;
+a b c d e
+1 b1b1 Kyle 0000-00-00 00:00:00 Extra Column Testing
+2 b1b1 JOE 0000-00-00 00:00:00 Extra Column Testing
+3 b1b1 QA 0000-00-00 00:00:00 Extra Column Testing
+*** Drop t7 ***
+DROP TABLE t7;
+*** Create t8 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t8 (a INT KEY, b BLOB, c CHAR(5),
+d TIMESTAMP NULL DEFAULT '0000-00-00 00:00:00',
+e INT)ENGINE='InnoDB';
+*** Create t8 on Master ***
+CREATE TABLE t8 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
+) ENGINE='InnoDB';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t8 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+*** Drop t8 ***
+DROP TABLE t8;
+*** Create t10 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233',
+c CHAR(5), e INT DEFAULT '1')ENGINE='InnoDB';
+*** Create t10 on Master ***
+CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
+) ENGINE='InnoDB';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t10 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+********************************************
+*** Expect slave to fail with Error 1522 ***
+********************************************
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port MASTER_PORT
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+Slave_SQL_Running No
+Replicate_Do_DB
+Replicate_Ignore_DB
+Replicate_Do_Table
+Replicate_Ignore_Table
+Replicate_Wild_Do_Table
+Replicate_Wild_Ignore_Table
+Last_Errno 1522
+Last_Error Column 2 type mismatch - received type 254, test.t10 has type 5
+Skip_Counter 0
+Exec_Master_Log_Pos #
+Relay_Log_Space #
+Until_Condition None
+Until_Log_File
+Until_Log_Pos 0
+Master_SSL_Allowed No
+Master_SSL_CA_File
+Master_SSL_CA_Path
+Master_SSL_Cert
+Master_SSL_Cipher
+Master_SSL_Key
+Seconds_Behind_Master #
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+*** Drop t10 ***
+DROP TABLE t10;
+*** Create t11 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT,
+c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='InnoDB';
+*** Create t11 on Master ***
+CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254)
+) ENGINE='InnoDB';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t11 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+********************************************
+*** Expect slave to fail with Error 1522 ***
+********************************************
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port MASTER_PORT
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+Slave_SQL_Running No
+Replicate_Do_DB
+Replicate_Ignore_DB
+Replicate_Do_Table
+Replicate_Ignore_Table
+Replicate_Wild_Do_Table
+Replicate_Wild_Ignore_Table
+Last_Errno 1522
+Last_Error Column 2 type mismatch - received type 15, test.t11 has type 252
+Skip_Counter 0
+Exec_Master_Log_Pos #
+Relay_Log_Space #
+Until_Condition None
+Until_Log_File
+Until_Log_Pos 0
+Master_SSL_Allowed No
+Master_SSL_CA_File
+Master_SSL_CA_Path
+Master_SSL_Cert
+Master_SSL_Cipher
+Master_SSL_Key
+Seconds_Behind_Master #
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+*** Drop t11 ***
+DROP TABLE t11;
+*** Create t12 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT,
+c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='InnoDB';
+*** Create t12 on Master ***
+CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB
+) ENGINE='InnoDB';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t12 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+SELECT * FROM t12 ORDER BY a;
+a b c
+1 b1b1b1b1b1b1b1b1 Kyle
+2 b1b1b1b1b1b1b1b1 JOE
+3 b1b1b1b1b1b1b1b1 QA
+*** Select on Slave ***
+SELECT * FROM t12 ORDER BY a;
+a b f c e
+1 b1b1b1b1b1b1b1b1 Kyle test 1
+2 b1b1b1b1b1b1b1b1 JOE test 1
+3 b1b1b1b1b1b1b1b1 QA test 1
+*** Drop t12 ***
+DROP TABLE t12;
+**** Extra Colums End ****
+*** BUG 22177 Start ***
+*** Create t13 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t13 (a INT KEY, b BLOB, c CHAR(5),
+d INT DEFAULT '1',
+e TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+)ENGINE='InnoDB';
+*** Create t13 on Master ***
+CREATE TABLE t13 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
+) ENGINE='InnoDB';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t13 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+SELECT * FROM t13 ORDER BY a;
+a b c
+1 b1b1b1b1b1b1b1b1 Kyle
+2 b1b1b1b1b1b1b1b1 JOE
+3 b1b1b1b1b1b1b1b1 QA
+*** Select on Slave ****
+SELECT * FROM t13 ORDER BY a;
+a b c d e
+1 b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
+2 b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
+3 b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
+*** Drop t13 ***
+DROP TABLE t13;
+*** 22117 END ***
+*** Alter Master Table Testing Start ***
+*** Create t14 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
+c6 INT DEFAULT '1',
+c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+)ENGINE='InnoDB';
+*** Create t14 on Master ***
+CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
+) ENGINE='InnoDB';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+ALTER TABLE t14 ADD COLUMN c2 DECIMAL(8,2) AFTER c1;
+ALTER TABLE t14 ADD COLUMN c3 TEXT AFTER c2;
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t14 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle'),
+(2,2.00,'This Test Should work',@b1,'JOE'),
+(3,3.00,'If is does not, I will open a bug',@b1,'QA');
+SELECT * FROM t14 ORDER BY c1;
+c1 c2 c3 c4 c5
+1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle
+2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE
+3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA
+*** Select on Slave ****
+SELECT * FROM t14 ORDER BY c1;
+c1 c2 c3 c4 c5 c6 c7
+1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
+2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
+3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
+*** connect to master and drop columns ***
+ALTER TABLE t14 DROP COLUMN c2;
+ALTER TABLE t14 DROP COLUMN c4;
+*** Select from Master ***
+SELECT * FROM t14 ORDER BY c1;
+c1 c3 c5
+1 Replication Testing Extra Col Kyle
+2 This Test Should work JOE
+3 If is does not, I will open a bug QA
+*** Select from Slave ***
+SELECT * FROM t14 ORDER BY c1;
+c1 c3 c5 c6 c7
+1 Replication Testing Extra Col Kyle 1 CURRENT_TIMESTAMP
+2 This Test Should work JOE 1 CURRENT_TIMESTAMP
+3 If is does not, I will open a bug QA 1 CURRENT_TIMESTAMP
+*** Drop t14 ***
+DROP TABLE t14;
+*** Create t15 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t15 (c1 INT KEY, c2 DECIMAL(8,2), c3 TEXT,
+c4 BLOB, c5 CHAR(5),
+c6 INT DEFAULT '1',
+c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+)ENGINE='InnoDB';
+*** Create t15 on Master ***
+CREATE TABLE t15 (c1 INT PRIMARY KEY, c2 DECIMAL(8,2), c3 TEXT,
+c4 BLOB, c5 CHAR(5)) ENGINE='InnoDB';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t15 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle'),
+(2,2.00,'This Test Should work',@b1,'JOE'),
+(3,3.00,'If is does not, I will open a bug',@b1,'QA');
+SELECT * FROM t15 ORDER BY c1;
+c1 c2 c3 c4 c5
+1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle
+2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE
+3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA
+*** Select on Slave ****
+SELECT * FROM t15 ORDER BY c1;
+c1 c2 c3 c4 c5 c6 c7
+1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
+2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
+3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
+*** Add column on master that is a Extra on Slave ***
+ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5;
+********************************************
+*** Expect slave to fail with Error 1060 ***
+********************************************
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port MASTER_PORT
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+Slave_SQL_Running No
+Replicate_Do_DB
+Replicate_Ignore_DB
+Replicate_Do_Table
+Replicate_Ignore_Table
+Replicate_Wild_Do_Table
+Replicate_Wild_Ignore_Table
+Last_Errno 1060
+Last_Error Error 'Duplicate column name 'c6'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5'
+Skip_Counter 0
+Exec_Master_Log_Pos #
+Relay_Log_Space #
+Until_Condition None
+Until_Log_File
+Until_Log_Pos 0
+Master_SSL_Allowed No
+Master_SSL_CA_File
+Master_SSL_CA_Path
+Master_SSL_Cert
+Master_SSL_Cipher
+Master_SSL_Key
+Seconds_Behind_Master #
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+*** Try to insert in master ****
+INSERT INTO t15 () VALUES(5,2.00,'Replication Testing',@b1,'Buda',2);
+SELECT * FROM t15 ORDER BY c1;
+c1 c2 c3 c4 c5 c6
+1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle NULL
+2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE NULL
+3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA NULL
+5 2.00 Replication Testing b1b1b1b1b1b1b1b1 Buda 2
+*** Try to select from slave ****
+SELECT * FROM t15 ORDER BY c1;
+c1 c2 c3 c4 c5 c6 c7
+1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
+2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
+3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
+*** DROP TABLE t15 ***
+DROP TABLE t15;
+*** Create t16 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t16 (c1 INT KEY, c2 DECIMAL(8,2), c3 TEXT,
+c4 BLOB, c5 CHAR(5),
+c6 INT DEFAULT '1',
+c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+)ENGINE='InnoDB';
+*** Create t16 on Master ***
+CREATE TABLE t16 (c1 INT PRIMARY KEY, c2 DECIMAL(8,2), c3 TEXT,
+c4 BLOB, c5 CHAR(5))ENGINE='InnoDB';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t16 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle'),
+(2,2.00,'This Test Should work',@b1,'JOE'),
+(3,3.00,'If is does not, I will open a bug',@b1,'QA');
+SELECT * FROM t16 ORDER BY c1;
+c1 c2 c3 c4 c5
+1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle
+2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE
+3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA
+*** Select on Slave ****
+SELECT * FROM t16 ORDER BY c1;
+c1 c2 c3 c4 c5 c6 c7
+1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
+2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
+3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
+*** Add Partition on master ***
+ALTER TABLE t16 PARTITION BY KEY(c1) PARTITIONS 4;
+INSERT INTO t16 () VALUES(4,1.00,'Replication Rocks',@b1,'Omer');
+SHOW CREATE TABLE t16;
+Table Create Table
+t16 CREATE TABLE `t16` (
+ `c1` int(11) NOT NULL,
+ `c2` decimal(8,2) DEFAULT NULL,
+ `c3` text,
+ `c4` blob,
+ `c5` char(5) DEFAULT NULL,
+ PRIMARY KEY (`c1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (c1) PARTITIONS 4 */
+*** Show table on Slave ****
+SHOW CREATE TABLE t16;
+Table Create Table
+t16 CREATE TABLE `t16` (
+ `c1` int(11) NOT NULL,
+ `c2` decimal(8,2) DEFAULT NULL,
+ `c3` text,
+ `c4` blob,
+ `c5` char(5) DEFAULT NULL,
+ `c6` int(11) DEFAULT '1',
+ `c7` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
+ PRIMARY KEY (`c1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (c1) PARTITIONS 4 */
+*** DROP TABLE t16 ***
+DROP TABLE t16;
+*** Alter Master End ***
+*** Create t17 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t17 (a SMALLINT, b INT PRIMARY KEY, c CHAR(5),
+d FLOAT DEFAULT '2.00',
+e CHAR(5) DEFAULT 'TEST2')
+ENGINE='InnoDB';
+*** Create t17 on Master ***
+CREATE TABLE t17 (a BIGINT PRIMARY KEY, b INT, c CHAR(10)
+) ENGINE='InnoDB';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+INSERT INTO t17 () VALUES(9223372036854775807,2,'Kyle, TEX');
+********************************************
+*** Expect slave to fail with Error 1522 ***
+********************************************
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port MASTER_PORT
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+Slave_SQL_Running No
+Replicate_Do_DB
+Replicate_Ignore_DB
+Replicate_Do_Table
+Replicate_Ignore_Table
+Replicate_Wild_Do_Table
+Replicate_Wild_Ignore_Table
+Last_Errno 1522
+Last_Error Column 0 type mismatch - received type 8, test.t17 has type 2
+Skip_Counter 0
+Exec_Master_Log_Pos #
+Relay_Log_Space #
+Until_Condition None
+Until_Log_File
+Until_Log_Pos 0
+Master_SSL_Allowed No
+Master_SSL_CA_File
+Master_SSL_CA_Path
+Master_SSL_Cert
+Master_SSL_Cipher
+Master_SSL_Key
+Seconds_Behind_Master #
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+** DROP table t17 ***
+DROP TABLE t17;
diff --git a/mysql-test/r/rpl_extraCol_myisam.result b/mysql-test/r/rpl_extraCol_myisam.result
new file mode 100644
index 00000000000..3c0d1fae4a8
--- /dev/null
+++ b/mysql-test/r/rpl_extraCol_myisam.result
@@ -0,0 +1,741 @@
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+**** Diff Table Def Start ****
+*** On Slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t1 (a INT, b INT PRIMARY KEY, c CHAR(20),
+d FLOAT DEFAULT '2.00',
+e CHAR(4) DEFAULT 'TEST')
+ENGINE='MyISAM';
+*** Create t1 on Master ***
+CREATE TABLE t1 (a INT PRIMARY KEY, b INT, c CHAR(10)
+) ENGINE='MyISAM';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+INSERT INTO t1 () VALUES(1,2,'TEXAS'),(2,1,'AUSTIN'),(3,4,'QA');
+SELECT * FROM t1 ORDER BY a;
+a b c
+1 2 TEXAS
+2 1 AUSTIN
+3 4 QA
+*** Select from slave ***
+SELECT * FROM t1 ORDER BY a;
+a b c d e
+1 2 TEXAS 2 TEST
+2 1 AUSTIN 2 TEST
+3 4 QA 2 TEST
+*** Drop t1 ***
+DROP TABLE t1;
+*** Create t3 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t3 (a INT, b INT PRIMARY KEY, c CHAR(20),
+d FLOAT DEFAULT '2.00',
+e CHAR(5) DEFAULT 'TEST2')
+ENGINE='MyISAM';
+*** Create t3 on Master ***
+CREATE TABLE t3 (a BLOB, b INT PRIMARY KEY, c CHAR(20)
+) ENGINE='MyISAM';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+set @b1 = 'b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t3 () VALUES(@b1,2,'Kyle, TEX'),(@b1,1,'JOE AUSTIN'),(@b1,4,'QA TESTING');
+********************************************
+*** Expect slave to fail with Error 1522 ***
+********************************************
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port MASTER_PORT
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+Slave_SQL_Running No
+Replicate_Do_DB
+Replicate_Ignore_DB
+Replicate_Do_Table
+Replicate_Ignore_Table
+Replicate_Wild_Do_Table
+Replicate_Wild_Ignore_Table
+Last_Errno 1522
+Last_Error Column 0 type mismatch - received type 252, test.t3 has type 3
+Skip_Counter 0
+Exec_Master_Log_Pos #
+Relay_Log_Space #
+Until_Condition None
+Until_Log_File
+Until_Log_Pos 0
+Master_SSL_Allowed No
+Master_SSL_CA_File
+Master_SSL_CA_Path
+Master_SSL_Cert
+Master_SSL_Cipher
+Master_SSL_Key
+Seconds_Behind_Master #
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+*** Drop t3 ***
+DROP TABLE t3;
+*** Create t4 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t4 (a INT, b INT PRIMARY KEY, c CHAR(20),
+d FLOAT DEFAULT '2.00',
+e CHAR(5) DEFAULT 'TEST2')
+ENGINE='MyISAM';
+*** Create t4 on Master ***
+CREATE TABLE t4 (a DECIMAL(8,2), b INT PRIMARY KEY, c CHAR(20)
+) ENGINE='MyISAM';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+INSERT INTO t4 () VALUES(100.22,2,'Kyle, TEX'),(200.26,1,'JOE AUSTIN'),
+(30000.22,4,'QA TESTING');
+********************************************
+*** Expect slave to fail with Error 1522 ***
+********************************************
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port MASTER_PORT
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+Slave_SQL_Running No
+Replicate_Do_DB
+Replicate_Ignore_DB
+Replicate_Do_Table
+Replicate_Ignore_Table
+Replicate_Wild_Do_Table
+Replicate_Wild_Ignore_Table
+Last_Errno 1522
+Last_Error Column 0 type mismatch - received type 246, test.t4 has type 3
+Skip_Counter 0
+Exec_Master_Log_Pos #
+Relay_Log_Space #
+Until_Condition None
+Until_Log_File
+Until_Log_Pos 0
+Master_SSL_Allowed No
+Master_SSL_CA_File
+Master_SSL_CA_Path
+Master_SSL_Cert
+Master_SSL_Cipher
+Master_SSL_Key
+Seconds_Behind_Master #
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+*** Drop t4 ***
+DROP TABLE t4;
+*** Create t5 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t5 (a INT PRIMARY KEY, b CHAR(5),
+c FLOAT, d INT, e DOUBLE,
+f DECIMAL(8,2))ENGINE='MyISAM';
+*** Create t5 on Master ***
+CREATE TABLE t5 (a INT PRIMARY KEY, b VARCHAR(6),
+c DECIMAL(8,2), d BIT, e BLOB,
+f FLOAT) ENGINE='MyISAM';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+INSERT INTO t5 () VALUES(1,'Kyle',200.23,1,'b1b1',23.00098),
+(2,'JOE',300.01,0,'b2b2',1.0000009);
+********************************************
+*** Expect slave to fail with Error 1522 ***
+********************************************
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port MASTER_PORT
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+Slave_SQL_Running No
+Replicate_Do_DB
+Replicate_Ignore_DB
+Replicate_Do_Table
+Replicate_Ignore_Table
+Replicate_Wild_Do_Table
+Replicate_Wild_Ignore_Table
+Last_Errno 1522
+Last_Error Column 5 type mismatch - received type 4, test.t5 has type 246
+Skip_Counter 0
+Exec_Master_Log_Pos #
+Relay_Log_Space #
+Until_Condition None
+Until_Log_File
+Until_Log_Pos 0
+Master_SSL_Allowed No
+Master_SSL_CA_File
+Master_SSL_CA_Path
+Master_SSL_Cert
+Master_SSL_Cipher
+Master_SSL_Key
+Seconds_Behind_Master #
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+*** Drop t5 ***
+DROP TABLE t5;
+*** Create t6 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t6 (a INT PRIMARY KEY, b CHAR(5),
+c FLOAT, d INT)ENGINE='MyISAM';
+*** Create t6 on Master ***
+CREATE TABLE t6 (a INT PRIMARY KEY, b VARCHAR(6),
+c DECIMAL(8,2), d BIT
+) ENGINE='MyISAM';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+INSERT INTO t6 () VALUES(1,'Kyle',200.23,1),
+(2,'JOE',300.01,0);
+********************************************
+*** Expect slave to fail with Error 1522 ***
+********************************************
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port MASTER_PORT
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+Slave_SQL_Running No
+Replicate_Do_DB
+Replicate_Ignore_DB
+Replicate_Do_Table
+Replicate_Ignore_Table
+Replicate_Wild_Do_Table
+Replicate_Wild_Ignore_Table
+Last_Errno 1522
+Last_Error Column 3 type mismatch - received type 16, test.t6 has type 3
+Skip_Counter 0
+Exec_Master_Log_Pos #
+Relay_Log_Space #
+Until_Condition None
+Until_Log_File
+Until_Log_Pos 0
+Master_SSL_Allowed No
+Master_SSL_CA_File
+Master_SSL_CA_Path
+Master_SSL_Cert
+Master_SSL_Cipher
+Master_SSL_Key
+Seconds_Behind_Master #
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3;
+*** Drop t6 ***
+DROP TABLE t6;
+DROP TABLE t6;
+START SLAVE;
+**** Diff Table Def End ****
+**** Extra Colums Start ****
+*** Create t7 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t7 (a INT KEY, b BLOB, c CHAR(5),
+d TIMESTAMP NULL DEFAULT '0000-00-00 00:00:00',
+e CHAR(20) DEFAULT 'Extra Column Testing')
+ENGINE='MyISAM';
+*** Create t7 on Master ***
+CREATE TABLE t7 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
+) ENGINE='MyISAM';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+set @b1 = 'b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t7 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+SELECT * FROM t7 ORDER BY a;
+a b c
+1 b1b1 Kyle
+2 b1b1 JOE
+3 b1b1 QA
+*** Select from slave ***
+SELECT * FROM t7 ORDER BY a;
+a b c d e
+1 b1b1 Kyle 0000-00-00 00:00:00 Extra Column Testing
+2 b1b1 JOE 0000-00-00 00:00:00 Extra Column Testing
+3 b1b1 QA 0000-00-00 00:00:00 Extra Column Testing
+*** Drop t7 ***
+DROP TABLE t7;
+*** Create t8 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t8 (a INT KEY, b BLOB, c CHAR(5),
+d TIMESTAMP NULL DEFAULT '0000-00-00 00:00:00',
+e INT)ENGINE='MyISAM';
+*** Create t8 on Master ***
+CREATE TABLE t8 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
+) ENGINE='MyISAM';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t8 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+*** Drop t8 ***
+DROP TABLE t8;
+*** Create t10 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233',
+c CHAR(5), e INT DEFAULT '1')ENGINE='MyISAM';
+*** Create t10 on Master ***
+CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
+) ENGINE='MyISAM';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t10 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+********************************************
+*** Expect slave to fail with Error 1522 ***
+********************************************
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port MASTER_PORT
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+Slave_SQL_Running No
+Replicate_Do_DB
+Replicate_Ignore_DB
+Replicate_Do_Table
+Replicate_Ignore_Table
+Replicate_Wild_Do_Table
+Replicate_Wild_Ignore_Table
+Last_Errno 1522
+Last_Error Column 2 type mismatch - received type 254, test.t10 has type 5
+Skip_Counter 0
+Exec_Master_Log_Pos #
+Relay_Log_Space #
+Until_Condition None
+Until_Log_File
+Until_Log_Pos 0
+Master_SSL_Allowed No
+Master_SSL_CA_File
+Master_SSL_CA_Path
+Master_SSL_Cert
+Master_SSL_Cipher
+Master_SSL_Key
+Seconds_Behind_Master #
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+*** Drop t10 ***
+DROP TABLE t10;
+*** Create t11 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT,
+c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='MyISAM';
+*** Create t11 on Master ***
+CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254)
+) ENGINE='MyISAM';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t11 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+********************************************
+*** Expect slave to fail with Error 1522 ***
+********************************************
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port MASTER_PORT
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+Slave_SQL_Running No
+Replicate_Do_DB
+Replicate_Ignore_DB
+Replicate_Do_Table
+Replicate_Ignore_Table
+Replicate_Wild_Do_Table
+Replicate_Wild_Ignore_Table
+Last_Errno 1522
+Last_Error Column 2 type mismatch - received type 15, test.t11 has type 252
+Skip_Counter 0
+Exec_Master_Log_Pos #
+Relay_Log_Space #
+Until_Condition None
+Until_Log_File
+Until_Log_Pos 0
+Master_SSL_Allowed No
+Master_SSL_CA_File
+Master_SSL_CA_Path
+Master_SSL_Cert
+Master_SSL_Cipher
+Master_SSL_Key
+Seconds_Behind_Master #
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+*** Drop t11 ***
+DROP TABLE t11;
+*** Create t12 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT,
+c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='MyISAM';
+*** Create t12 on Master ***
+CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB
+) ENGINE='MyISAM';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t12 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+SELECT * FROM t12 ORDER BY a;
+a b c
+1 b1b1b1b1b1b1b1b1 Kyle
+2 b1b1b1b1b1b1b1b1 JOE
+3 b1b1b1b1b1b1b1b1 QA
+*** Select on Slave ***
+SELECT * FROM t12 ORDER BY a;
+a b f c e
+1 b1b1b1b1b1b1b1b1 Kyle test 1
+2 b1b1b1b1b1b1b1b1 JOE test 1
+3 b1b1b1b1b1b1b1b1 QA test 1
+*** Drop t12 ***
+DROP TABLE t12;
+**** Extra Colums End ****
+*** BUG 22177 Start ***
+*** Create t13 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t13 (a INT KEY, b BLOB, c CHAR(5),
+d INT DEFAULT '1',
+e TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+)ENGINE='MyISAM';
+*** Create t13 on Master ***
+CREATE TABLE t13 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
+) ENGINE='MyISAM';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t13 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+SELECT * FROM t13 ORDER BY a;
+a b c
+1 b1b1b1b1b1b1b1b1 Kyle
+2 b1b1b1b1b1b1b1b1 JOE
+3 b1b1b1b1b1b1b1b1 QA
+*** Select on Slave ****
+SELECT * FROM t13 ORDER BY a;
+a b c d e
+1 b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
+2 b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
+3 b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
+*** Drop t13 ***
+DROP TABLE t13;
+*** 22117 END ***
+*** Alter Master Table Testing Start ***
+*** Create t14 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
+c6 INT DEFAULT '1',
+c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+)ENGINE='MyISAM';
+*** Create t14 on Master ***
+CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
+) ENGINE='MyISAM';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+ALTER TABLE t14 ADD COLUMN c2 DECIMAL(8,2) AFTER c1;
+ALTER TABLE t14 ADD COLUMN c3 TEXT AFTER c2;
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t14 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle'),
+(2,2.00,'This Test Should work',@b1,'JOE'),
+(3,3.00,'If is does not, I will open a bug',@b1,'QA');
+SELECT * FROM t14 ORDER BY c1;
+c1 c2 c3 c4 c5
+1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle
+2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE
+3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA
+*** Select on Slave ****
+SELECT * FROM t14 ORDER BY c1;
+c1 c2 c3 c4 c5 c6 c7
+1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
+2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
+3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
+*** connect to master and drop columns ***
+ALTER TABLE t14 DROP COLUMN c2;
+ALTER TABLE t14 DROP COLUMN c4;
+*** Select from Master ***
+SELECT * FROM t14 ORDER BY c1;
+c1 c3 c5
+1 Replication Testing Extra Col Kyle
+2 This Test Should work JOE
+3 If is does not, I will open a bug QA
+*** Select from Slave ***
+SELECT * FROM t14 ORDER BY c1;
+c1 c3 c5 c6 c7
+1 Replication Testing Extra Col Kyle 1 CURRENT_TIMESTAMP
+2 This Test Should work JOE 1 CURRENT_TIMESTAMP
+3 If is does not, I will open a bug QA 1 CURRENT_TIMESTAMP
+*** Drop t14 ***
+DROP TABLE t14;
+*** Create t15 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t15 (c1 INT KEY, c2 DECIMAL(8,2), c3 TEXT,
+c4 BLOB, c5 CHAR(5),
+c6 INT DEFAULT '1',
+c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+)ENGINE='MyISAM';
+*** Create t15 on Master ***
+CREATE TABLE t15 (c1 INT PRIMARY KEY, c2 DECIMAL(8,2), c3 TEXT,
+c4 BLOB, c5 CHAR(5)) ENGINE='MyISAM';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t15 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle'),
+(2,2.00,'This Test Should work',@b1,'JOE'),
+(3,3.00,'If is does not, I will open a bug',@b1,'QA');
+SELECT * FROM t15 ORDER BY c1;
+c1 c2 c3 c4 c5
+1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle
+2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE
+3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA
+*** Select on Slave ****
+SELECT * FROM t15 ORDER BY c1;
+c1 c2 c3 c4 c5 c6 c7
+1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
+2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
+3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
+*** Add column on master that is a Extra on Slave ***
+ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5;
+********************************************
+*** Expect slave to fail with Error 1060 ***
+********************************************
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port MASTER_PORT
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+Slave_SQL_Running No
+Replicate_Do_DB
+Replicate_Ignore_DB
+Replicate_Do_Table
+Replicate_Ignore_Table
+Replicate_Wild_Do_Table
+Replicate_Wild_Ignore_Table
+Last_Errno 1060
+Last_Error Error 'Duplicate column name 'c6'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5'
+Skip_Counter 0
+Exec_Master_Log_Pos #
+Relay_Log_Space #
+Until_Condition None
+Until_Log_File
+Until_Log_Pos 0
+Master_SSL_Allowed No
+Master_SSL_CA_File
+Master_SSL_CA_Path
+Master_SSL_Cert
+Master_SSL_Cipher
+Master_SSL_Key
+Seconds_Behind_Master #
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+*** Try to insert in master ****
+INSERT INTO t15 () VALUES(5,2.00,'Replication Testing',@b1,'Buda',2);
+SELECT * FROM t15 ORDER BY c1;
+c1 c2 c3 c4 c5 c6
+1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle NULL
+2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE NULL
+3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA NULL
+5 2.00 Replication Testing b1b1b1b1b1b1b1b1 Buda 2
+*** Try to select from slave ****
+SELECT * FROM t15 ORDER BY c1;
+c1 c2 c3 c4 c5 c6 c7
+1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
+2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
+3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
+*** DROP TABLE t15 ***
+DROP TABLE t15;
+*** Create t16 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t16 (c1 INT KEY, c2 DECIMAL(8,2), c3 TEXT,
+c4 BLOB, c5 CHAR(5),
+c6 INT DEFAULT '1',
+c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+)ENGINE='MyISAM';
+*** Create t16 on Master ***
+CREATE TABLE t16 (c1 INT PRIMARY KEY, c2 DECIMAL(8,2), c3 TEXT,
+c4 BLOB, c5 CHAR(5))ENGINE='MyISAM';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t16 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle'),
+(2,2.00,'This Test Should work',@b1,'JOE'),
+(3,3.00,'If is does not, I will open a bug',@b1,'QA');
+SELECT * FROM t16 ORDER BY c1;
+c1 c2 c3 c4 c5
+1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle
+2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE
+3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA
+*** Select on Slave ****
+SELECT * FROM t16 ORDER BY c1;
+c1 c2 c3 c4 c5 c6 c7
+1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
+2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
+3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
+*** Add Partition on master ***
+ALTER TABLE t16 PARTITION BY KEY(c1) PARTITIONS 4;
+INSERT INTO t16 () VALUES(4,1.00,'Replication Rocks',@b1,'Omer');
+SHOW CREATE TABLE t16;
+Table Create Table
+t16 CREATE TABLE `t16` (
+ `c1` int(11) NOT NULL,
+ `c2` decimal(8,2) DEFAULT NULL,
+ `c3` text,
+ `c4` blob,
+ `c5` char(5) DEFAULT NULL,
+ PRIMARY KEY (`c1`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (c1) PARTITIONS 4 */
+*** Show table on Slave ****
+SHOW CREATE TABLE t16;
+Table Create Table
+t16 CREATE TABLE `t16` (
+ `c1` int(11) NOT NULL,
+ `c2` decimal(8,2) DEFAULT NULL,
+ `c3` text,
+ `c4` blob,
+ `c5` char(5) DEFAULT NULL,
+ `c6` int(11) DEFAULT '1',
+ `c7` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
+ PRIMARY KEY (`c1`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (c1) PARTITIONS 4 */
+*** DROP TABLE t16 ***
+DROP TABLE t16;
+*** Alter Master End ***
+*** Create t17 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t17 (a SMALLINT, b INT PRIMARY KEY, c CHAR(5),
+d FLOAT DEFAULT '2.00',
+e CHAR(5) DEFAULT 'TEST2')
+ENGINE='MyISAM';
+*** Create t17 on Master ***
+CREATE TABLE t17 (a BIGINT PRIMARY KEY, b INT, c CHAR(10)
+) ENGINE='MyISAM';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+INSERT INTO t17 () VALUES(9223372036854775807,2,'Kyle, TEX');
+********************************************
+*** Expect slave to fail with Error 1522 ***
+********************************************
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port MASTER_PORT
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+Slave_SQL_Running No
+Replicate_Do_DB
+Replicate_Ignore_DB
+Replicate_Do_Table
+Replicate_Ignore_Table
+Replicate_Wild_Do_Table
+Replicate_Wild_Ignore_Table
+Last_Errno 1522
+Last_Error Column 0 type mismatch - received type 8, test.t17 has type 2
+Skip_Counter 0
+Exec_Master_Log_Pos #
+Relay_Log_Space #
+Until_Condition None
+Until_Log_File
+Until_Log_Pos 0
+Master_SSL_Allowed No
+Master_SSL_CA_File
+Master_SSL_CA_Path
+Master_SSL_Cert
+Master_SSL_Cipher
+Master_SSL_Key
+Seconds_Behind_Master #
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+** DROP table t17 ***
+DROP TABLE t17;
diff --git a/mysql-test/r/rpl_ignore_table.result b/mysql-test/r/rpl_ignore_table.result
index 356a9dcb2f8..136cf5cc5eb 100644
--- a/mysql-test/r/rpl_ignore_table.result
+++ b/mysql-test/r/rpl_ignore_table.result
@@ -14,3 +14,19 @@ SELECT * FROM t4;
a
DROP TABLE t1;
DROP TABLE t4;
+DROP TABLE IF EXISTS t5;
+CREATE TABLE t5 (
+word varchar(50) collate utf8_unicode_ci NOT NULL default ''
+) DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+SET @@session.character_set_client=33,@@session.collation_connection=192;
+CREATE TEMPORARY TABLE tmptbl504451f4258$1 (id INT NOT NULL) ENGINE=MEMORY;
+INSERT INTO t5 (word) VALUES ('TEST’');
+SELECT HEX(word) FROM t5;
+HEX(word)
+54455354E28099
+SELECT HEX(word) FROM t5;
+HEX(word)
+54455354E28099
+SELECT * FROM tmptbl504451f4258$1;
+ERROR 42S02: Table 'test.tmptbl504451f4258$1' doesn't exist
+DROP TABLE t5;
diff --git a/mysql-test/r/rpl_ndb_dd_advance.result b/mysql-test/r/rpl_ndb_dd_advance.result
index bbc67a04027..b29d1201a85 100644
--- a/mysql-test/r/rpl_ndb_dd_advance.result
+++ b/mysql-test/r/rpl_ndb_dd_advance.result
@@ -326,12 +326,12 @@ COUNT(*)
**** Must make sure slave is clean *****
STOP SLAVE;
RESET SLAVE;
-DROP PROCEDURE tpcb.load;
-DROP PROCEDURE tpcb.trans;
-DROP TABLE tpcb.account;
-DROP TABLE tpcb.teller;
-DROP TABLE tpcb.branch;
-DROP TABLE tpcb.history;
+DROP PROCEDURE IF EXISTS tpcb.load;
+DROP PROCEDURE IF EXISTS tpcb.trans;
+DROP TABLE IF EXISTS tpcb.account;
+DROP TABLE IF EXISTS tpcb.teller;
+DROP TABLE IF EXISTS tpcb.branch;
+DROP TABLE IF EXISTS tpcb.history;
DROP DATABASE tpcb;
ALTER TABLESPACE ts1
DROP DATAFILE 'datafile.dat'
@@ -392,8 +392,8 @@ COUNT(*)
4050
*** DUMP MASTER & SLAVE FOR COMPARE ********
*************** TEST 2 CLEANUP SECTION ********************
-DROP PROCEDURE tpcb.load;
-DROP PROCEDURE tpcb.trans;
+DROP PROCEDURE IF EXISTS tpcb.load;
+DROP PROCEDURE IF EXISTS tpcb.trans;
DROP TABLE tpcb.account;
DROP TABLE tpcb.teller;
DROP TABLE tpcb.branch;
diff --git a/mysql-test/r/rpl_ndb_ddl.result b/mysql-test/r/rpl_ndb_ddl.result
index de35175bf18..f5d8073be94 100644
--- a/mysql-test/r/rpl_ndb_ddl.result
+++ b/mysql-test/r/rpl_ndb_ddl.result
@@ -359,8 +359,6 @@ MAX(f1)
-------- switch to master -------
ROLLBACK;
-Warnings:
-Warning 1196 Some non-transactional changed tables couldn't be rolled back
SELECT MAX(f1) FROM t1;
MAX(f1)
5
@@ -370,9 +368,9 @@ TEST-INFO: MASTER: The INSERT is not committed (Succeeded)
-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
-6
+5
-TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
+TEST-INFO: SLAVE: The INSERT is not committed (Succeeded)
-------- switch to master -------
flush logs;
@@ -401,7 +399,7 @@ MAX(f1)
-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
-6
+5
-------- switch to master -------
RENAME TABLE mysqltest1.t3 to mysqltest1.t20;
@@ -506,7 +504,7 @@ f2 bigint(20) YES NULL
-------- switch to master -------
-######## CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE= "InnoDB" ########
+######## CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE= "NDB" ########
-------- switch to master -------
INSERT INTO t1 SET f1= 7 + 1;
@@ -520,7 +518,7 @@ MAX(f1)
7
-------- switch to master -------
-CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE= "InnoDB";
+CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE= "NDB";
SELECT MAX(f1) FROM t1;
MAX(f1)
8
@@ -579,8 +577,6 @@ MAX(f1)
-------- switch to master -------
ROLLBACK;
-Warnings:
-Warning 1196 Some non-transactional changed tables couldn't be rolled back
SELECT MAX(f1) FROM t1;
MAX(f1)
8
@@ -590,9 +586,9 @@ TEST-INFO: MASTER: The INSERT is not committed (Succeeded)
-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
-9
+8
-TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
+TEST-INFO: SLAVE: The INSERT is not committed (Succeeded)
-------- switch to master -------
flush logs;
@@ -613,7 +609,7 @@ MAX(f1)
-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
-9
+8
-------- switch to master -------
TRUNCATE TABLE mysqltest1.t7;
@@ -650,11 +646,9 @@ flush logs;
-------- switch to master -------
SELECT * FROM mysqltest1.t7;
f1
-
-------- switch to slave --------
SELECT * FROM mysqltest1.t7;
f1
-
-------- switch to master -------
######## LOCK TABLES mysqltest1.t1 WRITE, mysqltest1.t8 READ ########
@@ -957,7 +951,7 @@ t5 1 my_idx5 1 f1 A 0 NULL NULL YES BTREE
-------- switch to slave --------
SHOW INDEX FROM mysqltest1.t5;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
-t5 1 my_idx5 1 f1 A NULL NULL NULL YES BTREE
+t5 1 my_idx5 1 f1 A 0 NULL NULL YES BTREE
-------- switch to master -------
@@ -1691,3 +1685,4 @@ user
DROP DATABASE IF EXISTS mysqltest1;
DROP DATABASE IF EXISTS mysqltest2;
DROP DATABASE IF EXISTS mysqltest3;
+ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
diff --git a/mysql-test/r/rpl_ndb_extraCol.result b/mysql-test/r/rpl_ndb_extraCol.result
new file mode 100644
index 00000000000..e51fae29c54
--- /dev/null
+++ b/mysql-test/r/rpl_ndb_extraCol.result
@@ -0,0 +1,742 @@
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+**** Diff Table Def Start ****
+*** On Slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t1 (a INT, b INT PRIMARY KEY, c CHAR(20),
+d FLOAT DEFAULT '2.00',
+e CHAR(4) DEFAULT 'TEST')
+ENGINE='NDB';
+*** Create t1 on Master ***
+CREATE TABLE t1 (a INT PRIMARY KEY, b INT, c CHAR(10)
+) ENGINE='NDB';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+INSERT INTO t1 () VALUES(1,2,'TEXAS'),(2,1,'AUSTIN'),(3,4,'QA');
+SELECT * FROM t1 ORDER BY a;
+a b c
+1 2 TEXAS
+2 1 AUSTIN
+3 4 QA
+*** Select from slave ***
+SELECT * FROM t1 ORDER BY a;
+a b c d e
+1 2 TEXAS 2 TEST
+2 1 AUSTIN 2 TEST
+3 4 QA 2 TEST
+*** Drop t1 ***
+DROP TABLE t1;
+*** Create t3 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t3 (a INT, b INT PRIMARY KEY, c CHAR(20),
+d FLOAT DEFAULT '2.00',
+e CHAR(5) DEFAULT 'TEST2')
+ENGINE='NDB';
+*** Create t3 on Master ***
+CREATE TABLE t3 (a BLOB, b INT PRIMARY KEY, c CHAR(20)
+) ENGINE='NDB';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+set @b1 = 'b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t3 () VALUES(@b1,2,'Kyle, TEX'),(@b1,1,'JOE AUSTIN'),(@b1,4,'QA TESTING');
+********************************************
+*** Expect slave to fail with Error 1522 ***
+********************************************
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port MASTER_PORT
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+Slave_SQL_Running No
+Replicate_Do_DB
+Replicate_Ignore_DB
+Replicate_Do_Table
+Replicate_Ignore_Table
+Replicate_Wild_Do_Table
+Replicate_Wild_Ignore_Table
+Last_Errno 1522
+Last_Error Column 0 type mismatch - received type 252, test.t3 has type 3
+Skip_Counter 0
+Exec_Master_Log_Pos #
+Relay_Log_Space #
+Until_Condition None
+Until_Log_File
+Until_Log_Pos 0
+Master_SSL_Allowed No
+Master_SSL_CA_File
+Master_SSL_CA_Path
+Master_SSL_Cert
+Master_SSL_Cipher
+Master_SSL_Key
+Seconds_Behind_Master #
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+*** Drop t3 ***
+DROP TABLE t3;
+*** Create t4 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t4 (a INT, b INT PRIMARY KEY, c CHAR(20),
+d FLOAT DEFAULT '2.00',
+e CHAR(5) DEFAULT 'TEST2')
+ENGINE='NDB';
+*** Create t4 on Master ***
+CREATE TABLE t4 (a DECIMAL(8,2), b INT PRIMARY KEY, c CHAR(20)
+) ENGINE='NDB';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+INSERT INTO t4 () VALUES(100.22,2,'Kyle, TEX'),(200.26,1,'JOE AUSTIN'),
+(30000.22,4,'QA TESTING');
+********************************************
+*** Expect slave to fail with Error 1522 ***
+********************************************
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port MASTER_PORT
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+Slave_SQL_Running No
+Replicate_Do_DB
+Replicate_Ignore_DB
+Replicate_Do_Table
+Replicate_Ignore_Table
+Replicate_Wild_Do_Table
+Replicate_Wild_Ignore_Table
+Last_Errno 1522
+Last_Error Column 0 type mismatch - received type 246, test.t4 has type 3
+Skip_Counter 0
+Exec_Master_Log_Pos #
+Relay_Log_Space #
+Until_Condition None
+Until_Log_File
+Until_Log_Pos 0
+Master_SSL_Allowed No
+Master_SSL_CA_File
+Master_SSL_CA_Path
+Master_SSL_Cert
+Master_SSL_Cipher
+Master_SSL_Key
+Seconds_Behind_Master #
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+*** Drop t4 ***
+DROP TABLE t4;
+*** Create t5 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t5 (a INT PRIMARY KEY, b CHAR(5),
+c FLOAT, d INT, e DOUBLE,
+f DECIMAL(8,2))ENGINE='NDB';
+*** Create t5 on Master ***
+CREATE TABLE t5 (a INT PRIMARY KEY, b VARCHAR(6),
+c DECIMAL(8,2), d BIT, e BLOB,
+f FLOAT) ENGINE='NDB';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+INSERT INTO t5 () VALUES(1,'Kyle',200.23,1,'b1b1',23.00098),
+(2,'JOE',300.01,0,'b2b2',1.0000009);
+********************************************
+*** Expect slave to fail with Error 1522 ***
+********************************************
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port MASTER_PORT
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+Slave_SQL_Running No
+Replicate_Do_DB
+Replicate_Ignore_DB
+Replicate_Do_Table
+Replicate_Ignore_Table
+Replicate_Wild_Do_Table
+Replicate_Wild_Ignore_Table
+Last_Errno 1522
+Last_Error Column 5 type mismatch - received type 4, test.t5 has type 246
+Skip_Counter 0
+Exec_Master_Log_Pos #
+Relay_Log_Space #
+Until_Condition None
+Until_Log_File
+Until_Log_Pos 0
+Master_SSL_Allowed No
+Master_SSL_CA_File
+Master_SSL_CA_Path
+Master_SSL_Cert
+Master_SSL_Cipher
+Master_SSL_Key
+Seconds_Behind_Master #
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+*** Drop t5 ***
+DROP TABLE t5;
+*** Create t6 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t6 (a INT PRIMARY KEY, b CHAR(5),
+c FLOAT, d INT)ENGINE='NDB';
+*** Create t6 on Master ***
+CREATE TABLE t6 (a INT PRIMARY KEY, b VARCHAR(6),
+c DECIMAL(8,2), d BIT
+) ENGINE='NDB';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+INSERT INTO t6 () VALUES(1,'Kyle',200.23,1),
+(2,'JOE',300.01,0);
+********************************************
+*** Expect slave to fail with Error 1522 ***
+********************************************
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port MASTER_PORT
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+Slave_SQL_Running No
+Replicate_Do_DB
+Replicate_Ignore_DB
+Replicate_Do_Table
+Replicate_Ignore_Table
+Replicate_Wild_Do_Table
+Replicate_Wild_Ignore_Table
+Last_Errno 1522
+Last_Error Column 3 type mismatch - received type 16, test.t6 has type 3
+Skip_Counter 0
+Exec_Master_Log_Pos #
+Relay_Log_Space #
+Until_Condition None
+Until_Log_File
+Until_Log_Pos 0
+Master_SSL_Allowed No
+Master_SSL_CA_File
+Master_SSL_CA_Path
+Master_SSL_Cert
+Master_SSL_Cipher
+Master_SSL_Key
+Seconds_Behind_Master #
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3;
+*** Drop t6 ***
+DROP TABLE t6;
+DROP TABLE t6;
+START SLAVE;
+**** Diff Table Def End ****
+**** Extra Colums Start ****
+*** Create t7 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t7 (a INT KEY, b BLOB, c CHAR(5),
+d TIMESTAMP NULL DEFAULT '0000-00-00 00:00:00',
+e CHAR(20) DEFAULT 'Extra Column Testing')
+ENGINE='NDB';
+*** Create t7 on Master ***
+CREATE TABLE t7 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
+) ENGINE='NDB';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+set @b1 = 'b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t7 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+SELECT * FROM t7 ORDER BY a;
+a b c
+1 b1b1 Kyle
+2 b1b1 JOE
+3 b1b1 QA
+*** Select from slave ***
+SELECT * FROM t7 ORDER BY a;
+a b c d e
+1 b1b1 Kyle 0000-00-00 00:00:00 Extra Column Testing
+2 b1b1 JOE 0000-00-00 00:00:00 Extra Column Testing
+3 b1b1 QA 0000-00-00 00:00:00 Extra Column Testing
+*** Drop t7 ***
+DROP TABLE t7;
+*** Create t8 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t8 (a INT KEY, b BLOB, c CHAR(5),
+d TIMESTAMP NULL DEFAULT '0000-00-00 00:00:00',
+e INT)ENGINE='NDB';
+*** Create t8 on Master ***
+CREATE TABLE t8 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
+) ENGINE='NDB';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t8 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+*** Drop t8 ***
+DROP TABLE t8;
+*** Create t10 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233',
+c CHAR(5), e INT DEFAULT '1')ENGINE='NDB';
+*** Create t10 on Master ***
+CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
+) ENGINE='NDB';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t10 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+********************************************
+*** Expect slave to fail with Error 1522 ***
+********************************************
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port MASTER_PORT
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+Slave_SQL_Running No
+Replicate_Do_DB
+Replicate_Ignore_DB
+Replicate_Do_Table
+Replicate_Ignore_Table
+Replicate_Wild_Do_Table
+Replicate_Wild_Ignore_Table
+Last_Errno 1522
+Last_Error Column 2 type mismatch - received type 254, test.t10 has type 5
+Skip_Counter 0
+Exec_Master_Log_Pos #
+Relay_Log_Space #
+Until_Condition None
+Until_Log_File
+Until_Log_Pos 0
+Master_SSL_Allowed No
+Master_SSL_CA_File
+Master_SSL_CA_Path
+Master_SSL_Cert
+Master_SSL_Cipher
+Master_SSL_Key
+Seconds_Behind_Master #
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+*** Drop t10 ***
+DROP TABLE t10;
+*** Create t11 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT,
+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)
+) ENGINE='NDB';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t11 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+********************************************
+*** Expect slave to fail with Error 1522 ***
+********************************************
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port MASTER_PORT
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+Slave_SQL_Running No
+Replicate_Do_DB
+Replicate_Ignore_DB
+Replicate_Do_Table
+Replicate_Ignore_Table
+Replicate_Wild_Do_Table
+Replicate_Wild_Ignore_Table
+Last_Errno 1522
+Last_Error Column 2 type mismatch - received type 15, test.t11 has type 252
+Skip_Counter 0
+Exec_Master_Log_Pos #
+Relay_Log_Space #
+Until_Condition None
+Until_Log_File
+Until_Log_Pos 0
+Master_SSL_Allowed No
+Master_SSL_CA_File
+Master_SSL_CA_Path
+Master_SSL_Cert
+Master_SSL_Cipher
+Master_SSL_Key
+Seconds_Behind_Master #
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+*** Drop t11 ***
+DROP TABLE t11;
+*** Create t12 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT,
+c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='NDB';
+*** Create t12 on Master ***
+CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB
+) ENGINE='NDB';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t12 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+SELECT * FROM t12 ORDER BY a;
+a b c
+1 b1b1b1b1b1b1b1b1 Kyle
+2 b1b1b1b1b1b1b1b1 JOE
+3 b1b1b1b1b1b1b1b1 QA
+*** Select on Slave ***
+SELECT * FROM t12 ORDER BY a;
+a b f c e
+1 b1b1b1b1b1b1b1b1 Kyle test 1
+2 b1b1b1b1b1b1b1b1 JOE test 1
+3 b1b1b1b1b1b1b1b1 QA test 1
+*** Drop t12 ***
+DROP TABLE t12;
+**** Extra Colums End ****
+*** BUG 22177 Start ***
+*** Create t13 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t13 (a INT KEY, b BLOB, c CHAR(5),
+d INT DEFAULT '1',
+e TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+)ENGINE='NDB';
+*** Create t13 on Master ***
+CREATE TABLE t13 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
+) ENGINE='NDB';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t13 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+SELECT * FROM t13 ORDER BY a;
+a b c
+1 b1b1b1b1b1b1b1b1 Kyle
+2 b1b1b1b1b1b1b1b1 JOE
+3 b1b1b1b1b1b1b1b1 QA
+*** Select on Slave ****
+SELECT * FROM t13 ORDER BY a;
+a b c d e
+1 b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
+2 b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
+3 b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
+*** Drop t13 ***
+DROP TABLE t13;
+*** 22117 END ***
+*** Alter Master Table Testing Start ***
+*** Create t14 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
+c6 INT DEFAULT '1',
+c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+)ENGINE='NDB';
+*** Create t14 on Master ***
+CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
+) ENGINE='NDB';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+ALTER TABLE t14 ADD COLUMN c2 DECIMAL(8,2) AFTER c1;
+ALTER TABLE t14 ADD COLUMN c3 TEXT AFTER c2;
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t14 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle'),
+(2,2.00,'This Test Should work',@b1,'JOE'),
+(3,3.00,'If is does not, I will open a bug',@b1,'QA');
+SELECT * FROM t14 ORDER BY c1;
+c1 c2 c3 c4 c5
+1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle
+2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE
+3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA
+*** Select on Slave ****
+SELECT * FROM t14 ORDER BY c1;
+c1 c2 c3 c4 c5 c6 c7
+1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
+2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
+3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
+*** connect to master and drop columns ***
+ALTER TABLE t14 DROP COLUMN c2;
+ALTER TABLE t14 DROP COLUMN c4;
+*** Select from Master ***
+SELECT * FROM t14 ORDER BY c1;
+c1 c3 c5
+1 Replication Testing Extra Col Kyle
+2 This Test Should work JOE
+3 If is does not, I will open a bug QA
+*** Select from Slave ***
+SELECT * FROM t14 ORDER BY c1;
+c1 c3 c5 c6 c7
+1 Replication Testing Extra Col Kyle 1 CURRENT_TIMESTAMP
+2 This Test Should work JOE 1 CURRENT_TIMESTAMP
+3 If is does not, I will open a bug QA 1 CURRENT_TIMESTAMP
+*** Drop t14 ***
+DROP TABLE t14;
+*** Create t15 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t15 (c1 INT KEY, c2 DECIMAL(8,2), c3 TEXT,
+c4 BLOB, c5 CHAR(5),
+c6 INT DEFAULT '1',
+c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+)ENGINE='NDB';
+*** Create t15 on Master ***
+CREATE TABLE t15 (c1 INT PRIMARY KEY, c2 DECIMAL(8,2), c3 TEXT,
+c4 BLOB, c5 CHAR(5)) ENGINE='NDB';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t15 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle'),
+(2,2.00,'This Test Should work',@b1,'JOE'),
+(3,3.00,'If is does not, I will open a bug',@b1,'QA');
+SELECT * FROM t15 ORDER BY c1;
+c1 c2 c3 c4 c5
+1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle
+2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE
+3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA
+*** Select on Slave ****
+SELECT * FROM t15 ORDER BY c1;
+c1 c2 c3 c4 c5 c6 c7
+1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
+2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
+3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
+*** Add column on master that is a Extra on Slave ***
+ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5;
+********************************************
+*** Expect slave to fail with Error 1060 ***
+********************************************
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port MASTER_PORT
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+Slave_SQL_Running No
+Replicate_Do_DB
+Replicate_Ignore_DB
+Replicate_Do_Table
+Replicate_Ignore_Table
+Replicate_Wild_Do_Table
+Replicate_Wild_Ignore_Table
+Last_Errno 1060
+Last_Error Error 'Duplicate column name 'c6'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5'
+Skip_Counter 0
+Exec_Master_Log_Pos #
+Relay_Log_Space #
+Until_Condition None
+Until_Log_File
+Until_Log_Pos 0
+Master_SSL_Allowed No
+Master_SSL_CA_File
+Master_SSL_CA_Path
+Master_SSL_Cert
+Master_SSL_Cipher
+Master_SSL_Key
+Seconds_Behind_Master #
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+*** Try to insert in master ****
+INSERT INTO t15 () VALUES(5,2.00,'Replication Testing',@b1,'Buda',2);
+SELECT * FROM t15 ORDER BY c1;
+c1 c2 c3 c4 c5 c6
+1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle NULL
+2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE NULL
+3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA NULL
+5 2.00 Replication Testing b1b1b1b1b1b1b1b1 Buda 2
+*** Try to select from slave ****
+SELECT * FROM t15 ORDER BY c1;
+c1 c2 c3 c4 c5 c6 c7
+1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
+2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
+3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
+5 2.00 Replication Testing b1b1b1b1b1b1b1b1 Buda 2 CURRENT_TIMESTAMP
+*** DROP TABLE t15 ***
+DROP TABLE t15;
+*** Create t16 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t16 (c1 INT KEY, c2 DECIMAL(8,2), c3 TEXT,
+c4 BLOB, c5 CHAR(5),
+c6 INT DEFAULT '1',
+c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+)ENGINE='NDB';
+*** Create t16 on Master ***
+CREATE TABLE t16 (c1 INT PRIMARY KEY, c2 DECIMAL(8,2), c3 TEXT,
+c4 BLOB, c5 CHAR(5))ENGINE='NDB';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t16 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle'),
+(2,2.00,'This Test Should work',@b1,'JOE'),
+(3,3.00,'If is does not, I will open a bug',@b1,'QA');
+SELECT * FROM t16 ORDER BY c1;
+c1 c2 c3 c4 c5
+1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle
+2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE
+3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA
+*** Select on Slave ****
+SELECT * FROM t16 ORDER BY c1;
+c1 c2 c3 c4 c5 c6 c7
+1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
+2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
+3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
+*** Add Partition on master ***
+ALTER TABLE t16 PARTITION BY KEY(c1) PARTITIONS 4;
+INSERT INTO t16 () VALUES(4,1.00,'Replication Rocks',@b1,'Omer');
+SHOW CREATE TABLE t16;
+Table Create Table
+t16 CREATE TABLE `t16` (
+ `c1` int(11) NOT NULL,
+ `c2` decimal(8,2) DEFAULT NULL,
+ `c3` text,
+ `c4` blob,
+ `c5` char(5) DEFAULT NULL,
+ PRIMARY KEY (`c1`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (c1) PARTITIONS 4 */
+*** Show table on Slave ****
+SHOW CREATE TABLE t16;
+Table Create Table
+t16 CREATE TABLE `t16` (
+ `c1` int(11) NOT NULL,
+ `c2` decimal(8,2) DEFAULT NULL,
+ `c3` text,
+ `c4` blob,
+ `c5` char(5) DEFAULT NULL,
+ `c6` int(11) DEFAULT '1',
+ `c7` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
+ PRIMARY KEY (`c1`)
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (c1) PARTITIONS 4 */
+*** DROP TABLE t16 ***
+DROP TABLE t16;
+*** Alter Master End ***
+*** Create t17 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t17 (a SMALLINT, b INT PRIMARY KEY, c CHAR(5),
+d FLOAT DEFAULT '2.00',
+e CHAR(5) DEFAULT 'TEST2')
+ENGINE='NDB';
+*** Create t17 on Master ***
+CREATE TABLE t17 (a BIGINT PRIMARY KEY, b INT, c CHAR(10)
+) ENGINE='NDB';
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+INSERT INTO t17 () VALUES(9223372036854775807,2,'Kyle, TEX');
+********************************************
+*** Expect slave to fail with Error 1522 ***
+********************************************
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port MASTER_PORT
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+Slave_SQL_Running No
+Replicate_Do_DB
+Replicate_Ignore_DB
+Replicate_Do_Table
+Replicate_Ignore_Table
+Replicate_Wild_Do_Table
+Replicate_Wild_Ignore_Table
+Last_Errno 1522
+Last_Error Column 0 type mismatch - received type 8, test.t17 has type 2
+Skip_Counter 0
+Exec_Master_Log_Pos #
+Relay_Log_Space #
+Until_Condition None
+Until_Log_File
+Until_Log_Pos 0
+Master_SSL_Allowed No
+Master_SSL_CA_File
+Master_SSL_CA_Path
+Master_SSL_Cert
+Master_SSL_Cipher
+Master_SSL_Key
+Seconds_Behind_Master #
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+** DROP table t17 ***
+DROP TABLE t17;
diff --git a/mysql-test/r/strict_autoinc_1myisam.result b/mysql-test/r/strict_autoinc_1myisam.result
index dcda74a19cd..afcccb1c40f 100644
--- a/mysql-test/r/strict_autoinc_1myisam.result
+++ b/mysql-test/r/strict_autoinc_1myisam.result
@@ -1,3 +1,4 @@
+drop table if exists t1;
set @org_mode=@@sql_mode;
create table t1
(
diff --git a/mysql-test/r/strict_autoinc_2innodb.result b/mysql-test/r/strict_autoinc_2innodb.result
index 9e90ab886f3..e534286e2a2 100644
--- a/mysql-test/r/strict_autoinc_2innodb.result
+++ b/mysql-test/r/strict_autoinc_2innodb.result
@@ -1,3 +1,4 @@
+drop table if exists t1;
set @org_mode=@@sql_mode;
create table t1
(
diff --git a/mysql-test/r/strict_autoinc_3heap.result b/mysql-test/r/strict_autoinc_3heap.result
index d22054eb59d..0a31da04460 100644
--- a/mysql-test/r/strict_autoinc_3heap.result
+++ b/mysql-test/r/strict_autoinc_3heap.result
@@ -1,3 +1,4 @@
+drop table if exists t1;
set @org_mode=@@sql_mode;
create table t1
(
diff --git a/mysql-test/r/strict_autoinc_4bdb.result b/mysql-test/r/strict_autoinc_4bdb.result
index 48ebe196baf..2e8980e435b 100644
--- a/mysql-test/r/strict_autoinc_4bdb.result
+++ b/mysql-test/r/strict_autoinc_4bdb.result
@@ -1,3 +1,4 @@
+drop table if exists t1;
set @org_mode=@@sql_mode;
create table t1
(
diff --git a/mysql-test/r/strict_autoinc_5ndb.result b/mysql-test/r/strict_autoinc_5ndb.result
index debc7242e15..ea6e5ffc741 100644
--- a/mysql-test/r/strict_autoinc_5ndb.result
+++ b/mysql-test/r/strict_autoinc_5ndb.result
@@ -1,3 +1,4 @@
+drop table if exists t1;
set @org_mode=@@sql_mode;
create table t1
(
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index 501d15efa82..4bc122cc97b 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -3015,3 +3015,22 @@ i j
DROP VIEW v1, v2;
DROP TABLE t1;
End of 5.0 tests.
+DROP DATABASE IF EXISTS `d-1`;
+CREATE DATABASE `d-1`;
+USE `d-1`;
+CREATE TABLE `t-1` (c1 INT);
+CREATE VIEW `v-1` AS SELECT c1 FROM `t-1`;
+SHOW TABLES;
+Tables_in_d-1
+t-1
+v-1
+RENAME TABLE `t-1` TO `t-2`;
+RENAME TABLE `v-1` TO `v-2`;
+SHOW TABLES;
+Tables_in_d-1
+t-2
+v-2
+DROP TABLE `t-2`;
+DROP VIEW `v-2`;
+DROP DATABASE `d-1`;
+USE test;
diff --git a/mysql-test/r/xml.result b/mysql-test/r/xml.result
index efe7d14095d..bb7f84d0287 100644
--- a/mysql-test/r/xml.result
+++ b/mysql-test/r/xml.result
@@ -736,3 +736,76 @@ test
select extractValue('<x.-_:>test</x.-_:>','//*');
extractValue('<x.-_:>test</x.-_:>','//*')
test
+set @xml= "<entry><id>pt10</id><pt>10</pt></entry><entry><id>pt50</id><pt>50</pt></entry>";
+select ExtractValue(@xml, "/entry[(pt=10)]/id");
+ExtractValue(@xml, "/entry[(pt=10)]/id")
+pt10
+select ExtractValue(@xml, "/entry[(pt!=10)]/id");
+ExtractValue(@xml, "/entry[(pt!=10)]/id")
+pt50
+select ExtractValue(@xml, "/entry[(pt<10)]/id");
+ExtractValue(@xml, "/entry[(pt<10)]/id")
+
+select ExtractValue(@xml, "/entry[(pt<=10)]/id");
+ExtractValue(@xml, "/entry[(pt<=10)]/id")
+pt10
+select ExtractValue(@xml, "/entry[(pt>10)]/id");
+ExtractValue(@xml, "/entry[(pt>10)]/id")
+pt50
+select ExtractValue(@xml, "/entry[(pt>=10)]/id");
+ExtractValue(@xml, "/entry[(pt>=10)]/id")
+pt10 pt50
+select ExtractValue(@xml, "/entry[(pt=50)]/id");
+ExtractValue(@xml, "/entry[(pt=50)]/id")
+pt50
+select ExtractValue(@xml, "/entry[(pt!=50)]/id");
+ExtractValue(@xml, "/entry[(pt!=50)]/id")
+pt10
+select ExtractValue(@xml, "/entry[(pt<50)]/id");
+ExtractValue(@xml, "/entry[(pt<50)]/id")
+pt10
+select ExtractValue(@xml, "/entry[(pt<=50)]/id");
+ExtractValue(@xml, "/entry[(pt<=50)]/id")
+pt10 pt50
+select ExtractValue(@xml, "/entry[(pt>50)]/id");
+ExtractValue(@xml, "/entry[(pt>50)]/id")
+
+select ExtractValue(@xml, "/entry[(pt>=50)]/id");
+ExtractValue(@xml, "/entry[(pt>=50)]/id")
+pt50
+select ExtractValue(@xml, "/entry[(10=pt)]/id");
+ExtractValue(@xml, "/entry[(10=pt)]/id")
+pt10
+select ExtractValue(@xml, "/entry[(10!=pt)]/id");
+ExtractValue(@xml, "/entry[(10!=pt)]/id")
+pt50
+select ExtractValue(@xml, "/entry[(10>pt)]/id");
+ExtractValue(@xml, "/entry[(10>pt)]/id")
+
+select ExtractValue(@xml, "/entry[(10>=pt)]/id");
+ExtractValue(@xml, "/entry[(10>=pt)]/id")
+pt10
+select ExtractValue(@xml, "/entry[(10<pt)]/id");
+ExtractValue(@xml, "/entry[(10<pt)]/id")
+pt50
+select ExtractValue(@xml, "/entry[(10<=pt)]/id");
+ExtractValue(@xml, "/entry[(10<=pt)]/id")
+pt10 pt50
+select ExtractValue(@xml, "/entry[(50=pt)]/id");
+ExtractValue(@xml, "/entry[(50=pt)]/id")
+pt50
+select ExtractValue(@xml, "/entry[(50!=pt)]/id");
+ExtractValue(@xml, "/entry[(50!=pt)]/id")
+pt10
+select ExtractValue(@xml, "/entry[(50>pt)]/id");
+ExtractValue(@xml, "/entry[(50>pt)]/id")
+pt10
+select ExtractValue(@xml, "/entry[(50>=pt)]/id");
+ExtractValue(@xml, "/entry[(50>=pt)]/id")
+pt10 pt50
+select ExtractValue(@xml, "/entry[(50<pt)]/id");
+ExtractValue(@xml, "/entry[(50<pt)]/id")
+
+select ExtractValue(@xml, "/entry[(50<=pt)]/id");
+ExtractValue(@xml, "/entry[(50<=pt)]/id")
+pt50
diff --git a/mysql-test/t/ctype_ucs.test b/mysql-test/t/ctype_ucs.test
index 6c814368c88..dedba4caf0f 100644
--- a/mysql-test/t/ctype_ucs.test
+++ b/mysql-test/t/ctype_ucs.test
@@ -455,6 +455,23 @@ drop table t1;
deallocate prepare stmt;
#
+# Bug#22052 Trailing spaces are not removed from UNICODE fields in an index
+#
+create table t1 (
+ a char(10) unicode not null,
+ index a (a)
+) engine=myisam;
+insert into t1 values (repeat(0x201f, 10));
+insert into t1 values (repeat(0x2020, 10));
+insert into t1 values (repeat(0x2021, 10));
+# make sure "index read" is used
+explain select hex(a) from t1 order by a;
+select hex(a) from t1 order by a;
+alter table t1 drop index a;
+select hex(a) from t1 order by a;
+drop table t1;
+
+#
# Bug #20076: server crashes for a query with GROUP BY if MIN/MAX aggregation
# over a 'ucs2' field uses a temporary table
#
diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test
index 65ee82fff23..804b17ab6bb 100644
--- a/mysql-test/t/ctype_utf8.test
+++ b/mysql-test/t/ctype_utf8.test
@@ -1229,6 +1229,30 @@ set @a:=null;
execute my_stmt using @a;
drop table if exists t1;
+
+#
+# Bug#21505 Create view - illegal mix of collation for operation 'UNION'
+#
+--disable_warnings
+drop table if exists t1;
+drop view if exists v1, v2;
+--enable_warnings
+set names utf8;
+create table t1(col1 varchar(12) character set utf8 collate utf8_unicode_ci);
+insert into t1 values('t1_val');
+create view v1 as select 'v1_val' as col1;
+select coercibility(col1), collation(col1) from v1;
+create view v2 as select col1 from v1 union select col1 from t1;
+select coercibility(col1), collation(col1)from v2;
+drop view v1, v2;
+create view v1 as select 'v1_val' collate utf8_swedish_ci as col1;
+select coercibility(col1), collation(col1) from v1;
+create view v2 as select col1 from v1 union select col1 from t1;
+select coercibility(col1), collation(col1) from v2;
+drop view v1, v2;
+drop table t1;
+
+
#
# Bug#19960: Inconsistent results when joining
# InnoDB tables using partial UTF8 indexes
diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def
index 0d3b7cdfdeb..8e15bad7aed 100644
--- a/mysql-test/t/disabled.def
+++ b/mysql-test/t/disabled.def
@@ -21,7 +21,7 @@ ps_7ndb : BUG#18950 2006-02-16 jmiller create table like does n
rpl_ndb_2innodb : BUG#19227 2006-04-20 pekka pk delete apparently not replicated
rpl_ndb_2myisam : BUG#19227 Seems to pass currently
rpl_ndb_dd_partitions : BUG#19259 2006-04-21 rpl_ndb_dd_partitions fails on s/AMD
-rpl_ndb_ddl : BUG#18946 result file needs update + test needs to checked
+#rpl_ndb_ddl : BUG#18946 result file needs update + test needs to checked
rpl_ndb_innodb2ndb : Bug #19710 Cluster replication to partition table fails on DELETE FROM statement
rpl_ndb_myisam2ndb : Bug #19710 Cluster replication to partition table fails on DELETE FROM statement
rpl_row_blob_innodb : BUG#18980 2006-04-10 kent Test fails randomly
diff --git a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test
index db3536c6d36..cde9c1fcea3 100644
--- a/mysql-test/t/func_gconcat.test
+++ b/mysql-test/t/func_gconcat.test
@@ -461,3 +461,38 @@ SELECT GROUP_CONCAT(a), x
GROUP BY x;
DROP TABLE t1;
+#
+# Bug#23451 GROUP_CONCAT truncates a multibyte utf8 character
+#
+set names utf8;
+create table t1
+(
+ x text character set utf8 not null,
+ y integer not null
+);
+insert into t1 values (repeat('a', 1022), 0), (repeat(_utf8 0xc3b7, 4), 0);
+let $1= 10;
+while ($1)
+{
+ eval set group_concat_max_len= 1022 + $1;
+ --disable_result_log
+ select @x:=group_concat(x) from t1 group by y;
+ --enable_result_log
+ select @@group_concat_max_len, length(@x), char_length(@x), right(@x,12), right(HEX(@x),12);
+ dec $1;
+}
+drop table t1;
+set group_concat_max_len=1024;
+set names latin1;
+
+#
+# Bug#14169 type of group_concat() result changed to blob if tmp_table was used
+#
+create table t1 (f1 int unsigned, f2 varchar(255));
+insert into t1 values (1,repeat('a',255)),(2,repeat('b',255));
+--enable_metadata
+select f2,group_concat(f1) from t1 group by f2;
+--disable_metadata
+drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/lowercase_table.test b/mysql-test/t/lowercase_table.test
index 96437bc7636..31513f1bd06 100644
--- a/mysql-test/t/lowercase_table.test
+++ b/mysql-test/t/lowercase_table.test
@@ -85,3 +85,23 @@ drop table t1, t2;
show tables;
# End of 4.1 tests
+
+
+#
+# Bug#20404: SHOW CREATE TABLE fails with Turkish I
+#
+set names utf8;
+--disable_warnings
+drop table if exists Ä°,Ä°Ä°;
+--enable_warnings
+create table Ä° (s1 int);
+show create table Ä°;
+show tables;
+drop table Ä°;
+create table Ä°Ä° (s1 int);
+show create table Ä°Ä°;
+show tables;
+drop table Ä°Ä°;
+set names latin1;
+
+--echo End of 5.0 tests
diff --git a/mysql-test/t/rpl_do_grant.test b/mysql-test/t/rpl_do_grant.test
index 8d6f99e4bf1..4e398114269 100644
--- a/mysql-test/t/rpl_do_grant.test
+++ b/mysql-test/t/rpl_do_grant.test
@@ -39,11 +39,11 @@ connection master;
delete from mysql.user where user=_binary'rpl_do_grant';
delete from mysql.db where user=_binary'rpl_do_grant';
flush privileges;
-save_master_pos;
-connection slave;
-sync_with_master;
-# no need to delete manually, as the DELETEs must have done some real job on
-# master (updated binlog)
+sync_slave_with_master;
+# The mysql database is not replicated, so we have to do the deletes
+# manually on the slave as well.
+delete from mysql.user where user=_binary'rpl_do_grant';
+delete from mysql.db where user=_binary'rpl_do_grant';
flush privileges;
# End of 4.1 tests
diff --git a/mysql-test/t/rpl_extraCol_innodb-master.opt b/mysql-test/t/rpl_extraCol_innodb-master.opt
new file mode 100644
index 00000000000..627becdbfb5
--- /dev/null
+++ b/mysql-test/t/rpl_extraCol_innodb-master.opt
@@ -0,0 +1 @@
+--innodb
diff --git a/mysql-test/t/rpl_extraCol_innodb-slave.opt b/mysql-test/t/rpl_extraCol_innodb-slave.opt
new file mode 100644
index 00000000000..627becdbfb5
--- /dev/null
+++ b/mysql-test/t/rpl_extraCol_innodb-slave.opt
@@ -0,0 +1 @@
+--innodb
diff --git a/mysql-test/t/rpl_extraCol_innodb.test b/mysql-test/t/rpl_extraCol_innodb.test
new file mode 100644
index 00000000000..e9685baf01b
--- /dev/null
+++ b/mysql-test/t/rpl_extraCol_innodb.test
@@ -0,0 +1,13 @@
+###########################################
+# Author: Jeb
+# Date: 2006-09-08
+# Purpose: Wapper for rpl_extraSlave_Col.test
+# Using innodb
+###########################################
+-- source include/have_binlog_format_row.inc
+-- source include/have_innodb.inc
+-- source include/master-slave.inc
+let $engine_type = 'InnoDB';
+-- source extra/rpl_tests/rpl_extraSlave_Col.test
+
+
diff --git a/mysql-test/t/rpl_extraCol_myisam.test b/mysql-test/t/rpl_extraCol_myisam.test
new file mode 100644
index 00000000000..d56df394ccf
--- /dev/null
+++ b/mysql-test/t/rpl_extraCol_myisam.test
@@ -0,0 +1,12 @@
+###########################################
+# Author: Jeb
+# Date: 2006-09-07
+# Purpose: Wapper for rpl_extraSlave_Col.test
+# Using MyISAM
+###########################################
+-- source include/have_binlog_format_row.inc
+-- source include/master-slave.inc
+let $engine_type = 'MyISAM';
+-- source extra/rpl_tests/rpl_extraSlave_Col.test
+
+
diff --git a/mysql-test/t/rpl_ignore_table-slave.opt b/mysql-test/t/rpl_ignore_table-slave.opt
index cb49119bfcb..3aabbb2e0f5 100644
--- a/mysql-test/t/rpl_ignore_table-slave.opt
+++ b/mysql-test/t/rpl_ignore_table-slave.opt
@@ -1 +1 @@
---replicate-ignore-table=test.t1 --replicate-ignore-table=test.t2 --replicate-ignore-table=test.t3
+--replicate-ignore-table=test.t1 --replicate-ignore-table=test.t2 --replicate-ignore-table=test.t3 --replicate-wild-ignore-table=%.tmptbl%
diff --git a/mysql-test/t/rpl_ignore_table.test b/mysql-test/t/rpl_ignore_table.test
index 84b0a4cde38..10c75db0b70 100644
--- a/mysql-test/t/rpl_ignore_table.test
+++ b/mysql-test/t/rpl_ignore_table.test
@@ -28,3 +28,27 @@ connection master;
DROP TABLE t1;
DROP TABLE t4;
sync_slave_with_master;
+
+#
+# bug#22877 replication character sets get out of sync
+# using replicate-wild-ignore-table
+#
+connection master;
+--disable_warnings
+DROP TABLE IF EXISTS t5;
+--enable_warnings
+CREATE TABLE t5 (
+ word varchar(50) collate utf8_unicode_ci NOT NULL default ''
+) DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+SET @@session.character_set_client=33,@@session.collation_connection=192;
+CREATE TEMPORARY TABLE tmptbl504451f4258$1 (id INT NOT NULL) ENGINE=MEMORY;
+INSERT INTO t5 (word) VALUES ('TEST’');
+SELECT HEX(word) FROM t5;
+sync_slave_with_master;
+connection slave;
+SELECT HEX(word) FROM t5;
+--error 1146
+SELECT * FROM tmptbl504451f4258$1;
+connection master;
+DROP TABLE t5;
+sync_slave_with_master;
diff --git a/mysql-test/t/rpl_ndb_dd_advance.test b/mysql-test/t/rpl_ndb_dd_advance.test
index 1fe36ecd8a1..a77521f3a82 100644
--- a/mysql-test/t/rpl_ndb_dd_advance.test
+++ b/mysql-test/t/rpl_ndb_dd_advance.test
@@ -385,12 +385,12 @@ while ($j)
--connection slave
STOP SLAVE;
RESET SLAVE;
-DROP PROCEDURE tpcb.load;
-DROP PROCEDURE tpcb.trans;
-DROP TABLE tpcb.account;
-DROP TABLE tpcb.teller;
-DROP TABLE tpcb.branch;
-DROP TABLE tpcb.history;
+DROP PROCEDURE IF EXISTS tpcb.load;
+DROP PROCEDURE IF EXISTS tpcb.trans;
+DROP TABLE IF EXISTS tpcb.account;
+DROP TABLE IF EXISTS tpcb.teller;
+DROP TABLE IF EXISTS tpcb.branch;
+DROP TABLE IF EXISTS tpcb.history;
DROP DATABASE tpcb;
ALTER TABLESPACE ts1
@@ -534,8 +534,8 @@ SELECT COUNT(*) FROM history;
--echo *************** TEST 2 CLEANUP SECTION ********************
connection master;
-DROP PROCEDURE tpcb.load;
-DROP PROCEDURE tpcb.trans;
+DROP PROCEDURE IF EXISTS tpcb.load;
+DROP PROCEDURE IF EXISTS tpcb.trans;
DROP TABLE tpcb.account;
DROP TABLE tpcb.teller;
DROP TABLE tpcb.branch;
diff --git a/mysql-test/t/rpl_ndb_ddl.test b/mysql-test/t/rpl_ndb_ddl.test
index b3d32232518..0c503e56c9c 100644
--- a/mysql-test/t/rpl_ndb_ddl.test
+++ b/mysql-test/t/rpl_ndb_ddl.test
@@ -31,4 +31,5 @@
--source include/have_ndb.inc
--source include/master-slave.inc
let $engine_type= "NDB";
--- source extra/rpl_tests/rpl_ddl.test
+-- source extra/rpl_tests/rpl_ndb_ddl.test
+
diff --git a/mysql-test/t/rpl_ndb_extraCol.test b/mysql-test/t/rpl_ndb_extraCol.test
new file mode 100644
index 00000000000..cf0501c490a
--- /dev/null
+++ b/mysql-test/t/rpl_ndb_extraCol.test
@@ -0,0 +1,13 @@
+###########################################
+# Author: Jeb
+# Date: 2006-09-08
+# Purpose: Wapper for rpl_extraSlave_Col.test
+# Using NDB
+###########################################
+-- source include/have_binlog_format_row.inc
+--source include/have_ndb.inc
+-- source include/master-slave.inc
+let $engine_type = 'NDB';
+-- source extra/rpl_tests/rpl_extraSlave_Col.test
+
+
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index fa3ddd28489..7175db1db4e 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -2959,3 +2959,22 @@ DROP TABLE t1;
--echo End of 5.0 tests.
+
+#
+# Bug#21370 View renaming lacks tablename_to_filename encoding
+#
+--disable_warnings
+DROP DATABASE IF EXISTS `d-1`;
+--enable_warnings
+CREATE DATABASE `d-1`;
+USE `d-1`;
+CREATE TABLE `t-1` (c1 INT);
+CREATE VIEW `v-1` AS SELECT c1 FROM `t-1`;
+SHOW TABLES;
+RENAME TABLE `t-1` TO `t-2`;
+RENAME TABLE `v-1` TO `v-2`;
+SHOW TABLES;
+DROP TABLE `t-2`;
+DROP VIEW `v-2`;
+DROP DATABASE `d-1`;
+USE test;
diff --git a/mysql-test/t/xml.test b/mysql-test/t/xml.test
index 3347573b4b7..ef94c7508c4 100644
--- a/mysql-test/t/xml.test
+++ b/mysql-test/t/xml.test
@@ -376,3 +376,33 @@ select extractValue('<:>test</:>','//*');
select extractValue('<_>test</_>','//*');
# dot, dash, underscore and semicolon are good identifier middle characters
select extractValue('<x.-_:>test</x.-_:>','//*');
+
+#
+# Bug#22823 gt and lt operators appear to be
+# reversed in ExtractValue() command
+#
+set @xml= "<entry><id>pt10</id><pt>10</pt></entry><entry><id>pt50</id><pt>50</pt></entry>";
+select ExtractValue(@xml, "/entry[(pt=10)]/id");
+select ExtractValue(@xml, "/entry[(pt!=10)]/id");
+select ExtractValue(@xml, "/entry[(pt<10)]/id");
+select ExtractValue(@xml, "/entry[(pt<=10)]/id");
+select ExtractValue(@xml, "/entry[(pt>10)]/id");
+select ExtractValue(@xml, "/entry[(pt>=10)]/id");
+select ExtractValue(@xml, "/entry[(pt=50)]/id");
+select ExtractValue(@xml, "/entry[(pt!=50)]/id");
+select ExtractValue(@xml, "/entry[(pt<50)]/id");
+select ExtractValue(@xml, "/entry[(pt<=50)]/id");
+select ExtractValue(@xml, "/entry[(pt>50)]/id");
+select ExtractValue(@xml, "/entry[(pt>=50)]/id");
+select ExtractValue(@xml, "/entry[(10=pt)]/id");
+select ExtractValue(@xml, "/entry[(10!=pt)]/id");
+select ExtractValue(@xml, "/entry[(10>pt)]/id");
+select ExtractValue(@xml, "/entry[(10>=pt)]/id");
+select ExtractValue(@xml, "/entry[(10<pt)]/id");
+select ExtractValue(@xml, "/entry[(10<=pt)]/id");
+select ExtractValue(@xml, "/entry[(50=pt)]/id");
+select ExtractValue(@xml, "/entry[(50!=pt)]/id");
+select ExtractValue(@xml, "/entry[(50>pt)]/id");
+select ExtractValue(@xml, "/entry[(50>=pt)]/id");
+select ExtractValue(@xml, "/entry[(50<pt)]/id");
+select ExtractValue(@xml, "/entry[(50<=pt)]/id");