summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2016-05-04 15:23:26 +0200
committerSergei Golubchik <serg@mariadb.org>2016-05-04 15:23:26 +0200
commit87e3e67f434628768b5125fbab7e8862fa60da1a (patch)
treedf19b8bcac9988d83270ed1da05f765bfc4e8624 /mysql-test
parent80da57cc4f0c717ee3e01ac5abccc859b88a2fbf (diff)
parentcee9ab9d85a8d75290b0d60bc7af26c8cf179a1d (diff)
downloadmariadb-git-87e3e67f434628768b5125fbab7e8862fa60da1a.tar.gz
Merge branch '10.0' into 10.1
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/include/ctype_numconv.inc6
-rw-r--r--mysql-test/include/have_crypt.inc9
-rw-r--r--mysql-test/include/have_des.inc6
-rwxr-xr-xmysql-test/mysql-test-run.pl2
-rw-r--r--mysql-test/r/alter_table_online.result13
-rw-r--r--mysql-test/r/bigint.result6
-rw-r--r--mysql-test/r/cache_temporal_4265.result13
-rw-r--r--mysql-test/r/case.result13
-rw-r--r--mysql-test/r/ctype_binary.result9
-rw-r--r--mysql-test/r/ctype_cp1251.result9
-rw-r--r--mysql-test/r/ctype_cp850.result14
-rw-r--r--mysql-test/r/ctype_latin1.result9
-rw-r--r--mysql-test/r/ctype_ucs.result9
-rw-r--r--mysql-test/r/ctype_utf8.result9
-rw-r--r--mysql-test/r/fulltext3.result12
-rw-r--r--mysql-test/r/func_math.result9
-rw-r--r--mysql-test/r/grant5.result16
-rw-r--r--mysql-test/r/have_crypt.require2
-rw-r--r--mysql-test/r/insert_innodb.result30
-rw-r--r--mysql-test/r/locale.result11
-rw-r--r--mysql-test/r/mdev6830.result3
-rw-r--r--mysql-test/r/mysqld--help.result6
-rw-r--r--mysql-test/r/null.result2
-rw-r--r--mysql-test/r/openssl_1.result9
-rw-r--r--mysql-test/r/select_debug.result2
-rw-r--r--mysql-test/r/set_password_plugin-9835.result160
-rw-r--r--mysql-test/r/sp-threads.result9
-rw-r--r--mysql-test/r/ssl_timeout-9836.result7
-rw-r--r--mysql-test/r/type_date.result35
-rw-r--r--mysql-test/r/type_timestamp.result9
-rw-r--r--mysql-test/r/wait_timeout_not_windows.result4
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_binlog.result2
-rw-r--r--mysql-test/suite/innodb/r/innodb-corrupted-table.result49
-rw-r--r--mysql-test/suite/innodb/r/innodb-fk.result44
-rw-r--r--mysql-test/suite/innodb/t/innodb-corrupted-table.test46
-rw-r--r--mysql-test/suite/innodb/t/innodb-fk.test41
-rw-r--r--mysql-test/suite/rpl/r/create_or_replace_mix.result2
-rw-r--r--mysql-test/suite/rpl/r/create_or_replace_row.result6
-rw-r--r--mysql-test/suite/rpl/r/create_or_replace_statement.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_killed_ddl.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_create_table.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_merge_engine.result5
-rw-r--r--mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL_innodb.result13
-rw-r--r--mysql-test/suite/rpl/t/rpl_killed_ddl.test40
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_merge_engine.test6
-rw-r--r--mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL_innodb.test55
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_innodb,xtradb.rdiff39
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_innodb.result2
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_buffer_pool_load_now_basic.test18
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_empty_free_list_algorithm_basic.opt1
-rw-r--r--mysql-test/t/alter_table_online.test26
-rw-r--r--mysql-test/t/bigint.test5
-rw-r--r--mysql-test/t/bootstrap.test2
-rw-r--r--mysql-test/t/cache_temporal_4265.test11
-rw-r--r--mysql-test/t/case.test10
-rw-r--r--mysql-test/t/ctype_cp850.test16
-rw-r--r--mysql-test/t/events_2.test4
-rw-r--r--mysql-test/t/fulltext3.test15
-rw-r--r--mysql-test/t/func_des_encrypt.test2
-rw-r--r--mysql-test/t/func_encrypt.test2
-rw-r--r--mysql-test/t/func_encrypt_ucs2.test2
-rw-r--r--mysql-test/t/func_math.test8
-rw-r--r--mysql-test/t/grant5.test18
-rw-r--r--mysql-test/t/insert_innodb.test43
-rw-r--r--mysql-test/t/kill_processlist-6619.test7
-rw-r--r--mysql-test/t/locale.test8
-rw-r--r--mysql-test/t/mdev6830-master.opt1
-rw-r--r--mysql-test/t/mdev6830.test10
-rw-r--r--mysql-test/t/mysqld--help.test2
-rw-r--r--mysql-test/t/openssl_1.test11
-rw-r--r--mysql-test/t/openssl_6975.test1
-rw-r--r--mysql-test/t/partition_innodb_plugin.test6
-rw-r--r--mysql-test/t/select_debug.test2
-rw-r--r--mysql-test/t/set_password_plugin-9835.test131
-rw-r--r--mysql-test/t/sp-threads.test9
-rw-r--r--mysql-test/t/ssl.test4
-rw-r--r--mysql-test/t/ssl_compress.test4
-rw-r--r--mysql-test/t/ssl_timeout-9836.opt1
-rw-r--r--mysql-test/t/ssl_timeout-9836.test11
-rw-r--r--mysql-test/t/ssl_timeout.test2
-rw-r--r--mysql-test/t/type_date.test30
-rw-r--r--mysql-test/t/type_timestamp.test8
-rw-r--r--mysql-test/t/wait_timeout_not_windows.test16
-rw-r--r--mysql-test/valgrind.supp7
84 files changed, 1153 insertions, 120 deletions
diff --git a/mysql-test/include/ctype_numconv.inc b/mysql-test/include/ctype_numconv.inc
index 1d675a5db6f..6bda2205c0e 100644
--- a/mysql-test/include/ctype_numconv.inc
+++ b/mysql-test/include/ctype_numconv.inc
@@ -1819,6 +1819,12 @@ DROP FUNCTION f1;
DROP TABLE t1;
--echo #
+--echo # MDEV-9662 Assertion `precision || !scale' failed in my_decimal_precision_to_length_no_truncation(uint, uint8, bool)
+--echo #
+SELECT @@collation_connection;
+SELECT CASE 1 WHEN 2 THEN ( - '3' ) END;
+
+--echo #
--echo # MDEV-5702 Incorrect results are returned with NULLIF()
--echo #
CREATE TABLE t1 (d DATE);
diff --git a/mysql-test/include/have_crypt.inc b/mysql-test/include/have_crypt.inc
index cbf0a7ac876..422f8922edc 100644
--- a/mysql-test/include/have_crypt.inc
+++ b/mysql-test/include/have_crypt.inc
@@ -1,4 +1,5 @@
--- require r/have_crypt.require
-disable_query_log;
-show variables like 'have_crypt';
-enable_query_log;
+# encrypt('a') is NULL if crypt(3) is not available
+# encrypt('a') is "*0" in fips mode
+if (`select length(encrypt('a')) > 3 IS NOT TRUE`) {
+ skip No crypt(3);
+}
diff --git a/mysql-test/include/have_des.inc b/mysql-test/include/have_des.inc
new file mode 100644
index 00000000000..5abdaf6e2aa
--- /dev/null
+++ b/mysql-test/include/have_des.inc
@@ -0,0 +1,6 @@
+# in the FIPS mode, OpenSSL disables DES and other weak algorithms
+source include/have_ssl_crypto_functs.inc;
+
+if (`select des_encrypt("a", "b") IS NULL`) {
+ skip DES is disabled (fips mode?);
+}
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index 8ccafec342b..aa46d70cfc5 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -3222,7 +3222,7 @@ sub mysql_install_db {
# Create mtr database
mtr_tofile($bootstrap_sql_file,
- "CREATE DATABASE mtr;\n");
+ "CREATE DATABASE mtr CHARSET=latin1;\n");
# Add help tables and data for warning detection and supression
mtr_tofile($bootstrap_sql_file,
diff --git a/mysql-test/r/alter_table_online.result b/mysql-test/r/alter_table_online.result
index 05d03aeae11..e3f285437a7 100644
--- a/mysql-test/r/alter_table_online.result
+++ b/mysql-test/r/alter_table_online.result
@@ -1,4 +1,3 @@
-drop table if exists t1,t2,t3;
create table t1 (a int not null primary key, b int, c varchar(80), e enum('a','b'));
insert into t1 (a) values (1),(2),(3);
alter online table t1 modify b int default 5;
@@ -62,6 +61,18 @@ create table t3 (a int not null primary key, b int, c varchar(80)) engine=merge
alter online table t3 union=(t1,t2);
ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCLUSIVE.
drop table t1,t2,t3;
+create table t1 (i int) partition by hash(i) partitions 2;
+alter online table t1 comment 'test';
+drop table t1;
+create table t1 (a int);
+alter online table t1 modify a int comment 'test';
+drop table t1;
+create table t1 (a int) engine=innodb;
+alter online table t1 modify a int comment 'test';
+drop table t1;
+create table t1 (a int) partition by hash(a) partitions 2;
+alter online table t1 modify a int comment 'test';
+drop table t1;
#
# MDEV-8948 ALTER ... INPLACE does work for BINARY, BLOB
#
diff --git a/mysql-test/r/bigint.result b/mysql-test/r/bigint.result
index cc2ab456833..f21a1a763a3 100644
--- a/mysql-test/r/bigint.result
+++ b/mysql-test/r/bigint.result
@@ -502,3 +502,9 @@ a
SELECT * FROM t1 WHERE a IN (0.8,0.9);
a
DROP TABLE t1;
+#
+# MDEV-9372 select 100 between 1 and 9223372036854775808 returns false
+#
+SELECT 100 BETWEEN 1 AND 9223372036854775808;
+100 BETWEEN 1 AND 9223372036854775808
+1
diff --git a/mysql-test/r/cache_temporal_4265.result b/mysql-test/r/cache_temporal_4265.result
index b8f13e465de..980bb957e19 100644
--- a/mysql-test/r/cache_temporal_4265.result
+++ b/mysql-test/r/cache_temporal_4265.result
@@ -8,4 +8,17 @@ a
Warnings:
Note 1003 2000-01-01
Note 1003 2000-01-06
+set debug_dbug='';
+drop table t1;
+create table t1 (id int not null, ut timestamp(6) not null);
+insert into t1 values(1, '2001-01-01 00:00:00.2');
+insert into t1 values(1, '2001-01-01 00:00:00.1');
+select * from t1;
+id ut
+1 2001-01-01 00:00:00.200000
+1 2001-01-01 00:00:00.100000
+select (select max(m2.ut) from t1 m2 where m1.id <> 0) from t1 m1;
+(select max(m2.ut) from t1 m2 where m1.id <> 0)
+2001-01-01 00:00:00.200000
+2001-01-01 00:00:00.200000
drop table t1;
diff --git a/mysql-test/r/case.result b/mysql-test/r/case.result
index b1e928c5e30..9ceb7efde64 100644
--- a/mysql-test/r/case.result
+++ b/mysql-test/r/case.result
@@ -232,6 +232,19 @@ case t1.f1 when '00:00:00' then 1 end
NULL
drop table t1;
#
+# MDEV-9745 Crash with CASE WHEN TRUE THEN COALESCE(CAST(NULL AS UNSIGNED)) ELSE 4 END
+#
+CREATE TABLE t1 SELECT CASE WHEN TRUE THEN COALESCE(CAST(NULL AS UNSIGNED)) ELSE 4 END AS a;
+DESCRIBE t1;
+Field Type Null Key Default Extra
+a decimal(1,0) YES NULL
+DROP TABLE t1;
+CREATE TABLE t1 SELECT CASE WHEN TRUE THEN COALESCE(CAST(NULL AS UNSIGNED)) ELSE 40 END AS a;
+DESCRIBE t1;
+Field Type Null Key Default Extra
+a decimal(2,0) YES NULL
+DROP TABLE t1;
+#
# Start of 10.1 test
#
#
diff --git a/mysql-test/r/ctype_binary.result b/mysql-test/r/ctype_binary.result
index ac79a158943..512368a2d26 100644
--- a/mysql-test/r/ctype_binary.result
+++ b/mysql-test/r/ctype_binary.result
@@ -2887,6 +2887,15 @@ f1()
DROP FUNCTION f1;
DROP TABLE t1;
#
+# MDEV-9662 Assertion `precision || !scale' failed in my_decimal_precision_to_length_no_truncation(uint, uint8, bool)
+#
+SELECT @@collation_connection;
+@@collation_connection
+binary
+SELECT CASE 1 WHEN 2 THEN ( - '3' ) END;
+CASE 1 WHEN 2 THEN ( - '3' ) END
+NULL
+#
# MDEV-5702 Incorrect results are returned with NULLIF()
#
CREATE TABLE t1 (d DATE);
diff --git a/mysql-test/r/ctype_cp1251.result b/mysql-test/r/ctype_cp1251.result
index 08a840f7749..09344a50ee9 100644
--- a/mysql-test/r/ctype_cp1251.result
+++ b/mysql-test/r/ctype_cp1251.result
@@ -3281,6 +3281,15 @@ f1()
DROP FUNCTION f1;
DROP TABLE t1;
#
+# MDEV-9662 Assertion `precision || !scale' failed in my_decimal_precision_to_length_no_truncation(uint, uint8, bool)
+#
+SELECT @@collation_connection;
+@@collation_connection
+cp1251_general_ci
+SELECT CASE 1 WHEN 2 THEN ( - '3' ) END;
+CASE 1 WHEN 2 THEN ( - '3' ) END
+NULL
+#
# MDEV-5702 Incorrect results are returned with NULLIF()
#
CREATE TABLE t1 (d DATE);
diff --git a/mysql-test/r/ctype_cp850.result b/mysql-test/r/ctype_cp850.result
new file mode 100644
index 00000000000..c028f72b58a
--- /dev/null
+++ b/mysql-test/r/ctype_cp850.result
@@ -0,0 +1,14 @@
+#
+# Start of 5.5 tests
+#
+#
+# MDEV-9862 Illegal mix of collation, when comparing column with CASE expression
+#
+SET NAMES cp850;
+CREATE TABLE t1 (a CHAR(1) CHARACTER SET latin1);
+SELECT a FROM t1 WHERE CASE a WHEN 'aaaa' THEN 'Y' WHEN 'aaaa' THEN 'Y' ELSE NULL END <> a;
+a
+DROP TABLE t1;
+#
+# End of 5.5 tests
+#
diff --git a/mysql-test/r/ctype_latin1.result b/mysql-test/r/ctype_latin1.result
index 48475923138..c6f190101f6 100644
--- a/mysql-test/r/ctype_latin1.result
+++ b/mysql-test/r/ctype_latin1.result
@@ -3563,6 +3563,15 @@ f1()
DROP FUNCTION f1;
DROP TABLE t1;
#
+# MDEV-9662 Assertion `precision || !scale' failed in my_decimal_precision_to_length_no_truncation(uint, uint8, bool)
+#
+SELECT @@collation_connection;
+@@collation_connection
+latin1_swedish_ci
+SELECT CASE 1 WHEN 2 THEN ( - '3' ) END;
+CASE 1 WHEN 2 THEN ( - '3' ) END
+NULL
+#
# MDEV-5702 Incorrect results are returned with NULLIF()
#
CREATE TABLE t1 (d DATE);
diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result
index 56174311bf3..767e034a0e5 100644
--- a/mysql-test/r/ctype_ucs.result
+++ b/mysql-test/r/ctype_ucs.result
@@ -4496,6 +4496,15 @@ f1()
DROP FUNCTION f1;
DROP TABLE t1;
#
+# MDEV-9662 Assertion `precision || !scale' failed in my_decimal_precision_to_length_no_truncation(uint, uint8, bool)
+#
+SELECT @@collation_connection;
+@@collation_connection
+ucs2_general_ci
+SELECT CASE 1 WHEN 2 THEN ( - '3' ) END;
+CASE 1 WHEN 2 THEN ( - '3' ) END
+NULL
+#
# MDEV-5702 Incorrect results are returned with NULLIF()
#
CREATE TABLE t1 (d DATE);
diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result
index 816fe654028..63815bfa9ff 100644
--- a/mysql-test/r/ctype_utf8.result
+++ b/mysql-test/r/ctype_utf8.result
@@ -5338,6 +5338,15 @@ f1()
DROP FUNCTION f1;
DROP TABLE t1;
#
+# MDEV-9662 Assertion `precision || !scale' failed in my_decimal_precision_to_length_no_truncation(uint, uint8, bool)
+#
+SELECT @@collation_connection;
+@@collation_connection
+utf8_general_ci
+SELECT CASE 1 WHEN 2 THEN ( - '3' ) END;
+CASE 1 WHEN 2 THEN ( - '3' ) END
+NULL
+#
# MDEV-5702 Incorrect results are returned with NULLIF()
#
CREATE TABLE t1 (d DATE);
diff --git a/mysql-test/r/fulltext3.result b/mysql-test/r/fulltext3.result
index 4ec48369ad1..c0b871cd5a7 100644
--- a/mysql-test/r/fulltext3.result
+++ b/mysql-test/r/fulltext3.result
@@ -15,3 +15,15 @@ CREATE TABLE t1(a VARCHAR(2) CHARACTER SET big5 COLLATE big5_chinese_ci,
FULLTEXT(a));
INSERT INTO t1 VALUES(0xA3C2);
DROP TABLE t1;
+create table t1 (
+id varchar(255),
+business_name text null collate utf8mb4_unicode_ci,
+street_address text,
+fulltext index ft (business_name),
+fulltext index ft2 (street_address)
+);
+select * from t1 where match (business_name, street_address) against ('some business name and address here');
+ERROR HY000: Can't find FULLTEXT index matching the column list
+select * from t1 where match (business_name, street_address) against ('some business name and address here' in boolean mode);
+id business_name street_address
+drop table t1;
diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result
index d768672efe4..f8e89dbc1c2 100644
--- a/mysql-test/r/func_math.result
+++ b/mysql-test/r/func_math.result
@@ -667,9 +667,14 @@ ERROR 22003: BIGINT UNSIGNED value is out of range in '(18446744073709551615 DIV
CREATE TABLE t1(a BIGINT, b BIGINT UNSIGNED);
INSERT INTO t1 VALUES(-9223372036854775808, 9223372036854775809);
SELECT -a FROM t1;
-ERROR 22003: BIGINT value is out of range in '-(-9223372036854775808)'
+ERROR 22003: BIGINT value is out of range in '-(`test`.`t1`.`a`)'
SELECT -b FROM t1;
-ERROR 22003: BIGINT value is out of range in '-(9223372036854775809)'
+ERROR 22003: BIGINT value is out of range in '-(`test`.`t1`.`b`)'
+INSERT INTO t1 VALUES(0,0);
+SELECT -a FROM t1;
+ERROR 22003: BIGINT value is out of range in '-(`test`.`t1`.`a`)'
+SELECT -b FROM t1;
+ERROR 22003: BIGINT value is out of range in '-(`test`.`t1`.`b`)'
DROP TABLE t1;
SET @a:=999999999999999999999999999999999999999999999999999999999999999999999999999999999;
SELECT @a + @a;
diff --git a/mysql-test/r/grant5.result b/mysql-test/r/grant5.result
index 2df394c0432..d7f3b6812bb 100644
--- a/mysql-test/r/grant5.result
+++ b/mysql-test/r/grant5.result
@@ -1,2 +1,18 @@
SHOW GRANTS FOR root@invalid_host;
ERROR 42000: There is no such grant defined for user 'root' on host 'invalid_host'
+create user test;
+create user foo;
+create role foo;
+grant foo to test;
+set role foo;
+show grants for test;
+Grants for test@%
+GRANT foo TO 'test'@'%'
+GRANT USAGE ON *.* TO 'test'@'%'
+show grants for foo;
+Grants for foo
+GRANT USAGE ON *.* TO 'foo'
+show grants for foo@'%';
+ERROR 42000: Access denied for user 'test'@'%' to database 'mysql'
+drop user test, foo;
+drop role foo;
diff --git a/mysql-test/r/have_crypt.require b/mysql-test/r/have_crypt.require
deleted file mode 100644
index 739fbb738f0..00000000000
--- a/mysql-test/r/have_crypt.require
+++ /dev/null
@@ -1,2 +0,0 @@
-Variable_name Value
-have_crypt YES
diff --git a/mysql-test/r/insert_innodb.result b/mysql-test/r/insert_innodb.result
new file mode 100644
index 00000000000..ffba9388ec4
--- /dev/null
+++ b/mysql-test/r/insert_innodb.result
@@ -0,0 +1,30 @@
+#
+# BUG#22037930: INSERT IGNORE FAILS TO IGNORE
+# FOREIGN KEY CONSTRAINT
+# Setup.
+CREATE TABLE t1 (fld1 INT PRIMARY KEY) ENGINE=INNODB;
+CREATE TABLE t2 (fld2 INT, FOREIGN KEY (fld2) REFERENCES t1 (fld1))
+ENGINE=INNODB;
+INSERT INTO t1 VALUES(0);
+INSERT INTO t2 VALUES(0);
+# Without fix, an error is reported.
+INSERT IGNORE INTO t2 VALUES(1);
+Warnings:
+Warning 1452 Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`fld2`) REFERENCES `t1` (`fld1`))
+UPDATE IGNORE t2 SET fld2=20 WHERE fld2=0;
+UPDATE IGNORE t1 SET fld1=20 WHERE fld1=0;
+# Test for multi update.
+UPDATE IGNORE t1, t2 SET t2.fld2= t2.fld2 + 3;
+UPDATE IGNORE t1, t2 SET t1.fld1= t1.fld1 + 3;
+# Reports an error since IGNORE is not used.
+INSERT INTO t2 VALUES(1);
+ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`fld2`) REFERENCES `t1` (`fld1`))
+UPDATE t2 SET fld2=20 WHERE fld2=0;
+ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`fld2`) REFERENCES `t1` (`fld1`))
+UPDATE t1 SET fld1=20 WHERE fld1=0;
+ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`fld2`) REFERENCES `t1` (`fld1`))
+UPDATE t1, t2 SET t2.fld2= t2.fld2 + 3;
+ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`fld2`) REFERENCES `t1` (`fld1`))
+UPDATE t1, t2 SET t1.fld1= t1.fld1 + 3;
+ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`fld2`) REFERENCES `t1` (`fld1`))
+DROP TABLE t2, t1;
diff --git a/mysql-test/r/locale.result b/mysql-test/r/locale.result
index 1335f1ec9d5..c28cedae8b1 100644
--- a/mysql-test/r/locale.result
+++ b/mysql-test/r/locale.result
@@ -90,6 +90,17 @@ SELECT DATE_FORMAT('2001-01-07', '%w %a %W');
DATE_FORMAT('2001-01-07', '%w %a %W')
0 Du Duminică
End of 5.4 tests
+SET NAMES utf8;
+SET lc_time_names=de_AT;
+SELECT monthname('2001-01-01');
+monthname('2001-01-01')
+Jänner
+SELECT monthname('2001-02-01');
+monthname('2001-02-01')
+Februar
+SELECT monthname('2001-03-01');
+monthname('2001-03-01')
+März
#
# Start of 5.6 tests
#
diff --git a/mysql-test/r/mdev6830.result b/mysql-test/r/mdev6830.result
index 0570659e860..d1cf8c98ac1 100644
--- a/mysql-test/r/mdev6830.result
+++ b/mysql-test/r/mdev6830.result
@@ -1,5 +1,4 @@
-drop table if exists t1,t2,t3;
-drop view if exists v2,v3;
+set @@debug_dbug= 'd,opt';
CREATE TABLE t1 (pk INT PRIMARY KEY) ENGINE=MyISAM;
CREATE TABLE t2 (
f1 DATE,
diff --git a/mysql-test/r/mysqld--help.result b/mysql-test/r/mysqld--help.result
index bef03904a72..f6e7c54745f 100644
--- a/mysql-test/r/mysqld--help.result
+++ b/mysql-test/r/mysqld--help.result
@@ -1066,7 +1066,7 @@ The following options may be given as the first argument:
--table-open-cache=#
The number of cached open tables
--tc-heuristic-recover=name
- Decision to use in heuristic recover process. One of:
+ Decision to use in heuristic recover process. One of: OFF,
COMMIT, ROLLBACK
--thread-cache-size=#
How many threads we should keep in a cache for reuse
@@ -1155,10 +1155,8 @@ bulk-insert-buffer-size 8388608
changed-page-bitmaps ON
character-set-client-handshake TRUE
character-set-filesystem binary
-character-set-server latin1
character-sets-dir MYSQL_CHARSETSDIR/
chroot (No default value)
-collation-server latin1_swedish_ci
completion-type NO_CHAIN
concurrent-insert AUTO
console FALSE
@@ -1424,7 +1422,7 @@ sysdate-is-now FALSE
table-cache 431
table-definition-cache 400
table-open-cache 431
-tc-heuristic-recover COMMIT
+tc-heuristic-recover OFF
thread-cache-size 0
thread-pool-idle-timeout 60
thread-pool-max-threads 1000
diff --git a/mysql-test/r/null.result b/mysql-test/r/null.result
index 3da7e4805c2..0d012e283b5 100644
--- a/mysql-test/r/null.result
+++ b/mysql-test/r/null.result
@@ -1556,7 +1556,7 @@ set names utf8;
create table t1 (f1 varchar(10));
insert into t1 values ('2015-12-31');
select power( timestamp( nullif( '2002-09-08', f1 ) ), 24 ) from t1;
-ERROR 22003: DOUBLE value is out of range in 'pow(cast((case when '2002-09-08' = '2015-12-31' then NULL else '2002-09-08' end) as datetime(6)),24)'
+ERROR 22003: DOUBLE value is out of range in 'pow(cast((case when '2002-09-08' = `test`.`t1`.`f1` then NULL else '2002-09-08' end) as datetime(6)),24)'
drop table t1;
CREATE TABLE t1 (f1 INT);
INSERT INTO t1 VALUES (1),(2);
diff --git a/mysql-test/r/openssl_1.result b/mysql-test/r/openssl_1.result
index 1d5c6d179df..852fdee51ee 100644
--- a/mysql-test/r/openssl_1.result
+++ b/mysql-test/r/openssl_1.result
@@ -210,3 +210,12 @@ Ssl_cipher DHE-RSA-AES256-SHA
DROP USER bug42158@localhost;
set global sql_mode=default;
End of 5.1 tests
+/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
+/*!40019 SET @@session.max_insert_delayed_threads=0*/;
+/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
+DELIMITER /*!*/;
+DELIMITER ;
+# End of log file
+ROLLBACK /* added by mysqlbinlog */;
+/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
+/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
diff --git a/mysql-test/r/select_debug.result b/mysql-test/r/select_debug.result
index a056affc2cd..55882ad337a 100644
--- a/mysql-test/r/select_debug.result
+++ b/mysql-test/r/select_debug.result
@@ -6,7 +6,7 @@ insert into t1 values (2,2), (1,1);
create table t2 (a int);
insert into t2 values (2), (3);
set session join_cache_level=3;
-set @@debug_dbug= 'd:t:O,/tmp/trace.out';
+set @@debug_dbug= 'd,opt';
explain select t1.b from t1,t2 where t1.b=t2.a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where
diff --git a/mysql-test/r/set_password_plugin-9835.result b/mysql-test/r/set_password_plugin-9835.result
new file mode 100644
index 00000000000..3cc723957d8
--- /dev/null
+++ b/mysql-test/r/set_password_plugin-9835.result
@@ -0,0 +1,160 @@
+set global secure_auth=0;
+create user natauth@localhost identified via 'mysql_native_password' using '*94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29';
+create user newpass@localhost identified by password '*94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29';
+create user newpassnat@localhost identified via 'mysql_native_password';
+set password for newpassnat@localhost = '*94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29';
+create user oldauth@localhost identified with 'mysql_old_password' using '378b243e220ca493';
+create user oldpass@localhost identified by password '378b243e220ca493';
+create user oldpassold@localhost identified with 'mysql_old_password';
+set password for oldpassold@localhost = '378b243e220ca493';
+select user, host, password, plugin, authentication_string from mysql.user where user != 'root';
+user host password plugin authentication_string
+natauth localhost *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29
+newpass localhost *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29
+newpassnat localhost *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29
+oldauth localhost 378b243e220ca493
+oldpass localhost 378b243e220ca493
+oldpassold localhost 378b243e220ca493
+connect con,localhost,natauth,test,;
+select current_user();
+current_user()
+natauth@localhost
+disconnect con;
+connect con,localhost,newpass,test,;
+select current_user();
+current_user()
+newpass@localhost
+disconnect con;
+connect con,localhost,newpassnat,test,;
+select current_user();
+current_user()
+newpassnat@localhost
+disconnect con;
+connect con,localhost,oldauth,test,;
+select current_user();
+current_user()
+oldauth@localhost
+disconnect con;
+connect con,localhost,oldpass,test,;
+select current_user();
+current_user()
+oldpass@localhost
+disconnect con;
+connect con,localhost,oldpassold,test,;
+select current_user();
+current_user()
+oldpassold@localhost
+disconnect con;
+connection default;
+flush privileges;
+connect con,localhost,natauth,test,;
+select current_user();
+current_user()
+natauth@localhost
+disconnect con;
+connect con,localhost,newpass,test,;
+select current_user();
+current_user()
+newpass@localhost
+disconnect con;
+connect con,localhost,newpassnat,test,;
+select current_user();
+current_user()
+newpassnat@localhost
+disconnect con;
+connect con,localhost,oldauth,test,;
+select current_user();
+current_user()
+oldauth@localhost
+disconnect con;
+connect con,localhost,oldpass,test,;
+select current_user();
+current_user()
+oldpass@localhost
+disconnect con;
+connect con,localhost,oldpassold,test,;
+select current_user();
+current_user()
+oldpassold@localhost
+disconnect con;
+connection default;
+set password for natauth@localhost = PASSWORD('test2');
+set password for newpass@localhost = PASSWORD('test2');
+set password for newpassnat@localhost = PASSWORD('test2');
+set password for oldauth@localhost = PASSWORD('test2');
+set password for oldpass@localhost = PASSWORD('test2');
+set password for oldpassold@localhost = PASSWORD('test2');
+select user, host, password, plugin, authentication_string from mysql.user where user != 'root';
+user host password plugin authentication_string
+natauth localhost *7CEB3FDE5F7A9C4CE5FBE610D7D8EDA62EBE5F4E
+newpass localhost *7CEB3FDE5F7A9C4CE5FBE610D7D8EDA62EBE5F4E
+newpassnat localhost *7CEB3FDE5F7A9C4CE5FBE610D7D8EDA62EBE5F4E
+oldauth localhost *7CEB3FDE5F7A9C4CE5FBE610D7D8EDA62EBE5F4E
+oldpass localhost *7CEB3FDE5F7A9C4CE5FBE610D7D8EDA62EBE5F4E
+oldpassold localhost *7CEB3FDE5F7A9C4CE5FBE610D7D8EDA62EBE5F4E
+connect con,localhost,natauth,test2,;
+select current_user();
+current_user()
+natauth@localhost
+disconnect con;
+connect con,localhost,newpass,test2,;
+select current_user();
+current_user()
+newpass@localhost
+disconnect con;
+connect con,localhost,newpassnat,test2,;
+select current_user();
+current_user()
+newpassnat@localhost
+disconnect con;
+connect con,localhost,oldauth,test2,;
+select current_user();
+current_user()
+oldauth@localhost
+disconnect con;
+connect con,localhost,oldpass,test2,;
+select current_user();
+current_user()
+oldpass@localhost
+disconnect con;
+connect con,localhost,oldpassold,test2,;
+select current_user();
+current_user()
+oldpassold@localhost
+disconnect con;
+connection default;
+flush privileges;
+connect con,localhost,natauth,test2,;
+select current_user();
+current_user()
+natauth@localhost
+disconnect con;
+connect con,localhost,newpass,test2,;
+select current_user();
+current_user()
+newpass@localhost
+disconnect con;
+connect con,localhost,newpassnat,test2,;
+select current_user();
+current_user()
+newpassnat@localhost
+disconnect con;
+connect con,localhost,oldauth,test2,;
+select current_user();
+current_user()
+oldauth@localhost
+disconnect con;
+connect con,localhost,oldpass,test2,;
+select current_user();
+current_user()
+oldpass@localhost
+disconnect con;
+connect con,localhost,oldpassold,test2,;
+select current_user();
+current_user()
+oldpassold@localhost
+disconnect con;
+connection default;
+drop user natauth@localhost, newpass@localhost, newpassnat@localhost;
+drop user oldauth@localhost, oldpass@localhost, oldpassold@localhost;
+set global secure_auth=default;
diff --git a/mysql-test/r/sp-threads.result b/mysql-test/r/sp-threads.result
index 4ce61c44762..ddf709d462b 100644
--- a/mysql-test/r/sp-threads.result
+++ b/mysql-test/r/sp-threads.result
@@ -32,12 +32,9 @@ update t1, t2 set val= 1 where id1=id2;
call bug9486();
lock tables t2 write;
call bug9486();
-show processlist;
-Id User Host db Command Time State Info Progress
-# root localhost test Sleep # NULL 0.000
-# root localhost test Query # Waiting for table metadata lock update t1, t2 set val= 1 where id1=id2 0.000
-# root localhost test Query # init show processlist 0.000
-# root localhost test Sleep # NULL 0.000
+SELECT state,info FROM information_schema.processlist WHERE id=con1root_id;
+state info
+Waiting for table metadata lock update t1, t2 set val= 1 where id1=id2
unlock tables;
drop procedure bug9486;
drop table t1, t2;
diff --git a/mysql-test/r/ssl_timeout-9836.result b/mysql-test/r/ssl_timeout-9836.result
new file mode 100644
index 00000000000..bc2e19e1475
--- /dev/null
+++ b/mysql-test/r/ssl_timeout-9836.result
@@ -0,0 +1,7 @@
+SET @@net_read_timeout=1;
+SELECT 1;
+1
+1
+SELECT 1;
+1
+1
diff --git a/mysql-test/r/type_date.result b/mysql-test/r/type_date.result
index 54f2aa91f2c..55de3b39f2d 100644
--- a/mysql-test/r/type_date.result
+++ b/mysql-test/r/type_date.result
@@ -439,6 +439,41 @@ select 1 from t1 as t1_0 inner join t1 as t2 on (t1_0.a <=> now()) join t1 on 1;
1
drop table t1;
#
+# MDEV-9521 Least function returns 0000-00-00 for null date columns instead of null
+#
+CREATE TABLE t1 (
+id BIGINT NOT NULL,
+date_debut DATE NOT NULL,
+date_fin DATE DEFAULT NULL);
+CREATE TABLE t2(
+id BIGINT NOT NULL,
+date_debut DATE NOT NULL,
+date_fin DATE DEFAULT NULL);
+INSERT INTO t1 VALUES (1,'2016-01-01','2016-01-31');
+INSERT INTO t1 VALUES (2,'2016-02-01',null);
+INSERT INTO t1 VALUES (3,'2016-03-01','2016-03-31');
+INSERT INTO t1 VALUES (4,'2016-04-01',null);
+INSERT INTO t2 VALUES (1,'2016-01-01','2016-01-31');
+INSERT INTO t2 VALUES (2,'2016-02-01','2016-01-28');
+INSERT INTO t2 VALUES (3,'2016-03-01',null);
+INSERT INTO t2 VALUES (4,'2016-04-01',null);
+SELECT t1.id,
+GREATEST(t2.date_debut, t1.date_debut) AS date_debut,
+LEAST(IFNULL(t2.date_fin, IFNULL(t1.date_fin, NULL)),
+IFNULL(t1.date_fin, IFNULL(t2.date_fin, NULL))) AS date_fin
+FROM t1 LEFT JOIN t2 ON (t1.id=t2.id);
+id date_debut date_fin
+1 2016-01-01 2016-01-31
+2 2016-02-01 2016-01-28
+3 2016-03-01 2016-03-31
+4 2016-04-01 NULL
+DROP TABLE t1,t2;
+SELECT
+LEAST(COALESCE(DATE(NULL), DATE(NULL)), COALESCE(DATE(NULL), DATE(NULL))) AS d0,
+LEAST(IFNULL(DATE(NULL), DATE(NULL)), IFNULL(DATE(NULL), DATE(NULL))) AS d1;
+d0 d1
+NULL NULL
+#
# MDEV-9511 Valgrind warnings 'Invalid read' in Field_newdate::cmp and Field_newdate::val_str
#
CREATE TABLE t1 (f1 DATE, f2 VARCHAR(1));
diff --git a/mysql-test/r/type_timestamp.result b/mysql-test/r/type_timestamp.result
index a579f6930a0..69c9f68811d 100644
--- a/mysql-test/r/type_timestamp.result
+++ b/mysql-test/r/type_timestamp.result
@@ -644,6 +644,15 @@ SELECT MAX(dt) = '2011-01-06 12:34:30' FROM t1;
MAX(dt) = '2011-01-06 12:34:30'
1
DROP TABLE t1;
+#
+# MDEV-9413 "datetime >= coalesce(c1(NULL))" doesn't return expected NULL
+#
+CREATE TABLE t1(c1 TIMESTAMP(6) NULL DEFAULT NULL);
+INSERT INTO t1 VALUES(NULL);
+SELECT c1, '2016-06-13 20:00:00.000003' >= COALESCE( c1 ) FROM t1;
+c1 '2016-06-13 20:00:00.000003' >= COALESCE( c1 )
+NULL NULL
+DROP TABLE t1;
End of 5.5 tests
#
# MDEV-7254: Assigned expression is evaluated twice when updating column TIMESTAMP NOT NULL
diff --git a/mysql-test/r/wait_timeout_not_windows.result b/mysql-test/r/wait_timeout_not_windows.result
new file mode 100644
index 00000000000..867787a8ed3
--- /dev/null
+++ b/mysql-test/r/wait_timeout_not_windows.result
@@ -0,0 +1,4 @@
+set global log_warnings=2;
+set @@wait_timeout=1;
+FOUND /Aborted.*Got timeout reading communication packets/ in mysqld.1.err
+set global log_warnings=@@log_warnings;
diff --git a/mysql-test/suite/binlog/r/binlog_row_binlog.result b/mysql-test/suite/binlog/r/binlog_row_binlog.result
index 181f254cd5d..cb6b344e311 100644
--- a/mysql-test/suite/binlog/r/binlog_row_binlog.result
+++ b/mysql-test/suite/binlog/r/binlog_row_binlog.result
@@ -681,7 +681,7 @@ master-bin.000001 # Query # # COMMIT
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; CREATE TABLE IF NOT EXISTS `t3` (
`a` int(11) DEFAULT NULL
-)
+) ENGINE=MyISAM
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (mysql.user)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
diff --git a/mysql-test/suite/innodb/r/innodb-corrupted-table.result b/mysql-test/suite/innodb/r/innodb-corrupted-table.result
new file mode 100644
index 00000000000..94203a794f8
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb-corrupted-table.result
@@ -0,0 +1,49 @@
+call mtr.add_suppression("Table .* has a primary key in InnoDB data dictionary, but not in MySQL.*");
+call mtr.add_suppression("InnoDB: Table .* contains .* indexes inside InnoDB, which is different from the number of indexes .* defined in the MySQL.*");
+create table t1 (pk int, i int, key(i)) engine=InnoDB;
+insert into t1 values (1,1),(2,2);
+flush tables;
+# Save the .frm file without the PK
+alter table t1 add primary key (pk);
+# Stop the server, replace the frm with the old one and restart the server
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `pk` int(11) DEFAULT NULL,
+ `i` int(11) DEFAULT NULL,
+ KEY `i` (`i`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+Warnings:
+Warning 1082 InnoDB: Table test/t1 has a primary key in InnoDB data dictionary, but not in MySQL!
+Warning 1082 InnoDB: Table test/t1 contains 2 indexes inside InnoDB, which is different from the number of indexes 1 defined in the MySQL
+select * from t1;
+pk i
+1 1
+2 2
+alter table t1 add j int;
+Warnings:
+Warning 1082 InnoDB: Table test/t1 contains 2 indexes inside InnoDB, which is different from the number of indexes 1 defined in the MySQL
+show warnings;
+Level Code Message
+Warning 1082 InnoDB: Table test/t1 contains 2 indexes inside InnoDB, which is different from the number of indexes 1 defined in the MySQL
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `pk` int(11) DEFAULT NULL,
+ `i` int(11) DEFAULT NULL,
+ `j` int(11) DEFAULT NULL,
+ KEY `i` (`i`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+alter table t1 add primary key (pk);
+show warnings;
+Level Code Message
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `pk` int(11) NOT NULL,
+ `i` int(11) DEFAULT NULL,
+ `j` int(11) DEFAULT NULL,
+ PRIMARY KEY (`pk`),
+ KEY `i` (`i`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+drop table t1;
diff --git a/mysql-test/suite/innodb/r/innodb-fk.result b/mysql-test/suite/innodb/r/innodb-fk.result
index c916d665bf0..2eb19764769 100644
--- a/mysql-test/suite/innodb/r/innodb-fk.result
+++ b/mysql-test/suite/innodb/r/innodb-fk.result
@@ -70,6 +70,50 @@ Error 1005 Can't create table `test`.`#sql-temporary` (errno: 150 "Foreign key c
Warning 1215 Cannot add foreign key constraint
drop table t2;
drop table t1;
+CREATE DATABASE kg_test1;
+CREATE DATABASE kg_test2;
+CREATE TABLE `kg_test1`.`group` (
+Id INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+CREATE TABLE `kg_test1`.`person` (
+`Id` INT(11) NOT NULL AUTO_INCREMENT,
+`Name` VARCHAR(50) NOT NULL,
+PRIMARY KEY (`Id`),
+CONSTRAINT `fk_person_group` FOREIGN KEY (`Id`) REFERENCES `group` (`Id`)
+) ENGINE=INNODB DEFAULT CHARSET=utf8;
+show create table `kg_test1`.`person`;
+Table Create Table
+person CREATE TABLE `person` (
+ `Id` int(11) NOT NULL AUTO_INCREMENT,
+ `Name` varchar(50) NOT NULL,
+ PRIMARY KEY (`Id`),
+ CONSTRAINT `fk_person_group` FOREIGN KEY (`Id`) REFERENCES `group` (`Id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8
+CREATE TABLE `kg_test2`.`person2` (
+`Id` INT(11) NOT NULL AUTO_INCREMENT,
+`Name` VARCHAR(50) NOT NULL,
+PRIMARY KEY (`Id`),
+CONSTRAINT `fk_person_group` FOREIGN KEY (`Id`) REFERENCES `group` (`Id`)
+) ENGINE=INNODB DEFAULT CHARSET=utf8;
+ERROR HY000: Can't create table `kg_test2`.`person2` (errno: 150 "Foreign key constraint is incorrectly formed")
+CREATE TABLE `kg_test2`.`person2` (
+`Id` INT(11) NOT NULL AUTO_INCREMENT,
+`Name` VARCHAR(50) NOT NULL,
+PRIMARY KEY (`Id`),
+CONSTRAINT `fk_person_group` FOREIGN KEY (`Id`) REFERENCES `kg_test1`.`group` (`Id`)
+) ENGINE=INNODB DEFAULT CHARSET=utf8;
+show create table `kg_test2`.`person2`;
+Table Create Table
+person2 CREATE TABLE `person2` (
+ `Id` int(11) NOT NULL AUTO_INCREMENT,
+ `Name` varchar(50) NOT NULL,
+ PRIMARY KEY (`Id`),
+ CONSTRAINT `fk_person_group` FOREIGN KEY (`Id`) REFERENCES `kg_test1`.`group` (`Id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8
+SHOW WARNINGS;
+Level Code Message
+DROP DATABASE kg_test2;
+DROP DATABASE kg_test1;
CREATE TABLE `#departaments` (
`id_depart` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`id_depart`)
diff --git a/mysql-test/suite/innodb/t/innodb-corrupted-table.test b/mysql-test/suite/innodb/t/innodb-corrupted-table.test
new file mode 100644
index 00000000000..94c5454429f
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-corrupted-table.test
@@ -0,0 +1,46 @@
+--source include/have_innodb.inc
+--source include/not_embedded.inc
+
+#
+# MDEV-9918: [ERROR] mysqld got signal 11 during ALTER TABLE `name` COLUMN ADD
+#
+
+call mtr.add_suppression("Table .* has a primary key in InnoDB data dictionary, but not in MySQL.*");
+call mtr.add_suppression("InnoDB: Table .* contains .* indexes inside InnoDB, which is different from the number of indexes .* defined in the MySQL.*");
+
+create table t1 (pk int, i int, key(i)) engine=InnoDB;
+insert into t1 values (1,1),(2,2);
+
+--let $datadir= `select @@datadir`
+
+flush tables;
+
+--echo # Save the .frm file without the PK
+
+--copy_file $datadir/test/t1.frm $MYSQLTEST_VARDIR/tmp/t1.frm
+
+alter table t1 add primary key (pk);
+
+--echo # Stop the server, replace the frm with the old one and restart the server
+
+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--shutdown_server 10
+--source include/wait_until_disconnected.inc
+
+--remove_file $datadir/test/t1.frm
+--copy_file $MYSQLTEST_VARDIR/tmp/t1.frm $datadir/test/t1.frm
+
+--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+show create table t1;
+select * from t1;
+alter table t1 add j int;
+show warnings;
+show create table t1;
+alter table t1 add primary key (pk);
+show warnings;
+show create table t1;
+# Cleanup
+drop table t1;
diff --git a/mysql-test/suite/innodb/t/innodb-fk.test b/mysql-test/suite/innodb/t/innodb-fk.test
index f7bcbe238dd..17e926e8647 100644
--- a/mysql-test/suite/innodb/t/innodb-fk.test
+++ b/mysql-test/suite/innodb/t/innodb-fk.test
@@ -126,6 +126,47 @@ drop table t2;
drop table t1;
#
+# MDEV-9142 :Adding Constraint with no database reference
+# results in ERROR 1046 (3D000) at line 13: No database selected
+#
+CREATE DATABASE kg_test1;
+CREATE DATABASE kg_test2;
+
+CREATE TABLE `kg_test1`.`group` (
+ Id INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+CREATE TABLE `kg_test1`.`person` (
+`Id` INT(11) NOT NULL AUTO_INCREMENT,
+`Name` VARCHAR(50) NOT NULL,
+PRIMARY KEY (`Id`),
+CONSTRAINT `fk_person_group` FOREIGN KEY (`Id`) REFERENCES `group` (`Id`)
+) ENGINE=INNODB DEFAULT CHARSET=utf8;
+
+show create table `kg_test1`.`person`;
+
+--error 1005
+CREATE TABLE `kg_test2`.`person2` (
+`Id` INT(11) NOT NULL AUTO_INCREMENT,
+`Name` VARCHAR(50) NOT NULL,
+PRIMARY KEY (`Id`),
+CONSTRAINT `fk_person_group` FOREIGN KEY (`Id`) REFERENCES `group` (`Id`)
+) ENGINE=INNODB DEFAULT CHARSET=utf8;
+
+CREATE TABLE `kg_test2`.`person2` (
+`Id` INT(11) NOT NULL AUTO_INCREMENT,
+`Name` VARCHAR(50) NOT NULL,
+PRIMARY KEY (`Id`),
+CONSTRAINT `fk_person_group` FOREIGN KEY (`Id`) REFERENCES `kg_test1`.`group` (`Id`)
+) ENGINE=INNODB DEFAULT CHARSET=utf8;
+
+show create table `kg_test2`.`person2`;
+
+SHOW WARNINGS;
+DROP DATABASE kg_test2;
+DROP DATABASE kg_test1;
+
+#
# MDEV-7627: Some symbols in table name can cause to Error Code: 1050 when created FK
#
diff --git a/mysql-test/suite/rpl/r/create_or_replace_mix.result b/mysql-test/suite/rpl/r/create_or_replace_mix.result
index c5dd67ed65c..c6cce358799 100644
--- a/mysql-test/suite/rpl/r/create_or_replace_mix.result
+++ b/mysql-test/suite/rpl/r/create_or_replace_mix.result
@@ -150,7 +150,7 @@ slave-bin.000001 # Query # # COMMIT
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `test`; CREATE TABLE `t4` (
`a` int(11) DEFAULT NULL
-)
+) ENGINE=MyISAM
slave-bin.000001 # Gtid # # BEGIN GTID #-#-#
slave-bin.000001 # Query # # use `test`; CREATE TABLE `t5` (
`a` int(11) DEFAULT NULL
diff --git a/mysql-test/suite/rpl/r/create_or_replace_row.result b/mysql-test/suite/rpl/r/create_or_replace_row.result
index 4a89a45354d..8f032107db9 100644
--- a/mysql-test/suite/rpl/r/create_or_replace_row.result
+++ b/mysql-test/suite/rpl/r/create_or_replace_row.result
@@ -39,7 +39,7 @@ master-bin.000001 # Query # # use `test`; CREATE OR REPLACE table t1 like t2
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE `t1` (
`a_in_temporary` int(11) DEFAULT NULL
-)
+) ENGINE=MyISAM
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
binlog from server 2
@@ -72,7 +72,7 @@ slave-bin.000001 # Query # # use `test`; CREATE OR REPLACE table t1 like t2
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE `t1` (
`a_in_temporary` int(11) DEFAULT NULL
-)
+) ENGINE=MyISAM
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by server */
#
@@ -172,7 +172,7 @@ slave-bin.000001 # Query # # COMMIT
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `test`; CREATE TABLE `t4` (
`a` int(11) DEFAULT NULL
-)
+) ENGINE=MyISAM
slave-bin.000001 # Gtid # # BEGIN GTID #-#-#
slave-bin.000001 # Query # # use `test`; CREATE TABLE `t5` (
`a` int(11) DEFAULT NULL
diff --git a/mysql-test/suite/rpl/r/create_or_replace_statement.result b/mysql-test/suite/rpl/r/create_or_replace_statement.result
index 663557cc1f3..7bdbc64e9f2 100644
--- a/mysql-test/suite/rpl/r/create_or_replace_statement.result
+++ b/mysql-test/suite/rpl/r/create_or_replace_statement.result
@@ -153,7 +153,7 @@ slave-bin.000001 # Query # # COMMIT
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `test`; CREATE TABLE `t4` (
`a` int(11) DEFAULT NULL
-)
+) ENGINE=MyISAM
slave-bin.000001 # Gtid # # BEGIN GTID #-#-#
slave-bin.000001 # Query # # use `test`; CREATE TABLE `t5` (
`a` int(11) DEFAULT NULL
diff --git a/mysql-test/suite/rpl/r/rpl_killed_ddl.result b/mysql-test/suite/rpl/r/rpl_killed_ddl.result
index a02c9b599bf..ed8745ca2c1 100644
--- a/mysql-test/suite/rpl/r/rpl_killed_ddl.result
+++ b/mysql-test/suite/rpl/r/rpl_killed_ddl.result
@@ -56,6 +56,10 @@ CREATE VIEW v1 AS SELECT a FROM t1 WHERE a < 100;
CREATE DATABASE d2;
source include/kill_query.inc;
include/rpl_diff.inc
+ALTER DATABASE d1
+DEFAULT CHARACTER SET = 'utf8';
+source include/kill_query.inc;
+include/rpl_diff.inc
DROP DATABASE d1;
source include/kill_query.inc;
include/rpl_diff.inc
@@ -83,6 +87,9 @@ include/rpl_diff.inc
DROP FUNCTION f1;
source include/kill_query.inc;
include/rpl_diff.inc
+DROP FUNCTION IF EXISTS f2;
+source include/kill_query.inc;
+include/rpl_diff.inc
CREATE PROCEDURE p2 (OUT rows INT)
BEGIN
SELECT COUNT(*) INTO rows FROM t2;
@@ -96,6 +103,9 @@ include/rpl_diff.inc
DROP PROCEDURE p1;
source include/kill_query.inc;
include/rpl_diff.inc
+DROP PROCEDURE IF EXISTS p2;
+source include/kill_query.inc;
+include/rpl_diff.inc
CREATE TABLE t2 (b int);
source include/kill_query.inc;
include/rpl_diff.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_create_table.result b/mysql-test/suite/rpl/r/rpl_row_create_table.result
index 283e769ce9a..31c4a823f70 100644
--- a/mysql-test/suite/rpl/r/rpl_row_create_table.result
+++ b/mysql-test/suite/rpl/r/rpl_row_create_table.result
@@ -194,7 +194,7 @@ master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; CREATE TABLE `t9` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL
-)
+) ENGINE=MyISAM
**** On Slave ****
SHOW CREATE TABLE t8;
Table t8
@@ -207,7 +207,7 @@ Table t9
Create Table CREATE TABLE `t9` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8,t9;
STOP SLAVE;
include/wait_for_slave_to_stop.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_merge_engine.result b/mysql-test/suite/rpl/r/rpl_row_merge_engine.result
index c61167e84e0..3b2e02bf97c 100644
--- a/mysql-test/suite/rpl/r/rpl_row_merge_engine.result
+++ b/mysql-test/suite/rpl/r/rpl_row_merge_engine.result
@@ -4,8 +4,9 @@ CREATE TABLE t1 (a int) ENGINE=MyISAM;
CREATE TABLE t2 (a int) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1), (2), (3);
INSERT INTO t2 VALUES (4), (5), (6);
-CREATE TABLE IF NOT EXISTS t1_merge LIKE t1;
-ALTER TABLE t1_merge ENGINE=MERGE UNION (t2, t1);
+CREATE TEMPORARY TABLE IF NOT EXISTS tt1_merge LIKE t1;
+ALTER TABLE tt1_merge ENGINE=MERGE UNION (t2, t1);
+CREATE TABLE t1_merge LIKE tt1_merge;
include/diff_tables.inc [master:test.t1, slave:test.t1]
include/diff_tables.inc [master:test.t2, slave:test.t2]
UPDATE t1_merge SET a=10 WHERE a=1;
diff --git a/mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL_innodb.result b/mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL_innodb.result
new file mode 100644
index 00000000000..4a5bc3b76e5
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL_innodb.result
@@ -0,0 +1,13 @@
+include/master-slave.inc
+[connection master]
+CREATE TEMPORARY TABLE temp_t1 (c1 INT) ENGINE=InnoDB;
+CREATE TEMPORARY TABLE temp_t2 (c1 INT) ENGINE=MyISAM;
+CREATE TABLE t1 LIKE temp_t1;
+CREATE TABLE t2 LIKE temp_t2;
+include/assert.inc ["t1 on master and temp_t1 have the same storage engine"]
+include/assert.inc ["t2 on master and temp_t2 have the same storage engine"]
+include/assert.inc ["t1 on slave and temp_t1 have the same storage engine"]
+include/assert.inc ["t2 on slave and temp_t2 have the same storage engine"]
+DROP TEMPORARY TABLE temp_t1, temp_t2;
+DROP TABLE t1, t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_killed_ddl.test b/mysql-test/suite/rpl/t/rpl_killed_ddl.test
index eff0392d5de..a910ab4bc5c 100644
--- a/mysql-test/suite/rpl/t/rpl_killed_ddl.test
+++ b/mysql-test/suite/rpl/t/rpl_killed_ddl.test
@@ -26,10 +26,8 @@
#
# There are some part of the test are temporarily disabled because of
# the following bugs, please enable then once they get fixed:
-# - BUG#44041
-# - BUG#43353
-# - BUG#25705
-# - BUG#44171
+# - BUG#22473427
+# - Bug#22587377
# Temporarily disabled on Windows due to bug #47638
--source include/not_windows.inc
@@ -148,11 +146,9 @@ let $rpl_diff_statement= SELECT schema_name FROM information_schema.schemata
send CREATE DATABASE d2;
source include/kill_query_and_diff_master_slave.inc;
-# Temporarily disabled, see BUG#44041, the ALTER DATABASE can affect the
-# collation of other database on slave
-#send ALTER DATABASE d1
-# DEFAULT CHARACTER SET = 'utf8';
-#source include/kill_query_and_diff_master_slave.inc;
+send ALTER DATABASE d1
+ DEFAULT CHARACTER SET = 'utf8';
+source include/kill_query_and_diff_master_slave.inc;
send DROP DATABASE d1;
source include/kill_query_and_diff_master_slave.inc;
@@ -171,8 +167,8 @@ send CREATE EVENT e2
DO INSERT INTO test.t1 VALUES (2);
source include/kill_query_and_diff_master_slave.inc;
-# Temporarily disabled because of BUG#44171, killing ALTER EVENT can
-# crash the server
+# Temporarily disabled,see Bug#22587377-RPL.RPL_KILLED_DDL
+# FAILS SPORADICALLY ON PB2 IN 5.5 AND 5.6
#send ALTER EVENT e1
# ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 2 DAY;
#source include/kill_query_and_diff_master_slave.inc;
@@ -201,16 +197,8 @@ source include/kill_query_and_diff_master_slave.inc;
# function f2 probably does not exist because the CREATE query was
# killed
-#
-# Temporarily disabled. Because of BUG#43353, KILL the query may
-# result in function not found, and for 5.1, DROP statements will be
-# logged if the function is not found on master, so the following DROP
-# FUNCTION statement may be interrupted and not drop the function on
-# master, but still get logged and executed on slave and cause
-# inconsistence. Also disable the following DROP PROCEDURE IF EXITS
-# below.
-#send DROP FUNCTION IF EXISTS f2;
-#source include/kill_query_and_diff_master_slave.inc;
+send DROP FUNCTION IF EXISTS f2;
+source include/kill_query_and_diff_master_slave.inc;
######## PROCEDURE ########
@@ -231,9 +219,8 @@ source include/kill_query_and_diff_master_slave.inc;
send DROP PROCEDURE p1;
source include/kill_query_and_diff_master_slave.inc;
-# Temporarily disabled because of bug#43353, see comment above for DROP FUNCTION IF EXISTS
-#send DROP PROCEDURE IF EXISTS p2;
-#source include/kill_query_and_diff_master_slave.inc;
+send DROP PROCEDURE IF EXISTS p2;
+source include/kill_query_and_diff_master_slave.inc;
######## TABLE ########
@@ -261,9 +248,10 @@ source include/kill_query_and_diff_master_slave.inc;
######## SERVER ########
-# Tempoarily disabled, see bug#25705
+# Temporarily disabled, see Bug #22473427 - DROP SERVER FAILS
+# AFTER ALTER SERVER+KILL QUERY
-# --let $rpl_diff_statement= SELECT * FROM mysql.server WHERE name like \'s%\'
+# --let $rpl_diff_statement= SELECT * FROM mysql.servers WHERE Server_name like \'s%\'
# send CREATE SERVER s2
# FOREIGN DATA WRAPPER mysql
diff --git a/mysql-test/suite/rpl/t/rpl_row_merge_engine.test b/mysql-test/suite/rpl/t/rpl_row_merge_engine.test
index 5add8dc1cda..dcbb8b891d8 100644
--- a/mysql-test/suite/rpl/t/rpl_row_merge_engine.test
+++ b/mysql-test/suite/rpl/t/rpl_row_merge_engine.test
@@ -20,8 +20,10 @@ CREATE TABLE t1 (a int) ENGINE=MyISAM;
CREATE TABLE t2 (a int) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1), (2), (3);
INSERT INTO t2 VALUES (4), (5), (6);
-CREATE TABLE IF NOT EXISTS t1_merge LIKE t1;
-ALTER TABLE t1_merge ENGINE=MERGE UNION (t2, t1);
+# Changed a little to check also an issue reported on BUG#20574550
+CREATE TEMPORARY TABLE IF NOT EXISTS tt1_merge LIKE t1;
+ALTER TABLE tt1_merge ENGINE=MERGE UNION (t2, t1);
+CREATE TABLE t1_merge LIKE tt1_merge;
--sync_slave_with_master
diff --git a/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL_innodb.test b/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL_innodb.test
new file mode 100644
index 00000000000..1a09b685249
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL_innodb.test
@@ -0,0 +1,55 @@
+source include/have_innodb.inc;
+source include/have_binlog_format_row.inc;
+source include/master-slave.inc;
+#
+# BUG#20574550
+# CREATE TABLE LIKE <TEMP_TABLE> does not preserve original table storage
+# engine when using row based replication
+#
+--connection master
+
+# Define temp_t1 and temp_t2 storage engines
+--let $engine_temp_t1= InnoDB
+--let $engine_temp_t2= MyISAM
+
+# Create the two temporary tables
+--eval CREATE TEMPORARY TABLE temp_t1 (c1 INT) ENGINE=$engine_temp_t1
+--eval CREATE TEMPORARY TABLE temp_t2 (c1 INT) ENGINE=$engine_temp_t2
+
+# Create t1 and t2 based on temporary tables
+CREATE TABLE t1 LIKE temp_t1;
+CREATE TABLE t2 LIKE temp_t2;
+--sync_slave_with_master
+
+# On master
+--connection master
+# Assert that t1 and t2 have the same storage engines as temp_t1 and temp_t2
+--let $engine_t1= query_get_value(SHOW TABLE STATUS WHERE Name='t1', Engine, 1)
+--let $assert_cond= "$engine_t1" = "$engine_temp_t1"
+--let $assert_text= "t1 on master and temp_t1 have the same storage engine"
+--source include/assert.inc
+
+--let $engine_t2= query_get_value(SHOW TABLE STATUS WHERE Name='t2', Engine, 1)
+--let $assert_cond= "$engine_t2" = "$engine_temp_t2"
+--let $assert_text= "t2 on master and temp_t2 have the same storage engine"
+--source include/assert.inc
+
+# On slave
+--connection slave
+# Assert that t1 and t2 have the same storage engines as temp_t1 and temp_t2
+--let $engine_t1= query_get_value(SHOW TABLE STATUS WHERE Name='t1', Engine, 1)
+--let $assert_cond= "$engine_t1" = "$engine_temp_t1"
+--let $assert_text= "t1 on slave and temp_t1 have the same storage engine"
+--source include/assert.inc
+
+--let $engine_t2= query_get_value(SHOW TABLE STATUS WHERE Name='t2', Engine, 1)
+--let $assert_cond= "$engine_t2" = "$engine_temp_t2"
+--let $assert_text= "t2 on slave and temp_t2 have the same storage engine"
+--source include/assert.inc
+
+# Cleanup
+--connection master
+DROP TEMPORARY TABLE temp_t1, temp_t2;
+DROP TABLE t1, t2;
+--source include/rpl_end.inc
+
diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb,xtradb.rdiff b/mysql-test/suite/sys_vars/r/sysvars_innodb,xtradb.rdiff
index a9e975313db..002cf66300a 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_innodb,xtradb.rdiff
+++ b/mysql-test/suite/sys_vars/r/sysvars_innodb,xtradb.rdiff
@@ -183,7 +183,7 @@
COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME INNODB_EMPTY_FREE_LIST_ALGORITHM
+SESSION_VALUE NULL
-+GLOBAL_VALUE BACKOFF
++GLOBAL_VALUE LEGACY
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE BACKOFF
+VARIABLE_SCOPE GLOBAL
@@ -571,21 +571,14 @@
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
-@@ -2203,14 +2637,28 @@
+@@ -2217,6 +2651,34 @@
ENUM_VALUE_LIST NULL
READ_ONLY NO
- COMMAND_LINE_ARGUMENT REQUIRED
--VARIABLE_NAME INNODB_TMPDIR
--SESSION_VALUE
--GLOBAL_VALUE
+ COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME INNODB_TRACK_CHANGED_PAGES
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
- GLOBAL_VALUE_ORIGIN COMPILE-TIME
--DEFAULT_VALUE
--VARIABLE_SCOPE SESSION
--VARIABLE_TYPE VARCHAR
--VARIABLE_COMMENT Directory for temporary non-tablespace files.
++GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
@@ -604,10 +597,16 @@
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Force log tracker to catch up with checkpoint now
- NUMERIC_MIN_VALUE NULL
- NUMERIC_MAX_VALUE NULL
- NUMERIC_BLOCK_SIZE NULL
-@@ -2294,7 +2742,7 @@
++NUMERIC_MIN_VALUE NULL
++NUMERIC_MAX_VALUE NULL
++NUMERIC_BLOCK_SIZE NULL
++ENUM_VALUE_LIST NULL
++READ_ONLY NO
++COMMAND_LINE_ARGUMENT OPTIONAL
+ VARIABLE_NAME INNODB_TRX_PURGE_VIEW_UPDATE_ONLY_DEBUG
+ SESSION_VALUE NULL
+ GLOBAL_VALUE OFF
+@@ -2294,7 +2756,7 @@
DEFAULT_VALUE OFF
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BOOLEAN
@@ -616,7 +615,7 @@
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
-@@ -2315,6 +2763,20 @@
+@@ -2315,6 +2777,20 @@
ENUM_VALUE_LIST NULL
READ_ONLY YES
COMMAND_LINE_ARGUMENT NONE
@@ -637,7 +636,7 @@
VARIABLE_NAME INNODB_USE_MTFLUSH
SESSION_VALUE NULL
GLOBAL_VALUE OFF
-@@ -2329,6 +2791,20 @@
+@@ -2329,6 +2805,20 @@
ENUM_VALUE_LIST NULL
READ_ONLY YES
COMMAND_LINE_ARGUMENT NONE
@@ -658,12 +657,12 @@
VARIABLE_NAME INNODB_USE_SYS_MALLOC
SESSION_VALUE NULL
GLOBAL_VALUE ON
-@@ -2359,12 +2835,12 @@
+@@ -2359,12 +2849,12 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME INNODB_VERSION
SESSION_VALUE NULL
--GLOBAL_VALUE 5.6.29
-+GLOBAL_VALUE 5.6.28-76.1
+-GLOBAL_VALUE 5.6.30
++GLOBAL_VALUE 5.6.29-76.2
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE NULL
VARIABLE_SCOPE GLOBAL
diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb.result b/mysql-test/suite/sys_vars/r/sysvars_innodb.result
index 0ddc401e618..4f09270a6aa 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_innodb.result
+++ b/mysql-test/suite/sys_vars/r/sysvars_innodb.result
@@ -2359,7 +2359,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME INNODB_VERSION
SESSION_VALUE NULL
-GLOBAL_VALUE 5.6.29
+GLOBAL_VALUE 5.6.30
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE NULL
VARIABLE_SCOPE GLOBAL
diff --git a/mysql-test/suite/sys_vars/t/innodb_buffer_pool_load_now_basic.test b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_load_now_basic.test
index 160b3ba52cc..a0409901865 100644
--- a/mysql-test/suite/sys_vars/t/innodb_buffer_pool_load_now_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_load_now_basic.test
@@ -13,11 +13,19 @@ let $old_status= `SELECT variable_value FROM information_schema.global_status
# A previous test could have run buffer pool dump already;
# in this case we want to make sure that the current time is different
-# from the timestamp in the status variable
-
-let $wait_condition =
- SELECT TRIM(SUBSTR('$old_status', -8)) != DATE_FORMAT(CURTIME(), '%k:%i:%s');
--- source include/wait_condition.inc
+# from the timestamp in the status variable.
+# We should have had a smart wait condition here, like the commented one below,
+# but we can't because of MDEV-9867, so there will be just sleep instead.
+# And it might be not enough to sleep one second, so we'll have to sleep two.
+# let $wait_condition =
+# SELECT TRIM(SUBSTR('$old_status', -8)) != DATE_FORMAT(CURTIME(), '%k:%i:%s');
+# -- source include/wait_condition.inc
+
+if (`SELECT variable_value LIKE '%dump completed at%' FROM information_schema.global_status
+ WHERE LOWER(variable_name) = 'innodb_buffer_pool_dump_status'`)
+{
+ -- sleep 2
+}
# Do the dump
SET GLOBAL innodb_buffer_pool_dump_now = ON;
diff --git a/mysql-test/suite/sys_vars/t/innodb_empty_free_list_algorithm_basic.opt b/mysql-test/suite/sys_vars/t/innodb_empty_free_list_algorithm_basic.opt
new file mode 100644
index 00000000000..c788dc76ac7
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_empty_free_list_algorithm_basic.opt
@@ -0,0 +1 @@
+--loose-innodb-buffer-pool-size=20M
diff --git a/mysql-test/t/alter_table_online.test b/mysql-test/t/alter_table_online.test
index 6386a1551e1..22ebadd64f9 100644
--- a/mysql-test/t/alter_table_online.test
+++ b/mysql-test/t/alter_table_online.test
@@ -3,9 +3,7 @@
#
--source include/have_innodb.inc
---disable_warnings
-drop table if exists t1,t2,t3;
---enable_warnings
+--source include/have_partition.inc
#
# Test of things that can be done online
#
@@ -102,6 +100,28 @@ create table t3 (a int not null primary key, b int, c varchar(80)) engine=merge
alter online table t3 union=(t1,t2);
drop table t1,t2,t3;
+#
+# MDEV-9868 Altering a partitioned table comment does a full copy
+#
+create table t1 (i int) partition by hash(i) partitions 2;
+alter online table t1 comment 'test';
+drop table t1;
+
+#
+# MDEV-9168 altering a column comment does a full copy
+#
+create table t1 (a int);
+alter online table t1 modify a int comment 'test';
+drop table t1;
+
+create table t1 (a int) engine=innodb;
+alter online table t1 modify a int comment 'test';
+drop table t1;
+
+create table t1 (a int) partition by hash(a) partitions 2;
+alter online table t1 modify a int comment 'test';
+drop table t1;
+
--echo #
--echo # MDEV-8948 ALTER ... INPLACE does work for BINARY, BLOB
--echo #
diff --git a/mysql-test/t/bigint.test b/mysql-test/t/bigint.test
index 41f33b8a7f2..fb18d60edd9 100644
--- a/mysql-test/t/bigint.test
+++ b/mysql-test/t/bigint.test
@@ -409,3 +409,8 @@ SELECT * FROM t1 WHERE a=0.9;
SELECT * FROM t1 WHERE a IN (0.8,0.9);
DROP TABLE t1;
+
+--echo #
+--echo # MDEV-9372 select 100 between 1 and 9223372036854775808 returns false
+--echo #
+SELECT 100 BETWEEN 1 AND 9223372036854775808;
diff --git a/mysql-test/t/bootstrap.test b/mysql-test/t/bootstrap.test
index 840b9a12cee..35f0a46af70 100644
--- a/mysql-test/t/bootstrap.test
+++ b/mysql-test/t/bootstrap.test
@@ -80,7 +80,7 @@ EOF
--write_file $MYSQLTEST_VARDIR/tmp/bootstrap_plugins.sql
SET SQL_MODE="";
use test;
-create table t1(a int) engine=example;
+create table t1(a int) engine=example charset=latin1;
EOF
--exec $MYSQLD_BOOTSTRAP_CMD --plugin-dir=$PLUGIN_DIR < $MYSQLTEST_VARDIR/tmp/bootstrap_plugins.sql >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1
--remove_file $MYSQLTEST_VARDIR/tmp/bootstrap_plugins.sql
diff --git a/mysql-test/t/cache_temporal_4265.test b/mysql-test/t/cache_temporal_4265.test
index 6135438f023..c62f3c3c506 100644
--- a/mysql-test/t/cache_temporal_4265.test
+++ b/mysql-test/t/cache_temporal_4265.test
@@ -7,5 +7,16 @@ create table t1 (a date);
insert t1 values ('2000-01-02'), ('2001-02-03'), ('2002-03-04');
set debug_dbug='d,str_to_datetime_warn';
select * from t1 where a > date_add('2000-01-01', interval 5 day);
+set debug_dbug='';
+drop table t1;
+
+#
+# MDEV-9707 MAX(timestamp(6) column) in correlated sub-query returns non-existent row data in original table
+#
+create table t1 (id int not null, ut timestamp(6) not null);
+insert into t1 values(1, '2001-01-01 00:00:00.2');
+insert into t1 values(1, '2001-01-01 00:00:00.1');
+select * from t1;
+select (select max(m2.ut) from t1 m2 where m1.id <> 0) from t1 m1;
drop table t1;
diff --git a/mysql-test/t/case.test b/mysql-test/t/case.test
index 957c4ac5c9d..7cc74c52b28 100644
--- a/mysql-test/t/case.test
+++ b/mysql-test/t/case.test
@@ -194,6 +194,16 @@ select case t1.f1 when '00:00:00' then 1 end from t1;
drop table t1;
--echo #
+--echo # MDEV-9745 Crash with CASE WHEN TRUE THEN COALESCE(CAST(NULL AS UNSIGNED)) ELSE 4 END
+--echo #
+CREATE TABLE t1 SELECT CASE WHEN TRUE THEN COALESCE(CAST(NULL AS UNSIGNED)) ELSE 4 END AS a;
+DESCRIBE t1;
+DROP TABLE t1;
+CREATE TABLE t1 SELECT CASE WHEN TRUE THEN COALESCE(CAST(NULL AS UNSIGNED)) ELSE 40 END AS a;
+DESCRIBE t1;
+DROP TABLE t1;
+
+--echo #
--echo # Start of 10.1 test
--echo #
diff --git a/mysql-test/t/ctype_cp850.test b/mysql-test/t/ctype_cp850.test
new file mode 100644
index 00000000000..358829eb351
--- /dev/null
+++ b/mysql-test/t/ctype_cp850.test
@@ -0,0 +1,16 @@
+--echo #
+--echo # Start of 5.5 tests
+--echo #
+
+--echo #
+--echo # MDEV-9862 Illegal mix of collation, when comparing column with CASE expression
+--echo #
+SET NAMES cp850;
+CREATE TABLE t1 (a CHAR(1) CHARACTER SET latin1);
+SELECT a FROM t1 WHERE CASE a WHEN 'aaaa' THEN 'Y' WHEN 'aaaa' THEN 'Y' ELSE NULL END <> a;
+DROP TABLE t1;
+
+
+--echo #
+--echo # End of 5.5 tests
+--echo #
diff --git a/mysql-test/t/events_2.test b/mysql-test/t/events_2.test
index 7d9ac7c5858..20f17966b29 100644
--- a/mysql-test/t/events_2.test
+++ b/mysql-test/t/events_2.test
@@ -69,10 +69,10 @@ select /*2*/ user, host, db, command, state, info
select release_lock("test_lock2");
drop event закачка;
-# Wait for release_lock("test_lock2") to complete,
+# Wait for get_lock("test_lock2") to complete,
# to avoid polluting the next test information_schema.processlist
let $wait_condition= select count(*) = 0 from information_schema.processlist
- where (state like 'User lock%' AND info like 'select get_lock%');
+ where info='select get_lock("test_lock2", 20)';
--source include/wait_condition.inc
diff --git a/mysql-test/t/fulltext3.test b/mysql-test/t/fulltext3.test
index 1b6a07c540f..66f940b495e 100644
--- a/mysql-test/t/fulltext3.test
+++ b/mysql-test/t/fulltext3.test
@@ -32,3 +32,18 @@ INSERT INTO t1 VALUES(0xA3C2);
DROP TABLE t1;
# End of 5.1 tests
+
+#
+# MDEV-9986 Full-text search of the utf8mb4 column causes crash
+#
+create table t1 (
+ id varchar(255),
+ business_name text null collate utf8mb4_unicode_ci,
+ street_address text,
+ fulltext index ft (business_name),
+ fulltext index ft2 (street_address)
+);
+--error ER_FT_MATCHING_KEY_NOT_FOUND
+select * from t1 where match (business_name, street_address) against ('some business name and address here');
+select * from t1 where match (business_name, street_address) against ('some business name and address here' in boolean mode);
+drop table t1;
diff --git a/mysql-test/t/func_des_encrypt.test b/mysql-test/t/func_des_encrypt.test
index e121aedab06..c9661b81cc0 100644
--- a/mysql-test/t/func_des_encrypt.test
+++ b/mysql-test/t/func_des_encrypt.test
@@ -1,4 +1,4 @@
--- source include/have_ssl_crypto_functs.inc
+-- source include/have_des.inc
# This test can't be in func_encrypt.test, because it requires
# --des-key-file to not be set.
diff --git a/mysql-test/t/func_encrypt.test b/mysql-test/t/func_encrypt.test
index 4eab0ac87e9..ed3e0a7b2d1 100644
--- a/mysql-test/t/func_encrypt.test
+++ b/mysql-test/t/func_encrypt.test
@@ -1,4 +1,4 @@
--- source include/have_ssl_crypto_functs.inc
+-- source include/have_des.inc
--disable_warnings
drop table if exists t1;
diff --git a/mysql-test/t/func_encrypt_ucs2.test b/mysql-test/t/func_encrypt_ucs2.test
index 8b4cd44d354..1242c3b9e6a 100644
--- a/mysql-test/t/func_encrypt_ucs2.test
+++ b/mysql-test/t/func_encrypt_ucs2.test
@@ -1,4 +1,4 @@
--- source include/have_ssl_crypto_functs.inc
+-- source include/have_des.inc
-- source include/have_ucs2.inc
--echo #
diff --git a/mysql-test/t/func_math.test b/mysql-test/t/func_math.test
index b48f4599074..da478080ab4 100644
--- a/mysql-test/t/func_math.test
+++ b/mysql-test/t/func_math.test
@@ -486,6 +486,14 @@ SELECT -a FROM t1;
--error ER_DATA_OUT_OF_RANGE
SELECT -b FROM t1;
+# try with two rows now
+INSERT INTO t1 VALUES(0,0);
+
+--error ER_DATA_OUT_OF_RANGE
+SELECT -a FROM t1;
+--error ER_DATA_OUT_OF_RANGE
+SELECT -b FROM t1;
+
DROP TABLE t1;
# Decimal overflows
diff --git a/mysql-test/t/grant5.test b/mysql-test/t/grant5.test
index db953d97fb3..14f2fd65020 100644
--- a/mysql-test/t/grant5.test
+++ b/mysql-test/t/grant5.test
@@ -5,3 +5,21 @@
#
--error ER_NONEXISTING_GRANT
SHOW GRANTS FOR root@invalid_host;
+
+#
+# MDEV-9580 SHOW GRANTS FOR <current_user> fails
+#
+create user test;
+create user foo;
+create role foo;
+grant foo to test;
+--connect (conn_1, localhost, test,,)
+set role foo;
+show grants for test; # user
+show grants for foo; # role
+--error ER_DBACCESS_DENIED_ERROR
+show grants for foo@'%'; # user
+--connection default
+drop user test, foo;
+drop role foo;
+
diff --git a/mysql-test/t/insert_innodb.test b/mysql-test/t/insert_innodb.test
new file mode 100644
index 00000000000..8c8d2690c11
--- /dev/null
+++ b/mysql-test/t/insert_innodb.test
@@ -0,0 +1,43 @@
+--source include/have_innodb.inc
+
+#
+# MDEV-8979 IGNORE does not ignore the error 1452
+#
+
+--echo #
+--echo # BUG#22037930: INSERT IGNORE FAILS TO IGNORE
+--echo # FOREIGN KEY CONSTRAINT
+
+--echo # Setup.
+CREATE TABLE t1 (fld1 INT PRIMARY KEY) ENGINE=INNODB;
+CREATE TABLE t2 (fld2 INT, FOREIGN KEY (fld2) REFERENCES t1 (fld1))
+ENGINE=INNODB;
+INSERT INTO t1 VALUES(0);
+INSERT INTO t2 VALUES(0);
+
+--echo # Without fix, an error is reported.
+INSERT IGNORE INTO t2 VALUES(1);
+UPDATE IGNORE t2 SET fld2=20 WHERE fld2=0;
+UPDATE IGNORE t1 SET fld1=20 WHERE fld1=0;
+
+--echo # Test for multi update.
+UPDATE IGNORE t1, t2 SET t2.fld2= t2.fld2 + 3;
+UPDATE IGNORE t1, t2 SET t1.fld1= t1.fld1 + 3;
+
+--echo # Reports an error since IGNORE is not used.
+--error ER_NO_REFERENCED_ROW_2
+INSERT INTO t2 VALUES(1);
+
+--error ER_NO_REFERENCED_ROW_2
+UPDATE t2 SET fld2=20 WHERE fld2=0;
+
+--error ER_ROW_IS_REFERENCED_2
+UPDATE t1 SET fld1=20 WHERE fld1=0;
+
+--error ER_NO_REFERENCED_ROW_2
+UPDATE t1, t2 SET t2.fld2= t2.fld2 + 3;
+
+--error ER_ROW_IS_REFERENCED_2
+UPDATE t1, t2 SET t1.fld1= t1.fld1 + 3;
+
+DROP TABLE t2, t1;
diff --git a/mysql-test/t/kill_processlist-6619.test b/mysql-test/t/kill_processlist-6619.test
index 95af83be56d..551d36e03fd 100644
--- a/mysql-test/t/kill_processlist-6619.test
+++ b/mysql-test/t/kill_processlist-6619.test
@@ -23,5 +23,12 @@ SET DEBUG_SYNC='now SIGNAL go';
--error ER_QUERY_INTERRUPTED
reap;
SET DEBUG_SYNC='reset';
+
+# Wait until default connection has reset query string
+let $wait_condition=
+ SELECT COUNT(*) = 1 from information_schema.processlist
+ WHERE info is NULL;
+--source include/wait_condition.inc
+
--replace_column 1 # 3 # 6 # 7 #
SHOW PROCESSLIST;
diff --git a/mysql-test/t/locale.test b/mysql-test/t/locale.test
index 93e347b722d..5d1fd24d750 100644
--- a/mysql-test/t/locale.test
+++ b/mysql-test/t/locale.test
@@ -55,6 +55,14 @@ SELECT DATE_FORMAT('2001-01-06', '%w %a %W');
SELECT DATE_FORMAT('2001-01-07', '%w %a %W');
--echo End of 5.4 tests
+#
+# MDEV-9928 LC_TIME_NAMES=de_AT; unusual name for february
+#
+SET NAMES utf8;
+SET lc_time_names=de_AT;
+SELECT monthname('2001-01-01');
+SELECT monthname('2001-02-01');
+SELECT monthname('2001-03-01');
--echo #
--echo # Start of 5.6 tests
diff --git a/mysql-test/t/mdev6830-master.opt b/mysql-test/t/mdev6830-master.opt
deleted file mode 100644
index 2a8c27d4731..00000000000
--- a/mysql-test/t/mdev6830-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---debug
diff --git a/mysql-test/t/mdev6830.test b/mysql-test/t/mdev6830.test
index 24565d04fed..3898d5bbef6 100644
--- a/mysql-test/t/mdev6830.test
+++ b/mysql-test/t/mdev6830.test
@@ -1,10 +1,10 @@
-
+#
+# MDEV-6830 Server crashes in best_access_path after a sequence of SELECTs invollving a temptable view
+#
--source include/have_debug.inc
---disable_warnings
-drop table if exists t1,t2,t3;
-drop view if exists v2,v3;
---enable_warnings
+set @@debug_dbug= 'd,opt';
+
CREATE TABLE t1 (pk INT PRIMARY KEY) ENGINE=MyISAM;
CREATE TABLE t2 (
diff --git a/mysql-test/t/mysqld--help.test b/mysql-test/t/mysqld--help.test
index d7aba43999e..b37b33fa8a3 100644
--- a/mysql-test/t/mysqld--help.test
+++ b/mysql-test/t/mysqld--help.test
@@ -22,7 +22,7 @@ perl;
log-slow-queries pid-file slow-query-log-file log-basename
datadir slave-load-tmpdir tmpdir socket thread-pool-size
large-files-support lower-case-file-system system-time-zone
- log-tc-size version.*/;
+ collation-server character-set-server log-tc-size version.*/;
# Plugins which may or may not be there:
@plugins=qw/innodb archive blackhole federated partition
diff --git a/mysql-test/t/openssl_1.test b/mysql-test/t/openssl_1.test
index 8c81bdc9bbb..837206e2717 100644
--- a/mysql-test/t/openssl_1.test
+++ b/mysql-test/t/openssl_1.test
@@ -134,7 +134,7 @@ drop table t1;
# verification of servers certificate by setting both ca certificate
# and ca path to NULL
#
---replace_result DHE-RSA-AES256-GCM-SHA384 DHE-RSA-AES256-SHA
+--replace_result DHE-RSA-AES256-GCM-SHA384 DHE-RSA-AES256-SHA DHE-RSA-CHACHA20-POLY1305 DHE-RSA-AES256-SHA
--exec $MYSQL --ssl --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1
--echo End of 5.0 tests
@@ -259,7 +259,7 @@ select 'is still running; no cipher request crashed the server' as result from d
GRANT SELECT ON test.* TO bug42158@localhost REQUIRE X509;
FLUSH PRIVILEGES;
connect(con1,localhost,bug42158,,,,,SSL);
---replace_result DHE-RSA-AES256-GCM-SHA384 DHE-RSA-AES256-SHA
+--replace_result DHE-RSA-AES256-GCM-SHA384 DHE-RSA-AES256-SHA DHE-RSA-CHACHA20-POLY1305 DHE-RSA-AES256-SHA
SHOW STATUS LIKE 'Ssl_cipher';
disconnect con1;
connection default;
@@ -268,5 +268,12 @@ DROP USER bug42158@localhost;
set global sql_mode=default;
--echo End of 5.1 tests
+#
+# MDEV-9605 mysqlbinlog does not accept ssl-ca option as expected.
+#
+
+--error 1
+--exec $MYSQL_BINLOG --read-from-remote-server --ssl-ca --user=root --host=localhost nobinlog.111111
+
# Wait till we reached the initial number of concurrent sessions
--source include/wait_until_count_sessions.inc
diff --git a/mysql-test/t/openssl_6975.test b/mysql-test/t/openssl_6975.test
index 88fe17d0621..6e8e03a0a89 100644
--- a/mysql-test/t/openssl_6975.test
+++ b/mysql-test/t/openssl_6975.test
@@ -17,6 +17,7 @@ let $mysql=$MYSQL --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$
disable_abort_on_error;
echo TLS1.2 ciphers: user is ok with any cipher;
exec $mysql --ssl-cipher=AES128-SHA256;
+--replace_result DHE-RSA-CHACHA20-POLY1305 DHE-RSA-AES256-GCM-SHA384
exec $mysql --ssl-cipher=TLSv1.2;
echo TLS1.2 ciphers: user requires SSLv3 cipher RC4-SHA;
exec $mysql --user ssl_sslv3 --ssl-cipher=AES128-SHA256;
diff --git a/mysql-test/t/partition_innodb_plugin.test b/mysql-test/t/partition_innodb_plugin.test
index fd6e60c27fb..d25a4b95bf1 100644
--- a/mysql-test/t/partition_innodb_plugin.test
+++ b/mysql-test/t/partition_innodb_plugin.test
@@ -125,12 +125,8 @@ SEND;
UPDATE `t``\""e` SET a = 12 WHERE a = 0;
--echo # default connection
connection default;
-let $wait_timeout= 2;
-let $wait_condition= SELECT 1 FROM INFORMATION_SCHEMA.PROCESSLIST
-WHERE ID = $id_1 AND STATE = 'Searching rows for update';
+let $wait_condition= SELECT COUNT(*)=2 FROM INFORMATION_SCHEMA.INNODB_LOCKS;
--source include/wait_condition.inc
-#--echo # tested wait condition $wait_condition_reps times
-# INNODB_LOCKS only exists in innodb_plugin
--sorted_result
SELECT lock_table, COUNT(*) FROM INFORMATION_SCHEMA.INNODB_LOCKS
GROUP BY lock_table;
diff --git a/mysql-test/t/select_debug.test b/mysql-test/t/select_debug.test
index 4b77f9fd047..49415400db3 100644
--- a/mysql-test/t/select_debug.test
+++ b/mysql-test/t/select_debug.test
@@ -10,7 +10,7 @@ create table t2 (a int);
insert into t2 values (2), (3);
set session join_cache_level=3;
-set @@debug_dbug= 'd:t:O,/tmp/trace.out';
+set @@debug_dbug= 'd,opt';
explain select t1.b from t1,t2 where t1.b=t2.a;
select t1.b from t1,t2 where t1.b=t2.a;
diff --git a/mysql-test/t/set_password_plugin-9835.test b/mysql-test/t/set_password_plugin-9835.test
new file mode 100644
index 00000000000..6afccd74f9d
--- /dev/null
+++ b/mysql-test/t/set_password_plugin-9835.test
@@ -0,0 +1,131 @@
+#
+# MDEV-9835 Valid password is not working after server restart.
+#
+# Various combinations of SET PASSWORD and not-empty mysql.user.plugin field
+#
+--source include/not_embedded.inc
+
+--enable_connect_log
+
+set global secure_auth=0;
+
+# The hash (old and new) is for 'test'
+create user natauth@localhost identified via 'mysql_native_password' using '*94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29';
+
+create user newpass@localhost identified by password '*94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29';
+
+create user newpassnat@localhost identified via 'mysql_native_password';
+set password for newpassnat@localhost = '*94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29';
+
+create user oldauth@localhost identified with 'mysql_old_password' using '378b243e220ca493';
+
+create user oldpass@localhost identified by password '378b243e220ca493';
+
+create user oldpassold@localhost identified with 'mysql_old_password';
+set password for oldpassold@localhost = '378b243e220ca493';
+
+--sorted_result
+select user, host, password, plugin, authentication_string from mysql.user where user != 'root';
+
+--connect(con,localhost,natauth,test,)
+select current_user();
+--disconnect con
+--connect(con,localhost,newpass,test,)
+select current_user();
+--disconnect con
+--connect(con,localhost,newpassnat,test,)
+select current_user();
+--disconnect con
+--connect(con,localhost,oldauth,test,)
+select current_user();
+--disconnect con
+--connect(con,localhost,oldpass,test,)
+select current_user();
+--disconnect con
+--connect(con,localhost,oldpassold,test,)
+select current_user();
+--disconnect con
+
+--connection default
+
+flush privileges;
+
+--connect(con,localhost,natauth,test,)
+select current_user();
+--disconnect con
+--connect(con,localhost,newpass,test,)
+select current_user();
+--disconnect con
+--connect(con,localhost,newpassnat,test,)
+select current_user();
+--disconnect con
+--connect(con,localhost,oldauth,test,)
+select current_user();
+--disconnect con
+--connect(con,localhost,oldpass,test,)
+select current_user();
+--disconnect con
+--connect(con,localhost,oldpassold,test,)
+select current_user();
+--disconnect con
+
+--connection default
+
+# changing to the NEW password hash
+set password for natauth@localhost = PASSWORD('test2');
+set password for newpass@localhost = PASSWORD('test2');
+set password for newpassnat@localhost = PASSWORD('test2');
+set password for oldauth@localhost = PASSWORD('test2');
+set password for oldpass@localhost = PASSWORD('test2');
+set password for oldpassold@localhost = PASSWORD('test2');
+
+--sorted_result
+select user, host, password, plugin, authentication_string from mysql.user where user != 'root';
+
+--connect(con,localhost,natauth,test2,)
+select current_user();
+--disconnect con
+--connect(con,localhost,newpass,test2,)
+select current_user();
+--disconnect con
+--connect(con,localhost,newpassnat,test2,)
+select current_user();
+--disconnect con
+--connect(con,localhost,oldauth,test2,)
+select current_user();
+--disconnect con
+--connect(con,localhost,oldpass,test2,)
+select current_user();
+--disconnect con
+--connect(con,localhost,oldpassold,test2,)
+select current_user();
+--disconnect con
+
+--connection default
+
+flush privileges;
+
+--connect(con,localhost,natauth,test2,)
+select current_user();
+--disconnect con
+--connect(con,localhost,newpass,test2,)
+select current_user();
+--disconnect con
+--connect(con,localhost,newpassnat,test2,)
+select current_user();
+--disconnect con
+--connect(con,localhost,oldauth,test2,)
+select current_user();
+--disconnect con
+--connect(con,localhost,oldpass,test2,)
+select current_user();
+--disconnect con
+--connect(con,localhost,oldpassold,test2,)
+select current_user();
+--disconnect con
+
+--connection default
+drop user natauth@localhost, newpass@localhost, newpassnat@localhost;
+drop user oldauth@localhost, oldpass@localhost, oldpassold@localhost;
+set global secure_auth=default;
+
diff --git a/mysql-test/t/sp-threads.test b/mysql-test/t/sp-threads.test
index e1012e2b72d..7a6d1258331 100644
--- a/mysql-test/t/sp-threads.test
+++ b/mysql-test/t/sp-threads.test
@@ -77,12 +77,15 @@ call bug9486();
connection con2root;
lock tables t2 write;
connection con1root;
+let $con1root_id=`SELECT CONNECTION_ID()`;
send call bug9486();
connection con2root;
---sleep 2
# There should be call statement in locked state.
---replace_column 1 # 3 localhost 6 #
-show processlist;
+let $wait_condition=SELECT COUNT(*)=1 FROM information_schema.processlist WHERE
+ id=$con1root_id AND state='Waiting for table metadata lock';
+--source include/wait_condition.inc
+--replace_result $con1root_id con1root_id
+eval SELECT state,info FROM information_schema.processlist WHERE id=$con1root_id;
unlock tables;
connection con1root;
reap;
diff --git a/mysql-test/t/ssl.test b/mysql-test/t/ssl.test
index 0d14ad82692..21733f7e594 100644
--- a/mysql-test/t/ssl.test
+++ b/mysql-test/t/ssl.test
@@ -11,7 +11,7 @@
connect (ssl_con,localhost,root,,,,,SSL);
# Check ssl turned on
---replace_result DHE-RSA-AES256-GCM-SHA384 DHE-RSA-AES256-SHA
+--replace_result DHE-RSA-AES256-GCM-SHA384 DHE-RSA-AES256-SHA DHE-RSA-CHACHA20-POLY1305 DHE-RSA-AES256-SHA
SHOW STATUS LIKE 'Ssl_cipher';
# Check ssl expiration
@@ -22,7 +22,7 @@ SHOW STATUS LIKE 'Ssl_server_not_after';
-- source include/common-tests.inc
# Check ssl turned on
---replace_result DHE-RSA-AES256-GCM-SHA384 DHE-RSA-AES256-SHA
+--replace_result DHE-RSA-AES256-GCM-SHA384 DHE-RSA-AES256-SHA DHE-RSA-CHACHA20-POLY1305 DHE-RSA-AES256-SHA
SHOW STATUS LIKE 'Ssl_cipher';
#
diff --git a/mysql-test/t/ssl_compress.test b/mysql-test/t/ssl_compress.test
index 5e45e3824a2..28f3453c23e 100644
--- a/mysql-test/t/ssl_compress.test
+++ b/mysql-test/t/ssl_compress.test
@@ -11,7 +11,7 @@
connect (ssl_compress_con,localhost,root,,,,,SSL COMPRESS);
# Check ssl turned on
---replace_result DHE-RSA-AES256-GCM-SHA384 DHE-RSA-AES256-SHA
+--replace_result DHE-RSA-AES256-GCM-SHA384 DHE-RSA-AES256-SHA DHE-RSA-CHACHA20-POLY1305 DHE-RSA-AES256-SHA
SHOW STATUS LIKE 'Ssl_cipher';
# Check compression turned on
@@ -21,7 +21,7 @@ SHOW STATUS LIKE 'Compression';
-- source include/common-tests.inc
# Check ssl turned on
---replace_result DHE-RSA-AES256-GCM-SHA384 DHE-RSA-AES256-SHA
+--replace_result DHE-RSA-AES256-GCM-SHA384 DHE-RSA-AES256-SHA DHE-RSA-CHACHA20-POLY1305 DHE-RSA-AES256-SHA
SHOW STATUS LIKE 'Ssl_cipher';
# Check compression turned on
diff --git a/mysql-test/t/ssl_timeout-9836.opt b/mysql-test/t/ssl_timeout-9836.opt
new file mode 100644
index 00000000000..7a2696875b8
--- /dev/null
+++ b/mysql-test/t/ssl_timeout-9836.opt
@@ -0,0 +1 @@
+--loose-thread-handling=pool-of-threads
diff --git a/mysql-test/t/ssl_timeout-9836.test b/mysql-test/t/ssl_timeout-9836.test
new file mode 100644
index 00000000000..5b57917f3b8
--- /dev/null
+++ b/mysql-test/t/ssl_timeout-9836.test
@@ -0,0 +1,11 @@
+#
+# MDEV-9836 Connection lost when using SSL
+#
+-- source include/have_ssl_communication.inc
+connect(con1,localhost,root,,,,,SSL);
+SET @@net_read_timeout=1;
+SELECT 1;
+# MDEV-9836 - YASSL bug - SSL connection lost if it has been idle, for longer than net_read_timeout
+-- sleep 2
+SELECT 1;
+disconnect con1;
diff --git a/mysql-test/t/ssl_timeout.test b/mysql-test/t/ssl_timeout.test
index 0d96b3f6601..806b928aca0 100644
--- a/mysql-test/t/ssl_timeout.test
+++ b/mysql-test/t/ssl_timeout.test
@@ -7,7 +7,7 @@
connect (ssl_con,localhost,root,,,,,SSL read_timeout=5);
--echo # Check ssl turned on
---replace_result DHE-RSA-AES256-GCM-SHA384 DHE-RSA-AES256-SHA
+--replace_result DHE-RSA-AES256-GCM-SHA384 DHE-RSA-AES256-SHA DHE-RSA-CHACHA20-POLY1305 DHE-RSA-AES256-SHA
SHOW STATUS LIKE 'Ssl_cipher';
# --error CR_SERVER_LOST
diff --git a/mysql-test/t/type_date.test b/mysql-test/t/type_date.test
index 52ca2c85b15..ce76ad410b6 100644
--- a/mysql-test/t/type_date.test
+++ b/mysql-test/t/type_date.test
@@ -386,6 +386,36 @@ select 1 from t1 as t1_0 inner join t1 as t2 on (t1_0.a <=> now()) join t1 on 1;
drop table t1;
--echo #
+--echo # MDEV-9521 Least function returns 0000-00-00 for null date columns instead of null
+--echo #
+CREATE TABLE t1 (
+ id BIGINT NOT NULL,
+ date_debut DATE NOT NULL,
+ date_fin DATE DEFAULT NULL);
+CREATE TABLE t2(
+ id BIGINT NOT NULL,
+ date_debut DATE NOT NULL,
+ date_fin DATE DEFAULT NULL);
+INSERT INTO t1 VALUES (1,'2016-01-01','2016-01-31');
+INSERT INTO t1 VALUES (2,'2016-02-01',null);
+INSERT INTO t1 VALUES (3,'2016-03-01','2016-03-31');
+INSERT INTO t1 VALUES (4,'2016-04-01',null);
+
+INSERT INTO t2 VALUES (1,'2016-01-01','2016-01-31');
+INSERT INTO t2 VALUES (2,'2016-02-01','2016-01-28');
+INSERT INTO t2 VALUES (3,'2016-03-01',null);
+INSERT INTO t2 VALUES (4,'2016-04-01',null);
+SELECT t1.id,
+ GREATEST(t2.date_debut, t1.date_debut) AS date_debut,
+ LEAST(IFNULL(t2.date_fin, IFNULL(t1.date_fin, NULL)),
+ IFNULL(t1.date_fin, IFNULL(t2.date_fin, NULL))) AS date_fin
+FROM t1 LEFT JOIN t2 ON (t1.id=t2.id);
+DROP TABLE t1,t2;
+SELECT
+ LEAST(COALESCE(DATE(NULL), DATE(NULL)), COALESCE(DATE(NULL), DATE(NULL))) AS d0,
+ LEAST(IFNULL(DATE(NULL), DATE(NULL)), IFNULL(DATE(NULL), DATE(NULL))) AS d1;
+
+--echo #
--echo # MDEV-9511 Valgrind warnings 'Invalid read' in Field_newdate::cmp and Field_newdate::val_str
--echo #
CREATE TABLE t1 (f1 DATE, f2 VARCHAR(1));
diff --git a/mysql-test/t/type_timestamp.test b/mysql-test/t/type_timestamp.test
index 6188ed6b4d6..460769f8961 100644
--- a/mysql-test/t/type_timestamp.test
+++ b/mysql-test/t/type_timestamp.test
@@ -445,6 +445,14 @@ SELECT MAX(ts) = '2011-01-06 12:34:30' FROM t1;
SELECT MAX(dt) = '2011-01-06 12:34:30' FROM t1;
DROP TABLE t1;
+--echo #
+--echo # MDEV-9413 "datetime >= coalesce(c1(NULL))" doesn't return expected NULL
+--echo #
+CREATE TABLE t1(c1 TIMESTAMP(6) NULL DEFAULT NULL);
+INSERT INTO t1 VALUES(NULL);
+SELECT c1, '2016-06-13 20:00:00.000003' >= COALESCE( c1 ) FROM t1;
+DROP TABLE t1;
+
--echo End of 5.5 tests
--echo #
diff --git a/mysql-test/t/wait_timeout_not_windows.test b/mysql-test/t/wait_timeout_not_windows.test
new file mode 100644
index 00000000000..de4904fada2
--- /dev/null
+++ b/mysql-test/t/wait_timeout_not_windows.test
@@ -0,0 +1,16 @@
+source include/not_embedded.inc;
+source include/not_windows.inc;
+
+#
+# MDEV-7775 Wrong error message (Unknown error) when idle sessions are killed after wait_timeout
+#
+set global log_warnings=2;
+connect (foo,localhost,root);
+set @@wait_timeout=1;
+sleep 2;
+connection default;
+let SEARCH_FILE=$MYSQLTEST_VARDIR/log/mysqld.1.err;
+let SEARCH_RANGE= -50;
+let SEARCH_PATTERN= Aborted.*Got timeout reading communication packets;
+source include/search_pattern_in_file.inc;
+set global log_warnings=@@log_warnings;
diff --git a/mysql-test/valgrind.supp b/mysql-test/valgrind.supp
index b5c9b62049b..fd5699b04c6 100644
--- a/mysql-test/valgrind.supp
+++ b/mysql-test/valgrind.supp
@@ -1152,6 +1152,13 @@
fun:SSL_library_init
}
+{
+ libcrypto 2.2.1 leak
+ Memcheck:Leak
+ fun:malloc
+ ...
+ fun:ERR_get_state
+}
{
Problem with udf and libresolve