summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorAlexey Kopytov <Alexey.Kopytov@Sun.com>2010-05-24 00:41:18 +0400
committerAlexey Kopytov <Alexey.Kopytov@Sun.com>2010-05-24 00:41:18 +0400
commit598cf5aec7c7cf4dbb158c87d80916b6e58e7ae6 (patch)
treef4f37b22f4271c44aa03c55abe609a058828bedc /mysql-test
parentdabd4a1c55cabbe73350c7c9b4c2bd6ab2db2b5c (diff)
parentd72a4710aaad2f1e76ac20d50793f13f941ef899 (diff)
downloadmariadb-git-598cf5aec7c7cf4dbb158c87d80916b6e58e7ae6.tar.gz
Manual merge of mysql-5.1-bugteam to mysql-trunk-merge.
Conflicts: conflict Makefile.am conflict mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result conflict mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test conflict sql/opt_sum.cc conflict sql/set_var.cc conflict sql/sql_base.cc conflict sql/sql_priv.h conflict sql/sql_show.cc
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/extra/binlog_tests/mix_innodb_myisam_side_effects.test2
-rw-r--r--mysql-test/extra/rpl_tests/rpl_record_compare.test68
-rw-r--r--mysql-test/r/delete.result9
-rw-r--r--mysql-test/r/group_by.result20
-rw-r--r--mysql-test/r/log_state.result33
-rw-r--r--mysql-test/r/renamedb.result2
-rw-r--r--mysql-test/r/upgrade.result28
-rw-r--r--mysql-test/r/variables_debug.result2
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result4
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_rec_comp_innodb.result46
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_rec_comp_myisam.result60
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result32
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_rec_comp_innodb.test10
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_rec_comp_myisam.test31
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_mixing_engines.test38
-rw-r--r--mysql-test/suite/rpl_ndb/my.cnf4
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_stm_innodb.result1
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb.test4
-rw-r--r--mysql-test/t/delete.test12
-rw-r--r--mysql-test/t/group_by.test15
-rw-r--r--mysql-test/t/log_state.test38
-rw-r--r--mysql-test/t/mysqldump.test1
-rw-r--r--mysql-test/t/renamedb.test2
-rw-r--r--mysql-test/t/upgrade.test34
-rw-r--r--mysql-test/t/variables_debug.test3
26 files changed, 494 insertions, 7 deletions
diff --git a/mysql-test/extra/binlog_tests/mix_innodb_myisam_side_effects.test b/mysql-test/extra/binlog_tests/mix_innodb_myisam_side_effects.test
index 26a70c4319e..68aa949a7c7 100644
--- a/mysql-test/extra/binlog_tests/mix_innodb_myisam_side_effects.test
+++ b/mysql-test/extra/binlog_tests/mix_innodb_myisam_side_effects.test
@@ -214,7 +214,7 @@ CREATE TABLE t5 (a int, PRIMARY KEY (a)) ENGINE=InnoDB;
# execute
--error ER_DUP_ENTRY
- UPDATE t3,t4 SET t3.a=t4.a + bug27417(1);
+ UPDATE t3,t4 SET t3.a = t4.a + bug27417(1) where t3.a = 1;
# check
select count(*) from t1 /* must be 1 */;
diff --git a/mysql-test/extra/rpl_tests/rpl_record_compare.test b/mysql-test/extra/rpl_tests/rpl_record_compare.test
new file mode 100644
index 00000000000..dc27dcb1f9d
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_record_compare.test
@@ -0,0 +1,68 @@
+
+#
+# BUG#52868: Wrong handling of NULL value during update, replication out of sync
+#
+-- echo ## case #1 - last_null_bit_pos==0 in record_compare without X bit
+
+-- source include/master-slave-reset.inc
+-- connection master
+
+-- eval CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bigint(20) DEFAULT 0, c3 bigint(20) DEFAULT 0, c4 varchar(1) DEFAULT '', c5 bigint(20) DEFAULT 0, c6 bigint(20) DEFAULT 0, c7 bigint(20) DEFAULT 0, c8 bigint(20) DEFAULT 0) ENGINE=$engine DEFAULT CHARSET=latin1
+
+INSERT INTO t1 ( c5, c6 ) VALUES ( 1 , 35 );
+INSERT INTO t1 ( c5, c6 ) VALUES ( NULL, 35 );
+-- disable_warnings
+UPDATE t1 SET c5 = 'a';
+-- enable_warnings
+-- sync_slave_with_master
+
+-- let $diff_table_1= master:test.t1
+-- let $diff_table_2= slave:test.t1
+-- source include/diff_tables.inc
+
+--connection master
+DROP TABLE t1;
+-- sync_slave_with_master
+
+-- echo ## case #1.1 - last_null_bit_pos==0 in record_compare with X bit
+-- echo ## (1 column less and no varchar)
+-- source include/master-slave-reset.inc
+-- connection master
+
+-- eval CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bigint(20) DEFAULT 0, c3 bigint(20) DEFAULT 0, c4 bigint(20) DEFAULT 0, c5 bigint(20) DEFAULT 0, c6 bigint(20) DEFAULT 0, c7 bigint(20) DEFAULT 0) ENGINE=$engine DEFAULT CHARSET=latin1
+
+INSERT INTO t1 ( c5, c6 ) VALUES ( 1 , 35 );
+INSERT INTO t1 ( c5, c6 ) VALUES ( NULL, 35 );
+-- disable_warnings
+UPDATE t1 SET c5 = 'a';
+-- enable_warnings
+-- sync_slave_with_master
+
+-- let $diff_table_1= master:test.t1
+-- let $diff_table_2= slave:test.t1
+-- source include/diff_tables.inc
+
+--connection master
+DROP TABLE t1;
+-- sync_slave_with_master
+
+-- echo ## case #2 - X bit is wrongly set.
+
+-- source include/master-slave-reset.inc
+-- connection master
+
+-- eval CREATE TABLE t1 (c1 int, c2 varchar(1) default '') ENGINE=$engine DEFAULT CHARSET= latin1
+INSERT INTO t1(c1) VALUES (10);
+INSERT INTO t1(c1) VALUES (NULL);
+UPDATE t1 SET c1= 0;
+-- sync_slave_with_master
+
+-- let $diff_table_1= master:test.t1
+-- let $diff_table_2= slave:test.t1
+-- source include/diff_tables.inc
+
+-- connection master
+DROP TABLE t1;
+-- sync_slave_with_master
+
+
diff --git a/mysql-test/r/delete.result b/mysql-test/r/delete.result
index 733614b765a..0c9b0d7d2e5 100644
--- a/mysql-test/r/delete.result
+++ b/mysql-test/r/delete.result
@@ -490,4 +490,13 @@ END |
DELETE IGNORE FROM t1;
ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
DROP TABLE t1;
+#
+# Bug #53450: Crash/assertion
+# "virtual int ha_myisam::index_first(uchar*)") at assert.c:81
+#
+CREATE TABLE t1 (a INT, b INT, c INT,
+INDEX(a), INDEX(b), INDEX(c));
+INSERT INTO t1 VALUES (1,2,3), (4,5,6), (7,8,9);
+DELETE FROM t1 WHERE a = 10 OR b = 20 ORDER BY c LIMIT 1;
+DROP TABLE t1;
End of 5.1 tests
diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result
index 9d16e0fb3c5..cdf48376fb0 100644
--- a/mysql-test/r/group_by.result
+++ b/mysql-test/r/group_by.result
@@ -1791,4 +1791,24 @@ aa b COUNT( b)
1 10 1
DROP TABLE t1, t2;
#
+# Bug#52051: Aggregate functions incorrectly returns NULL from outer
+# join query
+#
+CREATE TABLE t1 (a INT PRIMARY KEY);
+CREATE TABLE t2 (a INT PRIMARY KEY);
+INSERT INTO t2 VALUES (1), (2);
+EXPLAIN SELECT MIN(t2.a) FROM t2 LEFT JOIN t1 ON t2.a = t1.a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
+SELECT MIN(t2.a) FROM t2 LEFT JOIN t1 ON t2.a = t1.a;
+MIN(t2.a)
+1
+EXPLAIN SELECT MAX(t2.a) FROM t2 LEFT JOIN t1 ON t2.a = t1.a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
+SELECT MAX(t2.a) FROM t2 LEFT JOIN t1 ON t2.a = t1.a;
+MAX(t2.a)
+2
+DROP TABLE t1, t2;
+#
# End of 5.1 tests
diff --git a/mysql-test/r/log_state.result b/mysql-test/r/log_state.result
index 56e30ac59f8..714a14c1f4f 100644
--- a/mysql-test/r/log_state.result
+++ b/mysql-test/r/log_state.result
@@ -308,6 +308,37 @@ SET @@global.general_log = @old_general_log;
SET @@global.general_log_file = @old_general_log_file;
SET @@global.slow_query_log = @old_slow_query_log;
SET @@global.slow_query_log_file = @old_slow_query_log_file;
+#
+# Bug #49756 Rows_examined is always 0 in the slow query log
+# for update statements
+#
+SET @old_log_output = @@global.log_output;
+SET GLOBAL log_output = "TABLE";
+SET GLOBAL slow_query_log = ON;
+SET GLOBAL long_query_time = 0.001;
+TRUNCATE TABLE mysql.slow_log;
+CREATE TABLE t1 (a INT);
+CREATE TABLE t2 (b INT, PRIMARY KEY (b));
+INSERT INTO t2 VALUES (3),(4);
+INSERT INTO t1 VALUES (1+sleep(.01)),(2);
+INSERT INTO t1 SELECT b+sleep(.01) from t2;
+UPDATE t1 SET a=a+sleep(.01) WHERE a>2;
+UPDATE t1 SET a=a+sleep(.01) ORDER BY a DESC;
+UPDATE t2 set b=b+sleep(.01) limit 1;
+UPDATE t1 SET a=a+sleep(.01) WHERE a in (SELECT b from t2);
+DELETE FROM t1 WHERE a=a+sleep(.01) ORDER BY a LIMIT 2;
+SELECT rows_examined,sql_text FROM mysql.slow_log;
+rows_examined sql_text
+0 INSERT INTO t1 VALUES (1+sleep(.01)),(2)
+2 INSERT INTO t1 SELECT b+sleep(.01) from t2
+4 UPDATE t1 SET a=a+sleep(.01) WHERE a>2
+8 UPDATE t1 SET a=a+sleep(.01) ORDER BY a DESC
+2 UPDATE t2 set b=b+sleep(.01) limit 1
+4 UPDATE t1 SET a=a+sleep(.01) WHERE a in (SELECT b from t2)
+6 DELETE FROM t1 WHERE a=a+sleep(.01) ORDER BY a LIMIT 2
+DROP TABLE t1,t2;
+TRUNCATE TABLE mysql.slow_log;
+# end of bug#49756
End of 5.1 tests
# --
@@ -334,6 +365,8 @@ SELECT @@general_log_file = @my_glf;
1
SET GLOBAL general_log_file = @old_general_log_file;
# Close connection con1
+SET GLOBAL long_query_time = DEFAULT;
+SET GLOBAL log_output = @old_log_output;
SET global general_log = @old_general_log;
SET global general_log_file = @old_general_log_file;
SET global slow_query_log = @old_slow_query_log;
diff --git a/mysql-test/r/renamedb.result b/mysql-test/r/renamedb.result
index ff8f89592fc..e77aca0d0b7 100644
--- a/mysql-test/r/renamedb.result
+++ b/mysql-test/r/renamedb.result
@@ -7,6 +7,6 @@ ERROR HY000: Incorrect usage of ALTER DATABASE UPGRADE DATA DIRECTORY NAME and n
ALTER DATABASE `#mysql51#not-yet` UPGRADE DATA DIRECTORY NAME;
ERROR HY000: Incorrect usage of ALTER DATABASE UPGRADE DATA DIRECTORY NAME and name
ALTER DATABASE `#mysql50#` UPGRADE DATA DIRECTORY NAME;
-ERROR HY000: Incorrect usage of ALTER DATABASE UPGRADE DATA DIRECTORY NAME and name
+ERROR 42000: Incorrect database name '#mysql50#'
ALTER DATABASE `#mysql50#upgrade-me` UPGRADE DATA DIRECTORY NAME;
ERROR 42000: Unknown database '#mysql50#upgrade-me'
diff --git a/mysql-test/r/upgrade.result b/mysql-test/r/upgrade.result
index 034242079b1..da2f55b5bb1 100644
--- a/mysql-test/r/upgrade.result
+++ b/mysql-test/r/upgrade.result
@@ -112,3 +112,31 @@ select * from `a-b-c`.v1;
f1
drop database `a-b-c`;
use test;
+# End of 5.0 tests
+#
+# Bug #53804: serious flaws in the alter database .. upgrade data
+# directory name command
+#
+ALTER DATABASE `#mysql50#:` UPGRADE DATA DIRECTORY NAME;
+ERROR 42000: Unknown database '#mysql50#:'
+ALTER DATABASE `#mysql50#.` UPGRADE DATA DIRECTORY NAME;
+ERROR 42000: Incorrect database name '#mysql50#.'
+ALTER DATABASE `#mysql50#../` UPGRADE DATA DIRECTORY NAME;
+ERROR 42000: Incorrect database name '#mysql50#../'
+ALTER DATABASE `#mysql50#../..` UPGRADE DATA DIRECTORY NAME;
+ERROR 42000: Incorrect database name '#mysql50#../..'
+ALTER DATABASE `#mysql50#../../` UPGRADE DATA DIRECTORY NAME;
+ERROR 42000: Incorrect database name '#mysql50#../../'
+ALTER DATABASE `#mysql50#./blablabla` UPGRADE DATA DIRECTORY NAME;
+ERROR 42000: Incorrect database name '#mysql50#./blablabla'
+ALTER DATABASE `#mysql50#../blablabla` UPGRADE DATA DIRECTORY NAME;
+ERROR 42000: Incorrect database name '#mysql50#../blablabla'
+ALTER DATABASE `#mysql50#/` UPGRADE DATA DIRECTORY NAME;
+ERROR 42000: Incorrect database name '#mysql50#/'
+ALTER DATABASE `#mysql50#/.` UPGRADE DATA DIRECTORY NAME;
+ERROR 42000: Incorrect database name '#mysql50#/.'
+USE `#mysql50#.`;
+ERROR 42000: Incorrect database name '#mysql50#.'
+USE `#mysql50#../blablabla`;
+ERROR 42000: Incorrect database name '#mysql50#../blablabla'
+# End of 5.1 tests
diff --git a/mysql-test/r/variables_debug.result b/mysql-test/r/variables_debug.result
index 11cbef7fa5b..a02d285b15b 100644
--- a/mysql-test/r/variables_debug.result
+++ b/mysql-test/r/variables_debug.result
@@ -1,3 +1,4 @@
+SET @old_debug = @@GLOBAL.debug;
set debug= 'T';
select @@debug;
@@debug
@@ -29,4 +30,5 @@ SET GLOBAL debug='';
SELECT @@global.debug;
@@global.debug
+SET GLOBAL debug=@old_debug;
End of 5.1 tests
diff --git a/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result b/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result
index e71ec5cb8b3..6643c4557c2 100644
--- a/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result
+++ b/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result
@@ -848,11 +848,11 @@ delete from t4;
insert into t3 values (1,1),(2,2);
insert into t4 values (1,1),(2,2);
reset master;
-UPDATE t3,t4 SET t3.a=t4.a + bug27417(1);
+UPDATE t3,t4 SET t3.a = t4.a + bug27417(1) where t3.a = 1;
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
select count(*) from t1 /* must be 1 */;
count(*)
-2
+1
drop table t4;
delete from t1;
delete from t2;
diff --git a/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result b/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result
index eb8327558b7..cea3819cad3 100644
--- a/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result
+++ b/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result
@@ -886,7 +886,7 @@ delete from t4;
insert into t3 values (1,1),(2,2);
insert into t4 values (1,1),(2,2);
reset master;
-UPDATE t3,t4 SET t3.a=t4.a + bug27417(1);
+UPDATE t3,t4 SET t3.a = t4.a + bug27417(1) where t3.a = 1;
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
select count(*) from t1 /* must be 1 */;
count(*)
diff --git a/mysql-test/suite/rpl/r/rpl_row_rec_comp_innodb.result b/mysql-test/suite/rpl/r/rpl_row_rec_comp_innodb.result
new file mode 100644
index 00000000000..c461cafbd7c
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_row_rec_comp_innodb.result
@@ -0,0 +1,46 @@
+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;
+## case #1 - last_null_bit_pos==0 in record_compare without X bit
+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;
+CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bigint(20) DEFAULT 0, c3 bigint(20) DEFAULT 0, c4 varchar(1) DEFAULT '', c5 bigint(20) DEFAULT 0, c6 bigint(20) DEFAULT 0, c7 bigint(20) DEFAULT 0, c8 bigint(20) DEFAULT 0) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+INSERT INTO t1 ( c5, c6 ) VALUES ( 1 , 35 );
+INSERT INTO t1 ( c5, c6 ) VALUES ( NULL, 35 );
+UPDATE t1 SET c5 = 'a';
+Comparing tables master:test.t1 and slave:test.t1
+DROP TABLE t1;
+## case #1.1 - last_null_bit_pos==0 in record_compare with X bit
+## (1 column less and no varchar)
+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;
+CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bigint(20) DEFAULT 0, c3 bigint(20) DEFAULT 0, c4 bigint(20) DEFAULT 0, c5 bigint(20) DEFAULT 0, c6 bigint(20) DEFAULT 0, c7 bigint(20) DEFAULT 0) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+INSERT INTO t1 ( c5, c6 ) VALUES ( 1 , 35 );
+INSERT INTO t1 ( c5, c6 ) VALUES ( NULL, 35 );
+UPDATE t1 SET c5 = 'a';
+Comparing tables master:test.t1 and slave:test.t1
+DROP TABLE t1;
+## case #2 - X bit is wrongly set.
+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;
+CREATE TABLE t1 (c1 int, c2 varchar(1) default '') ENGINE=InnoDB DEFAULT CHARSET= latin1;
+INSERT INTO t1(c1) VALUES (10);
+INSERT INTO t1(c1) VALUES (NULL);
+UPDATE t1 SET c1= 0;
+Comparing tables master:test.t1 and slave:test.t1
+DROP TABLE t1;
diff --git a/mysql-test/suite/rpl/r/rpl_row_rec_comp_myisam.result b/mysql-test/suite/rpl/r/rpl_row_rec_comp_myisam.result
new file mode 100644
index 00000000000..38fbe486d2e
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_row_rec_comp_myisam.result
@@ -0,0 +1,60 @@
+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;
+## case #1 - last_null_bit_pos==0 in record_compare without X bit
+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;
+CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bigint(20) DEFAULT 0, c3 bigint(20) DEFAULT 0, c4 varchar(1) DEFAULT '', c5 bigint(20) DEFAULT 0, c6 bigint(20) DEFAULT 0, c7 bigint(20) DEFAULT 0, c8 bigint(20) DEFAULT 0) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+INSERT INTO t1 ( c5, c6 ) VALUES ( 1 , 35 );
+INSERT INTO t1 ( c5, c6 ) VALUES ( NULL, 35 );
+UPDATE t1 SET c5 = 'a';
+Comparing tables master:test.t1 and slave:test.t1
+DROP TABLE t1;
+## case #1.1 - last_null_bit_pos==0 in record_compare with X bit
+## (1 column less and no varchar)
+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;
+CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bigint(20) DEFAULT 0, c3 bigint(20) DEFAULT 0, c4 bigint(20) DEFAULT 0, c5 bigint(20) DEFAULT 0, c6 bigint(20) DEFAULT 0, c7 bigint(20) DEFAULT 0) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+INSERT INTO t1 ( c5, c6 ) VALUES ( 1 , 35 );
+INSERT INTO t1 ( c5, c6 ) VALUES ( NULL, 35 );
+UPDATE t1 SET c5 = 'a';
+Comparing tables master:test.t1 and slave:test.t1
+DROP TABLE t1;
+## case #2 - X bit is wrongly set.
+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;
+CREATE TABLE t1 (c1 int, c2 varchar(1) default '') ENGINE=MyISAM DEFAULT CHARSET= latin1;
+INSERT INTO t1(c1) VALUES (10);
+INSERT INTO t1(c1) VALUES (NULL);
+UPDATE t1 SET c1= 0;
+Comparing tables master:test.t1 and slave:test.t1
+DROP TABLE t1;
+## coverage purposes - Field_bits
+## 1 X bit + 2 Null bits + 5 bits => last_null_bit_pos==0
+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;
+CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bit(5)) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+INSERT INTO t1(c1,c2) VALUES (10, b'1');
+INSERT INTO t1(c1,c2) VALUES (NULL, b'1');
+UPDATE t1 SET c1= 0;
+Comparing tables master:test.t1 and slave:test.t1
+DROP TABLE t1;
diff --git a/mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result b/mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result
index b2c6c15d7e6..6db3642f3b5 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result
@@ -11314,3 +11314,35 @@ master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS tt_xx_1
###################################################################################
# CLEAN
###################################################################################
+DROP TABLE tt_1;
+DROP TABLE tt_2;
+DROP TABLE tt_3;
+DROP TABLE tt_4;
+DROP TABLE nt_1;
+DROP TABLE nt_2;
+DROP TABLE nt_3;
+DROP TABLE nt_4;
+DROP PROCEDURE pc_i_tt_3;
+DROP FUNCTION f1;
+DROP FUNCTION f2;
+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;
+CREATE TABLE `t1` (
+`c1` int(10) unsigned NOT NULL AUTO_INCREMENT,
+`c2` tinyint(1) unsigned DEFAULT NULL,
+`c3` varchar(300) DEFAULT NULL,
+`c4` int(10) unsigned NOT NULL,
+`c5` int(10) unsigned DEFAULT NULL,
+PRIMARY KEY (`c1`)) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+ALTER TABLE `t1` Engine=InnoDB;
+SET AUTOCOMMIT=0;
+INSERT INTO t1 (c1,c2,c3,c4,c5) VALUES (1, 1, 'X', 1, NULL);
+COMMIT;
+ROLLBACK;
+SET AUTOCOMMIT=1;
+Comparing tables master:test.t1 and slave:test.t1
+DROP TABLE `t1`;
diff --git a/mysql-test/suite/rpl/t/rpl_row_rec_comp_innodb.test b/mysql-test/suite/rpl/t/rpl_row_rec_comp_innodb.test
new file mode 100644
index 00000000000..67e4c4fb14d
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_rec_comp_innodb.test
@@ -0,0 +1,10 @@
+-- source include/have_binlog_format_row.inc
+-- source include/master-slave.inc
+-- source include/have_innodb.inc
+
+#
+# BUG#52868 Wrong handling of NULL value during update, replication out of sync
+#
+
+-- let $engine= InnoDB
+-- source extra/rpl_tests/rpl_record_compare.test
diff --git a/mysql-test/suite/rpl/t/rpl_row_rec_comp_myisam.test b/mysql-test/suite/rpl/t/rpl_row_rec_comp_myisam.test
new file mode 100644
index 00000000000..43fa99a51da
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_rec_comp_myisam.test
@@ -0,0 +1,31 @@
+-- source include/have_binlog_format_row.inc
+-- source include/master-slave.inc
+
+#
+# BUG#52868 Wrong handling of NULL value during update, replication out of sync
+#
+
+-- let $engine= MyISAM
+-- source extra/rpl_tests/rpl_record_compare.test
+
+-- echo ## coverage purposes - Field_bits
+-- echo ## 1 X bit + 2 Null bits + 5 bits => last_null_bit_pos==0
+## Added here because AFAIK it's only MyISAM and NDB that use Field_bits
+
+-- source include/master-slave-reset.inc
+-- connection master
+
+-- eval CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bit(5)) ENGINE=$engine DEFAULT CHARSET=latin1
+
+INSERT INTO t1(c1,c2) VALUES (10, b'1');
+INSERT INTO t1(c1,c2) VALUES (NULL, b'1');
+UPDATE t1 SET c1= 0;
+-- sync_slave_with_master
+
+-- let $diff_table_1= master:test.t1
+-- let $diff_table_2= slave:test.t1
+-- source include/diff_tables.inc
+
+-- connection master
+DROP TABLE t1;
+-- sync_slave_with_master
diff --git a/mysql-test/suite/rpl/t/rpl_stm_mixing_engines.test b/mysql-test/suite/rpl/t/rpl_stm_mixing_engines.test
index 39a9522bf6c..f32ab1f01f0 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_mixing_engines.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_mixing_engines.test
@@ -8,3 +8,41 @@
let $engine_type=Innodb;
--source extra/rpl_tests/rpl_mixing_engines.test
+
+#
+# BUG#49522: Replication problem with mixed MyISAM/InnoDB
+#
+
+-- source include/master-slave-reset.inc
+-- connection master
+
+CREATE TABLE `t1` (
+ `c1` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ `c2` tinyint(1) unsigned DEFAULT NULL,
+ `c3` varchar(300) DEFAULT NULL,
+ `c4` int(10) unsigned NOT NULL,
+ `c5` int(10) unsigned DEFAULT NULL,
+ PRIMARY KEY (`c1`)) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+
+-- sync_slave_with_master
+ALTER TABLE `t1` Engine=InnoDB;
+
+-- connection master
+SET AUTOCOMMIT=0;
+
+INSERT INTO t1 (c1,c2,c3,c4,c5) VALUES (1, 1, 'X', 1, NULL);
+COMMIT;
+ROLLBACK;
+SET AUTOCOMMIT=1;
+
+-- sync_slave_with_master
+
+-- let $diff_table_1=master:test.t1
+-- let $diff_table_2=slave:test.t1
+-- source include/diff_tables.inc
+
+-- connection master
+DROP TABLE `t1`;
+-- sync_slave_with_master
+
+-- source include/master-slave-end.inc
diff --git a/mysql-test/suite/rpl_ndb/my.cnf b/mysql-test/suite/rpl_ndb/my.cnf
index 191683fc9df..0c62988b220 100644
--- a/mysql-test/suite/rpl_ndb/my.cnf
+++ b/mysql-test/suite/rpl_ndb/my.cnf
@@ -19,6 +19,8 @@ mysqld=
ndbcluster
# Turn on bin logging
log-bin= master-bin
+# Cluster only supports row format
+binlog-format= row
[mysqld.1.1]
@@ -32,6 +34,8 @@ log-bin= master-bin
log-bin= slave-bin
relay-log= slave-relay-bin
+# Cluster only supports row format
+binlog-format= row
init-rpl-role= slave
log-slave-updates
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_stm_innodb.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_stm_innodb.result
index 675a69d17a4..5327bfde7e0 100644
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_stm_innodb.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_stm_innodb.result
@@ -4,6 +4,7 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
+SET binlog_format = STATEMENT;
*** Test 1 ***
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb.test
index 0d915b0aa00..5e54ca38dc1 100644
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb.test
@@ -27,9 +27,11 @@
--disable_query_log
--source include/have_ndb.inc
--source include/have_innodb.inc
---source include/have_binlog_format_statement.inc
--source include/ndb_master-slave.inc
--enable_query_log
+
+# statement format is supported because master uses innodb
+SET binlog_format = STATEMENT;
let $off_set = 6;
let $rpl_format = 'SBR';
disable_query_log;
diff --git a/mysql-test/t/delete.test b/mysql-test/t/delete.test
index acd67e0e766..a21fff60d33 100644
--- a/mysql-test/t/delete.test
+++ b/mysql-test/t/delete.test
@@ -527,5 +527,17 @@ DELETE IGNORE FROM t1;
DROP TABLE t1;
+--echo #
+--echo # Bug #53450: Crash/assertion
+--echo # "virtual int ha_myisam::index_first(uchar*)") at assert.c:81
+--echo #
+
+CREATE TABLE t1 (a INT, b INT, c INT,
+ INDEX(a), INDEX(b), INDEX(c));
+INSERT INTO t1 VALUES (1,2,3), (4,5,6), (7,8,9);
+
+DELETE FROM t1 WHERE a = 10 OR b = 20 ORDER BY c LIMIT 1;
+
+DROP TABLE t1;
--echo End of 5.1 tests
diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test
index 4f92ff65177..f90c1dc3c58 100644
--- a/mysql-test/t/group_by.test
+++ b/mysql-test/t/group_by.test
@@ -1206,6 +1206,21 @@ SELECT (SELECT t2.a FROM t2 WHERE t2.a = t1.a) aa, b, COUNT( b)
DROP TABLE t1, t2;
+
+--echo #
+--echo # Bug#52051: Aggregate functions incorrectly returns NULL from outer
+--echo # join query
+--echo #
+CREATE TABLE t1 (a INT PRIMARY KEY);
+CREATE TABLE t2 (a INT PRIMARY KEY);
+INSERT INTO t2 VALUES (1), (2);
+EXPLAIN SELECT MIN(t2.a) FROM t2 LEFT JOIN t1 ON t2.a = t1.a;
+SELECT MIN(t2.a) FROM t2 LEFT JOIN t1 ON t2.a = t1.a;
+EXPLAIN SELECT MAX(t2.a) FROM t2 LEFT JOIN t1 ON t2.a = t1.a;
+SELECT MAX(t2.a) FROM t2 LEFT JOIN t1 ON t2.a = t1.a;
+DROP TABLE t1, t2;
+
+
--echo #
--echo # End of 5.1 tests
diff --git a/mysql-test/t/log_state.test b/mysql-test/t/log_state.test
index 4d8c8fc6e74..d47044fbbee 100644
--- a/mysql-test/t/log_state.test
+++ b/mysql-test/t/log_state.test
@@ -313,6 +313,42 @@ SET @@global.general_log_file = @old_general_log_file;
SET @@global.slow_query_log = @old_slow_query_log;
SET @@global.slow_query_log_file = @old_slow_query_log_file;
+###########################################################################
+
+--echo #
+--echo # Bug #49756 Rows_examined is always 0 in the slow query log
+--echo # for update statements
+--echo #
+
+SET @old_log_output = @@global.log_output;
+SET GLOBAL log_output = "TABLE";
+SET GLOBAL slow_query_log = ON;
+SET GLOBAL long_query_time = 0.001;
+
+# clear slow_log of any residual slow queries
+TRUNCATE TABLE mysql.slow_log;
+CREATE TABLE t1 (a INT);
+CREATE TABLE t2 (b INT, PRIMARY KEY (b));
+INSERT INTO t2 VALUES (3),(4);
+
+connect (con2,localhost,root,,);
+INSERT INTO t1 VALUES (1+sleep(.01)),(2);
+INSERT INTO t1 SELECT b+sleep(.01) from t2;
+UPDATE t1 SET a=a+sleep(.01) WHERE a>2;
+UPDATE t1 SET a=a+sleep(.01) ORDER BY a DESC;
+UPDATE t2 set b=b+sleep(.01) limit 1;
+UPDATE t1 SET a=a+sleep(.01) WHERE a in (SELECT b from t2);
+DELETE FROM t1 WHERE a=a+sleep(.01) ORDER BY a LIMIT 2;
+
+SELECT rows_examined,sql_text FROM mysql.slow_log;
+disconnect con2;
+connection default;
+DROP TABLE t1,t2;
+TRUNCATE TABLE mysql.slow_log;
+
+--echo # end of bug#49756
+
+
--echo End of 5.1 tests
@@ -361,6 +397,8 @@ disconnect con1;
connection default;
# Reset global system variables to initial values if forgotten somewhere above.
+SET GLOBAL long_query_time = DEFAULT;
+SET GLOBAL log_output = @old_log_output;
SET global general_log = @old_general_log;
SET global general_log_file = @old_general_log_file;
SET global slow_query_log = @old_slow_query_log;
diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test
index d1dc8445861..952a3f94fb2 100644
--- a/mysql-test/t/mysqldump.test
+++ b/mysql-test/t/mysqldump.test
@@ -1988,6 +1988,7 @@ drop table if exists `load`;
create table `load` (a varchar(255));
--copy_file std_data/words.dat $MYSQLTEST_VARDIR/tmp/load.txt
+--chmod 0644 $MYSQLTEST_VARDIR/tmp/load.txt
--exec $MYSQL_IMPORT --ignore test $MYSQLTEST_VARDIR/tmp/load.txt
diff --git a/mysql-test/t/renamedb.test b/mysql-test/t/renamedb.test
index 84315090b7a..71d0c127058 100644
--- a/mysql-test/t/renamedb.test
+++ b/mysql-test/t/renamedb.test
@@ -44,7 +44,7 @@ ALTER DATABASE `#mysql41#not-supported` UPGRADE DATA DIRECTORY NAME;
--error ER_WRONG_USAGE
ALTER DATABASE `#mysql51#not-yet` UPGRADE DATA DIRECTORY NAME;
---error ER_WRONG_USAGE
+--error ER_WRONG_DB_NAME
ALTER DATABASE `#mysql50#` UPGRADE DATA DIRECTORY NAME;
--error ER_BAD_DB_ERROR
diff --git a/mysql-test/t/upgrade.test b/mysql-test/t/upgrade.test
index e390e8a1253..a7b9a1531ff 100644
--- a/mysql-test/t/upgrade.test
+++ b/mysql-test/t/upgrade.test
@@ -137,3 +137,37 @@ select * from `a-b-c`.v1;
--enable_ps_protocol
drop database `a-b-c`;
use test;
+
+--echo # End of 5.0 tests
+
+--echo #
+--echo # Bug #53804: serious flaws in the alter database .. upgrade data
+--echo # directory name command
+--echo #
+
+--error ER_BAD_DB_ERROR
+ALTER DATABASE `#mysql50#:` UPGRADE DATA DIRECTORY NAME;
+--error ER_WRONG_DB_NAME
+ALTER DATABASE `#mysql50#.` UPGRADE DATA DIRECTORY NAME;
+--error ER_WRONG_DB_NAME
+ALTER DATABASE `#mysql50#../` UPGRADE DATA DIRECTORY NAME;
+--error ER_WRONG_DB_NAME
+ALTER DATABASE `#mysql50#../..` UPGRADE DATA DIRECTORY NAME;
+--error ER_WRONG_DB_NAME
+ALTER DATABASE `#mysql50#../../` UPGRADE DATA DIRECTORY NAME;
+--error ER_WRONG_DB_NAME
+ALTER DATABASE `#mysql50#./blablabla` UPGRADE DATA DIRECTORY NAME;
+--error ER_WRONG_DB_NAME
+ALTER DATABASE `#mysql50#../blablabla` UPGRADE DATA DIRECTORY NAME;
+--error ER_WRONG_DB_NAME
+ALTER DATABASE `#mysql50#/` UPGRADE DATA DIRECTORY NAME;
+--error ER_WRONG_DB_NAME
+ALTER DATABASE `#mysql50#/.` UPGRADE DATA DIRECTORY NAME;
+
+--error ER_WRONG_DB_NAME
+USE `#mysql50#.`;
+--error ER_WRONG_DB_NAME
+USE `#mysql50#../blablabla`;
+
+--echo # End of 5.1 tests
+
diff --git a/mysql-test/t/variables_debug.test b/mysql-test/t/variables_debug.test
index 0d6ee43cd75..8fa2124137a 100644
--- a/mysql-test/t/variables_debug.test
+++ b/mysql-test/t/variables_debug.test
@@ -1,5 +1,7 @@
--source include/have_debug.inc
+SET @old_debug = @@GLOBAL.debug;
+
#
# Bug#34678 @@debug variable's incremental mode
#
@@ -31,5 +33,6 @@ SELECT @@global.debug;
SET GLOBAL debug='';
SELECT @@global.debug;
+SET GLOBAL debug=@old_debug;
--echo End of 5.1 tests