summaryrefslogtreecommitdiff
path: root/mysql-test/include
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/include')
-rw-r--r--mysql-test/include/analyze-format.inc2
-rw-r--r--mysql-test/include/check-testcase.test4
-rw-r--r--mysql-test/include/column_compression_rpl.inc2
-rw-r--r--mysql-test/include/commit.inc15
-rw-r--r--mysql-test/include/common-tests.inc8
-rw-r--r--mysql-test/include/concurrent.inc52
-rw-r--r--mysql-test/include/ctype_common.inc2
-rw-r--r--mysql-test/include/ctype_heap.inc2
-rw-r--r--mysql-test/include/ctype_ident_sys.inc73
-rw-r--r--mysql-test/include/ctype_pad_all_engines.inc6
-rw-r--r--mysql-test/include/ctype_strtoll10.inc2
-rw-r--r--mysql-test/include/deadlock.inc4
-rw-r--r--mysql-test/include/default_client.cnf3
-rw-r--r--mysql-test/include/default_my.cnf1
-rw-r--r--mysql-test/include/default_mysqld.cnf17
-rw-r--r--mysql-test/include/function_defaults.inc2
-rw-r--r--mysql-test/include/galera_cluster.inc23
-rw-r--r--mysql-test/include/galera_variables_ok.inc2
-rw-r--r--mysql-test/include/galera_variables_ok_debug.inc2
-rw-r--r--mysql-test/include/have_crypt.inc2
-rw-r--r--mysql-test/include/have_dbi_dbd-mariadb.inc (renamed from mysql-test/include/have_dbi_dbd-mysql.inc)10
-rw-r--r--mysql-test/include/have_innodb.inc12
-rw-r--r--mysql-test/include/have_pool_of_threads.inc3
-rw-r--r--mysql-test/include/have_query_cache_disabled.inc36
-rw-r--r--mysql-test/include/have_s3.inc10
-rw-r--r--mysql-test/include/have_type_mysql_json.inc3
-rw-r--r--mysql-test/include/have_type_mysql_json.opt2
-rw-r--r--mysql-test/include/icp_tests.inc7
-rw-r--r--mysql-test/include/index_merge1.inc4
-rw-r--r--mysql-test/include/innodb_checksum_algorithm.combinations2
-rw-r--r--mysql-test/include/kill_and_restart_mysqld.inc15
-rw-r--r--mysql-test/include/load_dump_and_upgrade.inc49
-rw-r--r--mysql-test/include/loaddata_autocom.inc2
-rw-r--r--mysql-test/include/maybe_pool_of_threads.combinations5
-rw-r--r--mysql-test/include/maybe_pool_of_threads.inc2
-rw-r--r--mysql-test/include/mix1.inc4
-rw-r--r--mysql-test/include/mix2.inc28
-rw-r--r--mysql-test/include/mysqlhotcopy.inc4
-rw-r--r--mysql-test/include/not_asan.inc2
-rw-r--r--mysql-test/include/not_msan.inc6
-rw-r--r--mysql-test/include/not_threadpool.inc3
-rw-r--r--mysql-test/include/not_ubsan.inc2
-rw-r--r--mysql-test/include/not_valgrind.inc2
-rw-r--r--mysql-test/include/not_windows.inc2
-rw-r--r--mysql-test/include/partition_mrr.inc6
-rw-r--r--mysql-test/include/percona_nonflushing_analyze_debug.inc35
-rw-r--r--mysql-test/include/ps_conv.inc16
-rw-r--r--mysql-test/include/query_cache.inc6
-rw-r--r--mysql-test/include/query_cache_partitions.inc2
-rw-r--r--mysql-test/include/read_many_rows.inc2
-rw-r--r--mysql-test/include/rowid_order.inc2
-rw-r--r--mysql-test/include/rpl_stop_server.inc4
-rw-r--r--mysql-test/include/search_pattern_in_file.inc13
-rw-r--r--mysql-test/include/show_events.inc6
-rw-r--r--mysql-test/include/shutdown_mysqld.inc10
-rw-r--r--mysql-test/include/unsafe_binlog.inc6
-rw-r--r--mysql-test/include/wait_for_sql_thread_read_all.inc2
-rw-r--r--mysql-test/include/wsrep_wait_condition.inc23
-rw-r--r--mysql-test/include/wsrep_wait_disconnect.inc20
-rw-r--r--mysql-test/include/wsrep_wait_membership.inc10
60 files changed, 457 insertions, 145 deletions
diff --git a/mysql-test/include/analyze-format.inc b/mysql-test/include/analyze-format.inc
index 08006e26c79..7e18524e44e 100644
--- a/mysql-test/include/analyze-format.inc
+++ b/mysql-test/include/analyze-format.inc
@@ -1,3 +1,3 @@
# The time on ANALYSE FORMAT=JSON is rather variable
---replace_regex /("(r_total_time_ms|r_buffer_size|r_filling_time_ms)": )[^, \n]*/\1"REPLACED"/
+--replace_regex /("(r_total_time_ms|r_table_time_ms|r_other_time_ms|r_buffer_size|r_filling_time_ms)": )[^, \n]*/\1"REPLACED"/
diff --git a/mysql-test/include/check-testcase.test b/mysql-test/include/check-testcase.test
index 191feae1628..e984c4dc497 100644
--- a/mysql-test/include/check-testcase.test
+++ b/mysql-test/include/check-testcase.test
@@ -66,7 +66,7 @@ if ($tmp)
--echo Gtid_IO_Pos #
--echo Replicate_Do_Domain_Ids
--echo Replicate_Ignore_Domain_Ids
- --echo Parallel_Mode conservative
+ --echo Parallel_Mode optimistic
--echo SQL_Delay 0
--echo SQL_Remaining_Delay NULL
--echo Slave_SQL_Running_State
@@ -98,7 +98,7 @@ call mtr.check_testcase();
let $datadir=`select @@datadir`;
list_files $datadir mysql_upgrade_info;
list_files_write_file $datadir.tempfiles.txt $datadir/test #sql*;
---replace_regex /#sql-ib[0-9a-f]+\.ibd\n//
+--replace_regex /#sql-ib[1-9][0-9]*\.ibd\n//
cat_file $datadir.tempfiles.txt;
remove_file $datadir.tempfiles.txt;
list_files $datadir/mysql #sql*;
diff --git a/mysql-test/include/column_compression_rpl.inc b/mysql-test/include/column_compression_rpl.inc
index 7c8931a491f..3abf04a92ed 100644
--- a/mysql-test/include/column_compression_rpl.inc
+++ b/mysql-test/include/column_compression_rpl.inc
@@ -5,7 +5,7 @@ SET @saved_slave_type_conversions = @@slave_type_conversions;
SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY';
--connection master
-if (!$engine_type) {let $engine_type=`SELECT @@storage_engine`; let $engine_type2=`SELECT @@storage_engine`;}
+if (!$engine_type) {let $engine_type=`SELECT @@default_storage_engine`; let $engine_type2=`SELECT @@default_storage_engine`;}
--disable_warnings
DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
diff --git a/mysql-test/include/commit.inc b/mysql-test/include/commit.inc
index 1844a5320f7..a3c64096adf 100644
--- a/mysql-test/include/commit.inc
+++ b/mysql-test/include/commit.inc
@@ -405,6 +405,11 @@ end|
delimiter ;|
--echo # Reset Handler_commit and Handler_prepare counters
flush status;
+
+--echo #
+--echo # Count of reading of p_verify_status_increment() from mysql.proc
+call p_verify_status_increment(2, 0, 2, 0);
+
--echo #
--echo # 1. Read-only statement: SELECT
--echo #
@@ -562,7 +567,7 @@ begin
return 2;
end|
delimiter ;|
-call p_verify_status_increment(0, 0, 0, 0);
+call p_verify_status_increment(4, 0, 4, 0);
--echo # 16. A function changes non-trans-table.
--echo #
@@ -571,7 +576,7 @@ call p_verify_status_increment(0, 0, 0, 0);
--echo # the binary log.
--echo #
select f1();
-call p_verify_status_increment(1, 0, 1, 0);
+call p_verify_status_increment(3, 0, 3, 0);
commit;
call p_verify_status_increment(1, 0, 1, 0);
@@ -650,7 +655,7 @@ call p_verify_status_increment(0, 0, 0, 0);
--echo # 24. DDL: TRUNCATE TEMPORARY TABLE
--echo
truncate table t2;
-call p_verify_status_increment(4, 0, 4, 0);
+call p_verify_status_increment(2, 0, 2, 0);
commit;
--echo # There is nothing left to commit
call p_verify_status_increment(0, 0, 0, 0);
@@ -763,7 +768,7 @@ call p_verify_status_increment(0, 0, 0, 0);
truncate table t3;
call p_verify_status_increment(2, 0, 2, 0);
create view v1 as select * from t2;
-call p_verify_status_increment(2, 0, 2, 0);
+call p_verify_status_increment(4, 0, 4, 0);
check table t1;
call p_verify_status_increment(2, 0, 2, 0);
--echo # Sic: after this bug is fixed, CHECK leaves no pending transaction
@@ -774,7 +779,7 @@ call p_verify_status_increment(4, 0, 4, 0);
commit;
call p_verify_status_increment(0, 0, 0, 0);
drop view v1;
-call p_verify_status_increment(0, 0, 0, 0);
+call p_verify_status_increment(2, 0, 2, 0);
--echo #
--echo # Cleanup
diff --git a/mysql-test/include/common-tests.inc b/mysql-test/include/common-tests.inc
index 347760bf3c0..9c6b29858c8 100644
--- a/mysql-test/include/common-tests.inc
+++ b/mysql-test/include/common-tests.inc
@@ -1412,9 +1412,9 @@ drop table tmp;
# big table done
-SET BIG_TABLES=1;
+set tmp_memory_table_size=0;
select distinct concat(fld3," ",fld3) as namn from t2,t3 where t2.fld1=t3.t2nr order by namn limit 10;
-SET BIG_TABLES=0;
+set tmp_memory_table_size=default;
select distinct concat(fld3," ",fld3) from t2,t3 where t2.fld1=t3.t2nr order by fld3 limit 10;
select distinct fld5 from t2 limit 10;
@@ -1423,9 +1423,9 @@ select distinct fld5 from t2 limit 10;
#
select distinct fld3,count(*) from t2 group by companynr,fld3 limit 10;
-SET BIG_TABLES=1; # Force use of MyISAM
+set tmp_memory_table_size=0;
select distinct fld3,count(*) from t2 group by companynr,fld3 limit 10;
-SET BIG_TABLES=0;
+set tmp_memory_table_size=default;
select distinct fld3,repeat("a",length(fld3)),count(*) from t2 group by companynr,fld3 limit 100,10;
#
diff --git a/mysql-test/include/concurrent.inc b/mysql-test/include/concurrent.inc
index 369b729a87c..0a49ae13d4b 100644
--- a/mysql-test/include/concurrent.inc
+++ b/mysql-test/include/concurrent.inc
@@ -31,20 +31,19 @@ SET SQL_MODE="";
# Show prerequisites for this test.
#
SELECT @@global.tx_isolation;
-SELECT @@global.innodb_locks_unsafe_for_binlog;
#
-# When innodb_locks_unsafe_for_binlog is not set (zero), which is the
-# default, InnoDB takes "next-key locks"/"gap locks". This means it
+# With the transaction isolation level REPEATABLE READ (the default)
+# or SERIALIZEBLE, InnoDB takes "next-key locks"/"gap locks". This means it
# locks the gap before the keys that it accessed to find the rows to
# use for a statement. In this case we have to expect some more lock
-# wait timeouts in the tests below as if innodb_locks_unsafe_for_binlog
-# is set (non-zero). In the latter case no "next-key locks"/"gap locks"
-# are taken and locks on keys that do not match the WHERE conditon are
-# released. Hence less lock collisions occur.
+# wait timeouts in the tests, compared to READ UNCOMMITTED or READ COMMITTED.
+# For READ UNCOMMITTED or READ COMMITTED, no "next-key locks"/"gap locks"
+# are taken and locks on keys that do not match the WHERE condition are
+# released. Hence fewer lock collisions occur.
# We use the variable $keep_locks to set the expectations for
# lock wait timeouts accordingly.
#
-let $keep_locks= `SELECT NOT @@global.innodb_locks_unsafe_for_binlog`;
+let $keep_locks= `SELECT @@global.tx_isolation IN ('REPEATABLE-READ','SERIALIZABLE')`;
--echo # keep_locks == $keep_locks
#
@@ -52,14 +51,6 @@ let $keep_locks= `SELECT NOT @@global.innodb_locks_unsafe_for_binlog`;
#
GRANT USAGE ON test.* TO mysqltest@localhost;
-#
-# Preparatory cleanup.
-#
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-
--echo
--echo **
--echo ** two UPDATE's running and both changing distinct result sets
@@ -68,7 +59,7 @@ drop table if exists t1;
connect (thread1, localhost, mysqltest,,);
connection thread1;
--echo ** Set up table
- eval SET SESSION STORAGE_ENGINE = $engine_type;
+ eval SET SESSION DEFAULT_STORAGE_ENGINE = $engine_type;
create table t1(eta int(11) not null, tipo int(11), c varchar(255));
insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
@@ -100,7 +91,7 @@ drop table if exists t1;
--echo ** Update on t1 will cause a table scan which will be blocked because
--echo ** the previously initiated table scan applied exclusive key locks on
--echo ** all primary keys.
- --echo ** Not so if innodb_locks_unsafe_for_binlog is set. The locks that
+ --echo ** Not so for READ UNCOMMITTED or READ COMMITTED. The locks that
--echo ** do not match the WHERE condition are released.
if ($keep_locks)
{
@@ -157,7 +148,7 @@ drop table t1;
#connect (thread1, localhost, mysqltest,,);
connection thread1;
--echo ** Set up table
- eval SET SESSION STORAGE_ENGINE = $engine_type;
+ eval SET SESSION DEFAULT_STORAGE_ENGINE = $engine_type;
create table t1(eta int(11) not null, tipo int(11), c varchar(255));
insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
@@ -190,7 +181,7 @@ drop table t1;
--echo ** Update on t1 will cause a table scan which will be blocked because
--echo ** the previously initiated table scan applied exclusive key locks on
--echo ** all primary keys.
- --echo ** Not so if innodb_locks_unsafe_for_binlog is set. The locks that
+ --echo ** Not so for READ UNCOMMITTED or READ COMMITTED. The locks that
--echo ** do not match the WHERE condition are released.
if ($keep_locks)
{
@@ -246,7 +237,7 @@ drop table t1;
#connect (thread1, localhost, mysqltest,,);
connection thread1;
--echo ** Set up table
- eval SET SESSION STORAGE_ENGINE = $engine_type;
+ eval SET SESSION DEFAULT_STORAGE_ENGINE = $engine_type;
create table t1 (a int not null, b int not null);
insert into t1 values (1,1),(2,1),(3,1),(4,1);
--echo ** Create ULL 'hello2'
@@ -296,7 +287,7 @@ drop table t1;
#connect (thread1, localhost, mysqltest,,);
connection thread1;
--echo ** Set up table
- eval SET SESSION STORAGE_ENGINE = $engine_type;
+ eval SET SESSION DEFAULT_STORAGE_ENGINE = $engine_type;
create table t1(eta int(11) not null, tipo int(11), c varchar(255));
insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
@@ -360,7 +351,7 @@ drop table t1;
#connect (thread1, localhost, mysqltest,,);
connection thread1;
--echo ** Set up table
- eval SET SESSION STORAGE_ENGINE = $engine_type;
+ eval SET SESSION DEFAULT_STORAGE_ENGINE = $engine_type;
create table t1(eta int(11) not null, tipo int(11), c varchar(255));
insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
@@ -387,7 +378,7 @@ drop table t1;
--echo ** Updating single row using a table scan. This will time out
--echo ** because of ongoing transaction on thread 1 holding lock on
--echo ** all primary keys in the scan.
- --echo ** Not so if innodb_locks_unsafe_for_binlog is set. The locks that
+ --echo ** Not so for READ UNCOMMITTED or READ COMMITTED. The locks that
--echo ** do not match the WHERE condition are released.
if ($keep_locks)
{
@@ -430,7 +421,7 @@ drop table t1;
#connect (thread1, localhost, mysqltest,,);
connection thread1;
--echo ** Set up table
- eval SET SESSION STORAGE_ENGINE = $engine_type;
+ eval SET SESSION DEFAULT_STORAGE_ENGINE = $engine_type;
create table t1(eta int(11) not null, tipo int(11), c varchar(255));
insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
@@ -489,7 +480,7 @@ drop table t1;
#connect (thread1, localhost, mysqltest,,);
connection thread1;
--echo ** Set up table
- eval SET SESSION STORAGE_ENGINE = $engine_type;
+ eval SET SESSION DEFAULT_STORAGE_ENGINE = $engine_type;
create table t1(eta int(11) not null, tipo int(11), c varchar(255));
insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
@@ -544,7 +535,7 @@ drop table t1;
#connect (thread1, localhost, mysqltest,,);
connection thread1;
--echo ** Set up table
- eval SET SESSION STORAGE_ENGINE = $engine_type;
+ eval SET SESSION DEFAULT_STORAGE_ENGINE = $engine_type;
create table t1(eta int(11) not null, tipo int(11), c varchar(255));
insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
@@ -572,7 +563,7 @@ drop table t1;
--echo ** Update on t1 will cause a table scan which will be blocked because
--echo ** the previously initiated table scan applied exclusive key locks on
--echo ** all primary keys.
- --echo ** Not so if innodb_locks_unsafe_for_binlog is set. The locks that
+ --echo ** Not so for READ UNCOMMITTED or READ COMMITTED. The locks that
--echo ** do not match the WHERE condition are released.
if ($keep_locks)
{
@@ -600,13 +591,8 @@ drop table t1;
connection thread1;
select * from t1;
---echo ** Cleanup
-connection thread1;
disconnect thread1;
---source include/wait_until_disconnected.inc
-connection thread2;
disconnect thread2;
---source include/wait_until_disconnected.inc
connection default;
drop table t1;
drop user mysqltest@localhost;
diff --git a/mysql-test/include/ctype_common.inc b/mysql-test/include/ctype_common.inc
index a0b3dd95451..410e8824b21 100644
--- a/mysql-test/include/ctype_common.inc
+++ b/mysql-test/include/ctype_common.inc
@@ -8,7 +8,7 @@
# use SHOW FULL COLUMNS instead.
#
# Please surround all CREATE TABLE with --disable_warnings
-# and --enable_warnings to be able to set storage_engine
+# and --enable_warnings to be able to set default_storage_engine
# without having to check if the hanlder exists.
SET @safe_character_set_server= @@character_set_server;
diff --git a/mysql-test/include/ctype_heap.inc b/mysql-test/include/ctype_heap.inc
index eafd37e104a..061ed439483 100644
--- a/mysql-test/include/ctype_heap.inc
+++ b/mysql-test/include/ctype_heap.inc
@@ -1,5 +1,5 @@
--echo #
---echo # Test that cs->coll->hash_sort() ignores trailing spaces
+--echo # Test that hash_sort() ignores trailing spaces
--echo #
SELECT @@collation_connection;
CREATE TABLE t1 ENGINE=HEAP AS SELECT REPEAT (' ', 10) AS a LIMIT 0;
diff --git a/mysql-test/include/ctype_ident_sys.inc b/mysql-test/include/ctype_ident_sys.inc
new file mode 100644
index 00000000000..80ac962f031
--- /dev/null
+++ b/mysql-test/include/ctype_ident_sys.inc
@@ -0,0 +1,73 @@
+--echo #
+--echo # SET STATEMENT (bad|good.bad|bad.good)=1
+--echo #
+
+--error ER_INVALID_CHARACTER_STRING
+EXECUTE IMMEDIATE CONCAT('SET STATEMENT ',@seq, '=1 SELECT 1');
+
+--error ER_INVALID_CHARACTER_STRING
+EXECUTE IMMEDIATE CONCAT('SET STATEMENT ',@seq, '.a=1 SELECT 1');
+
+--error ER_INVALID_CHARACTER_STRING
+EXECUTE IMMEDIATE CONCAT('SET STATEMENT a.',@seq, '=1 SELECT 1');
+
+
+--echo #
+--echo # SET SESSION (bad|good.bad|bad.good)=1
+--echo #
+
+--error ER_INVALID_CHARACTER_STRING
+EXECUTE IMMEDIATE CONCAT('SET SESSION ',@seq, '=1 SELECT 1');
+
+--error ER_INVALID_CHARACTER_STRING
+EXECUTE IMMEDIATE CONCAT('SET SESSION ',@seq, '.a=1 SELECT 1');
+
+--error ER_INVALID_CHARACTER_STRING
+EXECUTE IMMEDIATE CONCAT('SET SESSION a.',@seq, '=1 SELECT 1');
+
+
+--echo #
+--echo # SET (bad|good.bad|bad.good)=1
+--echo #
+
+
+--error ER_INVALID_CHARACTER_STRING
+EXECUTE IMMEDIATE CONCAT('SET ', @seq, '=1');
+
+--error ER_INVALID_CHARACTER_STRING
+EXECUTE IMMEDIATE CONCAT('SET ', @seq, '.a=1');
+
+--error ER_INVALID_CHARACTER_STRING
+EXECUTE IMMEDIATE CONCAT('SET a.', @seq, '=1');
+
+
+--echo #
+--echo # Oracle SP call: BEGIN (bad|good.bad|bad.good)(params); END
+--echo #
+
+SET sql_mode=ORACLE;
+--error ER_INVALID_CHARACTER_STRING
+EXECUTE IMMEDIATE CONCAT('BEGIN ',@seq, '(1); END;');
+
+--error ER_INVALID_CHARACTER_STRING
+EXECUTE IMMEDIATE CONCAT('BEGIN ',@seq, '.a(1); END;');
+
+--error ER_INVALID_CHARACTER_STRING
+EXECUTE IMMEDIATE CONCAT('BEGIN a.',@seq, '(1); END;');
+
+
+--echo #
+--echo # Oracle assignment: (bad|good.bad|bad.good):= value
+--echo #
+
+--error ER_INVALID_CHARACTER_STRING
+EXECUTE IMMEDIATE CONCAT(@seq, ':=1');
+
+--error ER_INVALID_CHARACTER_STRING
+EXECUTE IMMEDIATE CONCAT(@seq, '.a:=1');
+
+--error ER_INVALID_CHARACTER_STRING
+EXECUTE IMMEDIATE CONCAT('a.', @seq, ':=1');
+
+
+SET sql_mode=DEFAULT;
diff --git a/mysql-test/include/ctype_pad_all_engines.inc b/mysql-test/include/ctype_pad_all_engines.inc
index 29371676a19..a031f84e74b 100644
--- a/mysql-test/include/ctype_pad_all_engines.inc
+++ b/mysql-test/include/ctype_pad_all_engines.inc
@@ -1,7 +1,7 @@
-SET STORAGE_ENGINE=MyISAM;
+SET DEFAULT_STORAGE_ENGINE=MyISAM;
--source include/ctype_pad.inc
-SET STORAGE_ENGINE=HEAP;
+SET DEFAULT_STORAGE_ENGINE=HEAP;
--source include/ctype_pad.inc
-SET STORAGE_ENGINE=Default;
+SET DEFAULT_STORAGE_ENGINE=Default;
diff --git a/mysql-test/include/ctype_strtoll10.inc b/mysql-test/include/ctype_strtoll10.inc
index 8bb2d29f86a..725180d6a24 100644
--- a/mysql-test/include/ctype_strtoll10.inc
+++ b/mysql-test/include/ctype_strtoll10.inc
@@ -1,5 +1,5 @@
--echo #
---echo # Testing cs->cset->strtoll10()
+--echo # Testing strtoll10()
--echo #
SELECT @@character_set_connection;
diff --git a/mysql-test/include/deadlock.inc b/mysql-test/include/deadlock.inc
index fcf655fce23..abf217aea75 100644
--- a/mysql-test/include/deadlock.inc
+++ b/mysql-test/include/deadlock.inc
@@ -133,7 +133,7 @@ drop table t1, t2;
# Bug#25164 create table `a` as select * from `A` hangs
#
-set storage_engine=innodb;
+set default_storage_engine=innodb;
--disable_warnings
drop table if exists a;
@@ -150,7 +150,7 @@ drop table A;
drop table if exists a;
--enable_warnings
-set storage_engine=default;
+set default_storage_engine=default;
--echo End of 5.0 tests.
--enable_service_connection
diff --git a/mysql-test/include/default_client.cnf b/mysql-test/include/default_client.cnf
index e326b308f5f..1dda4b5b139 100644
--- a/mysql-test/include/default_client.cnf
+++ b/mysql-test/include/default_client.cnf
@@ -3,9 +3,6 @@
# when running tests - not to depend on the current machine localization.
#
-[client]
-plugin-dir=@mysqld.1.plugin-dir
-
[mysql]
default-character-set=latin1
diff --git a/mysql-test/include/default_my.cnf b/mysql-test/include/default_my.cnf
index d102c9020cc..a1c427fe12c 100644
--- a/mysql-test/include/default_my.cnf
+++ b/mysql-test/include/default_my.cnf
@@ -33,3 +33,4 @@ disable-force-if-open
[ENV]
MASTER_MYPORT= @mysqld.1.port
MASTER_MYSOCK= @mysqld.1.socket
+OPENSSL_ENABLE_SHA1_SIGNATURES= 1
diff --git a/mysql-test/include/default_mysqld.cnf b/mysql-test/include/default_mysqld.cnf
index 387a144bacb..cccf72591cc 100644
--- a/mysql-test/include/default_mysqld.cnf
+++ b/mysql-test/include/default_mysqld.cnf
@@ -1,5 +1,5 @@
# Copyright (c) 2007, 2013, Oracle and/or its affiliates
-# Copyright (c) 2010, 2013, Monty Program Ab
+# Copyright (c) 2010, 2019, MariaDB Corporation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -53,8 +53,7 @@ loose-innodb_lru_scan_depth= 100
loose-innodb_write_io_threads= 2
loose-innodb_read_io_threads= 2
loose-innodb_log_buffer_size= 1M
-loose-innodb_log_file_size= 5M
-loose-innodb_log_files_in_group= 2
+loose-innodb_log_file_size= 10M
loose-innodb-stats-persistent= OFF
slave-net-timeout=120
@@ -77,7 +76,13 @@ loose-performance-schema-max-cond-instances=1000
loose-performance-schema-max-file-instances=10000
loose-performance-schema-max-socket-instances=1000
loose-performance-schema-max-table-instances=500
+loose-performance-schema-max-table-lock-stat=500
+loose-performance-schema-max-index-stat=5000
loose-performance-schema-max-table-handles=1000
+loose-performance-schema-max-prepared-statements-instances=100
+loose-performance-schema-max-program-instances=5000
+loose-performance-schema-setup-actors-size=100
+loose-performance-schema-setup-objects-size=100
loose-performance-schema-events-waits-history-size=10
loose-performance-schema-events-waits-history-long-size=10000
@@ -85,8 +90,11 @@ loose-performance-schema-events-stages-history-size=10
loose-performance-schema-events-stages-history-long-size=1000
loose-performance-schema-events-statements-history-size=10
loose-performance-schema-events-statements-history-long-size=1000
+loose-performance-schema-events-transactions-history-size=10
+loose-performance-schema-events-transactions-history-long-size=1000
loose-performance-schema-max-thread-instances=200
loose-performance-schema-session-connect-attrs-size=2048
+loose-performance-schema-max-metadata-locks=10000
# Enable everything, for maximun code exposure during testing
@@ -98,6 +106,9 @@ loose-performance-schema-consumer-events-stages-history-long=ON
loose-performance-schema-consumer-events-statements-current=ON
loose-performance-schema-consumer-events-statements-history=ON
loose-performance-schema-consumer-events-statements-history-long=ON
+loose-performance-schema-consumer-events-transactions-current=ON
+loose-performance-schema-consumer-events-transactions-history=ON
+loose-performance-schema-consumer-events-transactions-history-long=ON
loose-performance-schema-consumer-events-waits-current=ON
loose-performance-schema-consumer-events-waits-history=ON
loose-performance-schema-consumer-events-waits-history-long=ON
diff --git a/mysql-test/include/function_defaults.inc b/mysql-test/include/function_defaults.inc
index 23822aa24dc..6e4fa10a65b 100644
--- a/mysql-test/include/function_defaults.inc
+++ b/mysql-test/include/function_defaults.inc
@@ -1,7 +1,7 @@
SET TIME_ZONE = "+00:00";
--echo #
---echo # Test of errors for column data types that dont support function
+--echo # Test of errors for column data types that don't support function
--echo # defaults.
--echo #
diff --git a/mysql-test/include/galera_cluster.inc b/mysql-test/include/galera_cluster.inc
index 7f76ea59c7f..48b5bc631db 100644
--- a/mysql-test/include/galera_cluster.inc
+++ b/mysql-test/include/galera_cluster.inc
@@ -3,16 +3,29 @@
#
# Description
# -----------
-# Configure galera cluster with 2 nodes.
+# Configure galera cluster with $galera_cluster_size (default: 2) nodes.
#
---let $galera_cluster_size = 2
+if (!$galera_cluster_size)
+{
+# --die ERROR IN TEST: $galera_cluster_size variable must be set
+ --let $galera_cluster_size = 2
+}
+
--source include/galera_init.inc
--source include/have_innodb.inc
--source include/galera_wait_ready.inc
---connection node_2
---source include/galera_wait_ready.inc
---source include/have_innodb.inc
+
+--let $_galera_node= $galera_cluster_size
+
+while ($_galera_node != 1)
+{
+ --connection node_$_galera_node
+ --source include/galera_wait_ready.inc
+ --source include/have_innodb.inc
+
+ --dec $_galera_node
+}
--connection node_1
diff --git a/mysql-test/include/galera_variables_ok.inc b/mysql-test/include/galera_variables_ok.inc
index 82c5174bc14..c9a54724c17 100644
--- a/mysql-test/include/galera_variables_ok.inc
+++ b/mysql-test/include/galera_variables_ok.inc
@@ -1,6 +1,6 @@
--disable_query_log
---let $galera_variables_ok = `SELECT COUNT(*) = 49 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'wsrep%'`
+--let $galera_variables_ok = `SELECT COUNT(*) = 50 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'wsrep%'`
--if (!$galera_variables_ok) {
--skip Galera number of variables has changed!
diff --git a/mysql-test/include/galera_variables_ok_debug.inc b/mysql-test/include/galera_variables_ok_debug.inc
index c9a54724c17..e420b3af6c3 100644
--- a/mysql-test/include/galera_variables_ok_debug.inc
+++ b/mysql-test/include/galera_variables_ok_debug.inc
@@ -1,6 +1,6 @@
--disable_query_log
---let $galera_variables_ok = `SELECT COUNT(*) = 50 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'wsrep%'`
+--let $galera_variables_ok = `SELECT COUNT(*) = 51 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'wsrep%'`
--if (!$galera_variables_ok) {
--skip Galera number of variables has changed!
diff --git a/mysql-test/include/have_crypt.inc b/mysql-test/include/have_crypt.inc
index 422f8922edc..ae94121980c 100644
--- a/mysql-test/include/have_crypt.inc
+++ b/mysql-test/include/have_crypt.inc
@@ -1,3 +1,5 @@
+# MDEV-27964 The function ENCRYPT() causes SIGSEGV in WITH_MSAN builds
+-- source include/not_msan.inc
# encrypt('a') is NULL if crypt(3) is not available
# encrypt('a') is "*0" in fips mode
if (`select length(encrypt('a')) > 3 IS NOT TRUE`) {
diff --git a/mysql-test/include/have_dbi_dbd-mysql.inc b/mysql-test/include/have_dbi_dbd-mariadb.inc
index 7c2113a8109..1495d2891c8 100644
--- a/mysql-test/include/have_dbi_dbd-mysql.inc
+++ b/mysql-test/include/have_dbi_dbd-mariadb.inc
@@ -1,7 +1,7 @@
#
# Originally created by John Embretsen, 2011-01-26.
#
-# Checks for the existence of Perl modules DBI and DBD::mysql as seen from the
+# Checks for the existence of Perl modules DBI and DBD::MariaDB as seen from the
# perl installation used by "external" executable perl scripts, i.e. scripts
# that are executed as standalone scripts interpreted by the perl installation
# specified by the "shebang" line in the top of these scripts.
@@ -30,7 +30,7 @@
# We jump through some hoops since there is no direct way to check if an
# external command went OK or not from a mysql-test file:
#
-# - In theory, we could do as simple as "exec perl -MDBI -MDBD::mysql -e 1",
+# - In theory, we could do as simple as "exec perl -MDBI -MDBD::MariaDB -e 1",
# however we cannot check the result (exit code) from within a test script.
# Also, this may not yield the same result as other uses of perl due to the
# shebang issue mentioned above.
@@ -55,8 +55,8 @@
# Instead, we call a separate helper script which checks for the modules in its
# own environment. We call it without "perl" in front.
---let $perlChecker= $MYSQLTEST_VARDIR/std_data/checkDBI_DBD-mysql.pl
---let $resultFile= $MYSQL_TMP_DIR/dbidbd-mysql.txt
+--let $perlChecker= $MYSQLTEST_VARDIR/std_data/checkDBI_DBD-MariaDB.pl
+--let $resultFile= $MYSQL_TMP_DIR/dbiDBD-MariaDB.txt
--exec perl $perlChecker
@@ -64,7 +64,7 @@
--source $resultFile
if (!$dbidbd) {
- --skip Test needs Perl modules DBI and DBD::mysql
+ --skip Test needs Perl modules DBI and DBD::MariaDB
}
# Clean up
diff --git a/mysql-test/include/have_innodb.inc b/mysql-test/include/have_innodb.inc
index 69ffdb5b284..0de070e1994 100644
--- a/mysql-test/include/have_innodb.inc
+++ b/mysql-test/include/have_innodb.inc
@@ -2,3 +2,15 @@
# suite.pm will make sure that all tests including this file
# will be skipped unless innodb is enabled
#
+--disable_query_log
+if (`select count(*) from information_schema.system_variables where variable_name='have_sanitizer' and global_value like "MSAN%"`)
+{
+SET STATEMENT sql_log_bin=0 FOR
+call mtr.add_suppression("InnoDB: Trying to delete tablespace.*pending operations");
+}
+if ($VALGRIND_TEST)
+{
+SET STATEMENT sql_log_bin=0 FOR
+call mtr.add_suppression("InnoDB: Trying to delete tablespace.*pending operations");
+}
+--enable_query_log
diff --git a/mysql-test/include/have_pool_of_threads.inc b/mysql-test/include/have_pool_of_threads.inc
index 432c6216804..62460127d88 100644
--- a/mysql-test/include/have_pool_of_threads.inc
+++ b/mysql-test/include/have_pool_of_threads.inc
@@ -1,4 +1,5 @@
--- require include/have_pool_of_threads.require
+--source include/not_aix.inc
+--require include/have_pool_of_threads.require
disable_query_log;
show variables like 'thread_handling';
enable_query_log;
diff --git a/mysql-test/include/have_query_cache_disabled.inc b/mysql-test/include/have_query_cache_disabled.inc
new file mode 100644
index 00000000000..9087fa392e1
--- /dev/null
+++ b/mysql-test/include/have_query_cache_disabled.inc
@@ -0,0 +1,36 @@
+# Skip the test if 'query cache' is disabled.
+# Note : There are 2 techniques to disable query cache :
+# (1) Set query_cache_type to 0 or OFF
+# (2) Set query_cache_size to 0
+
+disable_query_log;
+
+let $do_skip=0;
+
+let $qc_var_1= query_get_value("SELECT COUNT(*) AS var1 FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME = 'have_query_cache' AND variable_value = 'YES'", var1, 1);
+if ($qc_var_1 == 1)
+{
+ let $do_skip=1;
+}
+
+# Check if 'query_cache_type' is OFF
+let $qc_var_2= query_get_value("SELECT COUNT(*) AS var2 FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME = 'query_cache_type' AND VARIABLE_VALUE = 'OFF'", var2, 1);
+if ($qc_var_2 == 1)
+{
+ let $do_skip=0;
+}
+
+# Check if 'query_cache_size' is 0
+let $qc_var_3= query_get_value("SELECT COUNT(*) AS var3 FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME = 'query_cache_size' AND VARIABLE_VALUE = 0", var3, 1);
+
+if ($qc_var_3 == 1)
+{
+ let $do_skip=0;
+}
+
+if ($do_skip)
+{
+ skip Query Cache enabled, skipping test;
+}
+
+enable_query_log;
diff --git a/mysql-test/include/have_s3.inc b/mysql-test/include/have_s3.inc
new file mode 100644
index 00000000000..d81778cd157
--- /dev/null
+++ b/mysql-test/include/have_s3.inc
@@ -0,0 +1,10 @@
+if (!`SELECT count(*) FROM information_schema.engines WHERE
+ (support = 'YES' OR support = 'DEFAULT') AND
+ engine = 's3'`)
+{
+ skip Need s3 engine;
+}
+if (`select @@global.s3_secret_key = "" or @@global.s3_access_key = ""`)
+{
+ skip S3 engine not configured;
+}
diff --git a/mysql-test/include/have_type_mysql_json.inc b/mysql-test/include/have_type_mysql_json.inc
new file mode 100644
index 00000000000..bea1f52cb61
--- /dev/null
+++ b/mysql-test/include/have_type_mysql_json.inc
@@ -0,0 +1,3 @@
+if (!$TYPE_MYSQL_JSON_SO) {
+ skip Need MYSQL_JSON plugin;
+}
diff --git a/mysql-test/include/have_type_mysql_json.opt b/mysql-test/include/have_type_mysql_json.opt
new file mode 100644
index 00000000000..0676b7832cf
--- /dev/null
+++ b/mysql-test/include/have_type_mysql_json.opt
@@ -0,0 +1,2 @@
+--loose-type_mysql_json
+--plugin-load-add=$TYPE_MYSQL_JSON_SO
diff --git a/mysql-test/include/icp_tests.inc b/mysql-test/include/icp_tests.inc
index 66fdc3e754c..d78fe0dd209 100644
--- a/mysql-test/include/icp_tests.inc
+++ b/mysql-test/include/icp_tests.inc
@@ -1,3 +1,5 @@
+--source include/have_sequence.inc
+
--echo #
--echo # Bug#36981 - "innodb crash when selecting for update"
--echo #
@@ -459,6 +461,7 @@ INSERT INTO t2 VALUES (15,4);
set @save_optimizer_switch= @@optimizer_switch;
set optimizer_switch='semijoin=off';
+--replace_column 9 #
EXPLAIN
SELECT * FROM t1
WHERE pk IN (SELECT it.pk FROM t2 JOIN t2 AS it ON it.i=it.i WHERE it.pk-t1.i<10);
@@ -720,12 +723,15 @@ DROP TABLE t1;
CREATE TABLE t1 (b int NOT NULL, c int, a varchar(1024), PRIMARY KEY (b));
INSERT INTO t1 VALUES (1,4,'Ill');
+insert into t1 select seq+100,5,seq from seq_1_to_100;
CREATE TABLE t2 (a varchar(1024), KEY (a(512)));
INSERT INTO t2 VALUES
('Ill'), ('eckqzsflbzaffti'), ('w'), ('she'), ('gxbwypqtjzwywwer'), ('w');
+insert into t2 select seq from seq_1_to_100;
SET SESSION optimizer_switch='index_condition_pushdown=off';
+--replace_column 9 #
EXPLAIN
SELECT t1.b, t1.c FROM t1, t2 WHERE t1.a = t2.a AND (t1.b<0 OR t1.b>0)
HAVING t1.c != 5 ORDER BY t1.c;
@@ -733,6 +739,7 @@ SELECT t1.b, t1.c FROM t1, t2 WHERE t1.a = t2.a AND (t1.b<0 OR t1.b>0)
HAVING t1.c != 5 ORDER BY t1.c;
SET SESSION optimizer_switch='index_condition_pushdown=on';
+--replace_column 9 #
EXPLAIN
SELECT t1.b, t1.c FROM t1, t2 WHERE t1.a = t2.a AND (t1.b<0 OR t1.b>0)
HAVING t1.c != 5 ORDER BY t1.c;
diff --git a/mysql-test/include/index_merge1.inc b/mysql-test/include/index_merge1.inc
index e54fbe2834f..91609f628ca 100644
--- a/mysql-test/include/index_merge1.inc
+++ b/mysql-test/include/index_merge1.inc
@@ -192,7 +192,7 @@ alter table t2 add index i321(key3, key2, key1);
explain select key3 from t2 where key1 = 100 or key2 = 100;
# index_merge vs 'index', 'index' is better.
-explain select key3 from t2 where key1 < 500 or key2 < 500;
+explain select key3 from t2 where key1 < 600 or key2 < 600;
# index_merge vs 'all', index_merge is better.
explain select key7 from t2 where key1 <100 or key2 < 100;
@@ -390,7 +390,7 @@ drop table t1;
if ($merge_table_support)
{
#
-# BUG#17314: Index_merge/intersection not choosen by the optimizer for MERGE tables
+# BUG#17314: Index_merge/intersection not chosen by the optimizer for MERGE tables
#
create table t1 (
a int, b int,
diff --git a/mysql-test/include/innodb_checksum_algorithm.combinations b/mysql-test/include/innodb_checksum_algorithm.combinations
index fd237e1190a..039bfaef676 100644
--- a/mysql-test/include/innodb_checksum_algorithm.combinations
+++ b/mysql-test/include/innodb_checksum_algorithm.combinations
@@ -3,9 +3,11 @@
[strict_crc32]
--innodb-checksum-algorithm=strict_crc32
+--innodb-flush-sync=OFF
[full_crc32]
--innodb-checksum-algorithm=full_crc32
[strict_full_crc32]
--innodb-checksum-algorithm=strict_full_crc32
+--innodb-flush-sync=OFF
diff --git a/mysql-test/include/kill_and_restart_mysqld.inc b/mysql-test/include/kill_and_restart_mysqld.inc
new file mode 100644
index 00000000000..b67fb7350b4
--- /dev/null
+++ b/mysql-test/include/kill_and_restart_mysqld.inc
@@ -0,0 +1,15 @@
+if (!$restart_parameters)
+{
+ let $restart_parameters = restart;
+}
+
+--let $_server_id= `SELECT @@server_id`
+--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect
+
+--echo # Kill and $restart_parameters
+--exec echo "$restart_parameters" > $_expect_file_name
+--shutdown_server 0
+--source include/wait_until_disconnected.inc
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+--disable_reconnect
diff --git a/mysql-test/include/load_dump_and_upgrade.inc b/mysql-test/include/load_dump_and_upgrade.inc
new file mode 100644
index 00000000000..52351ea473c
--- /dev/null
+++ b/mysql-test/include/load_dump_and_upgrade.inc
@@ -0,0 +1,49 @@
+--source include/have_innodb.inc
+
+# ==== Usage ====
+#
+# [--let $old_version= 10.2]
+# --source include/load_dump_and_upgrade.inc
+
+# Dumps stored in std_data as mysql_database_<old_version>.dump
+# were pre-created by running mysqldump for `mysql` database
+# on a freshly boostrapped instance of the corresponding version.
+# On 10.4 the local root was additionally given an empty password,
+# to avoid using unix_socket.
+
+# Backup the existing mysql schema, to restore it later
+--exec $MYSQL_DUMP mysql > $MYSQL_TMP_DIR/mysql_database_backup
+
+--echo #
+--echo # Upgrade from version $old_version
+--echo #
+
+# Workaround for MDEV-22127 (can't import database dump created before 10.4)
+# The most universal workaround suggested in the item is running
+# DROP TABLE IF EXISTS `mysql`.`global_priv`;
+# DROP VIEW IF EXISTS `mysql`.`user`;
+# before the upgrade. For this test, it is better than creating the dumps
+# with --add-drop-database, because
+# a) it won't require re-creating the dump when the bug is fixed;
+# b) it won't hide possible unrelated problems;
+# c) add-drop-database doesn't work with logging into tables enabled (MDEV-4875 and more)
+
+--exec $MYSQL -e "DROP TABLE IF EXISTS mysql.global_priv; DROP VIEW IF EXISTS mysql.user"
+
+--echo # Loading dump of $old_version mysql schema
+--exec $MYSQL mysql < $MYSQLTEST_VARDIR/std_data/mysql_database_$old_version.dump
+
+--echo # Running mysql_upgrade
+--exec $MYSQL_UPGRADE --verbose > $MYSQL_TMP_DIR/upgrade.log
+
+--echo # Checking that mysql.user is accessible and returns some data
+SELECT COUNT(*) > 0 AS `mysql.user has data` FROM mysql.user;
+
+# Restore the backup of mysql schema
+--exec $MYSQL mysql < $MYSQL_TMP_DIR/mysql_database_backup
+
+--let $ddir= `select @@datadir`
+
+# It will fail if the file doesn't exist, which is good,
+# which is an extra check that it was written
+--remove_file $ddir/mysql_upgrade_info
diff --git a/mysql-test/include/loaddata_autocom.inc b/mysql-test/include/loaddata_autocom.inc
index 7b0c67d2ca8..8c38965f1c0 100644
--- a/mysql-test/include/loaddata_autocom.inc
+++ b/mysql-test/include/loaddata_autocom.inc
@@ -1,6 +1,6 @@
# Test if the engine does autocommit in LOAD DATA INFILE, or not
-eval SET SESSION STORAGE_ENGINE = $engine_type;
+eval SET SESSION DEFAULT_STORAGE_ENGINE = $engine_type;
--disable_warnings
drop table if exists t1;
diff --git a/mysql-test/include/maybe_pool_of_threads.combinations b/mysql-test/include/maybe_pool_of_threads.combinations
new file mode 100644
index 00000000000..29d3d7f4871
--- /dev/null
+++ b/mysql-test/include/maybe_pool_of_threads.combinations
@@ -0,0 +1,5 @@
+[pot]
+thread_handling=pool-of-threads
+
+[1tpc]
+thread_handling=one-thread-per-connection
diff --git a/mysql-test/include/maybe_pool_of_threads.inc b/mysql-test/include/maybe_pool_of_threads.inc
new file mode 100644
index 00000000000..d25e3864333
--- /dev/null
+++ b/mysql-test/include/maybe_pool_of_threads.inc
@@ -0,0 +1,2 @@
+# run with and without threadpool
+--source include/not_aix.inc
diff --git a/mysql-test/include/mix1.inc b/mysql-test/include/mix1.inc
index 30b17c2e063..2ec0868c39e 100644
--- a/mysql-test/include/mix1.inc
+++ b/mysql-test/include/mix1.inc
@@ -1183,10 +1183,6 @@ set @my_innodb_autoextend_increment=@@global.innodb_autoextend_increment;
set global innodb_autoextend_increment=8;
set global innodb_autoextend_increment=@my_innodb_autoextend_increment;
-set @my_innodb_commit_concurrency=@@global.innodb_commit_concurrency;
-set global innodb_commit_concurrency=0;
-set global innodb_commit_concurrency=@my_innodb_commit_concurrency;
-
#
# Bug #37830: ORDER BY ASC/DESC - no difference
#
diff --git a/mysql-test/include/mix2.inc b/mysql-test/include/mix2.inc
index 9465d578208..105e229761a 100644
--- a/mysql-test/include/mix2.inc
+++ b/mysql-test/include/mix2.inc
@@ -55,7 +55,7 @@
# Set the SESSION DEFAULT STORAGE ENGINE to a value <> storage engine
# to be tested. This must not affect any CREATE TABLE statement, where
# the storage engine is assigned explicitly,
-eval SET SESSION STORAGE_ENGINE = $other_engine_type;
+eval SET SESSION DEFAULT_STORAGE_ENGINE = $other_engine_type;
#
# Small basic test with ignore
@@ -1457,8 +1457,8 @@ show variables like "innodb_thread_sleep_delay";
# Test varchar
#
-let $default=`select @@storage_engine`;
-eval set storage_engine=$engine_type;
+let $default=`select @@default_storage_engine`;
+eval set default_storage_engine=$engine_type;
source include/varchar.inc;
#
@@ -1479,7 +1479,7 @@ create table t1 (v varchar(65530) character set utf8);
show create table t1;
drop table t1;
-eval set storage_engine=$default;
+eval set default_storage_engine=$default;
# InnoDB specific varchar tests
eval create table t1 (v varchar(16384)) engine=$engine_type;
@@ -2272,25 +2272,25 @@ drop table t1, t2, t3;
# 3) CREATE ... SELECT
connect (a,localhost,root,,);
-eval SET SESSION STORAGE_ENGINE = $engine_type;
+eval SET SESSION DEFAULT_STORAGE_ENGINE = $engine_type;
connect (b,localhost,root,,);
-eval SET SESSION STORAGE_ENGINE = $engine_type;
+eval SET SESSION DEFAULT_STORAGE_ENGINE = $engine_type;
connect (c,localhost,root,,);
-eval SET SESSION STORAGE_ENGINE = $engine_type;
+eval SET SESSION DEFAULT_STORAGE_ENGINE = $engine_type;
connect (d,localhost,root,,);
-eval SET SESSION STORAGE_ENGINE = $engine_type;
+eval SET SESSION DEFAULT_STORAGE_ENGINE = $engine_type;
connect (e,localhost,root,,);
-eval SET SESSION STORAGE_ENGINE = $engine_type;
+eval SET SESSION DEFAULT_STORAGE_ENGINE = $engine_type;
connect (f,localhost,root,,);
-eval SET SESSION STORAGE_ENGINE = $engine_type;
+eval SET SESSION DEFAULT_STORAGE_ENGINE = $engine_type;
connect (g,localhost,root,,);
-eval SET SESSION STORAGE_ENGINE = $engine_type;
+eval SET SESSION DEFAULT_STORAGE_ENGINE = $engine_type;
connect (h,localhost,root,,);
-eval SET SESSION STORAGE_ENGINE = $engine_type;
+eval SET SESSION DEFAULT_STORAGE_ENGINE = $engine_type;
connect (i,localhost,root,,);
-eval SET SESSION STORAGE_ENGINE = $engine_type;
+eval SET SESSION DEFAULT_STORAGE_ENGINE = $engine_type;
connect (j,localhost,root,,);
-eval SET SESSION STORAGE_ENGINE = $engine_type;
+eval SET SESSION DEFAULT_STORAGE_ENGINE = $engine_type;
connection a;
create table t1(a int not null, b int, primary key(a));
insert into t1 values (1,2),(5,3),(4,2);
diff --git a/mysql-test/include/mysqlhotcopy.inc b/mysql-test/include/mysqlhotcopy.inc
index 481ebc02622..31635af2bfe 100644
--- a/mysql-test/include/mysqlhotcopy.inc
+++ b/mysql-test/include/mysqlhotcopy.inc
@@ -4,7 +4,7 @@
--source include/not_windows.inc
--source include/not_embedded.inc
---source include/have_dbi_dbd-mysql.inc
+--source include/have_dbi_dbd-mariadb.inc
if (!$MYSQLHOTCOPY)
{
@@ -19,7 +19,7 @@ if (!$MYSQLHOTCOPY)
# executable, i.e. not necessarily using the perl interpreter in PATH,
# because that is how the documentation demonstrates it.
#
-# We include have_dbi_dbd-mysql.inc above so that the test will
+# We include have_dbi_dbd-mariadb.inc above so that the test will
# be skipped if Perl modules required by the mysqlhotcopy tool are not
# found when the script is run this way.
diff --git a/mysql-test/include/not_asan.inc b/mysql-test/include/not_asan.inc
index 9fc86a8525a..38fcac15ce7 100644
--- a/mysql-test/include/not_asan.inc
+++ b/mysql-test/include/not_asan.inc
@@ -2,7 +2,7 @@
# be overcome. In normal cases one should fix the bug server/test case or in
# the worst case add a (temporary?) suppression in asan.supp or lsan.supp
-if (`select count(*) from information_schema.system_variables where variable_name='have_sanitizer' and global_value="ASAN"`)
+if (`select count(*) from information_schema.system_variables where variable_name='have_sanitizer' and global_value like "ASAN%"`)
{
--skip Can't be run with ASan
}
diff --git a/mysql-test/include/not_msan.inc b/mysql-test/include/not_msan.inc
new file mode 100644
index 00000000000..ca1e2c1d7bd
--- /dev/null
+++ b/mysql-test/include/not_msan.inc
@@ -0,0 +1,6 @@
+# This file should only be used with tests that are too big or slow for MSAN.
+
+if (`select count(*) from information_schema.system_variables where variable_name='have_sanitizer' and global_value like "MSAN%"`)
+{
+--skip Can't be run WITH_MSAN
+}
diff --git a/mysql-test/include/not_threadpool.inc b/mysql-test/include/not_threadpool.inc
index a49c8cfcc32..98e1f7d2535 100644
--- a/mysql-test/include/not_threadpool.inc
+++ b/mysql-test/include/not_threadpool.inc
@@ -1,5 +1,4 @@
if (`SELECT count(*) FROM information_schema.GLOBAL_VARIABLES WHERE
- VARIABLE_NAME = 'THREAD_HANDLING' AND
- VARIABLE_VALUE = 'loaded-dynamically'`){
+ VARIABLE_NAME = 'THREAD_HANDLING' AND VARIABLE_VALUE = 'pool-of-threads'`){
skip Test requires: 'not_threadpool';
}
diff --git a/mysql-test/include/not_ubsan.inc b/mysql-test/include/not_ubsan.inc
index 809f505507e..237adcb4896 100644
--- a/mysql-test/include/not_ubsan.inc
+++ b/mysql-test/include/not_ubsan.inc
@@ -2,7 +2,7 @@
# be overcome. In normal cases one should fix the bug server/test case or in
# the worst case add a (temporary?) suppression in asan.supp or lsan.supp
-if (`select count(*) from information_schema.system_variables where variable_name='have_sanitizer' and global_value="UBSAN"`)
+if (`select count(*) from information_schema.system_variables where variable_name='have_sanitizer' and global_value LIKE "%UBSAN"`)
{
--skip Can't be run with UBSAN
}
diff --git a/mysql-test/include/not_valgrind.inc b/mysql-test/include/not_valgrind.inc
index 8bda3497878..a2372db4c4f 100644
--- a/mysql-test/include/not_valgrind.inc
+++ b/mysql-test/include/not_valgrind.inc
@@ -1,4 +1,4 @@
--require include/not_valgrind.require
--disable_query_log
-eval select $VALGRIND_TEST as using_valgrind;
+eval select $VALGRIND_TEST+0 as using_valgrind;
--enable_query_log
diff --git a/mysql-test/include/not_windows.inc b/mysql-test/include/not_windows.inc
index 08373095438..035486025f2 100644
--- a/mysql-test/include/not_windows.inc
+++ b/mysql-test/include/not_windows.inc
@@ -1,4 +1,4 @@
#
# suite.pm will make sure that all tests including this file
-# will be skipped unless this is on Windows
+# will be skipped if run under Windows
#
diff --git a/mysql-test/include/partition_mrr.inc b/mysql-test/include/partition_mrr.inc
index f372cccfdd2..188bc50147f 100644
--- a/mysql-test/include/partition_mrr.inc
+++ b/mysql-test/include/partition_mrr.inc
@@ -10,8 +10,8 @@ drop table if exists t1,t3;
create table t1(a int);
insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
-set @tmp=@@storage_engine;
-eval set storage_engine=$engine_type;
+set @tmp=@@default_storage_engine;
+eval set default_storage_engine=$engine_type;
create table t3 (
ID bigint(20) NOT NULL AUTO_INCREMENT,
@@ -27,7 +27,7 @@ create table t3 (
);
show create table t3;
-set storage_engine= @tmp;
+set default_storage_engine= @tmp;
insert into t3 select
A.a+10*B.a,
diff --git a/mysql-test/include/percona_nonflushing_analyze_debug.inc b/mysql-test/include/percona_nonflushing_analyze_debug.inc
new file mode 100644
index 00000000000..95621c70d5c
--- /dev/null
+++ b/mysql-test/include/percona_nonflushing_analyze_debug.inc
@@ -0,0 +1,35 @@
+#
+# Test ANALYZE TABLE that does not flush table definition cache
+# Arguments:
+# $percona_nonflushing_analyze_table - table to test
+#
+
+--source include/count_sessions.inc
+
+--connect con1,localhost,root
+
+SET DEBUG_SYNC="handler_ha_index_next_end SIGNAL idx_scan_in_progress WAIT_FOR finish_scan";
+
+send_eval SELECT * FROM $percona_nonflushing_analyze_table;
+
+--connection default
+
+SET DEBUG_SYNC="now WAIT_FOR idx_scan_in_progress";
+
+set @tmp=@@use_stat_tables;
+set use_stat_tables='preferably_for_queries';
+eval ANALYZE TABLE $percona_nonflushing_analyze_table;
+
+set use_stat_tables=@tmp;
+# With the bug fixed this should not block
+eval SELECT * FROM $percona_nonflushing_analyze_table;
+
+SET DEBUG_SYNC="now SIGNAL finish_scan";
+
+--connection con1
+reap;
+--disconnect con1
+--connection default
+SET DEBUG_SYNC='reset';
+
+--source include/wait_until_count_sessions.inc
diff --git a/mysql-test/include/ps_conv.inc b/mysql-test/include/ps_conv.inc
index e84becec010..2b7af82907c 100644
--- a/mysql-test/include/ps_conv.inc
+++ b/mysql-test/include/ps_conv.inc
@@ -159,7 +159,7 @@ select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4,
@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28,
@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32
from t9 where c1= 1 ;
-# get as much informations about the parameters as possible
+# get as much information about the parameters as possible
--enable_metadata
execute full_info ;
--disable_metadata
@@ -173,7 +173,7 @@ select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4,
@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28,
@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32
from t9 where c1= 0 ;
-# get as much informations about the parameters as possible
+# get as much information about the parameters as possible
--enable_metadata
execute full_info ;
--disable_metadata
@@ -190,14 +190,14 @@ prepare stmt1 from "select
from t9 where c1= ?" ;
set @my_key= 1 ;
execute stmt1 using @my_key ;
-# get as much informations about the parameters as possible
+# get as much information about the parameters as possible
--enable_metadata
execute full_info ;
--disable_metadata
# now the same procedure with the record containing so many NULLs
set @my_key= 0 ;
execute stmt1 using @my_key ;
-# get as much informations about the parameters as possible
+# get as much information about the parameters as possible
--enable_metadata
execute full_info ;
--disable_metadata
@@ -217,7 +217,7 @@ into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08,
@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24,
@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32
from t9 where c1= 1 ;
-# get as much informations about the parameters as possible
+# get as much information about the parameters as possible
--enable_metadata
execute full_info ;
--disable_metadata
@@ -230,7 +230,7 @@ into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08,
@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24,
@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32
from t9 where c1= 0 ;
-# get as much informations about the parameters as possible
+# get as much information about the parameters as possible
--enable_metadata
execute full_info ;
--disable_metadata
@@ -245,7 +245,7 @@ into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08,
from t9 where c1= ?" ;
set @my_key= 1 ;
execute stmt1 using @my_key ;
-# get as much informations about the parameters as possible
+# get as much information about the parameters as possible
--enable_metadata
execute full_info ;
--disable_metadata
@@ -253,7 +253,7 @@ execute full_info ;
# Bug#5034: prepared "select 1 into @arg15", second execute crashes server
set @my_key= 0 ;
execute stmt1 using @my_key ;
-# get as much informations about the parameters as possible
+# get as much information about the parameters as possible
--enable_metadata
execute full_info ;
--disable_metadata
diff --git a/mysql-test/include/query_cache.inc b/mysql-test/include/query_cache.inc
index cd99cac799c..a1ad20dbd15 100644
--- a/mysql-test/include/query_cache.inc
+++ b/mysql-test/include/query_cache.inc
@@ -17,7 +17,7 @@
--disable_view_protocol
SET global query_cache_type=ON;
SET local query_cache_type=ON;
-eval SET SESSION STORAGE_ENGINE = $engine_type;
+eval SET SESSION DEFAULT_STORAGE_ENGINE = $engine_type;
# Initialise
--disable_warnings
@@ -120,7 +120,7 @@ drop table t3,t2,t1;
# Establish connection1
connect (connection1,localhost,root,,);
-eval SET SESSION STORAGE_ENGINE = $engine_type;
+eval SET SESSION DEFAULT_STORAGE_ENGINE = $engine_type;
SET @@autocommit=1;
connection default;
@@ -130,7 +130,7 @@ SHOW VARIABLES LIKE 'have_query_cache';
SET GLOBAL query_cache_size = 204800;
flush status;
SET @@autocommit=1;
-eval SET SESSION STORAGE_ENGINE = $engine_type;
+eval SET SESSION DEFAULT_STORAGE_ENGINE = $engine_type;
eval CREATE TABLE t2 (s1 int, s2 varchar(1000), key(s1))$partitions_s1;
INSERT INTO t2 VALUES (1,repeat('a',10)),(2,repeat('a',10)),(3,repeat('a',10)),(4,repeat('a',10));
COMMIT;
diff --git a/mysql-test/include/query_cache_partitions.inc b/mysql-test/include/query_cache_partitions.inc
index d97d9db27b0..bfbaa87c257 100644
--- a/mysql-test/include/query_cache_partitions.inc
+++ b/mysql-test/include/query_cache_partitions.inc
@@ -10,7 +10,7 @@
SET global query_cache_type=ON;
SET local query_cache_type=ON;
-eval SET SESSION STORAGE_ENGINE = $engine_type;
+eval SET SESSION DEFAULT_STORAGE_ENGINE = $engine_type;
# Initialise
--disable_warnings
diff --git a/mysql-test/include/read_many_rows.inc b/mysql-test/include/read_many_rows.inc
index d40086b01df..7590f48af6c 100644
--- a/mysql-test/include/read_many_rows.inc
+++ b/mysql-test/include/read_many_rows.inc
@@ -19,7 +19,7 @@
# main code t/innodb-big.test --> include/read_many_rows.inc
#
-eval SET SESSION STORAGE_ENGINE = $engine_type;
+eval SET SESSION DEFAULT_STORAGE_ENGINE = $engine_type;
--disable_warnings
DROP TABLE IF EXISTS t1, t2, t3, t4;
diff --git a/mysql-test/include/rowid_order.inc b/mysql-test/include/rowid_order.inc
index b05bad45cde..0dfe48e0b52 100644
--- a/mysql-test/include/rowid_order.inc
+++ b/mysql-test/include/rowid_order.inc
@@ -16,7 +16,7 @@
# main code went into include/rowid_order.inc
#
-eval SET SESSION STORAGE_ENGINE = $engine_type;
+eval SET SESSION DEFAULT_STORAGE_ENGINE = $engine_type;
--disable_warnings
drop table if exists t1, t2, t3,t4;
diff --git a/mysql-test/include/rpl_stop_server.inc b/mysql-test/include/rpl_stop_server.inc
index 049c3d5bbd2..470e86a139d 100644
--- a/mysql-test/include/rpl_stop_server.inc
+++ b/mysql-test/include/rpl_stop_server.inc
@@ -48,7 +48,9 @@ if ($rpl_debug)
# Send shutdown to the connected server and give
# it 60 seconds (of mysqltest's default) to die before zapping it
-shutdown_server;
+let $rpl_shutdown_timeout= `select 60*(1+9*count(*)) from information_schema.system_variables where variable_name='have_sanitizer' and global_value like "MSAN%"`;
+
+shutdown_server $rpl_shutdown_timeout;
--source include/wait_until_disconnected.inc
diff --git a/mysql-test/include/search_pattern_in_file.inc b/mysql-test/include/search_pattern_in_file.inc
index 5e66bbb7db0..a899a9294cc 100644
--- a/mysql-test/include/search_pattern_in_file.inc
+++ b/mysql-test/include/search_pattern_in_file.inc
@@ -9,6 +9,9 @@
#
# The environment variables SEARCH_FILE and SEARCH_PATTERN must be set
# before sourcing this routine.
+# SEARCH_TYPE can also be set to either NULL(default) or _gm_
+# NULL is equivalent of using m/SEARCH_PATTERN/gs
+# _gm_ is equivalent of using m/SEARCH_RANGE/gm
#
# Optionally, SEARCH_RANGE can be set to the max number of bytes of the file
# to search. If negative, it will search that many bytes at the end of the
@@ -77,7 +80,15 @@ perl;
close(FILE);
$content.= $file_content;
}
- my @matches=($content =~ m/$search_pattern/gs);
+ my @matches;
+ if (not defined($ENV{SEARCH_TYPE}))
+ {
+ @matches=($content =~ /$search_pattern/gs);
+ }
+ elsif($ENV{SEARCH_TYPE} == "_gm_")
+ {
+ @matches=($content =~ /$search_pattern/gm);
+ }
my $res=@matches ? "FOUND " . scalar(@matches) : "NOT FOUND";
$ENV{SEARCH_FILE} =~ s{^.*?([^/\\]+)$}{$1};
diff --git a/mysql-test/include/show_events.inc b/mysql-test/include/show_events.inc
index 9ee01f73999..453cde39ed5 100644
--- a/mysql-test/include/show_events.inc
+++ b/mysql-test/include/show_events.inc
@@ -80,6 +80,11 @@ if ($binlog_limit != '')
--let $statement= $statement limit $binlog_limit
}
+if (!$binlog_database)
+{
+ --let $binlog_database="database"
+}
+
# Execute the statement and write to $output_file
--let $output_file= GENERATE
--source include/write_result_to_file.inc
@@ -102,6 +107,7 @@ let $script=
s{((?:master|slave|slave-relay)-bin\.[0-9]{6};pos=)[0-9]+DOLLAR}{DOLLAR1POS};
s{SONAME ".*"}{SONAME "LIB"};
s{DOLLARmysqltest_vardir}{MYSQLTEST_VARDIR}g;
+ s{$binlog_database}{database};
||
--let $pre_script= my DOLLARmysqltest_vardir = DOLLARENV{'MYSQLTEST_VARDIR'};
diff --git a/mysql-test/include/shutdown_mysqld.inc b/mysql-test/include/shutdown_mysqld.inc
index 74a3028946d..db0cfb82c68 100644
--- a/mysql-test/include/shutdown_mysqld.inc
+++ b/mysql-test/include/shutdown_mysqld.inc
@@ -26,7 +26,17 @@ if ($rpl_inited)
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect
--exec echo "wait" > $_expect_file_name
+# Avoid warnings from connection threads that does not have time to exit
+--disable_query_log
+set @@global.log_warnings=0;
+--enable_query_log
+
--let $server_shutdown_timeout= 60
+if ($VALGRIND_TEST)
+{
+ --let $server_shutdown_timeout= 300
+}
+
if ($shutdown_timeout)
{
--let $server_shutdown_timeout= $shutdown_timeout
diff --git a/mysql-test/include/unsafe_binlog.inc b/mysql-test/include/unsafe_binlog.inc
index 4c74845e32f..1fd1f0e01b6 100644
--- a/mysql-test/include/unsafe_binlog.inc
+++ b/mysql-test/include/unsafe_binlog.inc
@@ -151,15 +151,15 @@ connect (a,localhost,root,,);
connect (b,localhost,root,,);
connect (c,localhost,root,,);
connect (d,localhost,root,,);
-eval SET SESSION STORAGE_ENGINE = $engine_type;
+eval SET SESSION DEFAULT_STORAGE_ENGINE = $engine_type;
connect (e,localhost,root,,);
connect (f,localhost,root,,);
connect (g,localhost,root,,);
-eval SET SESSION STORAGE_ENGINE = $engine_type;
+eval SET SESSION DEFAULT_STORAGE_ENGINE = $engine_type;
connect (h,localhost,root,,);
connect (i,localhost,root,,);
connect (j,localhost,root,,);
-eval SET SESSION STORAGE_ENGINE = $engine_type;
+eval SET SESSION DEFAULT_STORAGE_ENGINE = $engine_type;
connection a;
eval create table t1(a int not null, b int, primary key(a)) engine = $engine_type;
insert into t1 values (1,2),(5,3),(4,2);
diff --git a/mysql-test/include/wait_for_sql_thread_read_all.inc b/mysql-test/include/wait_for_sql_thread_read_all.inc
index ec5ecd0cb17..1bbb006f3a8 100644
--- a/mysql-test/include/wait_for_sql_thread_read_all.inc
+++ b/mysql-test/include/wait_for_sql_thread_read_all.inc
@@ -1,6 +1,6 @@
--let $show_statement = show all slaves status
--let $field = Slave_SQL_State
---let $condition = = 'Slave has read all relay log; waiting for the slave I/O thread to update it'
+--let $condition = = 'Slave has read all relay log; waiting for more updates'
--let $wait_for_all = 1
--source include/wait_show_condition.inc
diff --git a/mysql-test/include/wsrep_wait_condition.inc b/mysql-test/include/wsrep_wait_condition.inc
new file mode 100644
index 00000000000..89b310475eb
--- /dev/null
+++ b/mysql-test/include/wsrep_wait_condition.inc
@@ -0,0 +1,23 @@
+# Helper script to allow to wait for condition on a node that may become
+# non-primary. It attempts to preserve wsrep_sync_wait and wsrep_on session
+# variables.
+#
+# We are forced to restore a global value for the session wsrep_sync_wait
+# here because we can not always issue a SELECT query to obtain the original
+# value and then restore it
+
+disable_query_log;
+SET SESSION wsrep_sync_wait = 8;
+let $restore_wsrep_sync_wait = `SELECT @@GLOBAL.wsrep_sync_wait`;
+let $restore_wsrep_on = `SELECT @@wsrep_on`;
+SET SESSION wsrep_on = OFF;
+
+--source include/wait_condition.inc
+
+if ($restore_wsrep_on == 1)
+{
+ --eval SET SESSION wsrep_on = ON
+}
+--eval SET SESSION wsrep_sync_wait = $restore_wsrep_sync_wait
+
+enable_query_log;
diff --git a/mysql-test/include/wsrep_wait_disconnect.inc b/mysql-test/include/wsrep_wait_disconnect.inc
index 740fc0d9426..504e8069cba 100644
--- a/mysql-test/include/wsrep_wait_disconnect.inc
+++ b/mysql-test/include/wsrep_wait_disconnect.inc
@@ -1,20 +1,2 @@
let $wait_condition = SELECT 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready' AND VARIABLE_VALUE = 'OFF';
-# since this is called until AFTER provider disconnects,we need to allow
-# queries in non-prim
-#
-# We are also forced to use a hard-coded value for wsrep_sync_wait here because
-# we can not issue a SELECT query to obtain the original value and then restore
-# it
-disable_query_log;
-SET SESSION wsrep_sync_wait = 7;
---let $restore_wsrep_on = `SHOW VARIABLES WHERE Variable_name = 'wsrep_on' AND Value = 'ON'`
-SET SESSION wsrep_on = OFF;
-
---source include/wait_condition.inc
-
-if ($restore_wsrep_on != "")
-{
- --eval SET SESSION wsrep_on = ON
-}
-SET SESSION wsrep_sync_wait = 15;
-enable_query_log;
+--source include/wsrep_wait_condition.inc
diff --git a/mysql-test/include/wsrep_wait_membership.inc b/mysql-test/include/wsrep_wait_membership.inc
new file mode 100644
index 00000000000..8bc1920ddfb
--- /dev/null
+++ b/mysql-test/include/wsrep_wait_membership.inc
@@ -0,0 +1,10 @@
+# Waits for N members in the cluster
+#
+# Usage:
+# --let $members=1
+# --source wsrep_wait_membership.inc
+#
+
+let $wait_condition = SELECT VARIABLE_VALUE = $members FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+
+--source include/wsrep_wait_condition.inc