summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2018-06-30 16:39:20 +0200
committerSergei Golubchik <serg@mariadb.org>2018-06-30 16:39:20 +0200
commit36e59752e7fc70bc5179a3d730b5ce3ee58e4e30 (patch)
tree0d3e30ce973b2e1f044931c0eb1846d7192becda /mysql-test
parent7c0779da7c37f6ef6eff2f79dda6f1b0c57e3869 (diff)
parent1dd3c8f8ba49ec06e550d7376d27ff05ce024bec (diff)
downloadmariadb-git-36e59752e7fc70bc5179a3d730b5ce3ee58e4e30.tar.gz
Merge branch '10.2' into 10.3
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/main/alter_table.result23
-rw-r--r--mysql-test/main/alter_table.test15
-rw-r--r--mysql-test/main/analyze_stmt_orderby.result2
-rw-r--r--mysql-test/main/auto_increment.result32
-rw-r--r--mysql-test/main/auto_increment.test28
-rw-r--r--mysql-test/main/cte_nonrecursive.result34
-rw-r--r--mysql-test/main/cte_nonrecursive.test29
-rw-r--r--mysql-test/main/derived_cond_pushdown.result139
-rw-r--r--mysql-test/main/derived_cond_pushdown.test110
-rw-r--r--mysql-test/main/func_json.result8
-rw-r--r--mysql-test/main/func_json.test15
-rw-r--r--mysql-test/main/grant.result1
-rw-r--r--mysql-test/main/grant.test3
-rw-r--r--mysql-test/main/grant2.result8
-rw-r--r--mysql-test/main/grant2.test4
-rw-r--r--mysql-test/main/having.result17
-rw-r--r--mysql-test/main/having.test17
-rw-r--r--mysql-test/main/information_schema.result2
-rw-r--r--mysql-test/main/limit.result16
-rw-r--r--mysql-test/main/limit.test14
-rw-r--r--mysql-test/main/lock.result2
-rw-r--r--mysql-test/main/lock.test2
-rw-r--r--mysql-test/main/max_statement_time.result3
-rw-r--r--mysql-test/main/max_statement_time.test8
-rw-r--r--mysql-test/main/mysqldump.result15
-rw-r--r--mysql-test/main/mysqldump.test22
-rw-r--r--mysql-test/main/mysqlslap.result3
-rw-r--r--mysql-test/main/mysqlslap.test8
-rw-r--r--mysql-test/main/mysqltest_tracking_info.result31
-rw-r--r--mysql-test/main/mysqltest_tracking_info.test25
-rw-r--r--mysql-test/main/olap.result24
-rw-r--r--mysql-test/main/olap.test25
-rw-r--r--mysql-test/main/ps.result41
-rw-r--r--mysql-test/main/ps.test54
-rw-r--r--mysql-test/main/read_only_innodb.result8
-rw-r--r--mysql-test/main/read_only_innodb.test9
-rw-r--r--mysql-test/main/reset_connection.result7
-rw-r--r--mysql-test/main/reset_connection.test25
-rw-r--r--mysql-test/main/selectivity.result70
-rw-r--r--mysql-test/main/selectivity.test18
-rw-r--r--mysql-test/main/selectivity_innodb.result70
-rw-r--r--mysql-test/main/session_tracker_last_gtid.result34
-rw-r--r--mysql-test/main/session_tracker_last_gtid.test19
-rw-r--r--mysql-test/main/set_password.result (renamed from mysql-test/main/set_password_plugin-9835.result)37
-rw-r--r--mysql-test/main/set_password.test (renamed from mysql-test/main/set_password_plugin-9835.test)16
-rw-r--r--mysql-test/main/show_grants_with_plugin-7985.result6
-rw-r--r--mysql-test/main/show_grants_with_plugin-7985.test2
-rw-r--r--mysql-test/main/sp-security.result1
-rw-r--r--mysql-test/main/sp-security.test2
-rw-r--r--mysql-test/main/statistics.result21
-rw-r--r--mysql-test/main/statistics.test26
-rw-r--r--mysql-test/main/subselect_mat_cost_bugs.result2
-rw-r--r--mysql-test/main/subselect_sj2_mat.result147
-rw-r--r--mysql-test/main/subselect_sj2_mat.test129
-rw-r--r--mysql-test/main/subselect_sj_nonmerged.result6
-rw-r--r--mysql-test/main/type_blob.result16
-rw-r--r--mysql-test/main/type_blob.test18
-rw-r--r--mysql-test/main/type_decimal.result27
-rw-r--r--mysql-test/main/type_decimal.test21
-rwxr-xr-xmysql-test/mysql-test-run.pl2
-rw-r--r--mysql-test/std_data/frm/t1.frmbin0 -> 8584 bytes
-rw-r--r--mysql-test/suite/encryption/disabled.def2
-rw-r--r--mysql-test/suite/encryption/r/innodb-redo-nokeys.result2
-rw-r--r--mysql-test/suite/encryption/t/innodb-discard-import.test13
-rw-r--r--mysql-test/suite/encryption/t/innodb-missing-key.test2
-rw-r--r--mysql-test/suite/encryption/t/innodb-redo-nokeys.test2
-rw-r--r--mysql-test/suite/federated/have_federatedx.inc2
-rw-r--r--mysql-test/suite/funcs_1/r/is_engines_archive.result2
-rw-r--r--mysql-test/suite/funcs_1/r/is_engines_csv.result2
-rw-r--r--mysql-test/suite/funcs_1/r/is_engines_federated.result2
-rw-r--r--mysql-test/suite/funcs_1/r/is_engines_myisam.result2
-rw-r--r--mysql-test/suite/galera/disabled.def3
-rw-r--r--mysql-test/suite/galera/galera_2nodes_as_master_slave.cnf83
-rw-r--r--mysql-test/suite/galera/galera_2nodes_as_master_with_repl_filter.cnf87
-rw-r--r--mysql-test/suite/galera/r/MW-416.result114
-rw-r--r--mysql-test/suite/galera/r/galera#500.result10
-rw-r--r--mysql-test/suite/galera/r/galera_sst_mysqldump_with_key.result19
-rw-r--r--mysql-test/suite/galera/r/galera_var_dirty_reads.result2
-rw-r--r--mysql-test/suite/galera/t/MW-416.test134
-rw-r--r--mysql-test/suite/galera/t/galera#500.test38
-rw-r--r--mysql-test/suite/galera/t/galera_gcache_recover_manytrx.test13
-rw-r--r--mysql-test/suite/galera/t/galera_many_tables_pk.test4
-rw-r--r--mysql-test/suite/galera/t/galera_sst_mariabackup.test1
-rw-r--r--mysql-test/suite/galera/t/galera_sst_mysqldump.test1
-rw-r--r--mysql-test/suite/galera/t/galera_sst_mysqldump_with_key.cnf4
-rw-r--r--mysql-test/suite/galera/t/galera_sst_mysqldump_with_key.test14
-rw-r--r--mysql-test/suite/galera/t/galera_sst_rsync.test1
-rw-r--r--mysql-test/suite/galera/t/galera_sst_xtrabackup-v2-options.cnf2
-rw-r--r--mysql-test/suite/galera/t/galera_sst_xtrabackup-v2.test1
-rw-r--r--mysql-test/suite/galera/t/galera_var_dirty_reads.test5
-rw-r--r--mysql-test/suite/galera_3nodes/r/galera_evs_suspect_timeout.result1
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_evs_suspect_timeout.test1
-rw-r--r--mysql-test/suite/handler/handler.inc2
-rw-r--r--mysql-test/suite/handler/ps.result9
-rw-r--r--mysql-test/suite/handler/ps.test11
-rw-r--r--mysql-test/suite/heap/heap_auto_increment.result29
-rw-r--r--mysql-test/suite/heap/heap_auto_increment.test25
-rw-r--r--mysql-test/suite/innodb/r/innodb_query_cache.result39
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug27216817.test28
-rw-r--r--mysql-test/suite/innodb/t/innodb_query_cache.test47
-rw-r--r--mysql-test/suite/maria/maria.result29
-rw-r--r--mysql-test/suite/maria/maria.test24
-rw-r--r--mysql-test/suite/mariabackup/apply-log-only-incr.test4
-rw-r--r--mysql-test/suite/mariabackup/mdev-14447.test4
-rw-r--r--mysql-test/suite/mariabackup/rename_during_mdl_lock.result3
-rw-r--r--mysql-test/suite/mariabackup/rename_during_mdl_lock.test13
-rw-r--r--mysql-test/suite/parts/r/alter_data_directory_innodb.result65
-rw-r--r--mysql-test/suite/parts/t/alter_data_directory_innodb.test46
-rw-r--r--mysql-test/suite/plugins/r/auth_ed25519.result2
-rw-r--r--mysql-test/suite/plugins/r/processlist.result9
-rw-r--r--mysql-test/suite/plugins/t/processlist.test20
-rw-r--r--mysql-test/suite/roles/grant_revoke_current.result1
-rw-r--r--mysql-test/suite/roles/grant_revoke_current.test2
-rw-r--r--mysql-test/suite/roles/set_default_role_ps-6960.result1
-rw-r--r--mysql-test/suite/roles/set_default_role_ps-6960.test2
-rw-r--r--mysql-test/suite/rpl/include/rpl_mixed_check_user.inc4
-rw-r--r--mysql-test/suite/rpl/r/rpl_do_grant.result14
-rw-r--r--mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result68
-rw-r--r--mysql-test/suite/rpl/r/rpl_parallel_optimistic.result31
-rw-r--r--mysql-test/suite/rpl/t/rpl_do_grant.test8
-rw-r--r--mysql-test/suite/rpl/t/rpl_parallel_optimistic.test61
-rw-r--r--mysql-test/suite/sys_vars/r/maximum_basic.result30
-rw-r--r--mysql-test/suite/sys_vars/t/maximum_basic-master.opt2
-rw-r--r--mysql-test/suite/sys_vars/t/maximum_basic.test19
-rw-r--r--mysql-test/suite/unit/suite.pm2
-rw-r--r--mysql-test/suite/vcol/r/index.result91
-rw-r--r--mysql-test/suite/vcol/r/vcol_misc.result10
-rw-r--r--mysql-test/suite/vcol/t/index.test81
-rw-r--r--mysql-test/suite/vcol/t/vcol_misc.test18
-rw-r--r--mysql-test/suite/wsrep/r/variables.result10
-rw-r--r--mysql-test/suite/wsrep/t/variables.test14
131 files changed, 2581 insertions, 385 deletions
diff --git a/mysql-test/main/alter_table.result b/mysql-test/main/alter_table.result
index ac6f9aba17b..cb3783eca5a 100644
--- a/mysql-test/main/alter_table.result
+++ b/mysql-test/main/alter_table.result
@@ -2235,6 +2235,29 @@ t1 CREATE TABLE `t1` (
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1;
#
+# MDEV-14668 ADD PRIMARY KEY IF NOT EXISTS on composite key
+#
+CREATE TABLE t1 (
+`ID` BIGINT(20) NOT NULL,
+`RANK` MEDIUMINT(4) NOT NULL,
+`CHECK_POINT` BIGINT(20) NOT NULL,
+UNIQUE INDEX `HORIZON_UIDX01` (`ID`, `RANK`)
+) ENGINE=InnoDB;
+ALTER TABLE t1 ADD PRIMARY KEY IF NOT EXISTS (`ID`, `CHECK_POINT`);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `ID` bigint(20) NOT NULL,
+ `RANK` mediumint(4) NOT NULL,
+ `CHECK_POINT` bigint(20) NOT NULL,
+ PRIMARY KEY (`ID`,`CHECK_POINT`),
+ UNIQUE KEY `HORIZON_UIDX01` (`ID`,`RANK`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+ALTER TABLE t1 ADD PRIMARY KEY IF NOT EXISTS (`ID`, `CHECK_POINT`);
+Warnings:
+Note 1061 Multiple primary key defined
+DROP TABLE t1;
+#
# End of 10.0 tests
#
#
diff --git a/mysql-test/main/alter_table.test b/mysql-test/main/alter_table.test
index c9302d588da..5c218c26923 100644
--- a/mysql-test/main/alter_table.test
+++ b/mysql-test/main/alter_table.test
@@ -1835,6 +1835,21 @@ SHOW CREATE TABLE t1;
DROP TABLE t1;
--echo #
+--echo # MDEV-14668 ADD PRIMARY KEY IF NOT EXISTS on composite key
+--echo #
+CREATE TABLE t1 (
+ `ID` BIGINT(20) NOT NULL,
+ `RANK` MEDIUMINT(4) NOT NULL,
+ `CHECK_POINT` BIGINT(20) NOT NULL,
+ UNIQUE INDEX `HORIZON_UIDX01` (`ID`, `RANK`)
+ ) ENGINE=InnoDB;
+
+ALTER TABLE t1 ADD PRIMARY KEY IF NOT EXISTS (`ID`, `CHECK_POINT`);
+SHOW CREATE TABLE t1;
+ALTER TABLE t1 ADD PRIMARY KEY IF NOT EXISTS (`ID`, `CHECK_POINT`);
+DROP TABLE t1;
+
+--echo #
--echo # End of 10.0 tests
--echo #
diff --git a/mysql-test/main/analyze_stmt_orderby.result b/mysql-test/main/analyze_stmt_orderby.result
index dd7bd6b53f7..deb19d4d93a 100644
--- a/mysql-test/main/analyze_stmt_orderby.result
+++ b/mysql-test/main/analyze_stmt_orderby.result
@@ -306,7 +306,7 @@ ANALYZE
"r_rows": 10,
"r_total_time_ms": "REPLACED",
"filtered": 100,
- "r_filtered": 1,
+ "r_filtered": 100,
"attached_condition": "t0.a is not null"
}
}
diff --git a/mysql-test/main/auto_increment.result b/mysql-test/main/auto_increment.result
index 660a93b1b30..bd61d73f08c 100644
--- a/mysql-test/main/auto_increment.result
+++ b/mysql-test/main/auto_increment.result
@@ -538,6 +538,35 @@ pk
1
drop table t1;
#
+# End of 5.3 tests
+#
+#
+# MDEV-16534 PPC64: Unexpected error with a negative values into auto-increment columns in HEAP, MyISAM, ARIA
+#
+CREATE TABLE t1 (
+id TINYINT NOT NULL AUTO_INCREMENT,
+name CHAR(30) NOT NULL,
+PRIMARY KEY (id)
+) ENGINE=MyISAM;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` tinyint(4) NOT NULL AUTO_INCREMENT,
+ `name` char(30) NOT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+INSERT INTO t1 (name) VALUES ('dog');
+UPDATE t1 SET id=-1 WHERE id=1;
+INSERT INTO t1 (name) VALUES ('cat');
+SELECT * FROM t1;
+id name
+-1 dog
+2 cat
+DROP TABLE t1;
+#
+# End of 5.5 tests
+#
+#
# MDEV-15352 AUTO_INCREMENT breaks after updating a column value to a negative number
#
SET @engine='MyISAM';
@@ -657,3 +686,6 @@ id name
-1 dog
2 cat
DROP PROCEDURE autoinc_mdev15353_one;
+#
+# End of 10.2 tests
+#
diff --git a/mysql-test/main/auto_increment.test b/mysql-test/main/auto_increment.test
index 6f678ed309f..1c359ec5268 100644
--- a/mysql-test/main/auto_increment.test
+++ b/mysql-test/main/auto_increment.test
@@ -398,6 +398,29 @@ select last_insert_id();
select * from t1;
drop table t1;
+--echo #
+--echo # End of 5.3 tests
+--echo #
+
+--echo #
+--echo # MDEV-16534 PPC64: Unexpected error with a negative values into auto-increment columns in HEAP, MyISAM, ARIA
+--echo #
+
+CREATE TABLE t1 (
+ id TINYINT NOT NULL AUTO_INCREMENT,
+ name CHAR(30) NOT NULL,
+ PRIMARY KEY (id)
+) ENGINE=MyISAM;
+SHOW CREATE TABLE t1;
+INSERT INTO t1 (name) VALUES ('dog');
+UPDATE t1 SET id=-1 WHERE id=1;
+INSERT INTO t1 (name) VALUES ('cat');
+SELECT * FROM t1;
+DROP TABLE t1;
+
+--echo #
+--echo # End of 5.5 tests
+--echo #
--echo #
--echo # MDEV-15352 AUTO_INCREMENT breaks after updating a column value to a negative number
@@ -405,3 +428,8 @@ drop table t1;
SET @engine='MyISAM';
--source include/autoinc_mdev15353.inc
+
+--echo #
+--echo # End of 10.2 tests
+--echo #
+
diff --git a/mysql-test/main/cte_nonrecursive.result b/mysql-test/main/cte_nonrecursive.result
index 150fe13f7fb..879d837f9f1 100644
--- a/mysql-test/main/cte_nonrecursive.result
+++ b/mysql-test/main/cte_nonrecursive.result
@@ -1478,3 +1478,37 @@ select 2 as f;
f
2
drop table t1;
+#
+# MDEV-16473: query with CTE when no database is set
+#
+create database db_mdev_16473;
+use db_mdev_16473;
+drop database db_mdev_16473;
+# Now no default database is set
+select database();
+database()
+NULL
+with cte as (select 1 as a) select * from cte;
+a
+1
+create database db_mdev_16473;
+create table db_mdev_16473.t1 (a int);
+insert into db_mdev_16473.t1 values (2), (7), (3), (1);
+with cte as (select * from db_mdev_16473.t1) select * from cte;
+a
+2
+7
+3
+1
+with cte as (select * from db_mdev_16473.t1)
+select * from cte, t1 as t where cte.a=t.a;
+ERROR 3D000: No database selected
+with cte as (select * from db_mdev_16473.t1)
+select * from cte, db_mdev_16473.t1 as t where cte.a=t.a;
+a a
+2 2
+7 7
+3 3
+1 1
+drop database db_mdev_16473;
+use test;
diff --git a/mysql-test/main/cte_nonrecursive.test b/mysql-test/main/cte_nonrecursive.test
index 98a77940c99..11c864bcac1 100644
--- a/mysql-test/main/cte_nonrecursive.test
+++ b/mysql-test/main/cte_nonrecursive.test
@@ -1029,4 +1029,31 @@ with cte as
select 2 as f;
drop table t1;
- \ No newline at end of file
+
+--echo #
+--echo # MDEV-16473: query with CTE when no database is set
+--echo #
+
+create database db_mdev_16473;
+use db_mdev_16473;
+drop database db_mdev_16473;
+
+--echo # Now no default database is set
+select database();
+
+with cte as (select 1 as a) select * from cte;
+
+create database db_mdev_16473;
+create table db_mdev_16473.t1 (a int);
+insert into db_mdev_16473.t1 values (2), (7), (3), (1);
+with cte as (select * from db_mdev_16473.t1) select * from cte;
+
+--error ER_NO_DB_ERROR
+with cte as (select * from db_mdev_16473.t1)
+select * from cte, t1 as t where cte.a=t.a;
+with cte as (select * from db_mdev_16473.t1)
+select * from cte, db_mdev_16473.t1 as t where cte.a=t.a;
+
+drop database db_mdev_16473;
+
+use test;
diff --git a/mysql-test/main/derived_cond_pushdown.result b/mysql-test/main/derived_cond_pushdown.result
index 487cb9add1f..0cd8b4cb844 100644
--- a/mysql-test/main/derived_cond_pushdown.result
+++ b/mysql-test/main/derived_cond_pushdown.result
@@ -13402,6 +13402,145 @@ EXPLAIN
}
DROP TABLE t1;
#
+# MDEV-16517: pushdown condition with the IN predicate defined
+# with non-constant values
+#
+CREATE TABLE t1 (a INT, b INT);
+INSERT INTO t1 VALUES (1,2),(1,3);
+SELECT * FROM
+(
+SELECT t1.a
+FROM t1
+WHERE 1 IN (0,t1.a)
+GROUP BY t1.a
+) AS dt1
+JOIN
+(
+SELECT t1.a
+FROM t1
+WHERE 1 IN (0,t1.a)
+) AS dt2
+ON dt1.a = dt2.a;
+a a
+1 1
+1 1
+EXPLAIN FORMAT=JSON SELECT * FROM
+(
+SELECT t1.a
+FROM t1
+WHERE 1 IN (0,t1.a)
+GROUP BY t1.a
+) AS dt1
+JOIN
+(
+SELECT t1.a
+FROM t1
+WHERE 1 IN (0,t1.a)
+) AS dt2
+ON dt1.a = dt2.a;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "table_name": "<derived2>",
+ "access_type": "ALL",
+ "rows": 2,
+ "filtered": 100,
+ "attached_condition": "1 in (0,dt1.a)",
+ "materialized": {
+ "query_block": {
+ "select_id": 2,
+ "filesort": {
+ "sort_key": "t1.a",
+ "temporary_table": {
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "rows": 2,
+ "filtered": 100,
+ "attached_condition": "1 in (0,t1.a) and 1 in (0,t1.a)"
+ }
+ }
+ }
+ }
+ }
+ },
+ "block-nl-join": {
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "rows": 2,
+ "filtered": 100
+ },
+ "buffer_type": "flat",
+ "buffer_size": "256Kb",
+ "join_type": "BNL",
+ "attached_condition": "t1.a = dt1.a"
+ }
+ }
+}
+SELECT * FROM
+(
+SELECT t1.a,MAX(t1.b)
+FROM t1
+GROUP BY t1.a
+) AS dt, t1
+WHERE dt.a=t1.a AND dt.a IN (1,t1.a);
+a MAX(t1.b) a b
+1 3 1 2
+1 3 1 3
+EXPLAIN FORMAT=JSON SELECT * FROM
+(
+SELECT t1.a,MAX(t1.b)
+FROM t1
+GROUP BY t1.a
+) AS dt, t1
+WHERE dt.a=t1.a AND dt.a IN (1,t1.a);
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "table_name": "<derived2>",
+ "access_type": "ALL",
+ "rows": 2,
+ "filtered": 100,
+ "attached_condition": "dt.a in (1,dt.a)",
+ "materialized": {
+ "query_block": {
+ "select_id": 2,
+ "filesort": {
+ "sort_key": "t1.a",
+ "temporary_table": {
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "rows": 2,
+ "filtered": 100,
+ "attached_condition": "t1.a in (1,t1.a)"
+ }
+ }
+ }
+ }
+ }
+ },
+ "block-nl-join": {
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "rows": 2,
+ "filtered": 100
+ },
+ "buffer_type": "flat",
+ "buffer_size": "256Kb",
+ "join_type": "BNL",
+ "attached_condition": "t1.a = dt.a"
+ }
+ }
+}
+DROP TABLE t1;
+#
# MDEV-10855: Pushdown into derived with window functions
#
set @save_optimizer_switch= @@optimizer_switch;
diff --git a/mysql-test/main/derived_cond_pushdown.test b/mysql-test/main/derived_cond_pushdown.test
index 4a908a49add..e51646a9764 100644
--- a/mysql-test/main/derived_cond_pushdown.test
+++ b/mysql-test/main/derived_cond_pushdown.test
@@ -2176,7 +2176,7 @@ CREATE TABLE t2 (x INT, y INT, z INT);
INSERT INTO t1 VALUES (1,1,66,1), (1,1,56,2), (3,2,42,3);
INSERT INTO t2 VALUES (1,1,66), (1,12,32);
-LET $query=
+let $query=
SELECT *
FROM t2,
(
@@ -2187,11 +2187,11 @@ FROM t2,
) AS v1
WHERE (v1.a=1) AND (v1.b=v1.a) AND
(v1.a=t2.x) AND (v1.max_c>30);
-EVAL $query;
-EVAL EXPLAIN $query;
-EVAL EXPLAIN FORMAT=JSON $query;
+eval $query;
+eval EXPLAIN $query;
+eval EXPLAIN FORMAT=JSON $query;
-LET $query=
+let $query=
SELECT *
FROM t2,
(
@@ -2202,9 +2202,9 @@ FROM t2,
) AS v1
WHERE (v1.a=1) AND (v1.b=v1.a) AND (v1.b=v1.d) AND
(v1.a=t2.x) AND (v1.max_c>30);
-EVAL $query;
-EVAL EXPLAIN $query;
-EVAL EXPLAIN FORMAT=JSON $query;
+eval $query;
+eval EXPLAIN $query;
+eval EXPLAIN FORMAT=JSON $query;
DROP TABLE t1,t2;
@@ -2230,7 +2230,7 @@ CREATE TABLE t2 (e INT, f INT, g INT);
INSERT INTO t1 VALUES (1,14),(2,13),(1,19),(2,32),(3,24);
INSERT INTO t2 VALUES (1,19,2),(3,24,1),(1,12,2),(3,11,3),(2,32,1);
-LET $query=
+let $query=
SELECT * FROM t1
WHERE (t1.a,t1.b) IN
(
@@ -2244,11 +2244,11 @@ WHERE (t1.a,t1.b) IN
WHERE d_tab.e>1
)
;
-EVAL $query;
-EVAL EXPLAIN $query;
-EVAL EXPLAIN FORMAT=JSON $query;
+eval $query;
+eval EXPLAIN $query;
+eval EXPLAIN FORMAT=JSON $query;
-LET $query=
+let $query=
SELECT * FROM t1
WHERE (t1.a,t1.b) IN
(
@@ -2262,11 +2262,11 @@ WHERE (t1.a,t1.b) IN
WHERE d_tab.max_f<25
)
;
-EVAL $query;
-EVAL EXPLAIN $query;
-EVAL EXPLAIN FORMAT=JSON $query;
+eval $query;
+eval EXPLAIN $query;
+eval EXPLAIN FORMAT=JSON $query;
-LET $query=
+let $query=
SELECT * FROM t1
WHERE (t1.a,t1.b) IN
(
@@ -2280,11 +2280,11 @@ WHERE (t1.a,t1.b) IN
GROUP BY d_tab.g
)
;
-EVAL $query;
-EVAL EXPLAIN $query;
-EVAL EXPLAIN FORMAT=JSON $query;
+eval $query;
+eval EXPLAIN $query;
+eval EXPLAIN FORMAT=JSON $query;
-LET $query=
+let $query=
SELECT * FROM t1
WHERE (t1.a,t1.b) IN
(
@@ -2298,9 +2298,9 @@ WHERE (t1.a,t1.b) IN
GROUP BY d_tab.g
)
;
-EVAL $query;
-EVAL EXPLAIN $query;
-EVAL EXPLAIN FORMAT=JSON $query;
+eval $query;
+eval EXPLAIN $query;
+eval EXPLAIN FORMAT=JSON $query;
DROP TABLE t1,t2;
@@ -2329,7 +2329,7 @@ CREATE TABLE t1 (a INT, b INT);
INSERT INTO t1 VALUES (1,2),(2,3),(3,4);
-LET $query=
+let $query=
SELECT * FROM
(
SELECT t1.b AS a
@@ -2337,10 +2337,10 @@ SELECT * FROM
GROUP BY t1.a
) dt
WHERE (dt.a=2);
-EVAL $query;
-EVAL EXPLAIN FORMAT=JSON $query;
+eval $query;
+eval EXPLAIN FORMAT=JSON $query;
-LET $query=
+let $query=
SELECT * FROM
(
SELECT t1.b AS a
@@ -2349,10 +2349,10 @@ SELECT * FROM
HAVING (t1.a<3)
) dt
WHERE (dt.a>1);
-EVAL $query;
-EVAL EXPLAIN FORMAT=JSON $query;
+eval $query;
+eval EXPLAIN FORMAT=JSON $query;
-LET $query=
+let $query=
SELECT * FROM
(
SELECT 'ab' AS a
@@ -2360,10 +2360,10 @@ SELECT * FROM
GROUP BY t1.a
) dt
WHERE (dt.a='ab');
-EVAL $query;
-EVAL EXPLAIN FORMAT=JSON $query;
+eval $query;
+eval EXPLAIN FORMAT=JSON $query;
-LET $query=
+let $query=
SELECT * FROM
(
SELECT 1 AS a
@@ -2371,9 +2371,47 @@ SELECT * FROM
GROUP BY t1.a
) dt
WHERE (dt.a=1);
-EVAL $query;
-EVAL EXPLAIN FORMAT=JSON $query;
+eval $query;
+eval EXPLAIN FORMAT=JSON $query;
+
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-16517: pushdown condition with the IN predicate defined
+--echo # with non-constant values
+--echo #
+
+CREATE TABLE t1 (a INT, b INT);
+INSERT INTO t1 VALUES (1,2),(1,3);
+let $query=
+SELECT * FROM
+(
+ SELECT t1.a
+ FROM t1
+ WHERE 1 IN (0,t1.a)
+ GROUP BY t1.a
+) AS dt1
+JOIN
+(
+ SELECT t1.a
+ FROM t1
+ WHERE 1 IN (0,t1.a)
+) AS dt2
+ON dt1.a = dt2.a;
+eval $query;
+eval EXPLAIN FORMAT=JSON $query;
+
+let $query=
+SELECT * FROM
+(
+ SELECT t1.a,MAX(t1.b)
+ FROM t1
+ GROUP BY t1.a
+) AS dt, t1
+WHERE dt.a=t1.a AND dt.a IN (1,t1.a);
+eval $query;
+eval EXPLAIN FORMAT=JSON $query;
DROP TABLE t1;
# Start of 10.3 tests
diff --git a/mysql-test/main/func_json.result b/mysql-test/main/func_json.result
index 9b41c1f9d61..5fa5d7c628c 100644
--- a/mysql-test/main/func_json.result
+++ b/mysql-test/main/func_json.result
@@ -739,6 +739,14 @@ drop table t1;
select json_extract('{"test":8.437e-5}','$.test');
json_extract('{"test":8.437e-5}','$.test')
8.437e-5
+select json_value('{"b":true}','$.b')=1;
+json_value('{"b":true}','$.b')=1
+1
+CREATE TABLE t1 (c VARCHAR(8));
+INSERT INTO t1 VALUES ('foo'),('bar');
+SELECT * FROM t1 WHERE c IN (JSON_EXTRACT('{"a":"b"}', '$.*'));
+c
+DROP TABLE t1;
#
# End of 10.2 tests
#
diff --git a/mysql-test/main/func_json.test b/mysql-test/main/func_json.test
index 2669408fdce..4f05d4f23c4 100644
--- a/mysql-test/main/func_json.test
+++ b/mysql-test/main/func_json.test
@@ -397,6 +397,21 @@ drop table t1;
select json_extract('{"test":8.437e-5}','$.test');
+#
+# MDEV-15905 select json_value('{"b":true}','$.b')=1 --> false with
+# "Truncated incorrect DOUBLE value: 'true'"
+#
+select json_value('{"b":true}','$.b')=1;
+
+#
+# MDEV-16209 JSON_EXTRACT in query crashes server.
+#
+
+CREATE TABLE t1 (c VARCHAR(8));
+INSERT INTO t1 VALUES ('foo'),('bar');
+SELECT * FROM t1 WHERE c IN (JSON_EXTRACT('{"a":"b"}', '$.*'));
+DROP TABLE t1;
+
--echo #
--echo # End of 10.2 tests
--echo #
diff --git a/mysql-test/main/grant.result b/mysql-test/main/grant.result
index 1d4402185a5..1279bcdd41e 100644
--- a/mysql-test/main/grant.result
+++ b/mysql-test/main/grant.result
@@ -1451,6 +1451,7 @@ CURRENT_USER()
root@localhost
SET PASSWORD FOR CURRENT_USER() = PASSWORD("admin");
SET PASSWORD FOR CURRENT_USER() = PASSWORD("");
+update mysql.user set plugin='';
# Bug#57952
diff --git a/mysql-test/main/grant.test b/mysql-test/main/grant.test
index 72e427493da..cb4254fe8c6 100644
--- a/mysql-test/main/grant.test
+++ b/mysql-test/main/grant.test
@@ -1265,6 +1265,9 @@ SELECT CURRENT_USER();
SET PASSWORD FOR CURRENT_USER() = PASSWORD("admin");
SET PASSWORD FOR CURRENT_USER() = PASSWORD("");
+#cleanup after MDEV-16238
+update mysql.user set plugin='';
+
#
# Bug#57952: privilege change is not taken into account by EXECUTE.
#
diff --git a/mysql-test/main/grant2.result b/mysql-test/main/grant2.result
index d7e42f9b7aa..ffb41c1b5f8 100644
--- a/mysql-test/main/grant2.result
+++ b/mysql-test/main/grant2.result
@@ -372,8 +372,8 @@ mysqltest_1@127.0.0.1
set password = password('changed');
disconnect b12302;
connection default;
-select host, length(password) from mysql.user where user like 'mysqltest\_1';
-host length(password)
+select host, length(authentication_string) from mysql.user where user like 'mysqltest\_1';
+host length(authentication_string)
127.0.0.1 41
revoke all on mysqltest_1.* from mysqltest_1@'127.0.0.1';
delete from mysql.user where user like 'mysqltest\_1';
@@ -387,8 +387,8 @@ mysqltest_1@127.0.0.0/255.0.0.0
set password = password('changed');
disconnect b12302_2;
connection default;
-select host, length(password) from mysql.user where user like 'mysqltest\_1';
-host length(password)
+select host, length(authentication_string) from mysql.user where user like 'mysqltest\_1';
+host length(authentication_string)
127.0.0.0/255.0.0.0 41
revoke all on mysqltest_1.* from mysqltest_1@'127.0.0.0/255.0.0.0';
delete from mysql.user where user like 'mysqltest\_1';
diff --git a/mysql-test/main/grant2.test b/mysql-test/main/grant2.test
index cee5df089df..1f7450df6c1 100644
--- a/mysql-test/main/grant2.test
+++ b/mysql-test/main/grant2.test
@@ -385,7 +385,7 @@ select current_user();
set password = password('changed');
disconnect b12302;
connection default;
-select host, length(password) from mysql.user where user like 'mysqltest\_1';
+select host, length(authentication_string) from mysql.user where user like 'mysqltest\_1';
revoke all on mysqltest_1.* from mysqltest_1@'127.0.0.1';
delete from mysql.user where user like 'mysqltest\_1';
flush privileges;
@@ -396,7 +396,7 @@ select current_user();
set password = password('changed');
disconnect b12302_2;
connection default;
-select host, length(password) from mysql.user where user like 'mysqltest\_1';
+select host, length(authentication_string) from mysql.user where user like 'mysqltest\_1';
revoke all on mysqltest_1.* from mysqltest_1@'127.0.0.0/255.0.0.0';
delete from mysql.user where user like 'mysqltest\_1';
flush privileges;
diff --git a/mysql-test/main/having.result b/mysql-test/main/having.result
index 6c206a1699d..f37cc48772e 100644
--- a/mysql-test/main/having.result
+++ b/mysql-test/main/having.result
@@ -711,6 +711,23 @@ a ct
set sql_mode=@save_sql_mode;
drop table t1;
#
+# mdev-16235: impossible HAVING in query without aggregation
+#
+explain extended
+select * from mysql.help_topic where example = 'foo' having description is null;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible HAVING
+Warnings:
+Note 1003 select `mysql`.`help_topic`.`help_topic_id` AS `help_topic_id`,`mysql`.`help_topic`.`name` AS `name`,`mysql`.`help_topic`.`help_category_id` AS `help_category_id`,`mysql`.`help_topic`.`description` AS `description`,`mysql`.`help_topic`.`example` AS `example`,`mysql`.`help_topic`.`url` AS `url` from `mysql`.`help_topic` where `mysql`.`help_topic`.`example` = 'foo' having 0
+select * from mysql.help_topic where example = 'foo' having description is null;
+help_topic_id name help_category_id description example url
+#
+# End of 5. tests
+#
+#
+# Start of 10.0 tests
+#
+#
# Bug mdev-5160: two-way join with HAVING over the second table
#
CREATE TABLE t1 (c1 varchar(6)) ENGINE=MyISAM;
diff --git a/mysql-test/main/having.test b/mysql-test/main/having.test
index c9231fef3be..179af14559f 100644
--- a/mysql-test/main/having.test
+++ b/mysql-test/main/having.test
@@ -746,6 +746,23 @@ set sql_mode=@save_sql_mode;
drop table t1;
--echo #
+--echo # mdev-16235: impossible HAVING in query without aggregation
+--echo #
+
+explain extended
+select * from mysql.help_topic where example = 'foo' having description is null;
+
+select * from mysql.help_topic where example = 'foo' having description is null;
+
+--echo #
+--echo # End of 5. tests
+--echo #
+
+--echo #
+--echo # Start of 10.0 tests
+--echo #
+
+--echo #
--echo # Bug mdev-5160: two-way join with HAVING over the second table
--echo #
diff --git a/mysql-test/main/information_schema.result b/mysql-test/main/information_schema.result
index 5fcda217d01..0e6b4168ea5 100644
--- a/mysql-test/main/information_schema.result
+++ b/mysql-test/main/information_schema.result
@@ -1489,7 +1489,7 @@ USE test;
End of 5.0 tests.
select * from information_schema.engines WHERE ENGINE="MyISAM";
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
-MyISAM DEFAULT MyISAM storage engine NO NO NO
+MyISAM DEFAULT Non-transactional engine with good performance and small data footprint NO NO NO
grant select on *.* to user3148@localhost;
connect con3148,localhost,user3148,,test;
connection con3148;
diff --git a/mysql-test/main/limit.result b/mysql-test/main/limit.result
index 064fa5a18a7..b47644eb40d 100644
--- a/mysql-test/main/limit.result
+++ b/mysql-test/main/limit.result
@@ -146,3 +146,19 @@ a
16
DROP TABLE t1;
End of 5.1 tests
+#
+# mdev-16235: SELECT over a table with LIMIT 0
+#
+EXPLAIN
+SELECT * FROM mysql.slow_log WHERE sql_text != 'foo' LIMIT 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Zero limit
+SELECT * FROM mysql.slow_log WHERE sql_text != 'foo' LIMIT 0;
+start_time user_host query_time lock_time rows_sent rows_examined db last_insert_id insert_id server_id sql_text thread_id rows_affected
+EXPLAIN
+SELECT * FROM mysql.help_topic WHERE help_category_id != example LIMIT 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Zero limit
+SELECT * FROM mysql.help_topic WHERE help_category_id != example LIMIT 0;
+help_topic_id name help_category_id description example url
+End of 5.5 tests
diff --git a/mysql-test/main/limit.test b/mysql-test/main/limit.test
index 4dbe13096d4..668d3b74518 100644
--- a/mysql-test/main/limit.test
+++ b/mysql-test/main/limit.test
@@ -115,3 +115,17 @@ SELECT a FROM t1 ORDER BY a LIMIT 2 OFFSET 14;
DROP TABLE t1;
--echo End of 5.1 tests
+
+--echo #
+--echo # mdev-16235: SELECT over a table with LIMIT 0
+--echo #
+
+EXPLAIN
+SELECT * FROM mysql.slow_log WHERE sql_text != 'foo' LIMIT 0;
+SELECT * FROM mysql.slow_log WHERE sql_text != 'foo' LIMIT 0;
+
+EXPLAIN
+SELECT * FROM mysql.help_topic WHERE help_category_id != example LIMIT 0;
+SELECT * FROM mysql.help_topic WHERE help_category_id != example LIMIT 0;
+
+--echo End of 5.5 tests
diff --git a/mysql-test/main/lock.result b/mysql-test/main/lock.result
index e3fd16ee59a..0805fd45864 100644
--- a/mysql-test/main/lock.result
+++ b/mysql-test/main/lock.result
@@ -406,7 +406,7 @@ LOCK TABLE t1 WRITE;
HANDLER t1 OPEN;
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
HANDLER t1 READ FIRST;
-ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
+Got one of the listed errors
HANDLER t1 CLOSE;
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
UNLOCK TABLES;
diff --git a/mysql-test/main/lock.test b/mysql-test/main/lock.test
index 2c2c5d42783..92ab8294273 100644
--- a/mysql-test/main/lock.test
+++ b/mysql-test/main/lock.test
@@ -474,7 +474,7 @@ LOCK TABLE t1 WRITE;
--echo # HANDLER commands are not allowed in LOCK TABLES mode
--error ER_LOCK_OR_ACTIVE_TRANSACTION
HANDLER t1 OPEN;
---error ER_LOCK_OR_ACTIVE_TRANSACTION
+--error ER_LOCK_OR_ACTIVE_TRANSACTION,ER_UNKNOWN_TABLE
HANDLER t1 READ FIRST;
--error ER_LOCK_OR_ACTIVE_TRANSACTION
HANDLER t1 CLOSE;
diff --git a/mysql-test/main/max_statement_time.result b/mysql-test/main/max_statement_time.result
index 44ee03b813a..a87a899b575 100644
--- a/mysql-test/main/max_statement_time.result
+++ b/mysql-test/main/max_statement_time.result
@@ -181,3 +181,6 @@ ERROR 70100: Query execution was interrupted (max_statement_time exceeded)
set max_statement_time = 0;
drop procedure pr;
drop table t1;
+SET max_statement_time= 1;
+CREATE TABLE t ENGINE=InnoDB SELECT * FROM seq_1_to_50000;
+ERROR 70100: Query execution was interrupted (max_statement_time exceeded)
diff --git a/mysql-test/main/max_statement_time.test b/mysql-test/main/max_statement_time.test
index 0882daff139..24b6d9311f2 100644
--- a/mysql-test/main/max_statement_time.test
+++ b/mysql-test/main/max_statement_time.test
@@ -5,6 +5,7 @@
--source include/not_embedded.inc
--source include/have_innodb.inc
+--source include/have_sequence.inc
--source include/not_valgrind.inc
--echo
@@ -226,3 +227,10 @@ call pr();
set max_statement_time = 0;
drop procedure pr;
drop table t1;
+
+#
+# MDEV-16615 ASAN SEGV in handler::print_error or server crash after error upon CREATE TABLE
+#
+SET max_statement_time= 1;
+--error ER_STATEMENT_TIMEOUT
+CREATE TABLE t ENGINE=InnoDB SELECT * FROM seq_1_to_50000;
diff --git a/mysql-test/main/mysqldump.result b/mysql-test/main/mysqldump.result
index 620afb32666..11e46657888 100644
--- a/mysql-test/main/mysqldump.result
+++ b/mysql-test/main/mysqldump.result
@@ -5608,6 +5608,21 @@ DROP DATABASE db1;
DROP DATABASE db2;
FOUND 1 /Database: mysql/ in bug11505.sql
#
+# MDEV-15021: Fix the order in which routines are called
+#
+use test;
+CREATE FUNCTION f() RETURNS INT RETURN 1;
+CREATE VIEW v1 AS SELECT f();
+# Running mysqldump -uroot test --routines --tables v1 > **vardir**/test.dmp
+DROP VIEW v1;
+DROP FUNCTION f;
+# Running mysql -uroot test < **vardir**/test.dmp
+#
+# Cleanup after succesful import.
+#
+DROP VIEW v1;
+DROP FUNCTION f;
+#
# Test for --add-drop-trigger
#
use test;
diff --git a/mysql-test/main/mysqldump.test b/mysql-test/main/mysqldump.test
index ebe54bac44a..61287b3170d 100644
--- a/mysql-test/main/mysqldump.test
+++ b/mysql-test/main/mysqldump.test
@@ -2645,6 +2645,28 @@ exec $MYSQL_DUMP mysql func > $SEARCH_FILE;
source include/search_pattern_in_file.inc;
--echo #
+--echo # MDEV-15021: Fix the order in which routines are called
+--echo #
+use test;
+CREATE FUNCTION f() RETURNS INT RETURN 1;
+CREATE VIEW v1 AS SELECT f();
+
+--echo # Running mysqldump -uroot test --routines --tables v1 > **vardir**/test.dmp
+--exec $MYSQL_DUMP -uroot test --routines --tables v1 > $MYSQLTEST_VARDIR/test.dmp
+
+DROP VIEW v1;
+DROP FUNCTION f;
+
+--echo # Running mysql -uroot test < **vardir**/test.dmp
+--exec $MYSQL -uroot test < $MYSQLTEST_VARDIR/test.dmp
+
+--echo #
+--echo # Cleanup after succesful import.
+--echo #
+DROP VIEW v1;
+DROP FUNCTION f;
+
+--echo #
--echo # Test for --add-drop-trigger
--echo #
use test;
diff --git a/mysql-test/main/mysqlslap.result b/mysql-test/main/mysqlslap.result
index d3c5107dee3..791cb5ac6b3 100644
--- a/mysql-test/main/mysqlslap.result
+++ b/mysql-test/main/mysqlslap.result
@@ -255,3 +255,6 @@ Benchmark
# MDEV-4684 - Enhancement request: --init-command support for mysqlslap
#
DROP TABLE t1;
+#
+# Bug MDEV-15789 (Upstream: #80329): MYSQLSLAP OPTIONS --AUTO-GENERATE-SQL-GUID-PRIMARY and --AUTO-GENERATE-SQL-SECONDARY-INDEXES DONT WORK
+#
diff --git a/mysql-test/main/mysqlslap.test b/mysql-test/main/mysqlslap.test
index c49c4ab3d7d..81115d59d09 100644
--- a/mysql-test/main/mysqlslap.test
+++ b/mysql-test/main/mysqlslap.test
@@ -80,3 +80,11 @@ DROP DATABASE bug58090;
--exec $MYSQL_SLAP --create-schema=test --init-command="CREATE TABLE t1(a INT)" --silent --concurrency=1 --iterations=1
DROP TABLE t1;
+
+--echo #
+--echo # Bug MDEV-15789 (Upstream: #80329): MYSQLSLAP OPTIONS --AUTO-GENERATE-SQL-GUID-PRIMARY and --AUTO-GENERATE-SQL-SECONDARY-INDEXES DONT WORK
+--echo #
+
+--exec $MYSQL_SLAP --concurrency=1 --silent --iterations=1 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql --auto-generate-sql-guid-primary --create-schema=slap
+
+--exec $MYSQL_SLAP --concurrency=1 --silent --iterations=1 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql --auto-generate-sql-secondary-indexes=1 --create-schema=slap
diff --git a/mysql-test/main/mysqltest_tracking_info.result b/mysql-test/main/mysqltest_tracking_info.result
new file mode 100644
index 00000000000..df966ae1d39
--- /dev/null
+++ b/mysql-test/main/mysqltest_tracking_info.result
@@ -0,0 +1,31 @@
+SELECT @@session.character_set_connection;
+@@session.character_set_connection
+latin1
+SET @@session.session_track_system_variables='character_set_connection';
+# tracking info on
+SET NAMES 'utf8';
+-- Tracker : SESSION_TRACK_SYSTEM_VARIABLES
+-- character_set_connection
+-- utf8
+
+SET NAMES 'big5';
+-- Tracker : SESSION_TRACK_SYSTEM_VARIABLES
+-- character_set_connection
+-- big5
+
+# tracking info on once
+SET NAMES 'utf8';
+-- Tracker : SESSION_TRACK_SYSTEM_VARIABLES
+-- character_set_connection
+-- utf8
+
+SET NAMES 'big5';
+# tracking info on
+SET NAMES 'utf8';
+-- Tracker : SESSION_TRACK_SYSTEM_VARIABLES
+-- character_set_connection
+-- utf8
+
+# tracking info off once
+SET NAMES 'big5';
+SET @@session.session_track_system_variables= default;
diff --git a/mysql-test/main/mysqltest_tracking_info.test b/mysql-test/main/mysqltest_tracking_info.test
new file mode 100644
index 00000000000..d31f68b3cbd
--- /dev/null
+++ b/mysql-test/main/mysqltest_tracking_info.test
@@ -0,0 +1,25 @@
+
+--source include/no_protocol.inc
+--source include/not_embedded.inc
+
+SELECT @@session.character_set_connection;
+SET @@session.session_track_system_variables='character_set_connection';
+
+--echo # tracking info on
+--enable_session_track_info
+SET NAMES 'utf8';
+SET NAMES 'big5';
+--disable_session_track_info
+--echo # tracking info on once
+--enable_session_track_info ONCE
+SET NAMES 'utf8';
+SET NAMES 'big5';
+--echo # tracking info on
+--enable_session_track_info
+SET NAMES 'utf8';
+--echo # tracking info off once
+--disable_session_track_info ONCE
+SET NAMES 'big5';
+--disable_session_track_info
+
+SET @@session.session_track_system_variables= default;
diff --git a/mysql-test/main/olap.result b/mysql-test/main/olap.result
index 6fdbe008016..1931fac6029 100644
--- a/mysql-test/main/olap.result
+++ b/mysql-test/main/olap.result
@@ -767,7 +767,29 @@ NULL
DROP TABLE t1, t2;
End of 5.0 tests
#
-# Start of 10.3 tests
+# End of 10.0 tests
+#
+#
+# MDEV-16190 Server crashes in Item_null_result::field_type on SELECT with time field, ROLLUP and HAVING
+#
+CREATE TABLE t1 (t TIME) ENGINE=MyISAM;
+INSERT INTO t1 VALUES ('12:12:12');
+SELECT t, COUNT(*) FROM t1 GROUP BY t WITH ROLLUP HAVING t > '00:00:00';
+t COUNT(*)
+12:12:12 1
+DROP TABLE t1;
+CREATE TABLE t1 (t TIME) ENGINE=MyISAM;
+INSERT INTO t1 VALUES ('12:12:12'),('12:12:13');
+SELECT t, COUNT(*) FROM t1 GROUP BY t WITH ROLLUP HAVING t > '00:00:00';
+t COUNT(*)
+12:12:12 1
+12:12:13 1
+DROP TABLE t1;
+#
+# End of 10.1 tests
+#
+#
+# End of 10.2 tests
#
#
# MDEV-12886 Different default for INT and BIGINT column in a VIEW for a SELECT with ROLLUP
diff --git a/mysql-test/main/olap.test b/mysql-test/main/olap.test
index 74dbe8ba10b..3756712b49d 100644
--- a/mysql-test/main/olap.test
+++ b/mysql-test/main/olap.test
@@ -406,7 +406,29 @@ DROP TABLE t1, t2;
--echo End of 5.0 tests
--echo #
---echo # Start of 10.3 tests
+--echo # End of 10.0 tests
+--echo #
+
+--echo #
+--echo # MDEV-16190 Server crashes in Item_null_result::field_type on SELECT with time field, ROLLUP and HAVING
+--echo #
+CREATE TABLE t1 (t TIME) ENGINE=MyISAM;
+INSERT INTO t1 VALUES ('12:12:12');
+SELECT t, COUNT(*) FROM t1 GROUP BY t WITH ROLLUP HAVING t > '00:00:00';
+DROP TABLE t1;
+
+CREATE TABLE t1 (t TIME) ENGINE=MyISAM;
+INSERT INTO t1 VALUES ('12:12:12'),('12:12:13');
+SELECT t, COUNT(*) FROM t1 GROUP BY t WITH ROLLUP HAVING t > '00:00:00';
+DROP TABLE t1;
+
+
+--echo #
+--echo # End of 10.1 tests
+--echo #
+
+--echo #
+--echo # End of 10.2 tests
--echo #
--echo #
@@ -462,5 +484,4 @@ SELECT NULLIF( CAST( 'foo' AS DATE ), NULL & 'bar' ) AS f FROM t1 GROUP BY f WIT
--enable_warnings
DROP TABLE t1;
-
--echo # End of 10.3 Tests
diff --git a/mysql-test/main/ps.result b/mysql-test/main/ps.result
index 518ae252d94..682c3e31be4 100644
--- a/mysql-test/main/ps.result
+++ b/mysql-test/main/ps.result
@@ -4368,7 +4368,46 @@ LINE3 3
drop table t1;
# End of 5.5 tests
#
-# Start of 10.2 tests
+# End of 10.0 tests
+#
+#
+# MDEV-12060 Crash in EXECUTE IMMEDIATE with an expression returning a GRANT command
+# (the 10.1 part)
+#
+CREATE PROCEDURE p2 ()
+BEGIN
+SET STATEMENT join_cache_level=CAST(CONCAT(_utf8'6',_latin1'') AS INT) FOR PREPARE stmt FROM 'SELECT 1';
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+END;
+/
+CALL p2();
+1
+1
+DROP PROCEDURE p2;
+BEGIN NOT ATOMIC
+SET STATEMENT join_cache_level=CAST(CONCAT(_utf8'6',_latin1'') AS INT) FOR PREPARE stmt FROM 'SELECT 1';
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+END;
+/
+1
+1
+BEGIN NOT ATOMIC
+SET STATEMENT join_cache_level=CAST(CONCAT(_utf8'6',_latin1'') AS INT) FOR PREPARE stmt FROM 'SELECT 1';
+DEALLOCATE PREPARE stmt;
+END;
+/
+BEGIN NOT ATOMIC
+PREPARE stmt FROM 'SELECT 1';
+SET STATEMENT join_cache_level=CAST(CONCAT(_utf8'6',_latin1'') AS INT) FOR EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+END;
+/
+1
+1
+#
+# End of 10.1 tests
#
#
# MDEV-10709 Expressions as parameters to Dynamic SQL
diff --git a/mysql-test/main/ps.test b/mysql-test/main/ps.test
index 1cf5124eec1..79c08d62290 100644
--- a/mysql-test/main/ps.test
+++ b/mysql-test/main/ps.test
@@ -3875,7 +3875,58 @@ drop table t1;
--echo # End of 5.5 tests
--echo #
---echo # Start of 10.2 tests
+--echo # End of 10.0 tests
+--echo #
+
+--echo #
+--echo # MDEV-12060 Crash in EXECUTE IMMEDIATE with an expression returning a GRANT command
+--echo # (the 10.1 part)
+--echo #
+
+DELIMITER /;
+CREATE PROCEDURE p2 ()
+BEGIN
+ SET STATEMENT join_cache_level=CAST(CONCAT(_utf8'6',_latin1'') AS INT) FOR PREPARE stmt FROM 'SELECT 1';
+ EXECUTE stmt;
+ DEALLOCATE PREPARE stmt;
+END;
+/
+DELIMITER ;/
+CALL p2();
+DROP PROCEDURE p2;
+
+
+DELIMITER /;
+BEGIN NOT ATOMIC
+ SET STATEMENT join_cache_level=CAST(CONCAT(_utf8'6',_latin1'') AS INT) FOR PREPARE stmt FROM 'SELECT 1';
+ EXECUTE stmt;
+ DEALLOCATE PREPARE stmt;
+END;
+/
+DELIMITER ;/
+
+
+DELIMITER /;
+BEGIN NOT ATOMIC
+ SET STATEMENT join_cache_level=CAST(CONCAT(_utf8'6',_latin1'') AS INT) FOR PREPARE stmt FROM 'SELECT 1';
+ DEALLOCATE PREPARE stmt;
+END;
+/
+DELIMITER ;/
+
+
+DELIMITER /;
+BEGIN NOT ATOMIC
+ PREPARE stmt FROM 'SELECT 1';
+ SET STATEMENT join_cache_level=CAST(CONCAT(_utf8'6',_latin1'') AS INT) FOR EXECUTE stmt;
+ DEALLOCATE PREPARE stmt;
+END;
+/
+DELIMITER ;/
+
+
+--echo #
+--echo # End of 10.1 tests
--echo #
--echo #
@@ -4733,7 +4784,6 @@ DROP PROCEDURE p2;
DROP PROCEDURE p1;
DROP ROLE testrole;
-
--echo #
--echo # End of 10.2 tests
--echo #
diff --git a/mysql-test/main/read_only_innodb.result b/mysql-test/main/read_only_innodb.result
index b6e294b633c..abfc5322ed0 100644
--- a/mysql-test/main/read_only_innodb.result
+++ b/mysql-test/main/read_only_innodb.result
@@ -237,14 +237,6 @@ a a
5 10
DROP TABLE temp1, temp2;
-# MDEV-14185 CREATE TEMPORARY TABLE AS SELECT causes error 1290 with read_only and InnoDB.
-
-CREATE TEMPORARY TABLE temp1 ENGINE=INNODB AS SELECT a FROM t1;
-SELECT * FROM temp1;
-a
-1
-DROP TABLE temp1;
-
# Disconnect and cleanup
disconnect con1;
diff --git a/mysql-test/main/read_only_innodb.test b/mysql-test/main/read_only_innodb.test
index a9310a1a78e..9ba3ccaca07 100644
--- a/mysql-test/main/read_only_innodb.test
+++ b/mysql-test/main/read_only_innodb.test
@@ -241,15 +241,6 @@ SELECT * FROM temp1, temp2;
DROP TABLE temp1, temp2;
--echo
---echo # MDEV-14185 CREATE TEMPORARY TABLE AS SELECT causes error 1290 with read_only and InnoDB.
---echo
-
-CREATE TEMPORARY TABLE temp1 ENGINE=INNODB AS SELECT a FROM t1;
-SELECT * FROM temp1;
-DROP TABLE temp1;
-
-
---echo
--echo # Disconnect and cleanup
--echo
disconnect con1;
diff --git a/mysql-test/main/reset_connection.result b/mysql-test/main/reset_connection.result
new file mode 100644
index 00000000000..925195f704e
--- /dev/null
+++ b/mysql-test/main/reset_connection.result
@@ -0,0 +1,7 @@
+FLUSH STATUS;
+SHOW local STATUS LIKE 'com_select';
+Variable_name Value
+Com_select 10
+SHOW local STATUS LIKE 'com_select';
+Variable_name Value
+Com_select 0
diff --git a/mysql-test/main/reset_connection.test b/mysql-test/main/reset_connection.test
new file mode 100644
index 00000000000..49f41c32fc3
--- /dev/null
+++ b/mysql-test/main/reset_connection.test
@@ -0,0 +1,25 @@
+--source include/not_embedded.inc
+
+FLUSH STATUS;
+
+--disable_result_log
+--disable_query_log
+
+let $i = 10;
+begin;
+while ($i)
+{
+ dec $i;
+ SELECT 1;
+}
+commit;
+
+--enable_query_log
+--enable_result_log
+
+SHOW local STATUS LIKE 'com_select';
+
+--reset_connection
+
+SHOW local STATUS LIKE 'com_select';
+
diff --git a/mysql-test/main/selectivity.result b/mysql-test/main/selectivity.result
index 9cb6ee3e9bf..aff14b23ccb 100644
--- a/mysql-test/main/selectivity.result
+++ b/mysql-test/main/selectivity.result
@@ -356,13 +356,13 @@ and o_orderkey = l_orderkey
group by c_name, c_custkey, o_orderkey, o_orderdate, o_totalprice
order by o_totalprice desc, o_orderdate;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 6005 0.00 Using temporary; Using filesort
-1 PRIMARY orders eq_ref PRIMARY,i_o_custkey PRIMARY 4 <subquery2>.l_orderkey 1 100.00 Using where
+1 PRIMARY orders ALL PRIMARY,i_o_custkey NULL NULL NULL 1500 100.00 Using where; Using temporary; Using filesort
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 dbt3_s001.orders.o_orderkey 1 100.00
1 PRIMARY customer eq_ref PRIMARY PRIMARY 4 dbt3_s001.orders.o_custkey 1 100.00
-1 PRIMARY lineitem ref PRIMARY,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 <subquery2>.l_orderkey 4 100.00
+1 PRIMARY lineitem ref PRIMARY,i_l_orderkey,i_l_orderkey_quantity i_l_orderkey_quantity 4 dbt3_s001.orders.o_orderkey 4 100.00 Using index
2 MATERIALIZED lineitem index NULL i_l_orderkey_quantity 13 NULL 6005 100.00 Using index
Warnings:
-Note 1003 /* select#1 */ select `dbt3_s001`.`customer`.`c_name` AS `c_name`,`dbt3_s001`.`customer`.`c_custkey` AS `c_custkey`,`dbt3_s001`.`orders`.`o_orderkey` AS `o_orderkey`,`dbt3_s001`.`orders`.`o_orderDATE` AS `o_orderdate`,`dbt3_s001`.`orders`.`o_totalprice` AS `o_totalprice`,sum(`dbt3_s001`.`lineitem`.`l_quantity`) AS `sum(l_quantity)` from <materialize> (/* select#2 */ select `dbt3_s001`.`lineitem`.`l_orderkey` from `dbt3_s001`.`lineitem` group by `dbt3_s001`.`lineitem`.`l_orderkey` having sum(`dbt3_s001`.`lineitem`.`l_quantity`) > 250) join `dbt3_s001`.`customer` join `dbt3_s001`.`orders` join `dbt3_s001`.`lineitem` where `dbt3_s001`.`customer`.`c_custkey` = `dbt3_s001`.`orders`.`o_custkey` and `dbt3_s001`.`orders`.`o_orderkey` = `<subquery2>`.`l_orderkey` and `dbt3_s001`.`lineitem`.`l_orderkey` = `<subquery2>`.`l_orderkey` group by `dbt3_s001`.`customer`.`c_name`,`dbt3_s001`.`customer`.`c_custkey`,`dbt3_s001`.`orders`.`o_orderkey`,`dbt3_s001`.`orders`.`o_orderDATE`,`dbt3_s001`.`orders`.`o_totalprice` order by `dbt3_s001`.`orders`.`o_totalprice` desc,`dbt3_s001`.`orders`.`o_orderDATE`
+Note 1003 /* select#1 */ select `dbt3_s001`.`customer`.`c_name` AS `c_name`,`dbt3_s001`.`customer`.`c_custkey` AS `c_custkey`,`dbt3_s001`.`orders`.`o_orderkey` AS `o_orderkey`,`dbt3_s001`.`orders`.`o_orderDATE` AS `o_orderdate`,`dbt3_s001`.`orders`.`o_totalprice` AS `o_totalprice`,sum(`dbt3_s001`.`lineitem`.`l_quantity`) AS `sum(l_quantity)` from <materialize> (/* select#2 */ select `dbt3_s001`.`lineitem`.`l_orderkey` from `dbt3_s001`.`lineitem` group by `dbt3_s001`.`lineitem`.`l_orderkey` having sum(`dbt3_s001`.`lineitem`.`l_quantity`) > 250) join `dbt3_s001`.`customer` join `dbt3_s001`.`orders` join `dbt3_s001`.`lineitem` where `dbt3_s001`.`customer`.`c_custkey` = `dbt3_s001`.`orders`.`o_custkey` and `<subquery2>`.`l_orderkey` = `dbt3_s001`.`orders`.`o_orderkey` and `dbt3_s001`.`lineitem`.`l_orderkey` = `dbt3_s001`.`orders`.`o_orderkey` group by `dbt3_s001`.`customer`.`c_name`,`dbt3_s001`.`customer`.`c_custkey`,`dbt3_s001`.`orders`.`o_orderkey`,`dbt3_s001`.`orders`.`o_orderDATE`,`dbt3_s001`.`orders`.`o_totalprice` order by `dbt3_s001`.`orders`.`o_totalprice` desc,`dbt3_s001`.`orders`.`o_orderDATE`
select
c_name, c_custkey, o_orderkey, o_orderdate, o_totalprice, sum(l_quantity)
from customer, orders, lineitem
@@ -1530,6 +1530,68 @@ t
10:00:00
11:00:00
DROP TABLE t1;
+#
+# MDEV-16374: filtered shows 0 for materilization scan for a semi join, which makes optimizer
+# always pick materialization scan over materialization lookup
+#
+create table t0(a int);
+insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+create table t1 (a int, b int);
+insert into t1 values (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9),(10,10),
+(11,11),(12,12),(13,13),(14,14),(15,15);
+set @@optimizer_use_condition_selectivity=2;
+explain extended select * from t1 where a in (select max(a) from t1 group by b);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 16 100.00 Using where
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 test.t1.a 1 100.00
+2 MATERIALIZED t1 ALL NULL NULL NULL NULL 16 100.00 Using temporary
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from <materialize> (/* select#2 */ select max(`test`.`t1`.`a`) from `test`.`t1` group by `test`.`t1`.`b`) join `test`.`t1` where `<subquery2>`.`max(a)` = `test`.`t1`.`a`
+select * from t1 where a in (select max(a) from t1 group by b);
+a b
+0 0
+1 1
+2 2
+3 3
+4 4
+5 5
+6 6
+7 7
+8 8
+9 9
+10 10
+11 11
+12 12
+13 13
+14 14
+15 15
+set @@optimizer_use_condition_selectivity=1;
+explain extended select * from t1 where a in (select max(a) from t1 group by b);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 16 100.00 Using where
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 test.t1.a 1 100.00
+2 MATERIALIZED t1 ALL NULL NULL NULL NULL 16 100.00 Using temporary
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from <materialize> (/* select#2 */ select max(`test`.`t1`.`a`) from `test`.`t1` group by `test`.`t1`.`b`) join `test`.`t1` where `<subquery2>`.`max(a)` = `test`.`t1`.`a`
+select * from t1 where a in (select max(a) from t1 group by b);
+a b
+0 0
+1 1
+2 2
+3 3
+4 4
+5 5
+6 6
+7 7
+8 8
+9 9
+10 10
+11 11
+12 12
+13 13
+14 14
+15 15
+drop table t1,t0;
set histogram_size=@save_histogram_size;
set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
set use_stat_tables=@save_use_stat_tables;
diff --git a/mysql-test/main/selectivity.test b/mysql-test/main/selectivity.test
index 3e60f242083..cf12bdaea21 100644
--- a/mysql-test/main/selectivity.test
+++ b/mysql-test/main/selectivity.test
@@ -1045,6 +1045,24 @@ SELECT * FROM (SELECT t FROM t1 WHERE d IS NULL) sq;
DROP TABLE t1;
+--echo #
+--echo # MDEV-16374: filtered shows 0 for materilization scan for a semi join, which makes optimizer
+--echo # always pick materialization scan over materialization lookup
+--echo #
+
+create table t0(a int);
+insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+create table t1 (a int, b int);
+insert into t1 values (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9),(10,10),
+(11,11),(12,12),(13,13),(14,14),(15,15);
+set @@optimizer_use_condition_selectivity=2;
+explain extended select * from t1 where a in (select max(a) from t1 group by b);
+select * from t1 where a in (select max(a) from t1 group by b);
+set @@optimizer_use_condition_selectivity=1;
+explain extended select * from t1 where a in (select max(a) from t1 group by b);
+select * from t1 where a in (select max(a) from t1 group by b);
+drop table t1,t0;
+
set histogram_size=@save_histogram_size;
set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
set use_stat_tables=@save_use_stat_tables;
diff --git a/mysql-test/main/selectivity_innodb.result b/mysql-test/main/selectivity_innodb.result
index 332cc947a6b..ab698760c55 100644
--- a/mysql-test/main/selectivity_innodb.result
+++ b/mysql-test/main/selectivity_innodb.result
@@ -359,13 +359,13 @@ and o_orderkey = l_orderkey
group by c_name, c_custkey, o_orderkey, o_orderdate, o_totalprice
order by o_totalprice desc, o_orderdate;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 6005 0.00 Using temporary; Using filesort
-1 PRIMARY orders eq_ref PRIMARY,i_o_custkey PRIMARY 4 <subquery2>.l_orderkey 1 100.00 Using where
+1 PRIMARY orders ALL PRIMARY,i_o_custkey NULL NULL NULL 1500 100.00 Using where; Using temporary; Using filesort
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 dbt3_s001.orders.o_orderkey 1 100.00
1 PRIMARY customer eq_ref PRIMARY PRIMARY 4 dbt3_s001.orders.o_custkey 1 100.00
-1 PRIMARY lineitem ref PRIMARY,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 <subquery2>.l_orderkey 4 100.00
+1 PRIMARY lineitem ref PRIMARY,i_l_orderkey,i_l_orderkey_quantity i_l_orderkey_quantity 4 dbt3_s001.orders.o_orderkey 4 100.00 Using index
2 MATERIALIZED lineitem index NULL PRIMARY 8 NULL 6005 100.00
Warnings:
-Note 1003 /* select#1 */ select `dbt3_s001`.`customer`.`c_name` AS `c_name`,`dbt3_s001`.`customer`.`c_custkey` AS `c_custkey`,`dbt3_s001`.`orders`.`o_orderkey` AS `o_orderkey`,`dbt3_s001`.`orders`.`o_orderDATE` AS `o_orderdate`,`dbt3_s001`.`orders`.`o_totalprice` AS `o_totalprice`,sum(`dbt3_s001`.`lineitem`.`l_quantity`) AS `sum(l_quantity)` from <materialize> (/* select#2 */ select `dbt3_s001`.`lineitem`.`l_orderkey` from `dbt3_s001`.`lineitem` group by `dbt3_s001`.`lineitem`.`l_orderkey` having sum(`dbt3_s001`.`lineitem`.`l_quantity`) > 250) join `dbt3_s001`.`customer` join `dbt3_s001`.`orders` join `dbt3_s001`.`lineitem` where `dbt3_s001`.`customer`.`c_custkey` = `dbt3_s001`.`orders`.`o_custkey` and `dbt3_s001`.`orders`.`o_orderkey` = `<subquery2>`.`l_orderkey` and `dbt3_s001`.`lineitem`.`l_orderkey` = `<subquery2>`.`l_orderkey` group by `dbt3_s001`.`customer`.`c_name`,`dbt3_s001`.`customer`.`c_custkey`,`dbt3_s001`.`orders`.`o_orderkey`,`dbt3_s001`.`orders`.`o_orderDATE`,`dbt3_s001`.`orders`.`o_totalprice` order by `dbt3_s001`.`orders`.`o_totalprice` desc,`dbt3_s001`.`orders`.`o_orderDATE`
+Note 1003 /* select#1 */ select `dbt3_s001`.`customer`.`c_name` AS `c_name`,`dbt3_s001`.`customer`.`c_custkey` AS `c_custkey`,`dbt3_s001`.`orders`.`o_orderkey` AS `o_orderkey`,`dbt3_s001`.`orders`.`o_orderDATE` AS `o_orderdate`,`dbt3_s001`.`orders`.`o_totalprice` AS `o_totalprice`,sum(`dbt3_s001`.`lineitem`.`l_quantity`) AS `sum(l_quantity)` from <materialize> (/* select#2 */ select `dbt3_s001`.`lineitem`.`l_orderkey` from `dbt3_s001`.`lineitem` group by `dbt3_s001`.`lineitem`.`l_orderkey` having sum(`dbt3_s001`.`lineitem`.`l_quantity`) > 250) join `dbt3_s001`.`customer` join `dbt3_s001`.`orders` join `dbt3_s001`.`lineitem` where `dbt3_s001`.`customer`.`c_custkey` = `dbt3_s001`.`orders`.`o_custkey` and `<subquery2>`.`l_orderkey` = `dbt3_s001`.`orders`.`o_orderkey` and `dbt3_s001`.`lineitem`.`l_orderkey` = `dbt3_s001`.`orders`.`o_orderkey` group by `dbt3_s001`.`customer`.`c_name`,`dbt3_s001`.`customer`.`c_custkey`,`dbt3_s001`.`orders`.`o_orderkey`,`dbt3_s001`.`orders`.`o_orderDATE`,`dbt3_s001`.`orders`.`o_totalprice` order by `dbt3_s001`.`orders`.`o_totalprice` desc,`dbt3_s001`.`orders`.`o_orderDATE`
select
c_name, c_custkey, o_orderkey, o_orderdate, o_totalprice, sum(l_quantity)
from customer, orders, lineitem
@@ -1541,6 +1541,68 @@ t
10:00:00
11:00:00
DROP TABLE t1;
+#
+# MDEV-16374: filtered shows 0 for materilization scan for a semi join, which makes optimizer
+# always pick materialization scan over materialization lookup
+#
+create table t0(a int);
+insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+create table t1 (a int, b int);
+insert into t1 values (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9),(10,10),
+(11,11),(12,12),(13,13),(14,14),(15,15);
+set @@optimizer_use_condition_selectivity=2;
+explain extended select * from t1 where a in (select max(a) from t1 group by b);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 16 100.00 Using where
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 test.t1.a 1 100.00
+2 MATERIALIZED t1 ALL NULL NULL NULL NULL 16 100.00 Using temporary
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from <materialize> (/* select#2 */ select max(`test`.`t1`.`a`) from `test`.`t1` group by `test`.`t1`.`b`) join `test`.`t1` where `<subquery2>`.`max(a)` = `test`.`t1`.`a`
+select * from t1 where a in (select max(a) from t1 group by b);
+a b
+0 0
+1 1
+2 2
+3 3
+4 4
+5 5
+6 6
+7 7
+8 8
+9 9
+10 10
+11 11
+12 12
+13 13
+14 14
+15 15
+set @@optimizer_use_condition_selectivity=1;
+explain extended select * from t1 where a in (select max(a) from t1 group by b);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 16 100.00 Using where
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 test.t1.a 1 100.00
+2 MATERIALIZED t1 ALL NULL NULL NULL NULL 16 100.00 Using temporary
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from <materialize> (/* select#2 */ select max(`test`.`t1`.`a`) from `test`.`t1` group by `test`.`t1`.`b`) join `test`.`t1` where `<subquery2>`.`max(a)` = `test`.`t1`.`a`
+select * from t1 where a in (select max(a) from t1 group by b);
+a b
+0 0
+1 1
+2 2
+3 3
+4 4
+5 5
+6 6
+7 7
+8 8
+9 9
+10 10
+11 11
+12 12
+13 13
+14 14
+15 15
+drop table t1,t0;
set histogram_size=@save_histogram_size;
set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
set use_stat_tables=@save_use_stat_tables;
diff --git a/mysql-test/main/session_tracker_last_gtid.result b/mysql-test/main/session_tracker_last_gtid.result
new file mode 100644
index 00000000000..795d0aaa2a2
--- /dev/null
+++ b/mysql-test/main/session_tracker_last_gtid.result
@@ -0,0 +1,34 @@
+#
+# MDEV-15477: SESSION_SYSVARS_TRACKER does not track last_gtid
+#
+SET gtid_seq_no=1000;
+SET @@session.session_track_system_variables='last_gtid';
+create table t1 (a int) engine=innodb;
+-- Tracker : SESSION_TRACK_SYSTEM_VARIABLES
+-- last_gtid
+-- 0-1-1000
+
+select @@last_gtid;
+@@last_gtid
+0-1-1000
+-- Tracker : SESSION_TRACK_SYSTEM_VARIABLES
+-- last_gtid
+-- 0-1-1000
+
+insert into t1 values (1);
+-- Tracker : SESSION_TRACK_SYSTEM_VARIABLES
+-- last_gtid
+-- 0-1-1001
+
+select @@last_gtid;
+@@last_gtid
+0-1-1001
+-- Tracker : SESSION_TRACK_SYSTEM_VARIABLES
+-- last_gtid
+-- 0-1-1001
+
+drop table t1;
+-- Tracker : SESSION_TRACK_SYSTEM_VARIABLES
+-- last_gtid
+-- 0-1-1002
+
diff --git a/mysql-test/main/session_tracker_last_gtid.test b/mysql-test/main/session_tracker_last_gtid.test
new file mode 100644
index 00000000000..24cf2104a0c
--- /dev/null
+++ b/mysql-test/main/session_tracker_last_gtid.test
@@ -0,0 +1,19 @@
+--source include/not_embedded.inc
+--source include/have_innodb.inc
+--source include/have_binlog_format_statement.inc
+
+--enable_session_track_info
+
+--echo #
+--echo # MDEV-15477: SESSION_SYSVARS_TRACKER does not track last_gtid
+--echo #
+
+SET gtid_seq_no=1000;
+SET @@session.session_track_system_variables='last_gtid';
+create table t1 (a int) engine=innodb;
+select @@last_gtid;
+insert into t1 values (1);
+select @@last_gtid;
+drop table t1;
+
+--disable_session_track_info
diff --git a/mysql-test/main/set_password_plugin-9835.result b/mysql-test/main/set_password.result
index 3cc723957d8..315d0bef9fb 100644
--- a/mysql-test/main/set_password_plugin-9835.result
+++ b/mysql-test/main/set_password.result
@@ -11,10 +11,10 @@ select user, host, password, plugin, authentication_string from mysql.user where
user host password plugin authentication_string
natauth localhost *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29
newpass localhost *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29
-newpassnat localhost *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29
+newpassnat localhost mysql_native_password *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29
oldauth localhost 378b243e220ca493
oldpass localhost 378b243e220ca493
-oldpassold localhost 378b243e220ca493
+oldpassold localhost mysql_old_password 378b243e220ca493
connect con,localhost,natauth,test,;
select current_user();
current_user()
@@ -86,12 +86,12 @@ 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
+natauth localhost mysql_native_password *7CEB3FDE5F7A9C4CE5FBE610D7D8EDA62EBE5F4E
+newpass localhost mysql_native_password *7CEB3FDE5F7A9C4CE5FBE610D7D8EDA62EBE5F4E
+newpassnat localhost mysql_native_password *7CEB3FDE5F7A9C4CE5FBE610D7D8EDA62EBE5F4E
+oldauth localhost mysql_native_password *7CEB3FDE5F7A9C4CE5FBE610D7D8EDA62EBE5F4E
+oldpass localhost mysql_native_password *7CEB3FDE5F7A9C4CE5FBE610D7D8EDA62EBE5F4E
+oldpassold localhost mysql_native_password *7CEB3FDE5F7A9C4CE5FBE610D7D8EDA62EBE5F4E
connect con,localhost,natauth,test2,;
select current_user();
current_user()
@@ -158,3 +158,24 @@ connection default;
drop user natauth@localhost, newpass@localhost, newpassnat@localhost;
drop user oldauth@localhost, oldpass@localhost, oldpassold@localhost;
set global secure_auth=default;
+create user foo@localhost identified with mysql_native_password;
+update mysql.user set authentication_string=password('foo'), plugin='mysql_native_password' where user='foo' and host='localhost';
+set password for 'foo'@'localhost' = password('bar');
+flush privileges;
+connect foo, localhost, foo, bar;
+select user(), current_user();
+user() current_user()
+foo@localhost foo@localhost
+show grants;
+Grants for foo@localhost
+GRANT USAGE ON *.* TO 'foo'@'localhost' IDENTIFIED BY PASSWORD '*E8D46CE25265E545D225A8A6F1BAF642FEBEE5CB'
+disconnect foo;
+connection default;
+select user,host,password,plugin,authentication_string from mysql.user where user='foo';
+user host password plugin authentication_string
+foo localhost mysql_native_password *E8D46CE25265E545D225A8A6F1BAF642FEBEE5CB
+set password for 'foo'@'localhost' = '';
+select user,host,password,plugin,authentication_string from mysql.user where user='foo';
+user host password plugin authentication_string
+foo localhost mysql_native_password
+drop user foo@localhost;
diff --git a/mysql-test/main/set_password_plugin-9835.test b/mysql-test/main/set_password.test
index 6afccd74f9d..fc1ecb5ef5c 100644
--- a/mysql-test/main/set_password_plugin-9835.test
+++ b/mysql-test/main/set_password.test
@@ -129,3 +129,19 @@ drop user natauth@localhost, newpass@localhost, newpassnat@localhost;
drop user oldauth@localhost, oldpass@localhost, oldpassold@localhost;
set global secure_auth=default;
+#
+# MDEV-16238 root/localhost authn prioritizes authentication_string over Password
+#
+create user foo@localhost identified with mysql_native_password;
+update mysql.user set authentication_string=password('foo'), plugin='mysql_native_password' where user='foo' and host='localhost';
+set password for 'foo'@'localhost' = password('bar');
+flush privileges;
+--connect foo, localhost, foo, bar
+select user(), current_user();
+show grants;
+--disconnect foo
+--connection default
+select user,host,password,plugin,authentication_string from mysql.user where user='foo';
+set password for 'foo'@'localhost' = '';
+select user,host,password,plugin,authentication_string from mysql.user where user='foo';
+drop user foo@localhost;
diff --git a/mysql-test/main/show_grants_with_plugin-7985.result b/mysql-test/main/show_grants_with_plugin-7985.result
index 81880e5cc40..0f8e1e39969 100644
--- a/mysql-test/main/show_grants_with_plugin-7985.result
+++ b/mysql-test/main/show_grants_with_plugin-7985.result
@@ -71,7 +71,7 @@ connection default;
set password for u1 = PASSWORD('SOMETHINGELSE');
select user, host, password, plugin, authentication_string from mysql.user where user = 'u1';
user host password plugin authentication_string
-u1 % *054B7BBD2B9A553DA560520DCD3F76DA2D81B7C6
+u1 % mysql_native_password *054B7BBD2B9A553DA560520DCD3F76DA2D81B7C6
#
# Here we should use the password field, as that primes over
# the authentication_string field.
@@ -112,7 +112,7 @@ connection default;
# Now we remove the authentication plugin password, flush privileges and
# try again.
#
-update mysql.user set authentication_string = '' where user='u1';
+update mysql.user set password=authentication_string, plugin='', authentication_string='' where user='u1';
select user, host, password, plugin, authentication_string from mysql.user where user = 'u1';
user host password plugin authentication_string
u1 % *054B7BBD2B9A553DA560520DCD3F76DA2D81B7C6
@@ -172,7 +172,7 @@ connection default;
set password for u1 = '';
select user, host, password, plugin, authentication_string from mysql.user where user = 'u1';
user host password plugin authentication_string
-u1 %
+u1 % mysql_native_password
#
# Test no password connect.
#
diff --git a/mysql-test/main/show_grants_with_plugin-7985.test b/mysql-test/main/show_grants_with_plugin-7985.test
index 84f71c72667..85952870254 100644
--- a/mysql-test/main/show_grants_with_plugin-7985.test
+++ b/mysql-test/main/show_grants_with_plugin-7985.test
@@ -91,7 +91,7 @@ show grants;
--echo # Now we remove the authentication plugin password, flush privileges and
--echo # try again.
--echo #
-update mysql.user set authentication_string = '' where user='u1';
+update mysql.user set password=authentication_string, plugin='', authentication_string='' where user='u1';
select user, host, password, plugin, authentication_string from mysql.user where user = 'u1';
flush privileges;
show grants for u1;
diff --git a/mysql-test/main/sp-security.result b/mysql-test/main/sp-security.result
index 882072ff7c7..7813ab6a192 100644
--- a/mysql-test/main/sp-security.result
+++ b/mysql-test/main/sp-security.result
@@ -755,6 +755,7 @@ GRANT EXECUTE ON PROCEDURE `test`.`sp1` TO 'root'@'localhost'
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
drop procedure sp1;
set password='';
+update mysql.user set plugin='';
#
# MDEV-13396 Unexpected "alter routine comand defined" during CREATE OR REPLACE PROCEDURE
#
diff --git a/mysql-test/main/sp-security.test b/mysql-test/main/sp-security.test
index 059a5dd0fa8..73d0263dd69 100644
--- a/mysql-test/main/sp-security.test
+++ b/mysql-test/main/sp-security.test
@@ -1023,6 +1023,8 @@ grant execute on procedure sp1 to current_user() identified by 'barfoo';
show grants;
drop procedure sp1;
set password='';
+#cleanup after MDEV-16238
+update mysql.user set plugin='';
--echo #
--echo # MDEV-13396 Unexpected "alter routine comand defined" during CREATE OR REPLACE PROCEDURE
diff --git a/mysql-test/main/statistics.result b/mysql-test/main/statistics.result
index b710bc0e51a..574eb5f4727 100644
--- a/mysql-test/main/statistics.result
+++ b/mysql-test/main/statistics.result
@@ -1692,6 +1692,27 @@ set use_stat_tables=@save_use_stat_tables;
set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity;
drop table t1,t2;
#
+# MDEV-16507: statistics for temporary tables should not be used
+#
+SET
+@save_optimizer_use_condition_selectivity= @@optimizer_use_condition_selectivity;
+SET @@use_stat_tables = preferably ;
+SET @@optimizer_use_condition_selectivity = 4;
+CREATE TABLE t1 (
+TIMESTAMP TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
+ON UPDATE CURRENT_TIMESTAMP
+);
+SET @had_t1_table= @@warning_count != 0;
+CREATE TEMPORARY TABLE tmp_t1 LIKE t1;
+INSERT INTO tmp_t1 VALUES (now());
+INSERT INTO t1 SELECT * FROM tmp_t1 WHERE @had_t1_table=0;
+DROP TABLE t1;
+SET
+use_stat_tables=@save_use_stat_tables;
+SET
+optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity;
+# End of 10.0 tests
+#
# MDEV-9590: Always print "Engine-independent statistic" warnings and
# might be filtering columns unintentionally from engines
#
diff --git a/mysql-test/main/statistics.test b/mysql-test/main/statistics.test
index 368cee0f8c8..b2e544064b0 100644
--- a/mysql-test/main/statistics.test
+++ b/mysql-test/main/statistics.test
@@ -819,6 +819,32 @@ set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivi
drop table t1,t2;
--echo #
+--echo # MDEV-16507: statistics for temporary tables should not be used
+--echo #
+
+SET
+@save_optimizer_use_condition_selectivity= @@optimizer_use_condition_selectivity;
+SET @@use_stat_tables = preferably ;
+SET @@optimizer_use_condition_selectivity = 4;
+
+CREATE TABLE t1 (
+ TIMESTAMP TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
+ ON UPDATE CURRENT_TIMESTAMP
+);
+
+SET @had_t1_table= @@warning_count != 0;
+CREATE TEMPORARY TABLE tmp_t1 LIKE t1;
+INSERT INTO tmp_t1 VALUES (now());
+INSERT INTO t1 SELECT * FROM tmp_t1 WHERE @had_t1_table=0;
+DROP TABLE t1;
+
+SET
+use_stat_tables=@save_use_stat_tables;
+SET
+optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity;
+--echo # End of 10.0 tests
+
+--echo #
--echo # MDEV-9590: Always print "Engine-independent statistic" warnings and
--echo # might be filtering columns unintentionally from engines
--echo #
diff --git a/mysql-test/main/subselect_mat_cost_bugs.result b/mysql-test/main/subselect_mat_cost_bugs.result
index 125da8da517..658722112d2 100644
--- a/mysql-test/main/subselect_mat_cost_bugs.result
+++ b/mysql-test/main/subselect_mat_cost_bugs.result
@@ -334,7 +334,7 @@ SELECT * FROM t1
WHERE (f1) IN (SELECT f1 FROM t2)
LIMIT 0;
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Zero limit
2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
SELECT * FROM t1
WHERE (f1) IN (SELECT f1 FROM t2)
diff --git a/mysql-test/main/subselect_sj2_mat.result b/mysql-test/main/subselect_sj2_mat.result
index 6a1f310511f..62248536e34 100644
--- a/mysql-test/main/subselect_sj2_mat.result
+++ b/mysql-test/main/subselect_sj2_mat.result
@@ -1670,3 +1670,150 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 11 func 1
2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 Using where
DROP TABLE t1,t2;
+#
+# MDEV-16225: wrong resultset from query with semijoin=on
+#
+CREATE TABLE t1 (
+`id` int(10) NOT NULL AUTO_INCREMENT,
+`local_name` varchar(64) NOT NULL,
+PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=latin1;
+insert into t1(`id`,`local_name`) values
+(1,'Cash Advance'),
+(2,'Cash Advance'),
+(3,'Rollover'),
+(4,'AL Installment'),
+(5,'AL Installment'),
+(6,'AL Installment'),
+(7,'AL Installment'),
+(8,'AL Installment'),
+(9,'AL Installment'),
+(10,'Internet Payday'),
+(11,'Rollover - Internet Payday'),
+(12,'AL Monthly Installment'),
+(13,'AL Semi-Monthly Installment');
+explain
+SELECT SQL_NO_CACHE t.id
+FROM t1 t
+WHERE (
+t.id IN (SELECT A.id FROM t1 AS A WHERE A.local_name IN (SELECT B.local_name FROM t1 AS B WHERE B.id IN (0,4,12,13,1,10,3,11)))
+OR
+(t.id IN (0,4,12,13,1,10,3,11))
+);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t index PRIMARY PRIMARY 4 NULL 13 Using where; Using index
+2 MATERIALIZED <subquery3> ALL distinct_key NULL NULL NULL 8
+2 MATERIALIZED A ALL PRIMARY NULL NULL NULL 13 Using where; Using join buffer (flat, BNL join)
+3 MATERIALIZED B ALL PRIMARY NULL NULL NULL 13 Using where
+SELECT SQL_NO_CACHE t.id
+FROM t1 t
+WHERE (
+t.id IN (SELECT A.id FROM t1 AS A WHERE A.local_name IN (SELECT B.local_name FROM t1 AS B WHERE B.id IN (0,4,12,13,1,10,3,11)))
+OR
+(t.id IN (0,4,12,13,1,10,3,11))
+);
+id
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+drop table t1;
+#
+# MDEV-15247: Crash when SET NAMES 'utf8' is set
+#
+CREATE TABLE t1 (
+id_category int unsigned,
+id_product int unsigned,
+PRIMARY KEY (id_category,id_product)
+) ENGINE=MyISAM;
+INSERT INTO `t1` VALUES (31,216), (31,215), (31,214), (31,213), (31,212), (32,211), (32,210), (32,209), (32,208), (29,207), (30,315372), (2,161), (2,132), (33,315380), (31,315371), (29,315370), (29,315373), (29,315369), (29,315374), (29,315368), (29,315375), (29,315367), (29,183), (29,182), (30,177), (29,315376), (13,315365), (2,167), (2,315357), (2,164), (2,159), (2,131), (2,127), (14,315364), (27,315363), (29,205), (29,204), (29,203), (29,202), (29,201), (29,200), (29,199), (29,198), (29,197), (29,196), (29,195), (29,194), (29,193), (29,192), (29,191), (29,190), (29,189), (14,188), (29,187), (29,186), (29,185), (29,184), (29,315377), (29,315378), (29,181), (33,315379), (29,179), (30,178), (29,180), (30,176), (30,175), (30,174), (30,173), (30,172), (11,171), (27,315357), (23,108), (23,102);
+CREATE TABLE t2 (
+id_product int,
+id_t2 int,
+KEY id_t2 (id_t2),
+KEY id_product (id_product)
+) ENGINE=MyISAM;
+INSERT INTO `t2` VALUES (11,31), (11,31), (11,31), (11,32), (11,32),
+(11,32), (10,26), (11,32), (10,28), (11,32), (10,29), (11,33), (10,26),
+(11,33), (10,27), (9,23), (11,32), (10,26), (8,18), (7,15), (11,32),
+(10,28), (11,32), (10,28), (11,32), (10,29), (11,32), (10,29), (8,19),
+(7,16), (8,18), (7,16), (8,20), (7,16), (11,32), (10,28), (8,19),
+(7,16), (8,20), (7,16), (11,32), (10,29), (8,19), (7,16), (8,20),
+(7,16), (10,27), (9,23), (10,27), (9,23), (10,27), (9,23), (11,32),
+(10,27), (11,32), (10,27), (8,18), (7,15), (10,26), (9,24), (8,19),
+(7,16), (10,26), (9,23), (8,19), (7,16), (8,18), (7,16), (8,18), (7,16),
+(9,23), (8,18), (9,23), (8,19), (7,16), (7,16), (8,19), (7,16), (11,31),
+(10,27), (9,24), (11,31), (10,27), (9,23), (8,19), (11,31), (10,26), (9,24),
+(8,19), (11,31), (10,26), (9,25), (8,18), (11,31), (10,26), (9,23), (8,19),
+(11,31), (10,26), (9,23), (8,18), (11,31), (10,30), (9,23), (8,18), (11,31),
+(10,30), (9,23), (8,19), (11,31), (10,26), (9,25), (8,19), (8,21), (11,32),
+(10,26), (9,22), (8,19), (11,32), (10,26), (9,22), (8,18), (11,32), (10,26),
+(9,22), (8,20), (11,33), (10,26), (9,22), (8,19), (11,33), (10,26), (9,22),
+(8,18), (11,33), (10,26), (9,22), (8,20), (11,32), (10,26), (9,24), (8,19),
+(11,32), (10,26), (9,25), (8,19), (11,32), (10,26), (9,25), (8,18), (11,32),
+(10,26), (9,23), (8,18), (11,32), (10,30), (9,23), (8,18), (11,32), (10,30),
+(9,23), (8,19), (11,32), (10,26), (9,23), (8,19), (11,32), (10,27), (9,23),
+(11,32), (10,27), (9,23), (11,32), (10,27), (9,23), (10,26), (9,22), (8,19),
+(7,15), (10,26), (9,22), (8,20), (7,15), (10,26), (9,22), (8,18), (7,15),
+(8,19), (10,26), (10,26), (11,33), (10,26), (11,33), (10,26), (11,33),
+(10,27), (11,33), (10,27), (11,31), (10,26), (11,31), (10,26), (8,18),
+(7,15), (9,23), (9,23), (9,24), (8,21), (7,15), (7,15), (7,15), (7,15),
+(7,15), (7,15), (7,15), (7,15), (7,15), (8,18), (7,17), (8,18), (7,17), (8,19), (8,19);
+CREATE TABLE t3 (
+id_product int unsigned,
+PRIMARY KEY (id_product)
+) ENGINE=MyISAM;
+INSERT INTO t3 VALUES
+(102),(103),(104),(105),(106),(107),(108),(109),(110),
+(315371),(315373),(315374),(315375),(315376),(315377),
+(315378),(315379),(315380);
+CREATE TABLE t4 (
+id_product int not null,
+id_shop int,
+PRIMARY KEY (id_product,id_shop)
+) ENGINE=MyISAM ;
+INSERT INTO t4 VALUES
+(202,1),(201,1),(200,1),(199,1),(198,1),(197,1),(196,1),(195,1),
+(194,1),(193,1),(192,1),(191,1),(190,1),(189,1),(188,1),(187,1),
+(186,1),(185,1),(184,1),(183,1),(182,1),(181,1),(179,1),(178,1),
+(177,1),(176,1),(126,1),(315380,1);
+CREATE TABLE t5 (id_product int) ENGINE=MyISAM;
+INSERT INTO `t5` VALUES
+(652),(668),(669),(670),(671),(673),(674),(675),(676),
+(677),(679),(680),(681),(682),(683),(684),(685),(686);
+explain
+SELECT * FROM t3
+JOIN t4 ON (t4.id_product = t3.id_product AND t4.id_shop = 1)
+JOIN t1 ON (t1.id_product = t3.id_product)
+LEFT JOIN t5 ON (t5.id_product = t3.id_product)
+WHERE 1=1
+AND t3.id_product IN (SELECT id_product FROM t2 t2_1 WHERE t2_1.id_t2 = 32)
+AND t3.id_product IN (SELECT id_product FROM t2 t2_2 WHERE t2_2.id_t2 = 15)
+AND t3.id_product IN (SELECT id_product FROM t2 t2_3 WHERE t2_3.id_t2 = 18 OR t2_3.id_t2 = 19)
+AND t3.id_product IN (SELECT id_product FROM t2 t2_4 WHERE t2_4.id_t2 = 34 OR t2_4.id_t2 = 23)
+AND t3.id_product IN (SELECT id_product FROM t2 t2_5 WHERE t2_5.id_t2 = 29 OR t2_5.id_t2 = 28 OR t2_5.id_t2 = 26);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 index NULL PRIMARY 8 NULL 73 Using index
+1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t1.id_product 1 Using index
+1 PRIMARY <subquery5> eq_ref distinct_key distinct_key 4 func 1 Using where
+1 PRIMARY <subquery4> eq_ref distinct_key distinct_key 4 func 1 Using where
+1 PRIMARY <subquery3> eq_ref distinct_key distinct_key 4 func 1 Using where
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 Using where
+1 PRIMARY t4 eq_ref PRIMARY PRIMARY 8 test.t1.id_product,const 1 Using where; Using index
+1 PRIMARY <subquery6> eq_ref distinct_key distinct_key 4 func 1 Using where
+1 PRIMARY t5 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join)
+5 MATERIALIZED t2_4 range id_t2,id_product id_t2 5 NULL 18 Using index condition; Using where
+4 MATERIALIZED t2_3 range id_t2,id_product id_t2 5 NULL 32 Using index condition; Using where
+3 MATERIALIZED t2_2 ref id_t2,id_product id_t2 5 const 12
+2 MATERIALIZED t2_1 ref id_t2,id_product id_t2 5 const 50
+6 MATERIALIZED t2_5 range id_t2,id_product id_t2 5 NULL 30 Using index condition; Using where
+drop table t1,t2,t3,t4,t5;
diff --git a/mysql-test/main/subselect_sj2_mat.test b/mysql-test/main/subselect_sj2_mat.test
index 0234f0cb7b6..bba436078e3 100644
--- a/mysql-test/main/subselect_sj2_mat.test
+++ b/mysql-test/main/subselect_sj2_mat.test
@@ -303,3 +303,132 @@ eval $q;
eval explain $q;
DROP TABLE t1,t2;
+
+--echo #
+--echo # MDEV-16225: wrong resultset from query with semijoin=on
+--echo #
+
+CREATE TABLE t1 (
+ `id` int(10) NOT NULL AUTO_INCREMENT,
+ `local_name` varchar(64) NOT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=latin1;
+
+insert into t1(`id`,`local_name`) values
+(1,'Cash Advance'),
+(2,'Cash Advance'),
+(3,'Rollover'),
+(4,'AL Installment'),
+(5,'AL Installment'),
+(6,'AL Installment'),
+(7,'AL Installment'),
+(8,'AL Installment'),
+(9,'AL Installment'),
+(10,'Internet Payday'),
+(11,'Rollover - Internet Payday'),
+(12,'AL Monthly Installment'),
+(13,'AL Semi-Monthly Installment');
+
+explain
+SELECT SQL_NO_CACHE t.id
+FROM t1 t
+WHERE (
+ t.id IN (SELECT A.id FROM t1 AS A WHERE A.local_name IN (SELECT B.local_name FROM t1 AS B WHERE B.id IN (0,4,12,13,1,10,3,11)))
+ OR
+ (t.id IN (0,4,12,13,1,10,3,11))
+);
+SELECT SQL_NO_CACHE t.id
+FROM t1 t
+WHERE (
+ t.id IN (SELECT A.id FROM t1 AS A WHERE A.local_name IN (SELECT B.local_name FROM t1 AS B WHERE B.id IN (0,4,12,13,1,10,3,11)))
+ OR
+ (t.id IN (0,4,12,13,1,10,3,11))
+);
+drop table t1;
+
+--echo #
+--echo # MDEV-15247: Crash when SET NAMES 'utf8' is set
+--echo #
+
+CREATE TABLE t1 (
+ id_category int unsigned,
+ id_product int unsigned,
+ PRIMARY KEY (id_category,id_product)
+) ENGINE=MyISAM;
+
+INSERT INTO `t1` VALUES (31,216), (31,215), (31,214), (31,213), (31,212), (32,211), (32,210), (32,209), (32,208), (29,207), (30,315372), (2,161), (2,132), (33,315380), (31,315371), (29,315370), (29,315373), (29,315369), (29,315374), (29,315368), (29,315375), (29,315367), (29,183), (29,182), (30,177), (29,315376), (13,315365), (2,167), (2,315357), (2,164), (2,159), (2,131), (2,127), (14,315364), (27,315363), (29,205), (29,204), (29,203), (29,202), (29,201), (29,200), (29,199), (29,198), (29,197), (29,196), (29,195), (29,194), (29,193), (29,192), (29,191), (29,190), (29,189), (14,188), (29,187), (29,186), (29,185), (29,184), (29,315377), (29,315378), (29,181), (33,315379), (29,179), (30,178), (29,180), (30,176), (30,175), (30,174), (30,173), (30,172), (11,171), (27,315357), (23,108), (23,102);
+
+CREATE TABLE t2 (
+ id_product int,
+ id_t2 int,
+ KEY id_t2 (id_t2),
+ KEY id_product (id_product)
+) ENGINE=MyISAM;
+
+INSERT INTO `t2` VALUES (11,31), (11,31), (11,31), (11,32), (11,32),
+(11,32), (10,26), (11,32), (10,28), (11,32), (10,29), (11,33), (10,26),
+(11,33), (10,27), (9,23), (11,32), (10,26), (8,18), (7,15), (11,32),
+(10,28), (11,32), (10,28), (11,32), (10,29), (11,32), (10,29), (8,19),
+(7,16), (8,18), (7,16), (8,20), (7,16), (11,32), (10,28), (8,19),
+(7,16), (8,20), (7,16), (11,32), (10,29), (8,19), (7,16), (8,20),
+(7,16), (10,27), (9,23), (10,27), (9,23), (10,27), (9,23), (11,32),
+(10,27), (11,32), (10,27), (8,18), (7,15), (10,26), (9,24), (8,19),
+(7,16), (10,26), (9,23), (8,19), (7,16), (8,18), (7,16), (8,18), (7,16),
+(9,23), (8,18), (9,23), (8,19), (7,16), (7,16), (8,19), (7,16), (11,31),
+(10,27), (9,24), (11,31), (10,27), (9,23), (8,19), (11,31), (10,26), (9,24),
+(8,19), (11,31), (10,26), (9,25), (8,18), (11,31), (10,26), (9,23), (8,19),
+(11,31), (10,26), (9,23), (8,18), (11,31), (10,30), (9,23), (8,18), (11,31),
+(10,30), (9,23), (8,19), (11,31), (10,26), (9,25), (8,19), (8,21), (11,32),
+(10,26), (9,22), (8,19), (11,32), (10,26), (9,22), (8,18), (11,32), (10,26),
+(9,22), (8,20), (11,33), (10,26), (9,22), (8,19), (11,33), (10,26), (9,22),
+(8,18), (11,33), (10,26), (9,22), (8,20), (11,32), (10,26), (9,24), (8,19),
+(11,32), (10,26), (9,25), (8,19), (11,32), (10,26), (9,25), (8,18), (11,32),
+(10,26), (9,23), (8,18), (11,32), (10,30), (9,23), (8,18), (11,32), (10,30),
+(9,23), (8,19), (11,32), (10,26), (9,23), (8,19), (11,32), (10,27), (9,23),
+(11,32), (10,27), (9,23), (11,32), (10,27), (9,23), (10,26), (9,22), (8,19),
+(7,15), (10,26), (9,22), (8,20), (7,15), (10,26), (9,22), (8,18), (7,15),
+(8,19), (10,26), (10,26), (11,33), (10,26), (11,33), (10,26), (11,33),
+(10,27), (11,33), (10,27), (11,31), (10,26), (11,31), (10,26), (8,18),
+(7,15), (9,23), (9,23), (9,24), (8,21), (7,15), (7,15), (7,15), (7,15),
+(7,15), (7,15), (7,15), (7,15), (7,15), (8,18), (7,17), (8,18), (7,17), (8,19), (8,19);
+
+CREATE TABLE t3 (
+ id_product int unsigned,
+ PRIMARY KEY (id_product)
+) ENGINE=MyISAM;
+
+INSERT INTO t3 VALUES
+(102),(103),(104),(105),(106),(107),(108),(109),(110),
+(315371),(315373),(315374),(315375),(315376),(315377),
+(315378),(315379),(315380);
+
+CREATE TABLE t4 (
+ id_product int not null,
+ id_shop int,
+ PRIMARY KEY (id_product,id_shop)
+) ENGINE=MyISAM ;
+
+INSERT INTO t4 VALUES
+(202,1),(201,1),(200,1),(199,1),(198,1),(197,1),(196,1),(195,1),
+(194,1),(193,1),(192,1),(191,1),(190,1),(189,1),(188,1),(187,1),
+(186,1),(185,1),(184,1),(183,1),(182,1),(181,1),(179,1),(178,1),
+(177,1),(176,1),(126,1),(315380,1);
+
+CREATE TABLE t5 (id_product int) ENGINE=MyISAM;
+INSERT INTO `t5` VALUES
+(652),(668),(669),(670),(671),(673),(674),(675),(676),
+(677),(679),(680),(681),(682),(683),(684),(685),(686);
+
+explain
+SELECT * FROM t3
+ JOIN t4 ON (t4.id_product = t3.id_product AND t4.id_shop = 1)
+ JOIN t1 ON (t1.id_product = t3.id_product)
+LEFT JOIN t5 ON (t5.id_product = t3.id_product)
+WHERE 1=1
+AND t3.id_product IN (SELECT id_product FROM t2 t2_1 WHERE t2_1.id_t2 = 32)
+AND t3.id_product IN (SELECT id_product FROM t2 t2_2 WHERE t2_2.id_t2 = 15)
+AND t3.id_product IN (SELECT id_product FROM t2 t2_3 WHERE t2_3.id_t2 = 18 OR t2_3.id_t2 = 19)
+AND t3.id_product IN (SELECT id_product FROM t2 t2_4 WHERE t2_4.id_t2 = 34 OR t2_4.id_t2 = 23)
+AND t3.id_product IN (SELECT id_product FROM t2 t2_5 WHERE t2_5.id_t2 = 29 OR t2_5.id_t2 = 28 OR t2_5.id_t2 = 26);
+
+drop table t1,t2,t3,t4,t5;
diff --git a/mysql-test/main/subselect_sj_nonmerged.result b/mysql-test/main/subselect_sj_nonmerged.result
index c7e04225ffe..47970668ae5 100644
--- a/mysql-test/main/subselect_sj_nonmerged.result
+++ b/mysql-test/main/subselect_sj_nonmerged.result
@@ -77,9 +77,9 @@ explain select * from t4 where
t4.a in (select max(t2.a) from t1, t2 group by t2.b) and
t4.b in (select max(t2.a) from t1, t2 group by t2.b);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY <subquery3> ALL distinct_key NULL NULL NULL 5
-1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 5 Using join buffer (flat, BNL join)
-1 PRIMARY t4 ref a a 10 <subquery2>.max(t2.a),<subquery3>.max(t2.a) 12
+1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 5
+1 PRIMARY t4 ref a a 5 <subquery2>.max(t2.a) 12 Using index condition
+1 PRIMARY <subquery3> eq_ref distinct_key distinct_key 4 test.t4.b 1
3 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 Using temporary
3 MATERIALIZED t1 ALL NULL NULL NULL NULL 10 Using join buffer (flat, BNL join)
2 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 Using temporary
diff --git a/mysql-test/main/type_blob.result b/mysql-test/main/type_blob.result
index 569ba65df3f..3c99366168c 100644
--- a/mysql-test/main/type_blob.result
+++ b/mysql-test/main/type_blob.result
@@ -1063,3 +1063,19 @@ DROP TABLE t1;
#
# End of 5.5 tests
#
+#
+# Start of 10.2 test
+#
+#
+# MDEV-12809 Bad column type created for TEXT(1431655798) CHARACTER SET utf8
+#
+CREATE TABLE t1 (a TEXT(1431655798) CHARACTER SET utf8);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` longtext CHARACTER SET utf8 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+#
+# End of 10.2 test
+#
diff --git a/mysql-test/main/type_blob.test b/mysql-test/main/type_blob.test
index 8db6ac6da2a..2c74d4ea241 100644
--- a/mysql-test/main/type_blob.test
+++ b/mysql-test/main/type_blob.test
@@ -680,3 +680,21 @@ DROP TABLE t1;
--echo #
--echo # End of 5.5 tests
--echo #
+
+
+--echo #
+--echo # Start of 10.2 test
+--echo #
+
+--echo #
+--echo # MDEV-12809 Bad column type created for TEXT(1431655798) CHARACTER SET utf8
+--echo #
+
+CREATE TABLE t1 (a TEXT(1431655798) CHARACTER SET utf8);
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # End of 10.2 test
+--echo #
diff --git a/mysql-test/main/type_decimal.result b/mysql-test/main/type_decimal.result
index f96f98e7a9b..521dc887ff6 100644
--- a/mysql-test/main/type_decimal.result
+++ b/mysql-test/main/type_decimal.result
@@ -1033,6 +1033,31 @@ c1 c2
0.123456 0.123456
SET sql_mode=DEFAULT;
#
+# MDEV-12574 MAX(old_decimal) produces a column of the old DECIMAL type
+#
+SHOW CREATE TABLE t1dec102;
+Table Create Table
+t1dec102 CREATE TABLE `t1dec102` (
+ `a` decimal(10,2)/*old*/ DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+CREATE TABLE t1 AS SELECT a, MAX(a), COALESCE(a) FROM t1dec102;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` decimal(10,2) DEFAULT NULL,
+ `MAX(a)` decimal(10,2) DEFAULT NULL,
+ `COALESCE(a)` decimal(10,2) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 AS SELECT a FROM t1dec102 UNION SELECT a FROM t1dec102;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` decimal(10,2) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+DROP TABLE t1dec102;
+#
# End of 10.2 tests
#
#
@@ -1046,7 +1071,7 @@ CREATE TABLE t1 AS SELECT MAX(a) FROM t1dec102;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `MAX(a)` decimal(10,2)/*old*/ DEFAULT NULL
+ `MAX(a)` decimal(10,2) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1 AS SELECT COALESCE(a) FROM t1dec102;
diff --git a/mysql-test/main/type_decimal.test b/mysql-test/main/type_decimal.test
index 903f375d1ae..319f85edf9a 100644
--- a/mysql-test/main/type_decimal.test
+++ b/mysql-test/main/type_decimal.test
@@ -628,6 +628,27 @@ SELECT
SET sql_mode=DEFAULT;
--echo #
+--echo # MDEV-12574 MAX(old_decimal) produces a column of the old DECIMAL type
+--echo #
+
+let $MYSQLD_DATADIR= `select @@datadir`;
+--copy_file std_data/old_decimal/t1dec102.frm $MYSQLD_DATADIR/test/t1dec102.frm
+--copy_file std_data/old_decimal/t1dec102.MYD $MYSQLD_DATADIR/test/t1dec102.MYD
+--copy_file std_data/old_decimal/t1dec102.MYI $MYSQLD_DATADIR/test/t1dec102.MYI
+
+SHOW CREATE TABLE t1dec102;
+
+CREATE TABLE t1 AS SELECT a, MAX(a), COALESCE(a) FROM t1dec102;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 AS SELECT a FROM t1dec102 UNION SELECT a FROM t1dec102;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+DROP TABLE t1dec102;
+
+--echo #
--echo # End of 10.2 tests
--echo #
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index ddb79b925b6..6586e51dcd2 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -5727,7 +5727,7 @@ sub lldb_arguments {
$input = $input ? "< $input" : "";
# write init file for mysqld or client
- mtr_tofile($lldb_init_file, "set args $str $input\n");
+ mtr_tofile($lldb_init_file, "process launch --stop-at-entry -- $str $input\n");
print "\nTo start lldb for $type, type in another window:\n";
print "cd $glob_mysql_test_dir && lldb -s $lldb_init_file $$exe\n";
diff --git a/mysql-test/std_data/frm/t1.frm b/mysql-test/std_data/frm/t1.frm
new file mode 100644
index 00000000000..a998f54ec67
--- /dev/null
+++ b/mysql-test/std_data/frm/t1.frm
Binary files differ
diff --git a/mysql-test/suite/encryption/disabled.def b/mysql-test/suite/encryption/disabled.def
index 9777a4ac99a..d92d3495cb8 100644
--- a/mysql-test/suite/encryption/disabled.def
+++ b/mysql-test/suite/encryption/disabled.def
@@ -12,5 +12,3 @@
innodb_scrub : MDEV-8139 scrubbing does not work reliably
innodb_scrub_background : MDEV-8139 scrubbing does not work reliably
-innodb-redo-badkey : MDEV-13893 / MDEV-12699 Improve crash recovery of corrupted data pages
-
diff --git a/mysql-test/suite/encryption/r/innodb-redo-nokeys.result b/mysql-test/suite/encryption/r/innodb-redo-nokeys.result
index 251ea73cd4c..cc9d385bbbd 100644
--- a/mysql-test/suite/encryption/r/innodb-redo-nokeys.result
+++ b/mysql-test/suite/encryption/r/innodb-redo-nokeys.result
@@ -1,7 +1,7 @@
call mtr.add_suppression("mysqld: File .*");
call mtr.add_suppression("Plugin 'file_key_management' .*");
call mtr.add_suppression("InnoDB: cannot enable encryption, encryption plugin is not available");
-call mtr.add_suppression("Plugin 'InnoDB' init function returned error.");
+call mtr.add_suppression("Plugin 'InnoDB' init function returned error\\.");
call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed.");
call mtr.add_suppression("InnoDB: The page \\[page id: space=[0-9]+, page number=[0-9]+\\] in file '.*test.t[1-4]\\.ibd' cannot be decrypted\\.");
call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]");
diff --git a/mysql-test/suite/encryption/t/innodb-discard-import.test b/mysql-test/suite/encryption/t/innodb-discard-import.test
index e105cf82b67..62dafec4eba 100644
--- a/mysql-test/suite/encryption/t/innodb-discard-import.test
+++ b/mysql-test/suite/encryption/t/innodb-discard-import.test
@@ -1,10 +1,6 @@
-- source include/have_innodb.inc
+-- source include/innodb_page_size_small.inc
-- source include/have_file_key_management_plugin.inc
-# embedded does not support restart
--- source include/not_embedded.inc
--- source include/not_valgrind.inc
-# Avoid CrashReporter popup on Mac
--- source include/not_crashrep.inc
#
# MDEV-8770: Incorrect error message when importing page compressed tablespace
@@ -28,7 +24,9 @@ create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes en
show warnings;
create table t2(c1 bigint not null, b char(200)) engine=innodb page_compressed=1 encrypted=yes encryption_key_id=4;
show warnings;
-create table t3(c1 bigint not null, b char(200)) engine=innodb row_format=compressed encrypted=yes encryption_key_id=4;
+let $kbs= `select floor(@@global.innodb_page_size/1024)`;
+--replace_regex / key_block_size=\d+//i
+eval create table t3(c1 bigint not null, b char(200)) engine=innodb row_format=compressed encrypted=yes encryption_key_id=4 key_block_size=$kbs;
show warnings;
create table t4(c1 bigint not null, b char(200)) engine=innodb page_compressed=1;
show warnings;
@@ -89,6 +87,7 @@ ALTER TABLE t2 IMPORT TABLESPACE;
SHOW CREATE TABLE t2;
SELECT COUNT(*) FROM t2;
ALTER TABLE t3 IMPORT TABLESPACE;
+--replace_regex / key_block_size=\d+//i
SHOW CREATE TABLE t3;
SELECT COUNT(*) FROM t3;
ALTER TABLE t4 IMPORT TABLESPACE;
@@ -118,5 +117,5 @@ DROP TABLE t1,t2,t3,t4;
# reset system
--disable_query_log
-EVAL SET GLOBAL innodb_compression_algorithm = $innodb_compression_algo;
+eval SET GLOBAL innodb_compression_algorithm = $innodb_compression_algo;
--enable_query_log
diff --git a/mysql-test/suite/encryption/t/innodb-missing-key.test b/mysql-test/suite/encryption/t/innodb-missing-key.test
index 17059cc093d..cf851a54def 100644
--- a/mysql-test/suite/encryption/t/innodb-missing-key.test
+++ b/mysql-test/suite/encryption/t/innodb-missing-key.test
@@ -61,5 +61,3 @@ SELECT COUNT(1) FROM t2;
SELECT COUNT(1) FROM t3;
DROP TABLE t1, t2, t3;
-
-
diff --git a/mysql-test/suite/encryption/t/innodb-redo-nokeys.test b/mysql-test/suite/encryption/t/innodb-redo-nokeys.test
index 37565ab4827..66720eb8585 100644
--- a/mysql-test/suite/encryption/t/innodb-redo-nokeys.test
+++ b/mysql-test/suite/encryption/t/innodb-redo-nokeys.test
@@ -6,7 +6,7 @@
call mtr.add_suppression("mysqld: File .*");
call mtr.add_suppression("Plugin 'file_key_management' .*");
call mtr.add_suppression("InnoDB: cannot enable encryption, encryption plugin is not available");
-call mtr.add_suppression("Plugin 'InnoDB' init function returned error.");
+call mtr.add_suppression("Plugin 'InnoDB' init function returned error\\.");
call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed.");
call mtr.add_suppression("InnoDB: The page \\[page id: space=[0-9]+, page number=[0-9]+\\] in file '.*test.t[1-4]\\.ibd' cannot be decrypted\\.");
call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]");
diff --git a/mysql-test/suite/federated/have_federatedx.inc b/mysql-test/suite/federated/have_federatedx.inc
index 56ce31f5b2f..2250dd205bd 100644
--- a/mysql-test/suite/federated/have_federatedx.inc
+++ b/mysql-test/suite/federated/have_federatedx.inc
@@ -1,5 +1,5 @@
if (!`SELECT count(*) FROM information_schema.plugins WHERE
plugin_name = 'federated' AND plugin_status = 'active' AND
- plugin_description LIKE '%FederatedX%'`){
+ plugin_description LIKE '%transactions%'`){
skip Need FederatedX engine;
}
diff --git a/mysql-test/suite/funcs_1/r/is_engines_archive.result b/mysql-test/suite/funcs_1/r/is_engines_archive.result
index 2772992495c..52802b17acd 100644
--- a/mysql-test/suite/funcs_1/r/is_engines_archive.result
+++ b/mysql-test/suite/funcs_1/r/is_engines_archive.result
@@ -2,7 +2,7 @@ SELECT * FROM information_schema.engines
WHERE ENGINE = 'ARCHIVE';
ENGINE ARCHIVE
SUPPORT YES
-COMMENT Archive storage engine
+COMMENT gzip-compresses tables for a low storage footprint
TRANSACTIONS NO
XA NO
SAVEPOINTS NO
diff --git a/mysql-test/suite/funcs_1/r/is_engines_csv.result b/mysql-test/suite/funcs_1/r/is_engines_csv.result
index 2a7e61ee4d3..7e413b9af6f 100644
--- a/mysql-test/suite/funcs_1/r/is_engines_csv.result
+++ b/mysql-test/suite/funcs_1/r/is_engines_csv.result
@@ -2,7 +2,7 @@ SELECT * FROM information_schema.engines
WHERE ENGINE = 'CSV';
ENGINE CSV
SUPPORT YES
-COMMENT CSV storage engine
+COMMENT Stores tables as CSV files
TRANSACTIONS NO
XA NO
SAVEPOINTS NO
diff --git a/mysql-test/suite/funcs_1/r/is_engines_federated.result b/mysql-test/suite/funcs_1/r/is_engines_federated.result
index 8057a0266c5..20926458ed0 100644
--- a/mysql-test/suite/funcs_1/r/is_engines_federated.result
+++ b/mysql-test/suite/funcs_1/r/is_engines_federated.result
@@ -2,7 +2,7 @@ SELECT * FROM information_schema.engines
WHERE ENGINE = 'FEDERATED';
ENGINE FEDERATED
SUPPORT YES
-COMMENT FederatedX pluggable storage engine
+COMMENT Allows to access tables on other MariaDB servers, supports transactions and more
TRANSACTIONS YES
XA NO
SAVEPOINTS YES
diff --git a/mysql-test/suite/funcs_1/r/is_engines_myisam.result b/mysql-test/suite/funcs_1/r/is_engines_myisam.result
index 7e42c864187..d307ce4be6a 100644
--- a/mysql-test/suite/funcs_1/r/is_engines_myisam.result
+++ b/mysql-test/suite/funcs_1/r/is_engines_myisam.result
@@ -2,7 +2,7 @@ SELECT * FROM information_schema.engines
WHERE ENGINE = 'MyISAM';
ENGINE MyISAM
SUPPORT DEFAULT
-COMMENT MyISAM storage engine
+COMMENT Non-transactional engine with good performance and small data footprint
TRANSACTIONS NO
XA NO
SAVEPOINTS NO
diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def
index 58d7b6cc8be..322eff3506f 100644
--- a/mysql-test/suite/galera/disabled.def
+++ b/mysql-test/suite/galera/disabled.def
@@ -27,6 +27,9 @@ galera_ssl_upgrade : MDEV-13549 Galera test failures
galera.MW-329 : wsrep_local_replays not stable
galera.MW-328A : have_deadlocks test not stable
query_cache : MDEV-15805 Test failure on galera.query_cache
+MW-416 : MDEV-13549 Galera test failures
+galera_wan : MDEV-13549 Galera test failures
+MW-388 : MDEV-13549 Galera test failures
galera.MW-44 : MDEV-15809 Test failure on galera.MW-44
galera.galera_pc_ignore_sb : MDEV-15811 Test failure on galera_pc_ignore_sb
galera_kill_applier : race condition at the start of the test
diff --git a/mysql-test/suite/galera/galera_2nodes_as_master_slave.cnf b/mysql-test/suite/galera/galera_2nodes_as_master_slave.cnf
deleted file mode 100644
index f68fe524904..00000000000
--- a/mysql-test/suite/galera/galera_2nodes_as_master_slave.cnf
+++ /dev/null
@@ -1,83 +0,0 @@
-
-#
-# Let's understand the topology.
-# * Independent Master with server-id = 1
-# * Galera cluster with 2 nodes: node#1 and node#2 with server-id = 2, 3
-# node#1 act as slave to Independent Master with server-id = 1
-# * Independent Slave with server-id = 4 replicating from galera node#2
-#
-
-# Use default setting for mysqld processes
-!include include/default_mysqld.cnf
-
-[mysqld]
-log-slave-updates
-log-bin=mysqld-bin
-binlog-format=row
-gtid-mode=on
-enforce-gtid-consistency=true
-
-[mysqld.1]
-server-id=1
-
-[mysqld.2]
-server-id=2
-
-wsrep_provider=@ENV.WSREP_PROVIDER
-wsrep_cluster_address='gcomm://'
-wsrep_provider_options='base_port=@mysqld.2.#galera_port;evs.install_timeout = PT15S; evs.max_install_timeouts=1;'
-
-# enforce read-committed characteristics across the cluster
-wsrep_causal_reads=ON
-wsrep_sync_wait = 15
-
-wsrep_node_address=127.0.0.1
-wsrep_sst_receive_address=127.0.0.2:@mysqld.2.#sst_port
-wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port
-
-# Required for Galera
-innodb_autoinc_lock_mode=2
-
-innodb_flush_log_at_trx_commit=2
-
-[mysqld.3]
-server-id=3
-
-wsrep_provider=@ENV.WSREP_PROVIDER
-wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.2.#galera_port'
-wsrep_provider_options='base_port=@mysqld.3.#galera_port;evs.install_timeout = PT15S; evs.max_install_timeouts = 1;'
-
-# enforce read-committed characteristics across the cluster
-wsrep_causal_reads=ON
-wsrep_sync_wait = 15
-
-wsrep_node_address=127.0.0.1
-wsrep_sst_receive_address=127.0.0.2:@mysqld.3.#sst_port
-wsrep_node_incoming_address=127.0.0.1:@mysqld.3.port
-
-# Required for Galera
-innodb_autoinc_lock_mode=2
-
-innodb_flush_log_at_trx_commit=2
-
-[mysqld.4]
-server-id=4
-
-[ENV]
-NODE_MYPORT_1= @mysqld.1.port
-NODE_MYSOCK_1= @mysqld.1.socket
-
-NODE_MYPORT_2= @mysqld.2.port
-NODE_MYSOCK_2= @mysqld.2.socket
-
-NODE_MYPORT_3= @mysqld.3.port
-NODE_MYSOCK_3= @mysqld.3.socket
-
-NODE_MYPORT_4= @mysqld.4.port
-NODE_MYSOCK_4= @mysqld.4.socket
-
-NODE_GALERAPORT_2= @mysqld.2.#galera_port
-NODE_GALERAPORT_3= @mysqld.3.#galera_port
-
-NODE_SSTPORT_2= @mysqld.2.#sst_port
-NODE_SSTPORT_3= @mysqld.3.#sst_port
diff --git a/mysql-test/suite/galera/galera_2nodes_as_master_with_repl_filter.cnf b/mysql-test/suite/galera/galera_2nodes_as_master_with_repl_filter.cnf
deleted file mode 100644
index d5490280ab2..00000000000
--- a/mysql-test/suite/galera/galera_2nodes_as_master_with_repl_filter.cnf
+++ /dev/null
@@ -1,87 +0,0 @@
-#
-# This .cnf file creates a setup with a 2-node Galera cluster and one stand-alone MySQL server, to be used as a slave
-#
-
-# Use default setting for mysqld processes
-!include include/default_mysqld.cnf
-
-[mysqld]
-default-storage-engine=InnoDB
-
-[mysqld.1]
-server-id=1
-binlog-format=row
-log-bin=mysqld-bin
-log_slave_updates
-gtid-mode=on
-enforce-gtid-consistency=true
-event-scheduler=1
-
-wsrep_provider=@ENV.WSREP_PROVIDER
-wsrep_cluster_address='gcomm://'
-wsrep_provider_options='base_port=@mysqld.1.#galera_port'
-
-# enforce read-committed characteristics across the cluster
-wsrep_causal_reads=ON
-wsrep_sync_wait = 15
-
-wsrep_node_address=127.0.0.1
-wsrep_sst_receive_address=127.0.0.2:@mysqld.1.#sst_port
-wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port
-
-# Required for Galera
-innodb_autoinc_lock_mode=2
-
-innodb_flush_log_at_trx_commit=2
-
-[mysqld.2]
-server-id=2
-binlog-format=row
-log-bin=mysqld-bin
-log_slave_updates
-gtid-mode=on
-enforce-gtid-consistency=true
-event-scheduler=1
-
-wsrep_provider=@ENV.WSREP_PROVIDER
-wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
-wsrep_provider_options='base_port=@mysqld.2.#galera_port'
-
-# enforce read-committed characteristics across the cluster
-wsrep_causal_reads=ON
-wsrep_sync_wait = 15
-
-wsrep_node_address=127.0.0.1
-wsrep_sst_receive_address=127.0.0.2:@mysqld.2.#sst_port
-wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port
-
-# Required for Galera
-innodb_autoinc_lock_mode=2
-
-innodb_flush_log_at_trx_commit=2
-
-[mysqld.3]
-server-id=3
-replicate-ignore-db=test
-replicate-wild-ignore-table=test.%
-log-bin=mysqld-bin
-log_slave_updates
-gtid-mode=on
-enforce-gtid-consistency=true
-event-scheduler=1
-
-[ENV]
-NODE_MYPORT_1= @mysqld.1.port
-NODE_MYSOCK_1= @mysqld.1.socket
-
-NODE_MYPORT_2= @mysqld.2.port
-NODE_MYSOCK_2= @mysqld.2.socket
-
-NODE_MYPORT_3= @mysqld.3.port
-NODE_MYSOCK_3= @mysqld.3.socket
-
-NODE_GALERAPORT_1= @mysqld.1.#galera_port
-NODE_GALERAPORT_2= @mysqld.2.#galera_port
-
-NODE_SSTPORT_1= @mysqld.1.#sst_port
-NODE_SSTPORT_2= @mysqld.2.#sst_port
diff --git a/mysql-test/suite/galera/r/MW-416.result b/mysql-test/suite/galera/r/MW-416.result
new file mode 100644
index 00000000000..05399b213a8
--- /dev/null
+++ b/mysql-test/suite/galera/r/MW-416.result
@@ -0,0 +1,114 @@
+CREATE USER 'userMW416'@'localhost';
+GRANT SELECT, INSERT, UPDATE ON test.* TO 'userMW416'@'localhost';
+SHOW GLOBAL STATUS LIKE 'wsrep_replicated';
+Variable_name Value
+wsrep_replicated 2
+ALTER DATABASE db CHARACTER SET = utf8;
+ERROR 42000: Access denied for user 'userMW416'@'localhost' to database 'db'
+ALTER EVENT ev1 RENAME TO ev2;
+ERROR 42000: Access denied for user 'userMW416'@'localhost' to database 'test'
+ALTER FUNCTION fun1 COMMENT 'foo';
+ERROR 42000: alter routine command denied to user 'userMW416'@'localhost' for routine 'test.fun1'
+ALTER LOGFILE GROUP lfg ADD UNDOFILE 'file' ENGINE=InnoDB;
+Got one of the listed errors
+ALTER PROCEDURE proc1 COMMENT 'foo';
+Got one of the listed errors
+ALTER SERVER srv OPTIONS (USER 'sally');
+Got one of the listed errors
+ALTER TABLE tbl DROP COLUMN col;
+Got one of the listed errors
+ALTER TABLESPACE tblspc DROP DATAFILE 'file' ENGINE=innodb;
+Got one of the listed errors
+ALTER VIEW vw AS SELECT 1;
+Got one of the listed errors
+CREATE DATABASE db;
+Got one of the listed errors
+CREATE EVENT ev1 ON SCHEDULE AT CURRENT_TIMESTAMP DO SELECT 1;
+Got one of the listed errors
+CREATE FUNCTION fun1() RETURNS int RETURN(1);
+Got one of the listed errors
+CREATE FUNCTION fun1 RETURNS STRING SONAME 'funlib.so';
+Got one of the listed errors
+CREATE PROCEDURE proc1() BEGIN END;
+Got one of the listed errors
+CREATE INDEX idx ON tbl(id);
+Got one of the listed errors
+CREATE LOGFILE GROUP lfg ADD UNDOFILE 'undofile' ENGINE innodb;
+Got one of the listed errors
+CREATE SERVER srv FOREIGN DATA WRAPPER 'fdw' OPTIONS (USER 'user');
+Got one of the listed errors
+CREATE TABLE t (i int);
+Got one of the listed errors
+CREATE TABLESPACE tblspc ADD DATAFILE 'file' ENGINE=innodb;
+Got one of the listed errors
+CREATE TRIGGER trg BEFORE UPDATE ON t FOR EACH ROW BEGIN END;
+Got one of the listed errors
+CREATE VIEW vw AS SELECT 1;
+Got one of the listed errors
+DROP DATABASE db;
+Got one of the listed errors
+DROP EVENT ev;
+Got one of the listed errors
+DROP FUNCTION fun1;
+Got one of the listed errors
+DROP INDEX idx ON t0;
+Got one of the listed errors
+DROP LOGFILE GROUP lfg;
+Got one of the listed errors
+DROP PROCEDURE proc1;
+Got one of the listed errors
+DROP SERVEr srv;
+Got one of the listed errors
+DROP TABLE t0;
+Got one of the listed errors
+DROP TABLESPACE tblspc;
+Got one of the listed errors
+DROP TRIGGER trg;
+Got one of the listed errors
+DROP VIEW vw;
+Got one of the listed errors
+RENAME TABLE t0 TO t1;
+Got one of the listed errors
+TRUNCATE TABLE t0;
+Got one of the listed errors
+ALTER USER myuser PASSWORD EXPIRE;
+Got one of the listed errors
+CREATE USER myuser IDENTIFIED BY 'pass';
+Got one of the listed errors
+DROP USER myuser;
+Got one of the listed errors
+GRANT ALL ON *.* TO 'myuser';
+Got one of the listed errors
+RENAME USER myuser TO mariauser;
+Got one of the listed errors
+REVOKE SELECT ON test FROM myuser;
+Got one of the listed errors
+REVOKE ALL, GRANT OPTION FROM myuser;
+Got one of the listed errors
+REVOKE PROXY ON myuser FROM myuser;
+Got one of the listed errors
+ANALYZE TABLE db.tbl;
+Got one of the listed errors
+CHECK TABLE db.tbl;
+Got one of the listed errors
+CHECKSUM TABLE db.tbl;
+Got one of the listed errors
+OPTIMIZE TABLE db.tbl;
+Got one of the listed errors
+REPAIR TABLE db.tbl;
+Got one of the listed errors
+INSTALL PLUGIN plg SONAME 'plg.so';
+Got one of the listed errors
+UNINSTALL PLUGIN plg;
+Got one of the listed errors
+DROP USER 'userMW416'@'localhost';
+SHOW DATABASES;
+Database
+information_schema
+mtr
+mysql
+performance_schema
+test
+SHOW GLOBAL STATUS LIKE 'wsrep_replicated';
+Variable_name Value
+wsrep_replicated 3
diff --git a/mysql-test/suite/galera/r/galera#500.result b/mysql-test/suite/galera/r/galera#500.result
new file mode 100644
index 00000000000..6a07d0359a4
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera#500.result
@@ -0,0 +1,10 @@
+SET SESSION wsrep_sync_wait = 0;
+SET GLOBAL wsrep_provider_options="gmcast.isolate=2";
+SET SESSION wsrep_sync_wait = 0;
+SHOW STATUS LIKE 'wsrep_cluster_status';
+Variable_name Value
+wsrep_cluster_status non-Primary
+SET SESSION wsrep_sync_wait = default;
+SET GLOBAL wsrep_provider_options="pc.bootstrap=1";
+SET SESSION wsrep_on=0;
+CALL mtr.add_suppression("WSREP: exception from gcomm, backend must be restarted: Gcomm backend termination was requested by setting gmcast.isolate=2.");
diff --git a/mysql-test/suite/galera/r/galera_sst_mysqldump_with_key.result b/mysql-test/suite/galera/r/galera_sst_mysqldump_with_key.result
index 0a88b290e59..93ab4a3f3d4 100644
--- a/mysql-test/suite/galera/r/galera_sst_mysqldump_with_key.result
+++ b/mysql-test/suite/galera/r/galera_sst_mysqldump_with_key.result
@@ -1,13 +1,21 @@
Setting SST method to mysqldump ...
+call mtr.add_suppression("WSREP: wsrep_sst_method is set to 'mysqldump' yet mysqld bind_address is set to '127.0.0.1'");
+call mtr.add_suppression("Failed to load slave replication state from table mysql.gtid_slave_pos");
+connection node_1;
CREATE USER 'sst';
GRANT ALL PRIVILEGES ON *.* TO 'sst';
SET GLOBAL wsrep_sst_auth = 'sst:';
+connection node_2;
SET GLOBAL wsrep_sst_method = 'mysqldump';
+connection node_1;
+connection node_2;
+connection node_1;
CREATE USER sslsst;
GRANT ALL PRIVILEGES ON *.* TO sslsst;
GRANT USAGE ON *.* TO sslsst REQUIRE SSL;
SET GLOBAL wsrep_sst_auth = 'sslsst:';
Performing State Transfer on a server that has been temporarily disconnected
+connection node_1;
CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
SET AUTOCOMMIT=OFF;
START TRANSACTION;
@@ -17,6 +25,7 @@ INSERT INTO t1 VALUES ('node1_committed_before');
INSERT INTO t1 VALUES ('node1_committed_before');
INSERT INTO t1 VALUES ('node1_committed_before');
COMMIT;
+connection node_2;
SET AUTOCOMMIT=OFF;
START TRANSACTION;
INSERT INTO t1 VALUES ('node2_committed_before');
@@ -27,6 +36,7 @@ INSERT INTO t1 VALUES ('node2_committed_before');
COMMIT;
Unloading wsrep provider ...
SET GLOBAL wsrep_provider = 'none';
+connection node_1;
SET AUTOCOMMIT=OFF;
START TRANSACTION;
INSERT INTO t1 VALUES ('node1_committed_during');
@@ -41,6 +51,7 @@ INSERT INTO t1 VALUES ('node1_to_be_committed_after');
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
+connect node_1a_galera_st_disconnect_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1;
SET AUTOCOMMIT=OFF;
START TRANSACTION;
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
@@ -48,6 +59,7 @@ INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
+connection node_2;
Loading wsrep provider ...
SET AUTOCOMMIT=OFF;
START TRANSACTION;
@@ -57,6 +69,7 @@ INSERT INTO t1 VALUES ('node2_committed_after');
INSERT INTO t1 VALUES ('node2_committed_after');
INSERT INTO t1 VALUES ('node2_committed_after');
COMMIT;
+connection node_1;
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
@@ -71,6 +84,7 @@ INSERT INTO t1 VALUES ('node1_committed_after');
INSERT INTO t1 VALUES ('node1_committed_after');
INSERT INTO t1 VALUES ('node1_committed_after');
COMMIT;
+connection node_1a_galera_st_disconnect_slave;
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
@@ -85,6 +99,7 @@ COUNT(*) = 0
1
COMMIT;
SET AUTOCOMMIT=ON;
+connection node_1;
SELECT COUNT(*) = 35 FROM t1;
COUNT(*) = 35
1
@@ -94,8 +109,10 @@ COUNT(*) = 0
DROP TABLE t1;
COMMIT;
SET AUTOCOMMIT=ON;
+connection node_1;
CALL mtr.add_suppression("Slave SQL: Error 'The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement' on query");
DROP USER sst;
+connection node_2;
CALL mtr.add_suppression("Slave SQL: Error 'The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement' on query");
CALL mtr.add_suppression("InnoDB: Error: Table \"mysql\"\\.\"innodb_index_stats\" not found");
CALL mtr.add_suppression("Can't open and lock time zone table");
@@ -103,5 +120,3 @@ CALL mtr.add_suppression("Can't open and lock privilege tables");
CALL mtr.add_suppression("Info table is not ready to be used");
CALL mtr.add_suppression("Native table .* has the wrong structure");
DROP USER sslsst;
-SET GLOBAL general_log = ON;
-SET GLOBAL slow_query_log = ON;
diff --git a/mysql-test/suite/galera/r/galera_var_dirty_reads.result b/mysql-test/suite/galera/r/galera_var_dirty_reads.result
index 020efb7b8f1..049aa5be3cc 100644
--- a/mysql-test/suite/galera/r/galera_var_dirty_reads.result
+++ b/mysql-test/suite/galera/r/galera_var_dirty_reads.result
@@ -1,5 +1,7 @@
connection node_1;
connection node_2;
+connection node_1;
+connection node_2;
connection node_2;
CREATE TABLE t1(i INT) ENGINE=INNODB;
INSERT INTO t1 VALUES(1);
diff --git a/mysql-test/suite/galera/t/MW-416.test b/mysql-test/suite/galera/t/MW-416.test
new file mode 100644
index 00000000000..df4fa35abc7
--- /dev/null
+++ b/mysql-test/suite/galera/t/MW-416.test
@@ -0,0 +1,134 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--source include/wait_until_ready.inc
+
+CREATE USER 'userMW416'@'localhost';
+GRANT SELECT, INSERT, UPDATE ON test.* TO 'userMW416'@'localhost';
+
+SHOW GLOBAL STATUS LIKE 'wsrep_replicated';
+
+--connect userMW416, localhost, userMW416,, test, $NODE_MYPORT_1
+--connection userMW416
+
+# DDL
+
+--error 1044
+ALTER DATABASE db CHARACTER SET = utf8;
+--error 1044
+ALTER EVENT ev1 RENAME TO ev2;
+--error 1370
+ALTER FUNCTION fun1 COMMENT 'foo';
+#--error 1044,1227
+#ALTER INSTANCE ROTATE INNODB MASTER KEY;
+--error 1044,1227
+ALTER LOGFILE GROUP lfg ADD UNDOFILE 'file' ENGINE=InnoDB;
+--error 1044,1227,1370
+ALTER PROCEDURE proc1 COMMENT 'foo';
+--error 1044,1227,1370
+ALTER SERVER srv OPTIONS (USER 'sally');
+--error 1044,1142,1227,1370
+ALTER TABLE tbl DROP COLUMN col;
+--error 1044,1227,1370
+ALTER TABLESPACE tblspc DROP DATAFILE 'file' ENGINE=innodb;
+--error 1044,1142,1227,1370
+ALTER VIEW vw AS SELECT 1;
+
+--error 1044,1227,1370
+CREATE DATABASE db;
+--error 1044,1227,1370
+CREATE EVENT ev1 ON SCHEDULE AT CURRENT_TIMESTAMP DO SELECT 1;
+--error 1044,1227,1370
+CREATE FUNCTION fun1() RETURNS int RETURN(1);
+--error 1044,1227,1370
+CREATE FUNCTION fun1 RETURNS STRING SONAME 'funlib.so';
+--error 1044,1227,1370
+CREATE PROCEDURE proc1() BEGIN END;
+--error 1044,1142,1227,1370
+CREATE INDEX idx ON tbl(id);
+--error 1044,1142,1227,1370
+CREATE LOGFILE GROUP lfg ADD UNDOFILE 'undofile' ENGINE innodb;
+--error 1044,1142,1227,1370
+CREATE SERVER srv FOREIGN DATA WRAPPER 'fdw' OPTIONS (USER 'user');
+--error 1044,1142,1227,1370
+CREATE TABLE t (i int);
+--error 1044,1142,1227,1370
+CREATE TABLESPACE tblspc ADD DATAFILE 'file' ENGINE=innodb;
+--error 1044,1142,1227,1370
+CREATE TRIGGER trg BEFORE UPDATE ON t FOR EACH ROW BEGIN END;
+--error 1044,1142,1227,1370
+CREATE VIEW vw AS SELECT 1;
+
+
+
+--error 1044,1142,1227,1370
+DROP DATABASE db;
+--error 1044,1142,1227,1370
+DROP EVENT ev;
+--error 1044,1142,1227,1370
+DROP FUNCTION fun1;
+--error 1044,1142,1227,1370
+DROP INDEX idx ON t0;
+--error 1044,1142,1227,1370,1064
+DROP LOGFILE GROUP lfg;
+--error 1044,1142,1227,1370
+DROP PROCEDURE proc1;
+--error 1044,1142,1227,1370
+DROP SERVEr srv;
+--error 1044,1142,1227,1370
+DROP TABLE t0;
+--error 1044,1142,1227,1370,1064
+DROP TABLESPACE tblspc;
+--error 1044,1142,1227,1360,1370
+DROP TRIGGER trg;
+--error 1044,1142,1227,1370
+DROP VIEW vw;
+
+--error 1044,1142,1227,1370
+RENAME TABLE t0 TO t1;
+
+--error 1044,1142,1227,1370
+TRUNCATE TABLE t0;
+
+# DCL
+
+# account management
+--error 1044,1142,1227,1370,1064
+ALTER USER myuser PASSWORD EXPIRE;
+--error 1044,1142,1227,1370
+CREATE USER myuser IDENTIFIED BY 'pass';
+--error 1044,1142,1227,1370
+DROP USER myuser;
+--error 1044,1045,1142,1227,1370
+GRANT ALL ON *.* TO 'myuser';
+--error 1044,1142,1227,1370
+RENAME USER myuser TO mariauser;
+--error 1044,1142,1227,1370
+REVOKE SELECT ON test FROM myuser;
+--error 1044,1142,1227,1370,1698
+REVOKE ALL, GRANT OPTION FROM myuser;
+--error 1044,1142,1227,1370,1698
+REVOKE PROXY ON myuser FROM myuser;
+
+# table maintenance
+--error 1044,1142,1227,1370
+ANALYZE TABLE db.tbl;
+--error 1044,1142,1227,1370
+CHECK TABLE db.tbl;
+--error 1044,1142,1227,1370
+CHECKSUM TABLE db.tbl;
+--error 1044,1142,1227,1370
+OPTIMIZE TABLE db.tbl;
+--error 1044,1142,1227,1370
+REPAIR TABLE db.tbl;
+
+# plugin and user defined functions
+--error 1044,1142,1227,1370
+INSTALL PLUGIN plg SONAME 'plg.so';
+--error 1044,1142,1227,1370
+UNINSTALL PLUGIN plg;
+
+--connection node_1
+DROP USER 'userMW416'@'localhost';
+SHOW DATABASES;
+SHOW GLOBAL STATUS LIKE 'wsrep_replicated';
diff --git a/mysql-test/suite/galera/t/galera#500.test b/mysql-test/suite/galera/t/galera#500.test
new file mode 100644
index 00000000000..3c8490b6907
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera#500.test
@@ -0,0 +1,38 @@
+#
+# The purpose of this test is to verify that if an exception is
+# thrown from gcomm background thread, the provider terminates properly
+# and wsrep_ready becomes 0.
+#
+
+--source include/have_innodb.inc
+--source include/galera_cluster.inc
+--source include/galera_have_debug_sync.inc
+
+# Force node_2 gcomm background thread to terminate via exception.
+--connection node_2
+--let $wsrep_cluster_address = `SELECT @@wsrep_cluster_address`
+# Setting gmcast.isolate=2 will force gcomm background thread to
+# throw exception.
+SET SESSION wsrep_sync_wait = 0;
+SET GLOBAL wsrep_provider_options="gmcast.isolate=2";
+
+# Wait until wsrep_ready becomes 0.
+--let $wait_condition = SELECT VARIABLE_VALUE = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME ='wsrep_ready'
+--source include/wait_condition.inc
+
+# Wait until node_1 ends up in non-prim and rebootstrap the cluster.
+--connection node_1
+SET SESSION wsrep_sync_wait = 0;
+--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME ='wsrep_cluster_size'
+--source include/wait_condition.inc
+SHOW STATUS LIKE 'wsrep_cluster_status';
+SET SESSION wsrep_sync_wait = default;
+SET GLOBAL wsrep_provider_options="pc.bootstrap=1";
+
+# Restart node_2
+--connection node_2
+SET SESSION wsrep_on=0;
+--source include/restart_mysqld.inc
+
+--connection node_2
+CALL mtr.add_suppression("WSREP: exception from gcomm, backend must be restarted: Gcomm backend termination was requested by setting gmcast.isolate=2.");
diff --git a/mysql-test/suite/galera/t/galera_gcache_recover_manytrx.test b/mysql-test/suite/galera/t/galera_gcache_recover_manytrx.test
index 3bfcdc9f117..08165f30f7d 100644
--- a/mysql-test/suite/galera/t/galera_gcache_recover_manytrx.test
+++ b/mysql-test/suite/galera/t/galera_gcache_recover_manytrx.test
@@ -5,6 +5,7 @@
--source include/galera_cluster.inc
--source include/big_test.inc
+--source include/have_log_bin.inc
SET SESSION wsrep_sync_wait = 0;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT, f2 LONGBLOB) ENGINE=InnoDB;
@@ -93,6 +94,8 @@ END|
DELIMITER ;|
+--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+
--connect node_1_insert_simple, 127.0.0.1, root, , test, $NODE_MYPORT_1
--connect node_1_insert_multi, 127.0.0.1, root, , test, $NODE_MYPORT_1
--connect node_1_insert_transaction, 127.0.0.1, root, , test, $NODE_MYPORT_1
@@ -124,6 +127,13 @@ DELIMITER ;|
--connection node_2
SET SESSION wsrep_sync_wait = 0;
+
+# Make sure that node_2 is not killed while TOIs are applied.
+# Otherwhise we risk that grastate file is marked unsafe, and
+# as a consequence the node cannot rejoin with IST.
+--let $wait_condition = SELECT VARIABLE_VALUE > $wsrep_last_committed_before FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'
+--source include/wait_condition.inc
+
--source include/kill_galera.inc
--sleep 10
@@ -172,9 +182,8 @@ SET SESSION wsrep_sync_wait = 0;
--source include/start_mysqld.inc
--connection node_1
---source include/wait_until_connected_again.inc
---source include/galera_wait_ready.inc
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
--let $diff_servers = 1 2
--source include/diff_servers.inc
diff --git a/mysql-test/suite/galera/t/galera_many_tables_pk.test b/mysql-test/suite/galera/t/galera_many_tables_pk.test
index 551307b123f..73c5fc1622c 100644
--- a/mysql-test/suite/galera/t/galera_many_tables_pk.test
+++ b/mysql-test/suite/galera/t/galera_many_tables_pk.test
@@ -16,7 +16,7 @@ if (!`SELECT @@open_files_limit >= 1024`){
while ($count)
{
--disable_query_log
- --let $ddl_var = `SELECT CONCAT("CREATE TABLE t", $count, " (f1 INTEGER AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB")`
+ --let $ddl_var = `SELECT CONCAT("CREATE TABLE t", $count, " (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB")`
--eval $ddl_var
--enable_query_log
--dec $count
@@ -37,7 +37,7 @@ START TRANSACTION;
while ($count)
{
--disable_query_log
- --let $ddl_var = `SELECT CONCAT("INSERT INTO t", $count, " VALUES (DEFAULT)")`
+ --let $ddl_var = `SELECT CONCAT("INSERT INTO t", $count, " VALUES (1)")`
--eval $ddl_var
--enable_query_log
--dec $count
diff --git a/mysql-test/suite/galera/t/galera_sst_mariabackup.test b/mysql-test/suite/galera/t/galera_sst_mariabackup.test
index 0e7ac487700..bcb9ade3a25 100644
--- a/mysql-test/suite/galera/t/galera_sst_mariabackup.test
+++ b/mysql-test/suite/galera/t/galera_sst_mariabackup.test
@@ -1,3 +1,4 @@
+--source include/big_test.inc
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source include/have_mariabackup.inc
diff --git a/mysql-test/suite/galera/t/galera_sst_mysqldump.test b/mysql-test/suite/galera/t/galera_sst_mysqldump.test
index 390e9815b20..835fac94a68 100644
--- a/mysql-test/suite/galera/t/galera_sst_mysqldump.test
+++ b/mysql-test/suite/galera/t/galera_sst_mysqldump.test
@@ -1,3 +1,4 @@
+--source include/big_test.inc
--source include/galera_cluster.inc
--source suite/galera/include/galera_sst_set_mysqldump.inc
diff --git a/mysql-test/suite/galera/t/galera_sst_mysqldump_with_key.cnf b/mysql-test/suite/galera/t/galera_sst_mysqldump_with_key.cnf
index e108484b248..44e5573b3e6 100644
--- a/mysql-test/suite/galera/t/galera_sst_mysqldump_with_key.cnf
+++ b/mysql-test/suite/galera/t/galera_sst_mysqldump_with_key.cnf
@@ -12,10 +12,6 @@ wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore
[mysqld]
wsrep_debug=ON
-ssl-ca=@ENV.MYSQL_TEST_DIR/std_data/galera-cert.pem
-ssl-cert=@ENV.MYSQL_TEST_DIR/std_data/galera-cert.pem
-ssl-key=@ENV.MYSQL_TEST_DIR/std_data/galera-key.pem
-
[client]
ssl-ca=@ENV.MYSQL_TEST_DIR/std_data/cacert.pem
ssl-cert=@ENV.MYSQL_TEST_DIR/std_data/client-cert.pem
diff --git a/mysql-test/suite/galera/t/galera_sst_mysqldump_with_key.test b/mysql-test/suite/galera/t/galera_sst_mysqldump_with_key.test
index c813e04169f..0dbc63b531c 100644
--- a/mysql-test/suite/galera/t/galera_sst_mysqldump_with_key.test
+++ b/mysql-test/suite/galera/t/galera_sst_mysqldump_with_key.test
@@ -5,9 +5,12 @@
--source include/big_test.inc
--source include/galera_cluster.inc
--source include/have_innodb.inc
---source include/have_openssl.inc
+--source include/have_ssl_communication.inc
--source suite/galera/include/galera_sst_set_mysqldump.inc
+--let $node_1=node_1
+--let $node_2=node_2
+--source include/auto_increment_offset_save.inc
--connection node_1
CREATE USER sslsst;
@@ -18,12 +21,7 @@ SET GLOBAL wsrep_sst_auth = 'sslsst:';
--source suite/galera/include/galera_st_disconnect_slave.inc
+--source include/auto_increment_offset_restore.inc
--source suite/galera/include/galera_sst_restore.inc
-DROP USER sslsst;
-
---connection node_2
-# We have to manually restore global_log and slow_query_log due to mysql-wsrep#108
-# Otherwise MTR's check_testcases complains
-SET GLOBAL general_log = ON;
-SET GLOBAL slow_query_log = ON;
+DROP USER sslsst;
diff --git a/mysql-test/suite/galera/t/galera_sst_rsync.test b/mysql-test/suite/galera/t/galera_sst_rsync.test
index f796356cac7..5c08707e870 100644
--- a/mysql-test/suite/galera/t/galera_sst_rsync.test
+++ b/mysql-test/suite/galera/t/galera_sst_rsync.test
@@ -1,3 +1,4 @@
+--source include/big_test.inc
--source include/galera_cluster.inc
--let $node_1=node_1
diff --git a/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2-options.cnf b/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2-options.cnf
index 1e29673c0ff..3abf2549aae 100644
--- a/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2-options.cnf
+++ b/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2-options.cnf
@@ -8,7 +8,7 @@ wsrep_debug=ON
[xtrabackup]
backup-locks
close-files
-compact
+#compact - disabled in xtrabackup 2.4, https://bugs.launchpad.net/percona-xtrabackup/+bug/1192834/comments/29
# compression requires qpress from the Percona repositories
# compress
# compress-threads=2
diff --git a/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2.test b/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2.test
index f1fd0f3ddf3..c270e4d0b19 100644
--- a/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2.test
+++ b/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2.test
@@ -1,3 +1,4 @@
+--source include/big_test.inc
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source include/have_xtrabackup.inc
diff --git a/mysql-test/suite/galera/t/galera_var_dirty_reads.test b/mysql-test/suite/galera/t/galera_var_dirty_reads.test
index 3e2108868af..1f01c4aac07 100644
--- a/mysql-test/suite/galera/t/galera_var_dirty_reads.test
+++ b/mysql-test/suite/galera/t/galera_var_dirty_reads.test
@@ -11,6 +11,11 @@
--let $node_2=node_2
--source include/auto_increment_offset_save.inc
+# Save original auto_increment_offset values.
+--let $node_1=node_1
+--let $node_2=node_2
+--source include/auto_increment_offset_save.inc
+
--connection node_2
--let $wsrep_cluster_address_saved = `SELECT @@global.wsrep_cluster_address`
diff --git a/mysql-test/suite/galera_3nodes/r/galera_evs_suspect_timeout.result b/mysql-test/suite/galera_3nodes/r/galera_evs_suspect_timeout.result
index 1464222a079..7e0d282ec7f 100644
--- a/mysql-test/suite/galera_3nodes/r/galera_evs_suspect_timeout.result
+++ b/mysql-test/suite/galera_3nodes/r/galera_evs_suspect_timeout.result
@@ -11,6 +11,7 @@ SET SESSION wsrep_sync_wait = 0;
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
VARIABLE_VALUE = 2
1
+SET SESSION wsrep_sync_wait = DEFAULT;
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
1
diff --git a/mysql-test/suite/galera_3nodes/t/galera_evs_suspect_timeout.test b/mysql-test/suite/galera_3nodes/t/galera_evs_suspect_timeout.test
index a87f19ac94e..03236a3cb93 100644
--- a/mysql-test/suite/galera_3nodes/t/galera_evs_suspect_timeout.test
+++ b/mysql-test/suite/galera_3nodes/t/galera_evs_suspect_timeout.test
@@ -50,6 +50,7 @@ SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_N
--enable_query_log
--source include/wait_until_connected_again.inc
+SET SESSION wsrep_sync_wait = DEFAULT;
SELECT COUNT(*) = 1 FROM t1;
DROP TABLE t1;
diff --git a/mysql-test/suite/handler/handler.inc b/mysql-test/suite/handler/handler.inc
index 2432ff13e55..c29ee0c693d 100644
--- a/mysql-test/suite/handler/handler.inc
+++ b/mysql-test/suite/handler/handler.inc
@@ -373,7 +373,9 @@ connection con2;
send optimize table t1;
--sleep 1
connection default;
+--disable_ps_protocol
handler t1 read next;
+--enable_ps_protocol
handler t1 close;
connection con2;
reap;
diff --git a/mysql-test/suite/handler/ps.result b/mysql-test/suite/handler/ps.result
new file mode 100644
index 00000000000..54685f9156b
--- /dev/null
+++ b/mysql-test/suite/handler/ps.result
@@ -0,0 +1,9 @@
+create table t1 (i int);
+handler test.t1 open handler_a;
+flush status;
+handler handler_a read first;
+i
+show status like 'Com_stmt_prepare%';
+Variable_name Value
+Com_stmt_prepare OK
+drop table t1;
diff --git a/mysql-test/suite/handler/ps.test b/mysql-test/suite/handler/ps.test
new file mode 100644
index 00000000000..68091190c85
--- /dev/null
+++ b/mysql-test/suite/handler/ps.test
@@ -0,0 +1,11 @@
+#
+# MDEV-15729 Server crashes in Field::make_field upon HANDLER READ executed with PS protocol
+#
+create table t1 (i int);
+handler test.t1 open handler_a;
+flush status;
+handler handler_a read first;
+# handler...read must be prepared in --ps-protocol mode
+--replace_result $PS_PROTOCOL OK
+show status like 'Com_stmt_prepare%';
+drop table t1;
diff --git a/mysql-test/suite/heap/heap_auto_increment.result b/mysql-test/suite/heap/heap_auto_increment.result
index d6504349d92..e3fd377d4ef 100644
--- a/mysql-test/suite/heap/heap_auto_increment.result
+++ b/mysql-test/suite/heap/heap_auto_increment.result
@@ -40,6 +40,32 @@ _rowid _rowid skey sval
2 2 2 hey
drop table t1;
#
+# MDEV-16534 PPC64: Unexpected error with a negative values into auto-increment columns in HEAP, MyISAM, ARIA
+#
+CREATE TABLE t1 (
+id TINYINT NOT NULL AUTO_INCREMENT,
+name CHAR(30) NOT NULL,
+PRIMARY KEY (id)
+) ENGINE=MEMORY;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` tinyint(4) NOT NULL AUTO_INCREMENT,
+ `name` char(30) NOT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+INSERT INTO t1 (name) VALUES ('dog');
+UPDATE t1 SET id=-1 WHERE id=1;
+INSERT INTO t1 (name) VALUES ('cat');
+SELECT * FROM t1;
+id name
+-1 dog
+2 cat
+DROP TABLE t1;
+#
+# End of 5.5 tests
+#
+#
# MDEV-15352 AUTO_INCREMENT breaks after updating a column value to a negative number
#
SET @engine='MEMORY';
@@ -159,3 +185,6 @@ id name
-1 dog
2 cat
DROP PROCEDURE autoinc_mdev15353_one;
+#
+# End of 10.2 tests
+#
diff --git a/mysql-test/suite/heap/heap_auto_increment.test b/mysql-test/suite/heap/heap_auto_increment.test
index 6ec150f48da..a480251f3e8 100644
--- a/mysql-test/suite/heap/heap_auto_increment.test
+++ b/mysql-test/suite/heap/heap_auto_increment.test
@@ -35,8 +35,33 @@ drop table t1;
# End of 4.1 tests
--echo #
+--echo # MDEV-16534 PPC64: Unexpected error with a negative values into auto-increment columns in HEAP, MyISAM, ARIA
+--echo #
+
+CREATE TABLE t1 (
+ id TINYINT NOT NULL AUTO_INCREMENT,
+ name CHAR(30) NOT NULL,
+ PRIMARY KEY (id)
+) ENGINE=MEMORY;
+SHOW CREATE TABLE t1;
+INSERT INTO t1 (name) VALUES ('dog');
+UPDATE t1 SET id=-1 WHERE id=1;
+INSERT INTO t1 (name) VALUES ('cat');
+SELECT * FROM t1;
+DROP TABLE t1;
+
+--echo #
+--echo # End of 5.5 tests
+--echo #
+
+--echo #
--echo # MDEV-15352 AUTO_INCREMENT breaks after updating a column value to a negative number
--echo #
SET @engine='MEMORY';
--source include/autoinc_mdev15353.inc
+
+--echo #
+--echo # End of 10.2 tests
+--echo #
+
diff --git a/mysql-test/suite/innodb/r/innodb_query_cache.result b/mysql-test/suite/innodb/r/innodb_query_cache.result
new file mode 100644
index 00000000000..bbacbdfd748
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_query_cache.result
@@ -0,0 +1,39 @@
+#
+# MDEV-16087 Inconsistent SELECT results when query cache is enabled
+#
+set GLOBAL query_cache_type=ON;
+set LOCAL query_cache_type=ON;
+create table t1 (id bigint(20) auto_increment, primary key (id)) ENGINE=InnoDB;
+create table t2 (id bigint(20) auto_increment, primary key (id)) ENGINE=InnoDB;
+create table t3 (id bigint(20) auto_increment, primary key (id)) ENGINE=InnoDB;
+connect con1,localhost,root;
+START TRANSACTION WITH CONSISTENT SNAPSHOT;
+select * from t2;
+id
+connection default;
+insert into t3 () values ();
+connection con1;
+insert into t1 () values ();
+select * from t3;
+id
+connect con2,localhost,root;
+START TRANSACTION WITH CONSISTENT SNAPSHOT;
+select * from t3;
+id
+1
+select * from t3;
+id
+1
+select sql_no_cache * from t3;
+id
+1
+rollback;
+connection con1;
+rollback;
+disconnect con1;
+disconnect con2;
+connection default;
+drop table t1;
+drop table t2;
+drop table t3;
+set GLOBAL query_cache_type=default;
diff --git a/mysql-test/suite/innodb/t/innodb_bug27216817.test b/mysql-test/suite/innodb/t/innodb_bug27216817.test
deleted file mode 100644
index a93932b4a04..00000000000
--- a/mysql-test/suite/innodb/t/innodb_bug27216817.test
+++ /dev/null
@@ -1,28 +0,0 @@
-#
-# BUG#27216817: INNODB: FAILING ASSERTION:
-# PREBUILT->TABLE->N_MYSQL_HANDLES_OPENED == 1
-#
-
-source include/have_innodb.inc;
-create table t1 (a int not null, b int not null) engine=innodb;
-insert t1 values (1,2),(3,4);
-
-lock table t1 write, t1 tr read;
-flush status;
-alter table t1 add primary key (b);
-show status like 'Handler_read_rnd_next';
-unlock tables;
-alter table t1 drop primary key;
-
-lock table t1 write;
-flush status;
-alter table t1 add primary key (b);
-show status like 'Handler_read_rnd_next';
-unlock tables;
-alter table t1 drop primary key;
-
-flush status;
-alter table t1 add primary key (b);
-show status like 'Handler_read_rnd_next';
-
-drop table t1;
diff --git a/mysql-test/suite/innodb/t/innodb_query_cache.test b/mysql-test/suite/innodb/t/innodb_query_cache.test
new file mode 100644
index 00000000000..7dbdf986946
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_query_cache.test
@@ -0,0 +1,47 @@
+-- source include/have_innodb.inc
+-- source include/have_query_cache.inc
+-- source include/not_embedded.inc
+
+--echo #
+--echo # MDEV-16087 Inconsistent SELECT results when query cache is enabled
+--echo #
+
+set GLOBAL query_cache_type=ON;
+set LOCAL query_cache_type=ON;
+
+create table t1 (id bigint(20) auto_increment, primary key (id)) ENGINE=InnoDB;
+create table t2 (id bigint(20) auto_increment, primary key (id)) ENGINE=InnoDB;
+create table t3 (id bigint(20) auto_increment, primary key (id)) ENGINE=InnoDB;
+
+connect (con1,localhost,root);
+START TRANSACTION WITH CONSISTENT SNAPSHOT;
+select * from t2;
+
+connection default;
+insert into t3 () values ();
+
+connection con1;
+insert into t1 () values ();
+select * from t3;
+
+connect (con2,localhost,root);
+START TRANSACTION WITH CONSISTENT SNAPSHOT;
+select * from t3;
+select * from t3;
+select sql_no_cache * from t3;
+
+rollback;
+
+connection con1;
+
+rollback;
+
+disconnect con1;
+disconnect con2;
+connection default;
+
+drop table t1;
+drop table t2;
+drop table t3;
+
+set GLOBAL query_cache_type=default;
diff --git a/mysql-test/suite/maria/maria.result b/mysql-test/suite/maria/maria.result
index bd2403ad461..106bb85c4c8 100644
--- a/mysql-test/suite/maria/maria.result
+++ b/mysql-test/suite/maria/maria.result
@@ -2766,6 +2766,35 @@ INSERT INTO t1 (b) VALUES ('');
ALTER TABLE t1 ENABLE KEYS;
DROP TABLE t1;
#
+# Start of 5.5 tests
+#
+#
+# MDEV-16534 PPC64: Unexpected error with a negative values into auto-increment columns in HEAP, MyISAM, ARIA
+#
+CREATE TABLE t1 (
+id TINYINT NOT NULL AUTO_INCREMENT,
+name CHAR(30) NOT NULL,
+PRIMARY KEY (id)
+) ENGINE=ARIA;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` tinyint(4) NOT NULL AUTO_INCREMENT,
+ `name` char(30) NOT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0
+INSERT INTO t1 (name) VALUES ('dog');
+UPDATE t1 SET id=-1 WHERE id=1;
+INSERT INTO t1 (name) VALUES ('cat');
+SELECT * FROM t1;
+id name
+-1 dog
+2 cat
+DROP TABLE t1;
+#
+# End of 5.5 tests
+#
+#
# BUG#47444 - --myisam_repair_threads > 1 can result in all index
# cardinalities=1
#
diff --git a/mysql-test/suite/maria/maria.test b/mysql-test/suite/maria/maria.test
index e4f8d2427c4..d7710047f48 100644
--- a/mysql-test/suite/maria/maria.test
+++ b/mysql-test/suite/maria/maria.test
@@ -1989,6 +1989,30 @@ ALTER TABLE t1 ENABLE KEYS;
DROP TABLE t1;
--echo #
+--echo # Start of 5.5 tests
+--echo #
+
+--echo #
+--echo # MDEV-16534 PPC64: Unexpected error with a negative values into auto-increment columns in HEAP, MyISAM, ARIA
+--echo #
+
+CREATE TABLE t1 (
+ id TINYINT NOT NULL AUTO_INCREMENT,
+ name CHAR(30) NOT NULL,
+ PRIMARY KEY (id)
+) ENGINE=ARIA;
+SHOW CREATE TABLE t1;
+INSERT INTO t1 (name) VALUES ('dog');
+UPDATE t1 SET id=-1 WHERE id=1;
+INSERT INTO t1 (name) VALUES ('cat');
+SELECT * FROM t1;
+DROP TABLE t1;
+
+--echo #
+--echo # End of 5.5 tests
+--echo #
+
+--echo #
--echo # BUG#47444 - --myisam_repair_threads > 1 can result in all index
--echo # cardinalities=1
--echo #
diff --git a/mysql-test/suite/mariabackup/apply-log-only-incr.test b/mysql-test/suite/mariabackup/apply-log-only-incr.test
index 25cb3a82023..74ab680d840 100644
--- a/mysql-test/suite/mariabackup/apply-log-only-incr.test
+++ b/mysql-test/suite/mariabackup/apply-log-only-incr.test
@@ -36,7 +36,7 @@ connection default;
--disable_result_log
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --ftwrl-wait-timeout=5 --ftwrl-wait-threshold=300 --ftwrl-wait-query-type=all --target-dir=$incremental_dir --incremental-basedir=$basedir ;
-exec $XTRABACKUP --prepare --apply-log-only --target-dir=$basedir ;
+exec $XTRABACKUP --prepare --verbose --apply-log-only --target-dir=$basedir ;
--enable_result_log
let SEARCH_FILE=$MYSQLTEST_VARDIR/log/current_test;
@@ -44,7 +44,7 @@ let SEARCH_FILE=$MYSQLTEST_VARDIR/log/current_test;
--source include/search_pattern_in_file.inc
--echo # expect NOT FOUND
-exec $XTRABACKUP --prepare --apply-log-only --target-dir=$basedir --incremental-dir=$incremental_dir ;
+exec $XTRABACKUP --prepare --verbose --apply-log-only --target-dir=$basedir --incremental-dir=$incremental_dir ;
--source include/search_pattern_in_file.inc
--echo # expect NOT FOUND
diff --git a/mysql-test/suite/mariabackup/mdev-14447.test b/mysql-test/suite/mariabackup/mdev-14447.test
index 48f37646231..689b578f2ab 100644
--- a/mysql-test/suite/mariabackup/mdev-14447.test
+++ b/mysql-test/suite/mariabackup/mdev-14447.test
@@ -18,8 +18,8 @@ exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir
--disable_result_log
echo # Prepare full backup, apply incremental one;
-exec $XTRABACKUP --prepare --apply-log-only --target-dir=$basedir;
-exec $XTRABACKUP --prepare --apply-log-only --target-dir=$basedir --incremental-dir=$incremental_dir ;
+exec $XTRABACKUP --prepare --verbose --apply-log-only --target-dir=$basedir;
+exec $XTRABACKUP --prepare --verbose --apply-log-only --target-dir=$basedir --incremental-dir=$incremental_dir ;
echo # Restore and check results;
let $targetdir=$basedir;
diff --git a/mysql-test/suite/mariabackup/rename_during_mdl_lock.result b/mysql-test/suite/mariabackup/rename_during_mdl_lock.result
new file mode 100644
index 00000000000..982851438f2
--- /dev/null
+++ b/mysql-test/suite/mariabackup/rename_during_mdl_lock.result
@@ -0,0 +1,3 @@
+CREATE TABLE t1(i int) ENGINE INNODB;
+FOUND 1 /failed to execute query SELECT 1 FROM/ in backup.log
+DROP TABLE t2;
diff --git a/mysql-test/suite/mariabackup/rename_during_mdl_lock.test b/mysql-test/suite/mariabackup/rename_during_mdl_lock.test
new file mode 100644
index 00000000000..0a41f1dfe74
--- /dev/null
+++ b/mysql-test/suite/mariabackup/rename_during_mdl_lock.test
@@ -0,0 +1,13 @@
+--source include/have_debug.inc
+let $targetdir=$MYSQLTEST_VARDIR/backup;
+mkdir $targetdir;
+CREATE TABLE t1(i int) ENGINE INNODB;
+--error 1
+exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir --lock-ddl-per-table --dbug=+d,rename_during_mdl_lock_table 2>$targetdir/backup.log;
+
+let SEARCH_FILE=$targetdir/backup.log;
+let SEARCH_PATTERN=failed to execute query SELECT 1 FROM;
+source include/search_pattern_in_file.inc;
+
+DROP TABLE t2;
+rmdir $targetdir;
diff --git a/mysql-test/suite/parts/r/alter_data_directory_innodb.result b/mysql-test/suite/parts/r/alter_data_directory_innodb.result
new file mode 100644
index 00000000000..d0ad8cd074c
--- /dev/null
+++ b/mysql-test/suite/parts/r/alter_data_directory_innodb.result
@@ -0,0 +1,65 @@
+#
+# MDEV-15953 Alter InnoDB Partitioned Table Moves Files (which were originally not in the datadir) to the datadir
+#
+CREATE TABLE t (
+a INT NOT NULL
+) ENGINE=INNODB
+PARTITION BY HASH (a) (
+PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp/partitions_here/' ENGINE = INNODB,
+PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp/partitions_here/' ENGINE = INNODB
+);
+INSERT INTO t VALUES (1);
+SHOW CREATE TABLE t;
+Table Create Table
+t CREATE TABLE `t` (
+ `a` int(11) NOT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+ PARTITION BY HASH (`a`)
+(PARTITION `p1` DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp/partitions_here' ENGINE = InnoDB,
+ PARTITION `p2` DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp/partitions_here' ENGINE = InnoDB)
+ALTER TABLE t ADD PRIMARY KEY pk(a), ALGORITHM=INPLACE;
+SHOW CREATE TABLE t;
+Table Create Table
+t CREATE TABLE `t` (
+ `a` int(11) NOT NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+ PARTITION BY HASH (`a`)
+(PARTITION `p1` DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp/partitions_here' ENGINE = InnoDB,
+ PARTITION `p2` DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp/partitions_here' ENGINE = InnoDB)
+ALTER TABLE t DROP PRIMARY KEY, ALGORITHM=COPY;
+SHOW CREATE TABLE t;
+Table Create Table
+t CREATE TABLE `t` (
+ `a` int(11) NOT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+ PARTITION BY HASH (`a`)
+(PARTITION `p1` DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp/partitions_here' ENGINE = InnoDB,
+ PARTITION `p2` DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp/partitions_here' ENGINE = InnoDB)
+SET @TMP = @@GLOBAL.INNODB_FILE_PER_TABLE;
+SET GLOBAL INNODB_FILE_PER_TABLE=OFF;
+ALTER TABLE t ADD PRIMARY KEY pk(a), ALGORITHM=INPLACE;
+SHOW CREATE TABLE t;
+Table Create Table
+t CREATE TABLE `t` (
+ `a` int(11) NOT NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+ PARTITION BY HASH (`a`)
+(PARTITION `p1` DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp/partitions_here' ENGINE = InnoDB,
+ PARTITION `p2` DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp/partitions_here' ENGINE = InnoDB)
+SET GLOBAL INNODB_FILE_PER_TABLE=@TMP;
+ALTER TABLE t REORGANIZE PARTITION p1,p2 INTO (
+PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp/partitions_somewhere_else/' ENGINE = INNODB,
+PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp/partitions_somewhere_else/' ENGINE = INNODB
+);
+SHOW CREATE TABLE t;
+Table Create Table
+t CREATE TABLE `t` (
+ `a` int(11) NOT NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+ PARTITION BY HASH (`a`)
+(PARTITION `p1` DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp/partitions_here' ENGINE = InnoDB,
+ PARTITION `p2` DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp/partitions_here' ENGINE = InnoDB)
+DROP TABLE t;
diff --git a/mysql-test/suite/parts/t/alter_data_directory_innodb.test b/mysql-test/suite/parts/t/alter_data_directory_innodb.test
new file mode 100644
index 00000000000..ac15e9bec6c
--- /dev/null
+++ b/mysql-test/suite/parts/t/alter_data_directory_innodb.test
@@ -0,0 +1,46 @@
+--source include/have_innodb.inc
+--source include/have_partition.inc
+
+--echo #
+--echo # MDEV-15953 Alter InnoDB Partitioned Table Moves Files (which were originally not in the datadir) to the datadir
+--echo #
+
+mkdir $MYSQLTEST_VARDIR/tmp/partitions_here;
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval CREATE TABLE t (
+ a INT NOT NULL
+) ENGINE=INNODB
+PARTITION BY HASH (a) (
+ PARTITION p1 DATA DIRECTORY = '$MYSQLTEST_VARDIR/tmp/partitions_here/' ENGINE = INNODB,
+ PARTITION p2 DATA DIRECTORY = '$MYSQLTEST_VARDIR/tmp/partitions_here/' ENGINE = INNODB
+);
+INSERT INTO t VALUES (1);
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+SHOW CREATE TABLE t;
+ALTER TABLE t ADD PRIMARY KEY pk(a), ALGORITHM=INPLACE;
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+SHOW CREATE TABLE t;
+ALTER TABLE t DROP PRIMARY KEY, ALGORITHM=COPY;
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+SHOW CREATE TABLE t;
+SET @TMP = @@GLOBAL.INNODB_FILE_PER_TABLE;
+SET GLOBAL INNODB_FILE_PER_TABLE=OFF;
+ALTER TABLE t ADD PRIMARY KEY pk(a), ALGORITHM=INPLACE;
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+SHOW CREATE TABLE t;
+SET GLOBAL INNODB_FILE_PER_TABLE=@TMP;
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval ALTER TABLE t REORGANIZE PARTITION p1,p2 INTO (
+ PARTITION p1 DATA DIRECTORY = '$MYSQLTEST_VARDIR/tmp/partitions_somewhere_else/' ENGINE = INNODB,
+ PARTITION p2 DATA DIRECTORY = '$MYSQLTEST_VARDIR/tmp/partitions_somewhere_else/' ENGINE = INNODB
+);
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+SHOW CREATE TABLE t;
+
+DROP TABLE t;
+
+rmdir $MYSQLTEST_VARDIR/tmp/partitions_here/test;
+rmdir $MYSQLTEST_VARDIR/tmp/partitions_here;
diff --git a/mysql-test/suite/plugins/r/auth_ed25519.result b/mysql-test/suite/plugins/r/auth_ed25519.result
index 1baec60da40..ee9320bbc6c 100644
--- a/mysql-test/suite/plugins/r/auth_ed25519.result
+++ b/mysql-test/suite/plugins/r/auth_ed25519.result
@@ -32,7 +32,7 @@ PLUGIN_AUTHOR Sergei Golubchik
PLUGIN_DESCRIPTION Elliptic curve ED25519 based authentication
PLUGIN_LICENSE GPL
LOAD_OPTION ON
-PLUGIN_MATURITY Beta
+PLUGIN_MATURITY Stable
PLUGIN_AUTH_VERSION 1.0-alpha
create user test1@localhost identified via ed25519 using 'ZIgUREUg5PVgQ6LskhXmO+eZLS0nC8be6HPjYWR4YJY';
show grants for test1@localhost;
diff --git a/mysql-test/suite/plugins/r/processlist.result b/mysql-test/suite/plugins/r/processlist.result
new file mode 100644
index 00000000000..c27534d9d78
--- /dev/null
+++ b/mysql-test/suite/plugins/r/processlist.result
@@ -0,0 +1,9 @@
+create table t1 (a int) engine=innodb;
+start transaction;
+insert t1 values (1);
+connect con2,localhost,root;
+state from show engine innodb status, must be empty
+
+disconnect con2;
+connection default;
+drop table t1;
diff --git a/mysql-test/suite/plugins/t/processlist.test b/mysql-test/suite/plugins/t/processlist.test
new file mode 100644
index 00000000000..39b715b867b
--- /dev/null
+++ b/mysql-test/suite/plugins/t/processlist.test
@@ -0,0 +1,20 @@
+#
+# MDEV-15359 Thread stay in "cleaning up" status after finishing
+#
+source include/have_innodb.inc;
+
+create table t1 (a int) engine=innodb;
+start transaction;
+insert t1 values (1);
+let id=`select connection_id()`;
+connect con2,localhost,root;
+let $wait_condition=select state='' from information_schema.processlist where id = $id;
+--source include/wait_condition.inc
+replace_regex /\"/-/; #"
+let s=`show engine innodb status`;
+disable_query_log;
+eval select regexp_replace("$s", '(?s)^.*MySQL thread id $id,.*root([^\n]*)\n.*', '\\\\1') as `state from show engine innodb status, must be empty`;
+enable_query_log;
+disconnect con2;
+connection default;
+drop table t1;
diff --git a/mysql-test/suite/roles/grant_revoke_current.result b/mysql-test/suite/roles/grant_revoke_current.result
index d9798463965..436bec92a8f 100644
--- a/mysql-test/suite/roles/grant_revoke_current.result
+++ b/mysql-test/suite/roles/grant_revoke_current.result
@@ -39,4 +39,5 @@ GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY PASSWORD '*34391
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
GRANT USAGE ON *.* TO 'r1'
set password='';
+update mysql.user set plugin='';
drop role r1;
diff --git a/mysql-test/suite/roles/grant_revoke_current.test b/mysql-test/suite/roles/grant_revoke_current.test
index 0ebe0170782..bffc04087b1 100644
--- a/mysql-test/suite/roles/grant_revoke_current.test
+++ b/mysql-test/suite/roles/grant_revoke_current.test
@@ -25,5 +25,7 @@ show grants;
grant r1 to current_user() identified by 'barfoo';
show grants;
set password='';
+#cleanup after MDEV-16238
+update mysql.user set plugin='';
drop role r1;
diff --git a/mysql-test/suite/roles/set_default_role_ps-6960.result b/mysql-test/suite/roles/set_default_role_ps-6960.result
index 60210d7f92c..c186e7bccb0 100644
--- a/mysql-test/suite/roles/set_default_role_ps-6960.result
+++ b/mysql-test/suite/roles/set_default_role_ps-6960.result
@@ -6,3 +6,4 @@ execute stmt;
set password = '';
set default role NONE;
drop role r1;
+update mysql.user set plugin='';
diff --git a/mysql-test/suite/roles/set_default_role_ps-6960.test b/mysql-test/suite/roles/set_default_role_ps-6960.test
index 8ac520e1776..8af95c9e8a0 100644
--- a/mysql-test/suite/roles/set_default_role_ps-6960.test
+++ b/mysql-test/suite/roles/set_default_role_ps-6960.test
@@ -13,3 +13,5 @@ execute stmt;
set password = '';
set default role NONE;
drop role r1;
+#cleanup after MDEV-16238
+update mysql.user set plugin='';
diff --git a/mysql-test/suite/rpl/include/rpl_mixed_check_user.inc b/mysql-test/suite/rpl/include/rpl_mixed_check_user.inc
index 8bf5a4eea1e..548fdf789da 100644
--- a/mysql-test/suite/rpl/include/rpl_mixed_check_user.inc
+++ b/mysql-test/suite/rpl/include/rpl_mixed_check_user.inc
@@ -5,9 +5,9 @@
# Requirements:
#########################################
-SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
+SELECT host, user, password, plugin, authentication_string, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
sync_slave_with_master;
USE test_rpl;
-SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
+SELECT host, user, password, plugin, authentication_string, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
connection master;
diff --git a/mysql-test/suite/rpl/r/rpl_do_grant.result b/mysql-test/suite/rpl/r/rpl_do_grant.result
index aed8bba3bc0..9eca21b38e4 100644
--- a/mysql-test/suite/rpl/r/rpl_do_grant.result
+++ b/mysql-test/suite/rpl/r/rpl_do_grant.result
@@ -20,21 +20,21 @@ GRANT DROP ON `test`.* TO 'rpl_do_grant'@'localhost'
connection master;
set password for rpl_do_grant@localhost=password("does it work?");
connection slave;
-select password<>_binary'' from mysql.user where user=_binary'rpl_do_grant';
-password<>_binary''
+select authentication_string<>_binary'' from mysql.user where user=_binary'rpl_do_grant';
+authentication_string<>_binary''
1
connection master;
-update mysql.user set password='' where user='rpl_do_grant';
+update mysql.user set authentication_string='' where user='rpl_do_grant';
flush privileges;
-select password<>'' from mysql.user where user='rpl_do_grant';
-password<>''
+select authentication_string<>'' from mysql.user where user='rpl_do_grant';
+authentication_string<>''
0
set sql_mode='ANSI_QUOTES';
set password for rpl_do_grant@localhost=password('does it work?');
set sql_mode='';
connection slave;
-select password<>'' from mysql.user where user='rpl_do_grant';
-password<>''
+select authentication_string<>'' from mysql.user where user='rpl_do_grant';
+authentication_string<>''
1
connection master;
delete from mysql.user where user=_binary'rpl_do_grant';
diff --git a/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result b/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result
index 1f6a9370090..24ce8899e2c 100644
--- a/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result
+++ b/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result
@@ -480,72 +480,72 @@ SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
******************** CREATE USER ********************
CREATE USER 'user_test_rpl'@'localhost' IDENTIFIED BY PASSWORD '*1111111111111111111111111111111111111111';
-SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
-host user password select_priv
-localhost user_test_rpl *1111111111111111111111111111111111111111 N
+SELECT host, user, password, plugin, authentication_string, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
+host user password plugin authentication_string select_priv
+localhost user_test_rpl *1111111111111111111111111111111111111111 N
connection slave;
USE test_rpl;
-SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
-host user password select_priv
-localhost user_test_rpl *1111111111111111111111111111111111111111 N
+SELECT host, user, password, plugin, authentication_string, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
+host user password plugin authentication_string select_priv
+localhost user_test_rpl *1111111111111111111111111111111111111111 N
connection master;
******************** GRANT ********************
GRANT SELECT ON *.* TO 'user_test_rpl'@'localhost';
-SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
-host user password select_priv
-localhost user_test_rpl *1111111111111111111111111111111111111111 Y
+SELECT host, user, password, plugin, authentication_string, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
+host user password plugin authentication_string select_priv
+localhost user_test_rpl *1111111111111111111111111111111111111111 Y
connection slave;
USE test_rpl;
-SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
-host user password select_priv
-localhost user_test_rpl *1111111111111111111111111111111111111111 Y
+SELECT host, user, password, plugin, authentication_string, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
+host user password plugin authentication_string select_priv
+localhost user_test_rpl *1111111111111111111111111111111111111111 Y
connection master;
******************** REVOKE ********************
REVOKE SELECT ON *.* FROM 'user_test_rpl'@'localhost';
-SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
-host user password select_priv
-localhost user_test_rpl *1111111111111111111111111111111111111111 N
+SELECT host, user, password, plugin, authentication_string, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
+host user password plugin authentication_string select_priv
+localhost user_test_rpl *1111111111111111111111111111111111111111 N
connection slave;
USE test_rpl;
-SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
-host user password select_priv
-localhost user_test_rpl *1111111111111111111111111111111111111111 N
+SELECT host, user, password, plugin, authentication_string, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
+host user password plugin authentication_string select_priv
+localhost user_test_rpl *1111111111111111111111111111111111111111 N
connection master;
******************** SET PASSWORD ********************
SET PASSWORD FOR 'user_test_rpl'@'localhost' = '*0000000000000000000000000000000000000000';
-SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
-host user password select_priv
-localhost user_test_rpl *0000000000000000000000000000000000000000 N
+SELECT host, user, password, plugin, authentication_string, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
+host user password plugin authentication_string select_priv
+localhost user_test_rpl mysql_native_password *0000000000000000000000000000000000000000 N
connection slave;
USE test_rpl;
-SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
-host user password select_priv
-localhost user_test_rpl *0000000000000000000000000000000000000000 N
+SELECT host, user, password, plugin, authentication_string, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
+host user password plugin authentication_string select_priv
+localhost user_test_rpl mysql_native_password *0000000000000000000000000000000000000000 N
connection master;
******************** RENAME USER ********************
RENAME USER 'user_test_rpl'@'localhost' TO 'user_test_rpl_2'@'localhost';
-SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
-host user password select_priv
-localhost user_test_rpl_2 *0000000000000000000000000000000000000000 N
+SELECT host, user, password, plugin, authentication_string, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
+host user password plugin authentication_string select_priv
+localhost user_test_rpl_2 mysql_native_password *0000000000000000000000000000000000000000 N
connection slave;
USE test_rpl;
-SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
-host user password select_priv
-localhost user_test_rpl_2 *0000000000000000000000000000000000000000 N
+SELECT host, user, password, plugin, authentication_string, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
+host user password plugin authentication_string select_priv
+localhost user_test_rpl_2 mysql_native_password *0000000000000000000000000000000000000000 N
connection master;
******************** DROP USER ********************
DROP USER 'user_test_rpl_2'@'localhost';
-SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
-host user password select_priv
+SELECT host, user, password, plugin, authentication_string, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
+host user password plugin authentication_string select_priv
connection slave;
USE test_rpl;
-SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
-host user password select_priv
+SELECT host, user, password, plugin, authentication_string, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
+host user password plugin authentication_string select_priv
connection master;
INSERT INTO t1 VALUES(100, 'test');
diff --git a/mysql-test/suite/rpl/r/rpl_parallel_optimistic.result b/mysql-test/suite/rpl/r/rpl_parallel_optimistic.result
index 7c8a2a94104..07b080a72c3 100644
--- a/mysql-test/suite/rpl/r/rpl_parallel_optimistic.result
+++ b/mysql-test/suite/rpl/r/rpl_parallel_optimistic.result
@@ -610,8 +610,39 @@ a b
57 7
58 8
59 9
+connection server_1;
+DELETE FROM t1;
+DELETE FROM t2;
+include/save_master_gtid.inc
+connection server_2;
+include/sync_with_master_gtid.inc
+connection server_2;
+set global log_warnings=2;
+BEGIN;
+INSERT INTO t1 SET a=1;
+connection server_1;
+SET @save.binlog_format=@@session.binlog_format;
+SET @@SESSION.binlog_format=row;
+BEGIN;
+INSERT INTO t1 SET a=1;
+INSERT INTO t2 SET a=1;
+COMMIT;
+BEGIN;
+DELETE FROM t2;
+COMMIT;
+connection server_2;
+connection server_2;
+ROLLBACK;
+connection server_1;
+SET @@SESSION.binlog_format= @save.binlog_format;
+DELETE FROM t1;
+DELETE FROM t2;
+include/save_master_gtid.inc
+connection server_2;
+include/sync_with_master_gtid.inc
connection server_2;
include/stop_slave.inc
+set global log_warnings=default;
SET GLOBAL slave_parallel_mode=@old_parallel_mode;
SET GLOBAL slave_parallel_threads=@old_parallel_threads;
include/start_slave.inc
diff --git a/mysql-test/suite/rpl/t/rpl_do_grant.test b/mysql-test/suite/rpl/t/rpl_do_grant.test
index 83b9a84744f..0024c7039e4 100644
--- a/mysql-test/suite/rpl/t/rpl_do_grant.test
+++ b/mysql-test/suite/rpl/t/rpl_do_grant.test
@@ -27,20 +27,20 @@ show grants for rpl_do_grant@localhost;
connection master;
set password for rpl_do_grant@localhost=password("does it work?");
sync_slave_with_master;
-select password<>_binary'' from mysql.user where user=_binary'rpl_do_grant';
+select authentication_string<>_binary'' from mysql.user where user=_binary'rpl_do_grant';
#
# Bug#24158 SET PASSWORD in binary log fails under ANSI_QUOTES
#
connection master;
-update mysql.user set password='' where user='rpl_do_grant';
+update mysql.user set authentication_string='' where user='rpl_do_grant';
flush privileges;
-select password<>'' from mysql.user where user='rpl_do_grant';
+select authentication_string<>'' from mysql.user where user='rpl_do_grant';
set sql_mode='ANSI_QUOTES';
set password for rpl_do_grant@localhost=password('does it work?');
set sql_mode='';
sync_slave_with_master;
-select password<>'' from mysql.user where user='rpl_do_grant';
+select authentication_string<>'' from mysql.user where user='rpl_do_grant';
# clear what we have done, to not influence other tests.
diff --git a/mysql-test/suite/rpl/t/rpl_parallel_optimistic.test b/mysql-test/suite/rpl/t/rpl_parallel_optimistic.test
index b5d78033088..a49d59c4eb4 100644
--- a/mysql-test/suite/rpl/t/rpl_parallel_optimistic.test
+++ b/mysql-test/suite/rpl/t/rpl_parallel_optimistic.test
@@ -484,10 +484,69 @@ SELECT * FROM t2 WHERE a >= 40 ORDER BY a;
SELECT * FROM t1 WHERE a >= 40 ORDER BY a;
SELECT * FROM t2 WHERE a >= 40 ORDER BY a;
-# Clean up.
+# partial cleanup to reuse the tables by following tests
+--connection server_1
+DELETE FROM t1;
+DELETE FROM t2;
+--source include/save_master_gtid.inc
+
+--connection server_2
+--source include/sync_with_master_gtid.inc
+
+#
+# MDEV-13577 optimistic parallel slave errors out to error log unnecessary
+#
+
+# The 1st of the following two trx:s a blocker on slave
+--connection server_2
+set global log_warnings=2;
+BEGIN;
+INSERT INTO t1 SET a=1;
+
+--connection server_1
+SET @save.binlog_format=@@session.binlog_format;
+SET @@SESSION.binlog_format=row;
+
+BEGIN;
+ INSERT INTO t1 SET a=1;
+ INSERT INTO t2 SET a=1;
+COMMIT;
+# This transaction is going to win optimistical race with above INSERT
+# on slave while being depend on it. That means it will face a kind of temporary error
+# and then will retry to succeed.
+BEGIN;
+ DELETE FROM t2;
+COMMIT;
+
+# First make sure DELETE raced indeed to get stuck at retrying stage
+# where it runs "realistically" now. There is nomore optimistic error
+# in the errorlog, which is downgraded to the warning level (when
+# --log-warnings > 1), see above suppression.
+--connection server_2
+--let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist WHERE state = "Waiting for prior transaction to commit"
+--source include/wait_condition.inc
+
+# Next release the 1st trx to commit.
+--connection server_2
+ROLLBACK;
+
+# MDEV-13577 local cleanup:
+--connection server_1
+SET @@SESSION.binlog_format= @save.binlog_format;
+DELETE FROM t1;
+DELETE FROM t2;
+--source include/save_master_gtid.inc
+
+--connection server_2
+--source include/sync_with_master_gtid.inc
+
+#
+# Clean up.
+#
--connection server_2
--source include/stop_slave.inc
+set global log_warnings=default;
SET GLOBAL slave_parallel_mode=@old_parallel_mode;
SET GLOBAL slave_parallel_threads=@old_parallel_threads;
--source include/start_slave.inc
diff --git a/mysql-test/suite/sys_vars/r/maximum_basic.result b/mysql-test/suite/sys_vars/r/maximum_basic.result
index 20b6bbc962e..becd6da91f4 100644
--- a/mysql-test/suite/sys_vars/r/maximum_basic.result
+++ b/mysql-test/suite/sys_vars/r/maximum_basic.result
@@ -16,3 +16,33 @@ Warning 1292 Truncated incorrect max_join_size value: '40960'
SELECT @@session.max_join_size;
@@session.max_join_size
8192
+SET @@session.use_stat_tables= COMPLEMENTARY;
+SELECT @@session.use_stat_tables;
+@@session.use_stat_tables
+COMPLEMENTARY
+SET @@session.use_stat_tables= PREFERABLY;
+Warnings:
+Warning 1292 Truncated incorrect use_stat_tables value: 'PREFERABLY'
+SELECT @@session.use_stat_tables;
+@@session.use_stat_tables
+COMPLEMENTARY
+SET @@session.use_stat_tables= 2;
+Warnings:
+Warning 1292 Truncated incorrect use_stat_tables value: '2'
+SELECT @@session.use_stat_tables;
+@@session.use_stat_tables
+COMPLEMENTARY
+SET @@session.sql_mode= 'REAL_AS_FLOAT';
+SELECT @@session.sql_mode;
+@@session.sql_mode
+REAL_AS_FLOAT
+SET @@session.sql_mode= 'REAL_AS_FLOAT,ANSI_QUOTES';
+SELECT @@session.sql_mode;
+@@session.sql_mode
+REAL_AS_FLOAT,ANSI_QUOTES
+SET @@session.sql_mode= 'ANSI_QUOTES,IGNORE_SPACE';
+Warnings:
+Warning 1292 Truncated incorrect sql_mode value: 'ANSI_QUOTES,IGNORE_SPACE'
+SELECT @@session.sql_mode;
+@@session.sql_mode
+ANSI_QUOTES
diff --git a/mysql-test/suite/sys_vars/t/maximum_basic-master.opt b/mysql-test/suite/sys_vars/t/maximum_basic-master.opt
index b6e5666f4fb..16e365d491c 100644
--- a/mysql-test/suite/sys_vars/t/maximum_basic-master.opt
+++ b/mysql-test/suite/sys_vars/t/maximum_basic-master.opt
@@ -1,3 +1,5 @@
--maximum-auto-increment-increment=8192
--maximum-tmp-table-size=8192
--maximum-max-join-size=8192
+--maximum-use-stat-tables=COMPLEMENTARY
+--maximum-sql-mode='REAL_AS_FLOAT,ANSI_QUOTES'
diff --git a/mysql-test/suite/sys_vars/t/maximum_basic.test b/mysql-test/suite/sys_vars/t/maximum_basic.test
index 9961f65883a..3153d62d562 100644
--- a/mysql-test/suite/sys_vars/t/maximum_basic.test
+++ b/mysql-test/suite/sys_vars/t/maximum_basic.test
@@ -18,3 +18,22 @@ SELECT @@session.tmp_table_size;
SET @@session.max_join_size=40960;
SELECT @@session.max_join_size;
+#
+# enum
+#
+SET @@session.use_stat_tables= COMPLEMENTARY;
+SELECT @@session.use_stat_tables;
+SET @@session.use_stat_tables= PREFERABLY;
+SELECT @@session.use_stat_tables;
+SET @@session.use_stat_tables= 2;
+SELECT @@session.use_stat_tables;
+
+#
+# set
+#
+SET @@session.sql_mode= 'REAL_AS_FLOAT';
+SELECT @@session.sql_mode;
+SET @@session.sql_mode= 'REAL_AS_FLOAT,ANSI_QUOTES';
+SELECT @@session.sql_mode;
+SET @@session.sql_mode= 'ANSI_QUOTES,IGNORE_SPACE';
+SELECT @@session.sql_mode;
diff --git a/mysql-test/suite/unit/suite.pm b/mysql-test/suite/unit/suite.pm
index c92363a8601..c8180c59240 100644
--- a/mysql-test/suite/unit/suite.pm
+++ b/mysql-test/suite/unit/suite.pm
@@ -40,7 +40,7 @@ sub start_test {
my $bin=$ENV{MTR_BINDIR} || '..';
return "Not run for embedded server" if $::opt_embedded_server;
return "Not configured to run ctest" unless -f "$bin/CTestTestfile.cmake";
- my ($ctest_vs)= $opt_vs_config ? "-C $opt_vs_config" : "";
+ my ($ctest_vs)= $::opt_vs_config ? "-C ".substr($::opt_vs_config,1) : "";
my (@ctest_list)= `cd "$bin" && ctest $ctest_vs --show-only --verbose`;
return "No ctest" if $?;
diff --git a/mysql-test/suite/vcol/r/index.result b/mysql-test/suite/vcol/r/index.result
new file mode 100644
index 00000000000..8860a728bd1
--- /dev/null
+++ b/mysql-test/suite/vcol/r/index.result
@@ -0,0 +1,91 @@
+#
+# Test table with a key that consists of indirect virtual fields
+#
+CREATE TABLE t1 (a int, b int as (a+1) virtual, c int as (b+1) virtual, index(c)) engine=myisam;
+insert into t1 (a) values (1),(2),(3);
+update t1 set a=5 where a=3;
+delete from t1 where a=1;
+select * from t1;
+a b c
+2 3 4
+5 6 7
+select * from t1 where c=7;
+a b c
+5 6 7
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+select * from t1;
+a b c
+2 3 4
+5 6 7
+drop table t1;
+CREATE TABLE t1 (a int, b int as (a+1) virtual, c int as (b+1) virtual, index(c)) engine=innodb;
+insert into t1 (a) values (1),(2),(3);
+update t1 set a=5 where a=3;
+delete from t1 where a=1;
+select * from t1;
+a b c
+2 3 4
+5 6 7
+select * from t1 where c=7;
+a b c
+5 6 7
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+select * from t1;
+a b c
+2 3 4
+5 6 7
+drop table t1;
+#
+# MDEV-15114
+# ASAN heap-use-after-free in mem_heap_dup or
+# dfield_data_is_binary_equal
+#
+CREATE TABLE t1 (
+pk INT,
+extra tinyint,
+c TEXT,
+vc LONGTEXT AS (c) VIRTUAL,
+i INT,
+PRIMARY KEY(pk),
+UNIQUE(i),
+INDEX(vc(64))
+) ENGINE=InnoDB;
+INSERT INTO t1 (pk,extra, c, i) VALUES (1, 10, REPEAT('foo ',15000),0);
+REPLACE INTO t1 (pk,extra, c,i) SELECT pk,extra+10, c,i FROM t1;
+select pk, extra, left(c, 10), length(c), left(vc,10), length(vc), extra from t1;
+pk extra left(c, 10) length(c) left(vc,10) length(vc) extra
+1 20 foo foo fo 60000 foo foo fo 60000 20
+DROP TABLE t1;
+#
+# Update of deleted row with binary logging enabled
+#
+SET BINLOG_FORMAT=row;
+CREATE TABLE t1 (
+pk INT,
+c TEXT,
+vc LONGTEXT AS (c) VIRTUAL,
+i INT,
+PRIMARY KEY(pk),
+UNIQUE(i),
+INDEX(vc(64))
+) ENGINE=InnoDB;
+INSERT INTO t1 (pk,c,i) VALUES (1,REPEAT('foo ',15000),10);
+INSERT INTO t1 (pk,c,i) VALUES (2,REPEAT('bar ',15000),11);
+connect c1,localhost,root,,;
+connection c1;
+begin;
+DELETE from t1 WHERE pk=1;
+connection default;
+update t1 set pk=1 where pk=2;
+connection c1;
+commit;
+connection default;
+select pk, left(c, 10), length(c), i from t1;
+pk left(c, 10) length(c) i
+1 bar bar ba 60000 11
+drop table t1;
+disconnect c1;
diff --git a/mysql-test/suite/vcol/r/vcol_misc.result b/mysql-test/suite/vcol/r/vcol_misc.result
index 130eb0ff51a..f3edfa9c026 100644
--- a/mysql-test/suite/vcol/r/vcol_misc.result
+++ b/mysql-test/suite/vcol/r/vcol_misc.result
@@ -352,6 +352,16 @@ a b c
DROP TABLE t1;
SET sql_mode=DEFAULT;
#
+# MDEV-15834 The code in TABLE_SHARE::init_from_binary_frm_image() is not safe
+#
+SHOW TABLES;
+Tables_in_test
+t1
+SHOW CREATE TABLE t1;
+ERROR HY000: Incorrect information in file: './test/t1.frm'
+ALTER TABLE t1;
+ERROR HY000: Incorrect information in file: './test/t1.frm'
+#
# End of 5.5 tests
#
#
diff --git a/mysql-test/suite/vcol/t/index.test b/mysql-test/suite/vcol/t/index.test
new file mode 100644
index 00000000000..72eed0a8a40
--- /dev/null
+++ b/mysql-test/suite/vcol/t/index.test
@@ -0,0 +1,81 @@
+--source include/have_innodb.inc
+--source include/have_log_bin.inc
+
+--echo #
+--echo # Test table with a key that consists of indirect virtual fields
+--echo #
+
+CREATE TABLE t1 (a int, b int as (a+1) virtual, c int as (b+1) virtual, index(c)) engine=myisam;
+insert into t1 (a) values (1),(2),(3);
+update t1 set a=5 where a=3;
+delete from t1 where a=1;
+select * from t1;
+select * from t1 where c=7;
+check table t1;
+select * from t1;
+drop table t1;
+
+CREATE TABLE t1 (a int, b int as (a+1) virtual, c int as (b+1) virtual, index(c)) engine=innodb;
+insert into t1 (a) values (1),(2),(3);
+update t1 set a=5 where a=3;
+delete from t1 where a=1;
+select * from t1;
+select * from t1 where c=7;
+check table t1;
+select * from t1;
+drop table t1;
+
+--echo #
+--echo # MDEV-15114
+--echo # ASAN heap-use-after-free in mem_heap_dup or
+--echo # dfield_data_is_binary_equal
+--echo #
+
+CREATE TABLE t1 (
+ pk INT,
+ extra tinyint,
+ c TEXT,
+ vc LONGTEXT AS (c) VIRTUAL,
+ i INT,
+ PRIMARY KEY(pk),
+ UNIQUE(i),
+ INDEX(vc(64))
+) ENGINE=InnoDB;
+
+INSERT INTO t1 (pk,extra, c, i) VALUES (1, 10, REPEAT('foo ',15000),0);
+REPLACE INTO t1 (pk,extra, c,i) SELECT pk,extra+10, c,i FROM t1;
+select pk, extra, left(c, 10), length(c), left(vc,10), length(vc), extra from t1;
+DROP TABLE t1;
+
+--echo #
+--echo # Update of deleted row with binary logging enabled
+--echo #
+
+SET BINLOG_FORMAT=row;
+
+CREATE TABLE t1 (
+ pk INT,
+ c TEXT,
+ vc LONGTEXT AS (c) VIRTUAL,
+ i INT,
+ PRIMARY KEY(pk),
+ UNIQUE(i),
+ INDEX(vc(64))
+) ENGINE=InnoDB;
+
+INSERT INTO t1 (pk,c,i) VALUES (1,REPEAT('foo ',15000),10);
+INSERT INTO t1 (pk,c,i) VALUES (2,REPEAT('bar ',15000),11);
+
+--connect (c1,localhost,root,,)
+--connection c1
+begin;
+DELETE from t1 WHERE pk=1;
+--connection default
+--send update t1 set pk=1 where pk=2
+--connection c1
+commit;
+--connection default
+--reap
+select pk, left(c, 10), length(c), i from t1;
+drop table t1;
+disconnect c1;
diff --git a/mysql-test/suite/vcol/t/vcol_misc.test b/mysql-test/suite/vcol/t/vcol_misc.test
index 2244967a968..b351e1eb4a6 100644
--- a/mysql-test/suite/vcol/t/vcol_misc.test
+++ b/mysql-test/suite/vcol/t/vcol_misc.test
@@ -1,5 +1,7 @@
--source include/have_ucs2.inc
+let $MYSQLD_DATADIR= `select @@datadir`;
+
--disable_warnings
drop table if exists t1,t2;
--enable_warnings
@@ -321,6 +323,22 @@ SELECT * FROM t1;
DROP TABLE t1;
SET sql_mode=DEFAULT;
+
+--echo #
+--echo # MDEV-15834 The code in TABLE_SHARE::init_from_binary_frm_image() is not safe
+--echo #
+
+--copy_file std_data/frm/t1.frm $MYSQLD_DATADIR/test/t1.frm
+SHOW TABLES;
+--replace_result $MYSQLD_DATADIR ./
+--error ER_NOT_FORM_FILE
+SHOW CREATE TABLE t1;
+--replace_result $MYSQLD_DATADIR ./
+--error ER_NOT_FORM_FILE
+ALTER TABLE t1;
+--remove_file $MYSQLD_DATADIR/test/t1.frm
+
+
--echo #
--echo # End of 5.5 tests
--echo #
diff --git a/mysql-test/suite/wsrep/r/variables.result b/mysql-test/suite/wsrep/r/variables.result
index 30b97e02af3..b6f22828532 100644
--- a/mysql-test/suite/wsrep/r/variables.result
+++ b/mysql-test/suite/wsrep/r/variables.result
@@ -207,6 +207,16 @@ Threads_connected 1
SHOW STATUS LIKE 'wsrep_thread_count';
Variable_name Value
wsrep_thread_count 11
+set wsrep_on=0;
+set wsrep_on=1;
+create user test@localhost;
+connect con1,localhost,test;
+set auto_increment_increment=10;
+set wsrep_on=0;
+ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
+disconnect con1;
+connection default;
+drop user test@localhost;
#
# MDEV#6411: Setting set @@global.wsrep_sst_auth=NULL causes crash
#
diff --git a/mysql-test/suite/wsrep/t/variables.test b/mysql-test/suite/wsrep/t/variables.test
index 1769f567848..1315f090d5c 100644
--- a/mysql-test/suite/wsrep/t/variables.test
+++ b/mysql-test/suite/wsrep/t/variables.test
@@ -118,6 +118,20 @@ sleep 3;
SHOW STATUS LIKE 'threads_connected';
SHOW STATUS LIKE 'wsrep_thread_count';
+#
+# privileges for wsrep_on
+#
+set wsrep_on=0;
+set wsrep_on=1;
+create user test@localhost;
+connect con1,localhost,test;
+set auto_increment_increment=10;
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
+set wsrep_on=0;
+disconnect con1;
+connection default;
+drop user test@localhost;
+
--echo #
--echo # MDEV#6411: Setting set @@global.wsrep_sst_auth=NULL causes crash
--echo #