summaryrefslogtreecommitdiff
path: root/mysql-test/include
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/include')
-rw-r--r--mysql-test/include/binlog_start_pos.inc10
-rw-r--r--mysql-test/include/check-testcase.test3
-rw-r--r--mysql-test/include/check-warnings.test4
-rw-r--r--mysql-test/include/concurrent.inc2
-rw-r--r--mysql-test/include/ctype_innodb_like.inc7
-rw-r--r--mysql-test/include/ctype_like_cond_propagation.inc16
-rw-r--r--mysql-test/include/ctype_numconv.inc4
-rw-r--r--mysql-test/include/ctype_utf8_ilseq.inc18
-rw-r--r--mysql-test/include/ctype_utf8mb4.inc73
-rw-r--r--mysql-test/include/default_mysqld.cnf2
-rw-r--r--mysql-test/include/default_ndbd.cnf27
-rw-r--r--mysql-test/include/equal_fields_propagation_datetime.inc64
-rw-r--r--mysql-test/include/explain_non_select.inc2
-rw-r--r--mysql-test/include/func_hybrid_type.inc81
-rw-r--r--mysql-test/include/galera_cluster.inc10
-rw-r--r--mysql-test/include/galera_connect.inc48
-rw-r--r--mysql-test/include/galera_diff.inc100
-rw-r--r--mysql-test/include/galera_end.inc25
-rw-r--r--mysql-test/include/galera_init.inc26
-rw-r--r--mysql-test/include/grant_cache.inc8
-rw-r--r--mysql-test/include/have_aria.inc4
-rw-r--r--mysql-test/include/have_innodb.combinations13
-rw-r--r--mysql-test/include/have_innodb_32k.inc6
-rw-r--r--mysql-test/include/have_innodb_64k.inc4
-rw-r--r--mysql-test/include/have_innodb_bzip2.inc4
-rw-r--r--mysql-test/include/have_innodb_disallow_writes.inc6
-rw-r--r--mysql-test/include/have_innodb_lz4.inc4
-rw-r--r--mysql-test/include/have_innodb_lzma.inc4
-rw-r--r--mysql-test/include/have_innodb_lzo.inc4
-rw-r--r--mysql-test/include/have_innodb_snappy.inc4
-rw-r--r--mysql-test/include/have_max_indexes_128.inc5
-rw-r--r--mysql-test/include/have_max_indexes_64.inc5
-rw-r--r--mysql-test/include/have_multi_ndb.inc52
-rw-r--r--mysql-test/include/have_mutex_deadlock_detector.inc7
-rw-r--r--mysql-test/include/have_ndb.inc2
-rw-r--r--mysql-test/include/have_ndb_extra.inc2
-rw-r--r--mysql-test/include/have_ndbapi_examples.inc4
-rw-r--r--mysql-test/include/have_sequence.inc4
-rw-r--r--mysql-test/include/have_sequence.opt1
-rw-r--r--mysql-test/include/have_wsrep.inc8
-rw-r--r--mysql-test/include/have_wsrep_enabled.inc11
-rw-r--r--mysql-test/include/have_wsrep_provider.inc6
-rw-r--r--mysql-test/include/have_xtradb.combinations4
-rw-r--r--mysql-test/include/icp_tests.inc14
-rw-r--r--mysql-test/include/loaddata_autocom.inc3
-rw-r--r--mysql-test/include/maria_verify_recovery.inc2
-rw-r--r--mysql-test/include/max_indexes.inc2
-rw-r--r--mysql-test/include/mix2.inc10
-rw-r--r--mysql-test/include/mtr_check.sql4
-rw-r--r--mysql-test/include/mtr_warnings.sql7
-rw-r--r--mysql-test/include/ndb_backup.inc48
-rw-r--r--mysql-test/include/ndb_backup_print.inc9
-rw-r--r--mysql-test/include/ndb_default_cluster.inc4
-rw-r--r--mysql-test/include/ndb_master-slave.inc12
-rw-r--r--mysql-test/include/ndb_master-slave_2ch.inc67
-rw-r--r--mysql-test/include/ndb_not_readonly.inc36
-rw-r--r--mysql-test/include/ndb_restore_master.inc8
-rw-r--r--mysql-test/include/ndb_restore_slave_eoption.inc11
-rw-r--r--mysql-test/include/ndb_setup_slave.inc27
-rw-r--r--mysql-test/include/ndb_wait_connected.inc26
-rw-r--r--mysql-test/include/not_encrypted.inc4
-rw-r--r--mysql-test/include/not_ndb.inc7
-rw-r--r--mysql-test/include/not_ndb_default.inc4
-rw-r--r--mysql-test/include/ps_create.inc3
-rw-r--r--mysql-test/include/ps_query.inc2
-rw-r--r--mysql-test/include/query_cache.inc4
-rw-r--r--mysql-test/include/query_cache_partitions.inc3
-rw-r--r--mysql-test/include/query_cache_sql_prepare.inc3
-rw-r--r--mysql-test/include/restart_mysqld.inc9
-rw-r--r--mysql-test/include/rpl_init.inc16
-rw-r--r--mysql-test/include/rpl_multi_engine2.inc4
-rw-r--r--mysql-test/include/rpl_row_img_general_loop.inc42
-rw-r--r--mysql-test/include/rpl_row_img_set.inc55
-rw-r--r--mysql-test/include/safe_set_to_maybe_ro_var.inc23
-rw-r--r--mysql-test/include/search_pattern_in_file.inc15
-rw-r--r--mysql-test/include/select_ndb_apply_status.inc13
-rw-r--r--mysql-test/include/show_all_slaves_status.inc65
-rw-r--r--mysql-test/include/show_binlog_events2.inc2
-rw-r--r--mysql-test/include/show_events.inc16
-rw-r--r--mysql-test/include/show_relaylog_events.inc3
-rw-r--r--mysql-test/include/sync_slave_sql_with_master.inc53
-rw-r--r--mysql-test/include/sync_with_master_gtid.inc4
-rw-r--r--mysql-test/include/type_hrtime.inc14
-rw-r--r--mysql-test/include/type_temporal_zero_default.inc75
-rw-r--r--mysql-test/include/wait_condition.inc1
-rw-r--r--mysql-test/include/wait_for_ndb_to_binlog.inc26
-rw-r--r--mysql-test/include/wait_until_ready.inc34
-rw-r--r--mysql-test/include/word_size.combinations3
-rw-r--r--mysql-test/include/word_size.inc4
89 files changed, 978 insertions, 513 deletions
diff --git a/mysql-test/include/binlog_start_pos.inc b/mysql-test/include/binlog_start_pos.inc
index 7dac1b376ee..a187e18b3a4 100644
--- a/mysql-test/include/binlog_start_pos.inc
+++ b/mysql-test/include/binlog_start_pos.inc
@@ -10,19 +10,19 @@
#
# Format_description_log_event length =
# 19 /* event common header */ +
-# 57 /* misc stuff in the Format description header */ +
+# 58 /* misc stuff in the Format description header */ +
# number of events +
# 1 /* Checksum algorithm */ +
# 4 /* CRC32 length */
#
-# With current number of events = 163,
+# With current number of events = 164,
#
-# binlog_start_pos = 4 + 19 + 57 + 163 + 1 + 4 = 248.
+# binlog_start_pos = 4 + 19 + 57 + 163 + 1 + 4 = 249.
#
##############################################################################
-let $binlog_start_pos=248;
+let $binlog_start_pos=249;
--disable_query_log
-SET @binlog_start_pos=248;
+SET @binlog_start_pos=249;
--enable_query_log
diff --git a/mysql-test/include/check-testcase.test b/mysql-test/include/check-testcase.test
index dcf6bd154ce..083f44ce966 100644
--- a/mysql-test/include/check-testcase.test
+++ b/mysql-test/include/check-testcase.test
@@ -64,6 +64,9 @@ if ($tmp)
--echo Master_SSL_Crlpath #
--echo Using_Gtid No
--echo Gtid_IO_Pos #
+ --echo Replicate_Do_Domain_Ids
+ --echo Replicate_Ignore_Domain_Ids
+ --echo Parallel_Mode conservative
}
if (!$tmp) {
# Note: after WL#5177, fields 13-18 shall not be filtered-out.
diff --git a/mysql-test/include/check-warnings.test b/mysql-test/include/check-warnings.test
index 9ecf7de419a..b2f73c32e35 100644
--- a/mysql-test/include/check-warnings.test
+++ b/mysql-test/include/check-warnings.test
@@ -11,6 +11,10 @@
# Don't write these queries to binlog
set SQL_LOG_BIN=0;
+# Do not replicate updates to other galera nodes
+--error 0,1193
+set WSREP_ON=0;
+
# Turn off any debug crashes, allow the variable to be
# non existent in release builds
--error 0,1193
diff --git a/mysql-test/include/concurrent.inc b/mysql-test/include/concurrent.inc
index 0b7299a3c34..2912287be8e 100644
--- a/mysql-test/include/concurrent.inc
+++ b/mysql-test/include/concurrent.inc
@@ -26,6 +26,7 @@
#
connection default;
+SET SQL_MODE="";
#
# Show prerequisites for this test.
#
@@ -670,3 +671,4 @@ connection default;
drop table t1;
drop user mysqltest@localhost;
+SET SQL_MODE=default;
diff --git a/mysql-test/include/ctype_innodb_like.inc b/mysql-test/include/ctype_innodb_like.inc
index ae43342885a..4f3201f51fb 100644
--- a/mysql-test/include/ctype_innodb_like.inc
+++ b/mysql-test/include/ctype_innodb_like.inc
@@ -2,6 +2,10 @@
# Bug#11650: LIKE pattern matching using prefix index
# doesn't return correct result
#
+--disable_query_log
+set @ctype_save_sql_mode=@@sql_mode;
+set sql_mode="";
+--enable_query_log
--disable_warnings
#
# This query creates a column using
@@ -10,6 +14,9 @@
#
create table t1 engine=innodb select repeat('a',50) as c1;
--enable_warnings
+--disable_query_log
+set sql_mode=@ctype_save_sql_mode;
+--enable_query_log
alter table t1 add index(c1(5));
insert into t1 values ('abcdefg'),('abcde100'),('abcde110'),('abcde111');
diff --git a/mysql-test/include/ctype_like_cond_propagation.inc b/mysql-test/include/ctype_like_cond_propagation.inc
index 023cf2b1b30..1c6ea04ded2 100644
--- a/mysql-test/include/ctype_like_cond_propagation.inc
+++ b/mysql-test/include/ctype_like_cond_propagation.inc
@@ -37,3 +37,19 @@ SELECT * FROM t1 WHERE 'a' LIKE CONCAT(c1);
SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
EXPLAIN EXTENDED SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
DROP TABLE t1;
+
+--echo #
+--echo # MDEV-8694 Wrong result for SELECT..WHERE a NOT LIKE 'a ' AND a='a'
+--echo #
+
+CREATE TABLE t1 AS SELECT SPACE(10) AS a LIMIT 0;
+SHOW CREATE TABLE t1;
+INSERT INTO t1 VALUES ('a'),('a ');
+SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ';
+SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a';
+EXPLAIN EXTENDED SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a';
+DROP TABLE t1;
+
+--echo #
+--echo # End of MDEV-8694
+--echo #
diff --git a/mysql-test/include/ctype_numconv.inc b/mysql-test/include/ctype_numconv.inc
index 9e59f54a8b3..1d675a5db6f 100644
--- a/mysql-test/include/ctype_numconv.inc
+++ b/mysql-test/include/ctype_numconv.inc
@@ -1166,7 +1166,7 @@ create table t2 as select concat(a) from t1;
show create table t2;
drop table t1, t2;
-create table t1 (a timestamp);
+create table t1 (a timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
insert into t1 values (0);
insert into t1 values (20010203040506);
insert into t1 values (19800203040506);
@@ -1478,7 +1478,7 @@ select hex(a) from v1;
drop table t1;
drop view v1;
-create table t1 (a timestamp);
+create table t1 (a timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
insert into t1 values (0);
insert into t1 values (20010203040506);
insert into t1 values (19800203040506);
diff --git a/mysql-test/include/ctype_utf8_ilseq.inc b/mysql-test/include/ctype_utf8_ilseq.inc
index c400731c07f..1bb009f2a8b 100644
--- a/mysql-test/include/ctype_utf8_ilseq.inc
+++ b/mysql-test/include/ctype_utf8_ilseq.inc
@@ -28,17 +28,35 @@ INSERT INTO t1 (ch) VALUES (_utf8 0x61D680);
SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='aðŒ†' ORDER BY ch;
SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='aðŒ†b' ORDER BY ch;
+--replace_column 9 #
+EXPLAIN
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='aðŒ†' ORDER BY ch;
+SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='aðŒ†' ORDER BY ch;
+--replace_column 9 #
+EXPLAIN
+SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='aðŒ†b' ORDER BY ch;
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='aðŒ†b' ORDER BY ch;
SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch<'aðŒ†' ORDER BY ch;
SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch<'aðŒ†b' ORDER BY ch;
+--replace_column 9 #
+EXPLAIN
+SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'aðŒ†' ORDER BY ch;
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'aðŒ†' ORDER BY ch;
+--replace_column 9 #
+EXPLAIN
+SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'aðŒ†b' ORDER BY ch;
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'aðŒ†b' ORDER BY ch;
SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch>'aðŒ†' ORDER BY ch;
SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch>'aðŒ†b' ORDER BY ch;
+--replace_column 9 #
+EXPLAIN
+SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'aðŒ†' ORDER BY ch;
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'aðŒ†' ORDER BY ch;
+--replace_column 9 #
+EXPLAIN
+SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'aðŒ†b' ORDER BY ch;
SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'aðŒ†b' ORDER BY ch;
ALTER TABLE t1 DROP KEY ch;
diff --git a/mysql-test/include/ctype_utf8mb4.inc b/mysql-test/include/ctype_utf8mb4.inc
index 9ee2414e142..71993a946b3 100644
--- a/mysql-test/include/ctype_utf8mb4.inc
+++ b/mysql-test/include/ctype_utf8mb4.inc
@@ -191,17 +191,9 @@ drop table t1;
#
if(!$is_heap)
{
-if(!$is_ndb)
-{
--error ER_TOO_LONG_KEY
eval create table t1 (a text character set utf8mb4, primary key(a(371))) engine $engine;
}
-if($is_ndb)
-{
---error ER_BLOB_USED_AS_KEY
-eval create table t1 (a text character set utf8mb4, primary key(a(371))) engine $engine;
-}
-}
#
# Bug 2959
@@ -254,8 +246,6 @@ drop table t2;
# Bug 4521: unique key prefix interacts poorly with utf8mb4
# MYISAM: keys with prefix compression, case insensitive collation.
#
-if (!$is_ndb)
-{
eval create table t1 (c varchar(30) character set utf8mb4, unique(c(10))) engine $engine;
insert into t1 values ('1'),('2'),('3'),('x'),('y'),('z');
insert into t1 values ('aaaaaaaaaa');
@@ -549,7 +539,6 @@ select c as c_all from t1 order by c;
select c as c_a from t1 where c='a';
select c as c_a from t1 where c='б';
drop table t1;
-}
# Bug#4594: column index make = failed for gbk, but like works
@@ -593,8 +582,6 @@ drop table t1;
# the same for HEAP+HASH
#
-if (!$is_ndb)
-{
eval create table t1 (
str varchar(255) character set utf8mb4 not null,
key str using hash (str(2))
@@ -618,7 +605,6 @@ INSERT INTO t1 VALUES ('str');
INSERT INTO t1 VALUES ('str2');
select * from t1 where str='str';
drop table t1;
-}
#
# Bug #5397: Crash with varchar binary and LIKE
@@ -651,8 +637,6 @@ DROP TABLE t1;
#
if (!$is_heap)
{
-if (!$is_ndb)
-{
eval CREATE TABLE t1 (
id int unsigned NOT NULL auto_increment,
list_id smallint unsigned NOT NULL,
@@ -689,7 +673,6 @@ SELECT id, term FROM t1 where (list_id = 1) AND (term = "testetest");
SELECT id, term FROM t1 where (list_id = 1) AND (term = "testètest");
DROP TABLE t1;
}
-}
#
# Bug #6019 SELECT tries to use too short prefix index on utf8mb4 data
@@ -705,9 +688,16 @@ eval create table t1 (
insert into t1 values(1,'foo'),(2,'foobar');
--sorted_result
select * from t1 where b like 'foob%';
+--disable_query_log
+set @ctype_save_sql_mode=@@sql_mode;
+set sql_mode="";
+--enable_query_log
--disable_warnings
alter table t1 engine=innodb;
--enable_warnings
+--disable_query_log
+set sql_mode=@ctype_save_sql_mode;
+--enable_query_log
--sorted_result
select * from t1 where b like 'foob%';
drop table t1;
@@ -979,14 +969,7 @@ if (!$is_heap)
#
eval CREATE TABLE t1 (t TINYTEXT CHARACTER SET utf8mb4) ENGINE $engine;
INSERT INTO t1 VALUES(REPEAT('a', 100));
-if (!$is_ndb)
-{
eval CREATE TEMPORARY TABLE t2 ENGINE $engine SELECT COALESCE(t) AS bug FROM t1;
-}
-if ($is_ndb)
-{
-eval CREATE TABLE t2 ENGINE $engine SELECT COALESCE(t) AS bug FROM t1;
-}
SELECT LENGTH(bug) FROM t2;
DROP TABLE t2;
DROP TABLE t1;
@@ -1202,8 +1185,6 @@ SET NAMES latin2;
if (!$is_heap)
{
-if (!$is_ndb)
-{
eval CREATE TABLE t1 (
id int(11) NOT NULL default '0',
tid int(11) NOT NULL default '0',
@@ -1229,7 +1210,6 @@ SELECT * FROM t1 WHERE tid=72 and val LIKE 'VOLNÝ ADSL';
DROP TABLE t1;
}
-}
#
# Bug 20709: problem with utf8mb4 fields in temporary tables
@@ -1318,8 +1298,6 @@ drop table t1;
#
# Check that do_varstring2_mb produces a warning
#
-if (!$is_ndb)
-{
eval create table t1 (
a varchar(4000) not null
) default character set utf8mb4 engine $engine;
@@ -1327,7 +1305,6 @@ insert into t1 values (repeat('a',4000));
alter table t1 change a a varchar(3000) character set utf8mb4 not null;
select length(a) from t1;
drop table t1;
-}
#
# Bug#10504: Character set does not support traditional mode
@@ -1614,8 +1591,6 @@ set max_sort_length=default;
--echo #
if (!$is_heap)
{
-if (!$is_ndb)
-{
eval CREATE TABLE t1 (
clipid INT NOT NULL,
Tape TINYTEXT,
@@ -1626,7 +1601,6 @@ ALTER TABLE t1 ADD mos TINYINT DEFAULT 0 AFTER clipid;
SHOW CREATE TABLE t1;
DROP TABLE t1;
}
-}
#--echo #
#--echo # Check that supplementary characters are not allowed in identifiers
@@ -1807,12 +1781,9 @@ INSERT INTO t2 VALUES (x'ea9da8');
SELECT HEX(CONCAT(utf8mb4, utf8mb3)) FROM t1,t2 ORDER BY 1;
SELECT CHARSET(CONCAT(utf8mb4, utf8mb3)) FROM t1, t2 LIMIT 1;
-if (!$is_ndb)
-{
eval CREATE TEMPORARY TABLE t3 ENGINE $engine AS SELECT *, concat(utf8mb4,utf8mb3) FROM t1, t2;
SHOW CREATE TABLE t3;
DROP TEMPORARY TABLE t3;
-}
SELECT * FROM t1, t2 WHERE t1.utf8mb4 > t2.utf8mb3;
SELECT * FROM t1, t2 WHERE t1.utf8mb4 = t2.utf8mb3;
@@ -1838,5 +1809,33 @@ DROP TABLE t1;
--echo #
--echo #
---echo # End of tests
+--echo # ctype_utf8mb4.inc: Start of 10.1 tests
+--echo #
+
+--echo #
+--echo # MDEV-8417 utf8mb4: compare broken bytes as "greater than any non-broken character"
+--echo #
+CREATE TABLE t1 (
+ id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
+ a VARCHAR(10) CHARACTER SET utf8mb4, KEY(a,id)
+);
+INSERT INTO t1 (a) VALUES (0x61);
+INSERT INTO t1 (a) VALUES (0xC280),(0xDFBF);
+INSERT INTO t1 (a) VALUES (0xE0A080),(0xEFBFBF);
+INSERT INTO t1 (a) VALUES (0xF0908080),(0xF48FBFBF);
+SELECT id,HEX(a) FROM t1 ORDER BY a,id;
+SELECT id,HEX(a) FROM t1 ORDER BY a DESC,id DESC;
+SELECT COUNT(DISTINCT a) FROM t1;
+ALTER TABLE t1 MODIFY a VARCHAR(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
+SELECT id,HEX(a) FROM t1 ORDER BY a;
+SELECT id,HEX(a) FROM t1 ORDER BY a DESC,id DESC;
+SELECT COUNT(DISTINCT a) FROM t1;
+DROP TABLE t1;
+
+--echo #
+--echo # ctype_utf8mb4.inc: End of 10.1 tests
+--echo #
+
+--echo #
+--echo # End of ctype_utf8mb4.inc
--echo #
diff --git a/mysql-test/include/default_mysqld.cnf b/mysql-test/include/default_mysqld.cnf
index 7b84117639c..17b2fd5b2bc 100644
--- a/mysql-test/include/default_mysqld.cnf
+++ b/mysql-test/include/default_mysqld.cnf
@@ -16,6 +16,8 @@
# Default values that applies to all MySQL Servers
[mysqld]
+disable-getopt-prefix-matching
+
open-files-limit= 1024
local-infile
character-set-server= latin1
diff --git a/mysql-test/include/default_ndbd.cnf b/mysql-test/include/default_ndbd.cnf
deleted file mode 100644
index 9a88a5936aa..00000000000
--- a/mysql-test/include/default_ndbd.cnf
+++ /dev/null
@@ -1,27 +0,0 @@
-
-[cluster_config]
-MaxNoOfSavedMessages= 1000
-MaxNoOfConcurrentTransactions= 128
-MaxNoOfConcurrentOperations= 10000
-DataMemory= 20M
-IndexMemory= 1M
-Diskless= 0
-TimeBetweenWatchDogCheck= 30000
-MaxNoOfOrderedIndexes= 32
-MaxNoOfAttributes= 2048
-TimeBetweenGlobalCheckpoints= 500
-NoOfFragmentLogFiles= 4
-FragmentLogFileSize= 12M
-DiskPageBufferMemory= 4M
-
-# O_DIRECT has issues on 2.4 whach have not been handled, Bug #29612
-#ODirect= 1
-# the following parametes just function as a small regression
-# test that the parameter exists
-InitialNoOfOpenFiles= 27
-
-# Increase timeouts for slow test-machines
-HeartbeatIntervalDbDb= 30000
-HeartbeatIntervalDbApi= 30000
-
-#TransactionDeadlockDetectionTimeout= 7500
diff --git a/mysql-test/include/equal_fields_propagation_datetime.inc b/mysql-test/include/equal_fields_propagation_datetime.inc
new file mode 100644
index 00000000000..97a30a83df6
--- /dev/null
+++ b/mysql-test/include/equal_fields_propagation_datetime.inc
@@ -0,0 +1,64 @@
+
+# Trailing garbage in string literals
+--eval CREATE TABLE t1 (a $TYPE);
+INSERT INTO t1 VALUES ('2001-01-01 00:00:00'),('2001-01-01 00:00:01');
+SELECT * FROM t1 WHERE a='2001-01-01 00:00:00x';
+SELECT * FROM t1 WHERE LENGTH(a) != 20;
+SELECT * FROM t1 WHERE LENGTH(a) != 20 AND a='2001-01-01 00:00:00x';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a) != 20 AND a='2001-01-01 00:00:00x';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)!=30+RAND() AND a='2001-01-01 00:00:00x';
+DROP TABLE t1;
+
+# Leading spaces in string literals
+--eval CREATE TABLE t1 (a $TYPE);
+INSERT INTO t1 VALUES ('2001-01-01 00:00:00'),('2001-01-01 00:00:01');
+SELECT * FROM t1 WHERE LENGTH(a)=19;
+SELECT * FROM t1 WHERE LENGTH(a)=19 AND a=' 2001-01-01 00:00:00';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=19 AND a=' 2001-01-01 00:00:00';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=19+RAND() AND a=' 2001-01-01 00:00:00';
+# This should not propagate
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=' garbage ';
+DROP TABLE t1;
+
+# Trailing fractional digits in temporal literals
+--eval CREATE TABLE t1 (a $TYPE);
+INSERT INTO t1 VALUES ('2001-01-01 00:00:00'),('2001-01-01 00:00:01');
+SELECT * FROM t1 WHERE a=TIMESTAMP'2001-01-01 00:00:00.000000';
+SELECT * FROM t1 WHERE LENGTH(a)=19;
+SELECT * FROM t1 WHERE LENGTH(a)=19 AND a=TIMESTAMP'2001-01-01 00:00:00.000000';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=19 AND a=TIMESTAMP'2001-01-01 00:00:00.000000';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=TIMESTAMP'2001-01-01 00:00:00.000000';
+DROP TABLE t1;
+
+# Trailing fractional digits in temporal literals, the same precision
+--eval CREATE TABLE t1 (a $TYPE(6));
+INSERT INTO t1 VALUES ('2001-01-01 00:00:00.000000'),('2001-01-01 00:00:01.000000');
+SELECT * FROM t1 WHERE a=TIMESTAMP'2001-01-01 00:00:00.000000';
+SELECT * FROM t1 WHERE LENGTH(a)=26;
+SELECT * FROM t1 WHERE LENGTH(a)=26 AND a=TIMESTAMP'2001-01-01 00:00:00.000000';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=26 AND a=TIMESTAMP'2001-01-01 00:00:00.000000';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=40+RAND() AND a=TIMESTAMP'2001-01-01 00:00:00.000000';
+DROP TABLE t1;
+
+# DATETIME/TIMESTAMP column vs TIME literal
+SET timestamp=UNIX_TIMESTAMP('2001-01-01 10:20:30');
+--eval CREATE TABLE t1 (a $TYPE);
+INSERT INTO t1 VALUES ('2001-01-01 00:00:00'),('2001-01-01 00:00:01');
+SELECT * FROM t1 WHERE a=TIME'00:00:00';
+SELECT * FROM t1 WHERE LENGTH(a)=19;
+SELECT * FROM t1 WHERE LENGTH(a)=19 AND a=TIME'00:00:00';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=19 AND a=TIME'00:00:00';
+EXPLAIN EXTENDED
+SELECT * FROM t1 WHERE LENGTH(a)=40+RAND() AND a=TIME'00:00:00';
+DROP TABLE t1;
+
diff --git a/mysql-test/include/explain_non_select.inc b/mysql-test/include/explain_non_select.inc
index a0f86e744b0..57b96994d20 100644
--- a/mysql-test/include/explain_non_select.inc
+++ b/mysql-test/include/explain_non_select.inc
@@ -771,7 +771,7 @@ DROP TABLE t1,t2;
--echo #74
-CREATE TABLE t1(a INT PRIMARY KEY) ENGINE=InnoDB;
+CREATE TABLE t1(a INT PRIMARY KEY);
INSERT INTO t1 VALUES (1), (2), (3), (4), (5);
--echo # used key is modified & Using temporary
diff --git a/mysql-test/include/func_hybrid_type.inc b/mysql-test/include/func_hybrid_type.inc
new file mode 100644
index 00000000000..854c7ebd34e
--- /dev/null
+++ b/mysql-test/include/func_hybrid_type.inc
@@ -0,0 +1,81 @@
+# "mtr --ps" returns different values in "Max length"
+--disable_ps_protocol
+--enable_metadata
+--vertical_results
+SELECT
+ a AS ___________a,
+ CASE WHEN a IS NOT NULL THEN a END AS case_______a,
+ CASE WHEN a IS NOT NULL THEN a ELSE a END AS case_____a_a,
+ COALESCE(a) AS coalesce___a,
+ COALESCE(a, a) AS coalesce_a_a,
+ IF(a IS NULL, a, a) AS if_______a_a,
+ IFNULL(a, a) AS ifnull___a_a,
+ LEAST(a, a) AS least____a_a,
+ GREATEST(a, a) AS greatest_a_a,
+ b AS ___________b,
+ CASE WHEN a IS NOT NULL THEN b END AS case_______b,
+ CASE WHEN a IS NOT NULL THEN b ELSE b END AS case_____b_b,
+ COALESCE(b) AS coalesce___b,
+ COALESCE(b, b) AS coalesce_b_b,
+ IF(a IS NULL, b, b) AS if_______b_b,
+ IFNULL(b, b) AS ifnull___b_b,
+ LEAST(b, b) AS least____b_b,
+ GREATEST(b, b) AS greatest_b_b
+FROM t1;
+SELECT
+ CASE WHEN a IS NOT NULL THEN a ELSE b END AS case_____a_b,
+ CASE WHEN a IS NOT NULL THEN b ELSE a END AS case_____b_a,
+ COALESCE(a, b) AS coalesce_a_b,
+ COALESCE(b, a) AS coalesce_b_a,
+ IF(a IS NULL, a, b) AS if_______a_b,
+ IF(a IS NULL, b, a) AS if_______b_a,
+ IFNULL(a, b) AS ifnull___a_b,
+ IFNULL(b, a) AS ifnull___b_a,
+ LEAST(a, b) AS least____a_b,
+ LEAST(b, a) AS least____b_a,
+ GREATEST(a, b) AS greatest_a_b,
+ GREATEST(b, a) AS greatest_b_a
+FROM t1;
+--horizontal_results
+--disable_metadata
+--enable_ps_protocol
+CREATE TABLE t2 AS
+SELECT
+ a AS ___________a,
+ CASE WHEN a IS NOT NULL THEN a END AS case_______a,
+ CASE WHEN a IS NOT NULL THEN a ELSE a END AS case_____a_a,
+ COALESCE(a) AS coalesce___a,
+ COALESCE(a, a) AS coalesce_a_a,
+ IF(a IS NULL, a, a) AS if_______a_a,
+ IFNULL(a, a) AS ifnull___a_a,
+ LEAST(a, a) AS least____a_a,
+ GREATEST(a, a) AS greatest_a_a,
+ b AS ___________b,
+ CASE WHEN a IS NOT NULL THEN b END AS case_______b,
+ CASE WHEN a IS NOT NULL THEN b ELSE b END AS case_____b_b,
+ COALESCE(b) AS coalesce___b,
+ COALESCE(b, b) AS coalesce_b_b,
+ IF(a IS NULL, b, b) AS if_______b_b,
+ IFNULL(b, b) AS ifnull___b_b,
+ LEAST(b, b) AS least____b_b,
+ GREATEST(b, b) AS greatest_b_b
+FROM t1;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+CREATE TABLE t2 AS
+SELECT
+ CASE WHEN a IS NOT NULL THEN a ELSE b END AS case_____a_b,
+ CASE WHEN a IS NOT NULL THEN b ELSE a END AS case_____b_a,
+ COALESCE(a, b) AS coalesce_a_b,
+ COALESCE(b, a) AS coalesce_b_a,
+ IF(a IS NULL, a, b) AS if_______a_b,
+ IF(a IS NULL, b, a) AS if_______b_a,
+ IFNULL(a, b) AS ifnull___a_b,
+ IFNULL(b, a) AS ifnull___b_a,
+ LEAST(a, b) AS least____a_b,
+ LEAST(b, a) AS least____b_a,
+ GREATEST(a, b) AS greatest_a_b,
+ GREATEST(b, a) AS greatest_b_a
+FROM t1;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
diff --git a/mysql-test/include/galera_cluster.inc b/mysql-test/include/galera_cluster.inc
new file mode 100644
index 00000000000..bc652225722
--- /dev/null
+++ b/mysql-test/include/galera_cluster.inc
@@ -0,0 +1,10 @@
+# galera_cluster.inc
+# ==================
+#
+# Description
+# -----------
+# Configure galera cluster with 2 nodes.
+#
+
+--let $galera_cluster_size = 2
+--source include/galera_init.inc
diff --git a/mysql-test/include/galera_connect.inc b/mysql-test/include/galera_connect.inc
new file mode 100644
index 00000000000..9d458c5e063
--- /dev/null
+++ b/mysql-test/include/galera_connect.inc
@@ -0,0 +1,48 @@
+# galera_connect.inc
+# ==================
+#
+# Description
+# -----------
+# Open a connection to the specified server number ($galera_server_number).
+# The connection itself would be identified by $galera_connection_name.
+#
+# Parameters
+# ----------
+# $galera_connection_name
+# Name of the resulting connection.
+#
+# $galera_server_number
+# Sequence number of the node in the galera cluster.
+#
+# $galera_debug
+# Print debug information.
+#
+
+if (!$galera_connection_name)
+{
+ --die ERROR IN TEST: $galera_connection_name must be set before sourcing include/galera_connect.inc
+}
+
+if (!$galera_server_number)
+{
+ --die ERROR IN TEST: $galera_server_number must be set before sourcing include/galera_connect.inc
+}
+
+--let $_galera_port= \$NODE_MYPORT_$galera_server_number
+if (!$_galera_port)
+{
+ --echo Bug in test case: '\$NODE_MYPORT_$galera_server_number' not initialized. Check the test's .cfg file.
+ --die Not all NODE_MYPORT_* environment variables are setup correctly.
+}
+
+if ($galera_debug)
+{
+ --echo connect($galera_connection_name,127.0.0.1,root,,test,$_galera_port,)
+}
+
+# Temporal solution to avoid concurrent IST MDEV-7178
+--sleep 1
+
+# Open a connection
+--connect($galera_connection_name,127.0.0.1,root,,test,$_galera_port,)
+
diff --git a/mysql-test/include/galera_diff.inc b/mysql-test/include/galera_diff.inc
new file mode 100644
index 00000000000..6043b582647
--- /dev/null
+++ b/mysql-test/include/galera_diff.inc
@@ -0,0 +1,100 @@
+# galera_diff.inc
+# ===============
+#
+# Description
+# -----------
+# Compare the output of the given statement on all the nodes of the cluster.
+#
+# Parameters
+# ----------
+# $galera_diff_statement
+# Statement for which the output would be compared.
+#
+# $galera_diff_database
+# Database against which the above statement would be executed.
+# (Default : test)
+#
+# $galera_diff_servers
+# Comma separated list of servers to executed the diff statement on. If not
+# set, a list of servers will be generated based on $galera_cluster_size.
+#
+# $galerra_debug
+# Print debug information.
+#
+
+if (!$galera_diff_statement)
+{
+ --die ERROR IN TEST: $galera_diff_statement must be set before sourcing include/galera_diff.inc
+}
+
+--let $_galera_diff_database = $galera_diff_database
+if (!$_galera_diff_database)
+{
+ --let $_galera_diff_database = test
+}
+
+--let $_galera_diff_servers= $galera_diff_servers
+if (!$_galera_diff_servers)
+{
+ --let $_i= $galera_cluster_size
+ --let $_galera_diff_servers=
+ while ($_i)
+ {
+ --let $_galera_diff_servers= $_i,$_galera_diff_servers
+ --dec $_i
+ }
+}
+if ($galera_debug)
+{
+ --echo \$galera_diff_servers= '$_galera_diff_servers'
+}
+
+if (!$galera_debug)
+{
+ --disable_query_log
+}
+
+# Generate file containing $galera_diff_statement. We don't pass the
+# statement on the command line, because it would be subject to shell
+# substitutions.
+--let $write_to_file= GENERATE
+--let $write_var= $galera_diff_statement
+--source include/write_var_to_file.inc
+--let $_galera_diff_statement_file= $write_to_file
+
+if (!$galera_debug)
+{
+ --enable_query_log
+}
+
+# Compare all servers.
+--let $_galera_diff_first= 1
+while ($_galera_diff_servers)
+{
+ # Set $_galera_diff_server_i to the first number in the list
+ --let $_galera_diff_server_i= `SELECT SUBSTRING_INDEX('$_galera_diff_servers', ',', 1)`
+ # Remove $_galera_diff_server_i from the list
+ --let $_galera_diff_servers= `SELECT SUBSTRING('$_galera_diff_servers', LENGTH('$_galera_diff_server_i') + 2)`
+
+ # Execute statement
+ --let $_galera_diff_file= $MYSQLTEST_VARDIR/tmp/_galera_diff_server-$_galera_diff_server_i.tmp
+ --exec $MYSQL --defaults-group-suffix=.$_galera_diff_server_i $_galera_diff_database < $_galera_diff_statement_file > $_galera_diff_file
+
+ # Compare
+ if (!$_galera_diff_first)
+ {
+ if ($galera_debug)
+ {
+ --echo diffing $_galera_diff_file and $_galera_diff_prev_file
+ }
+ --diff_files $_galera_diff_file $_galera_diff_prev_file
+ --remove_file $_galera_diff_prev_file
+ }
+ --let $_galera_diff_prev_file= $_galera_diff_file
+ --let $_galera_diff_first= 0
+}
+
+# Cleanup
+--remove_file $_galera_diff_prev_file
+--remove_file $_galera_diff_statement_file
+
diff --git a/mysql-test/include/galera_end.inc b/mysql-test/include/galera_end.inc
new file mode 100644
index 00000000000..0fb5479844e
--- /dev/null
+++ b/mysql-test/include/galera_end.inc
@@ -0,0 +1,25 @@
+# galera_end.inc
+# ==============
+#
+# Description
+# -----------
+# Closes the connections opened via include/galera_init.inc
+#
+# Parameters
+# ----------
+# $galera_cluster_size
+# Number of nodes in the cluster.
+#
+
+--let $_galera_node= $galera_cluster_size
+
+while ($_galera_node)
+{
+ if ($galera_debug)
+ {
+ --echo Disconnecting node_$_galera_node
+ }
+ --disconnect node_$_galera_node
+ --dec $_galera_node
+}
+
diff --git a/mysql-test/include/galera_init.inc b/mysql-test/include/galera_init.inc
new file mode 100644
index 00000000000..79591973862
--- /dev/null
+++ b/mysql-test/include/galera_init.inc
@@ -0,0 +1,26 @@
+# galera_init.inc
+# ===============
+#
+# Description
+# -----------
+# Set up a Galera cluster with $wsrep_cluster_size nodes.
+#
+# Parameters
+# ----------
+# $galera_cluster_size
+# Number of nodes in the cluster.
+#
+
+--source include/have_wsrep_enabled.inc
+
+--let $_galera_node= $galera_cluster_size
+
+while ($_galera_node)
+{
+ --let $galera_connection_name= node_$_galera_node
+ --let $galera_server_number= $_galera_node
+ --source include/galera_connect.inc
+
+ --dec $_galera_node
+}
+
diff --git a/mysql-test/include/grant_cache.inc b/mysql-test/include/grant_cache.inc
index 47eef1cdb67..111b35d6940 100644
--- a/mysql-test/include/grant_cache.inc
+++ b/mysql-test/include/grant_cache.inc
@@ -37,12 +37,16 @@
--source include/add_anonymous_users.inc
+set GLOBAL sql_mode="";
+set LOCAL sql_mode="";
#
--disable_warnings
drop table if exists test.t1,mysqltest.t1,mysqltest.t2;
drop database if exists mysqltest;
--enable_warnings
+set GLOBAL query_cache_type=ON;
+set LOCAL query_cache_type=ON;
set GLOBAL query_cache_size=1355776;
reset query cache;
@@ -214,5 +218,9 @@ drop table test.t1,mysqltest.t1,mysqltest.t2;
drop database mysqltest;
set GLOBAL query_cache_size=default;
+set GLOBAL query_cache_type=ON;
+set LOCAL query_cache_type=ON;
--source include/delete_anonymous_users.inc
+set GLOBAL sql_mode=default;
+set GLOBAL query_cache_type=default;
diff --git a/mysql-test/include/have_aria.inc b/mysql-test/include/have_aria.inc
new file mode 100644
index 00000000000..18f2b4b0063
--- /dev/null
+++ b/mysql-test/include/have_aria.inc
@@ -0,0 +1,4 @@
+if (`SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.ENGINES WHERE engine = 'aria' AND support IN ('YES', 'DEFAULT', 'ENABLED')`)
+{
+ --skip Test requires Aria
+}
diff --git a/mysql-test/include/have_innodb.combinations b/mysql-test/include/have_innodb.combinations
index 5b8d376d1b9..49ae741b269 100644
--- a/mysql-test/include/have_innodb.combinations
+++ b/mysql-test/include/have_innodb.combinations
@@ -3,12 +3,14 @@ ignore-builtin-innodb
plugin-load-add=$HA_INNODB_SO
innodb
innodb-cmpmem
+innodb-cmp-per-index
innodb-trx
+innodb-locks
innodb-buffer-pool-stats
innodb-buffer-page
innodb-buffer-page-lru
innodb-sys-foreign
-innodb-sys-foreign-col
+innodb-sys-foreign-cols
innodb-sys-tables
innodb-metrics
@@ -17,24 +19,27 @@ ignore-builtin-innodb
plugin-load-add=$HA_XTRADB_SO
innodb
innodb-cmpmem
+innodb-cmp-per-index
innodb-trx
+innodb-locks
innodb-buffer-pool-stats
innodb-buffer-page
innodb-buffer-page-lru
innodb-sys-foreign
-innodb-sys-foreign-col
+innodb-sys-foreign-cols
innodb-sys-tables
innodb-metrics
[xtradb]
innodb
innodb-cmpmem
+innodb-cmp-per-index
innodb-trx
+innodb-locks
innodb-metrics
innodb-buffer-pool-stats
innodb-buffer-page
innodb-buffer-page-lru
innodb-sys-foreign
-innodb-sys-foreign-col
+innodb-sys-foreign-cols
innodb-sys-tables
-innodb-metrics
diff --git a/mysql-test/include/have_innodb_32k.inc b/mysql-test/include/have_innodb_32k.inc
new file mode 100644
index 00000000000..76a8d2d59a3
--- /dev/null
+++ b/mysql-test/include/have_innodb_32k.inc
@@ -0,0 +1,6 @@
+if (`SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE LOWER(variable_name) = 'innodb_page_size' AND variable_value = 32768`)
+{
+
+ --skip Test requires InnoDB with 32k Page size.
+
+} \ No newline at end of file
diff --git a/mysql-test/include/have_innodb_64k.inc b/mysql-test/include/have_innodb_64k.inc
new file mode 100644
index 00000000000..bcb76c4f54e
--- /dev/null
+++ b/mysql-test/include/have_innodb_64k.inc
@@ -0,0 +1,4 @@
+if (`SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE LOWER(variable_name) = 'innodb_page_size' AND variable_value = 65536`)
+{
+ --skip Test requires InnoDB with 64k Page size.
+}
diff --git a/mysql-test/include/have_innodb_bzip2.inc b/mysql-test/include/have_innodb_bzip2.inc
new file mode 100644
index 00000000000..afbe78f0cf9
--- /dev/null
+++ b/mysql-test/include/have_innodb_bzip2.inc
@@ -0,0 +1,4 @@
+if (! `SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE LOWER(variable_name) = 'innodb_have_bzip2' AND variable_value = 'ON'`)
+{
+ --skip Test requires InnoDB compiled with libbz2
+}
diff --git a/mysql-test/include/have_innodb_disallow_writes.inc b/mysql-test/include/have_innodb_disallow_writes.inc
new file mode 100644
index 00000000000..83b516b7a34
--- /dev/null
+++ b/mysql-test/include/have_innodb_disallow_writes.inc
@@ -0,0 +1,6 @@
+--source include/have_innodb.inc
+
+if (`SELECT COUNT(*) = 0 from INFORMATION_SCHEMA.GLOBAL_VARIABLES
+ WHERE VARIABLE_NAME = 'INNODB_DISALLOW_WRITES'`) {
+ --skip Test requires 'innodb_disallow_writes'
+}
diff --git a/mysql-test/include/have_innodb_lz4.inc b/mysql-test/include/have_innodb_lz4.inc
new file mode 100644
index 00000000000..bda3ffa8623
--- /dev/null
+++ b/mysql-test/include/have_innodb_lz4.inc
@@ -0,0 +1,4 @@
+if (!`SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE LOWER(variable_name) = 'innodb_have_lz4' AND variable_value = 'ON'`)
+{
+ --skip Test requires InnoDB compiled with liblz4
+}
diff --git a/mysql-test/include/have_innodb_lzma.inc b/mysql-test/include/have_innodb_lzma.inc
new file mode 100644
index 00000000000..86eda33f194
--- /dev/null
+++ b/mysql-test/include/have_innodb_lzma.inc
@@ -0,0 +1,4 @@
+if (!`SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE LOWER(variable_name) = 'innodb_have_lzma' AND variable_value = 'ON' `)
+{
+ --skip Test requires InnoDB compiled with liblzma
+}
diff --git a/mysql-test/include/have_innodb_lzo.inc b/mysql-test/include/have_innodb_lzo.inc
new file mode 100644
index 00000000000..f40418b00fb
--- /dev/null
+++ b/mysql-test/include/have_innodb_lzo.inc
@@ -0,0 +1,4 @@
+if (! `SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE LOWER(variable_name) = 'innodb_have_lzo' AND variable_value = 'ON'`)
+{
+ --skip Test requires InnoDB compiled with liblzo
+}
diff --git a/mysql-test/include/have_innodb_snappy.inc b/mysql-test/include/have_innodb_snappy.inc
new file mode 100644
index 00000000000..c4dca4c19ee
--- /dev/null
+++ b/mysql-test/include/have_innodb_snappy.inc
@@ -0,0 +1,4 @@
+if (! `SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE LOWER(variable_name) = 'innodb_have_snappy' AND variable_value = 'ON'`)
+{
+ --skip Test requires InnoDB compiled with libsnappy
+}
diff --git a/mysql-test/include/have_max_indexes_128.inc b/mysql-test/include/have_max_indexes_128.inc
new file mode 100644
index 00000000000..0cb58afc61a
--- /dev/null
+++ b/mysql-test/include/have_max_indexes_128.inc
@@ -0,0 +1,5 @@
+--source include/max_indexes.inc
+
+if (`SELECT "$max_indexes" NOT REGEXP "^128U?\$"`) {
+ --skip Test needs mysqld built with --with-max-indexes=128
+}
diff --git a/mysql-test/include/have_max_indexes_64.inc b/mysql-test/include/have_max_indexes_64.inc
new file mode 100644
index 00000000000..dda2c263616
--- /dev/null
+++ b/mysql-test/include/have_max_indexes_64.inc
@@ -0,0 +1,5 @@
+--source include/max_indexes.inc
+
+if (`SELECT "$max_indexes" NOT REGEXP "^64U?\$"`) {
+ --skip Test needs mysqld built with --with-max-indexes=64U
+}
diff --git a/mysql-test/include/have_multi_ndb.inc b/mysql-test/include/have_multi_ndb.inc
deleted file mode 100644
index 8dbfa2aa034..00000000000
--- a/mysql-test/include/have_multi_ndb.inc
+++ /dev/null
@@ -1,52 +0,0 @@
-# Setup connections to both MySQL Servers connected to the cluster
-connect (server1,127.0.0.1,root,,test,$MASTER_MYPORT,);
-connect (server2,127.0.0.1,root,,test,$MASTER_MYPORT1,);
-
-# Check that server1 has NDB support
-connection server1;
-let $engines_table= query_get_value(SHOW TABLES FROM information_schema LIKE 'ENGINES', Tables_in_information_schema (ENGINES), 1);
-disable_query_log;
-if (`SELECT 1 FROM dual WHERE '$engines_table' = 'engines'`)
-{
---require r/true.require
-SELECT (support = 'YES' or support = 'DEFAULT' or support = 'ENABLED') as `TRUE` FROM information_schema.engines WHERE engine = 'ndbcluster';
---source include/ndb_not_readonly.inc
-}
-enable_query_log;
-
-# Check that server2 has NDB support
-connection server2;
-let $engines_table= query_get_value(SHOW TABLES FROM information_schema LIKE 'ENGINES', Tables_in_information_schema (ENGINES), 1);
-disable_query_log;
-if (`SELECT 1 FROM dual WHERE '$engines_table' = 'engines'`)
-{
---require r/true.require
-SELECT (support = 'YES' or support = 'DEFAULT' or support = 'ENABLED') as `TRUE` FROM information_schema.engines WHERE engine = 'ndbcluster';
---source include/ndb_not_readonly.inc
-}
-enable_query_log;
-
-# cleanup
-
-connection server1;
-disable_query_log;
-disable_warnings;
---error 0,1051
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
-flush tables;
-flush status;
-enable_warnings;
-enable_query_log;
-
-connection server2;
-disable_query_log;
-disable_warnings;
---error 0,1051
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
-flush tables;
-flush status;
-enable_warnings;
-enable_query_log;
-
-# Set the default connection
-connection server1;
diff --git a/mysql-test/include/have_mutex_deadlock_detector.inc b/mysql-test/include/have_mutex_deadlock_detector.inc
index 3672f3eccef..88a7484a3e8 100644
--- a/mysql-test/include/have_mutex_deadlock_detector.inc
+++ b/mysql-test/include/have_mutex_deadlock_detector.inc
@@ -1,4 +1,3 @@
---require r/have_mutex_deadlock_detector.require
-disable_query_log;
-select 1 from information_schema.global_variables where variable_name = "mutex_deadlock_detector";
-enable_query_log;
+if (`select count(*)=0 from information_schema.global_variables where variable_name = "debug_mutex_deadlock_detector"`) {
+ skip needs safemutex deadlock detector;
+}
diff --git a/mysql-test/include/have_ndb.inc b/mysql-test/include/have_ndb.inc
deleted file mode 100644
index 1266f80c8cd..00000000000
--- a/mysql-test/include/have_ndb.inc
+++ /dev/null
@@ -1,2 +0,0 @@
-# Check that server is compiled and started with support for NDB
---source include/have_multi_ndb.inc
diff --git a/mysql-test/include/have_ndb_extra.inc b/mysql-test/include/have_ndb_extra.inc
deleted file mode 100644
index 4837a7ad4ea..00000000000
--- a/mysql-test/include/have_ndb_extra.inc
+++ /dev/null
@@ -1,2 +0,0 @@
--- require r/have_ndb_extra.require
-eval select $NDB_EXTRA_TEST;
diff --git a/mysql-test/include/have_ndbapi_examples.inc b/mysql-test/include/have_ndbapi_examples.inc
deleted file mode 100644
index 88499d555c0..00000000000
--- a/mysql-test/include/have_ndbapi_examples.inc
+++ /dev/null
@@ -1,4 +0,0 @@
---require r/have_ndbapi_examples.require
-disable_query_log;
-eval select LENGTH('$NDB_EXAMPLES_BINARY') > 0 as 'have_ndb_example';
-enable_query_log;
diff --git a/mysql-test/include/have_sequence.inc b/mysql-test/include/have_sequence.inc
new file mode 100644
index 00000000000..b509d605177
--- /dev/null
+++ b/mysql-test/include/have_sequence.inc
@@ -0,0 +1,4 @@
+if (`SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.ENGINES WHERE engine = 'sequence' AND support IN ('YES', 'DEFAULT', 'ENABLED')`)
+{
+ --skip Test requires Sequence engine
+}
diff --git a/mysql-test/include/have_sequence.opt b/mysql-test/include/have_sequence.opt
new file mode 100644
index 00000000000..d08d8f112cd
--- /dev/null
+++ b/mysql-test/include/have_sequence.opt
@@ -0,0 +1 @@
+--loose-sequence
diff --git a/mysql-test/include/have_wsrep.inc b/mysql-test/include/have_wsrep.inc
new file mode 100644
index 00000000000..52220edf481
--- /dev/null
+++ b/mysql-test/include/have_wsrep.inc
@@ -0,0 +1,8 @@
+# To be used in a test which requires server to be compiled with wsrep support
+# (-DWITH_WSREP=ON) and wsrep plugin is ACTIVE.
+
+if (`SELECT COUNT(*)=0 FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME = 'wsrep' AND PLUGIN_STATUS='ACTIVE'`)
+{
+ --skip Test requires wsrep plugin.
+}
+
diff --git a/mysql-test/include/have_wsrep_enabled.inc b/mysql-test/include/have_wsrep_enabled.inc
new file mode 100644
index 00000000000..94eccadec3b
--- /dev/null
+++ b/mysql-test/include/have_wsrep_enabled.inc
@@ -0,0 +1,11 @@
+# To be used in a test which requires wsrep plugin to be ACTIVE and enabled
+# (i.e. wsrep_on=ON). It includes have_wsrep.inc.
+
+--source include/have_wsrep.inc
+--source include/have_innodb.inc
+
+if (`SELECT COUNT(*)=0 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME = 'wsrep_on' AND VARIABLE_VALUE='ON'`)
+{
+ --skip Test requires wsrep_on=ON
+}
+
diff --git a/mysql-test/include/have_wsrep_provider.inc b/mysql-test/include/have_wsrep_provider.inc
new file mode 100644
index 00000000000..818abdd43b0
--- /dev/null
+++ b/mysql-test/include/have_wsrep_provider.inc
@@ -0,0 +1,6 @@
+if (`SELECT COUNT(*)=0 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE
+ VARIABLE_NAME LIKE 'wsrep_provider' AND VARIABLE_VALUE NOT LIKE 'none'`)
+{
+ --skip Test requires wsrep provider library (libgalera_smm.so)
+}
+
diff --git a/mysql-test/include/have_xtradb.combinations b/mysql-test/include/have_xtradb.combinations
index 20e07c62635..0419dc91171 100644
--- a/mysql-test/include/have_xtradb.combinations
+++ b/mysql-test/include/have_xtradb.combinations
@@ -4,10 +4,10 @@ plugin-load-add=$HA_XTRADB_SO
innodb
innodb-cmpmem
innodb-trx
-innodb-sys-index
+innodb-sys-indexes
[xtradb]
innodb
innodb-cmpmem
innodb-trx
-innodb-sys-index
+innodb-sys-indexes
diff --git a/mysql-test/include/icp_tests.inc b/mysql-test/include/icp_tests.inc
index 7c9feea55c2..88d6923d8f9 100644
--- a/mysql-test/include/icp_tests.inc
+++ b/mysql-test/include/icp_tests.inc
@@ -443,13 +443,13 @@ DROP TABLE t1;
--echo # when ICP is on"
--echo #
-CREATE TABLE t1 (pk INTEGER PRIMARY KEY, i INTEGER NOT NULL) ENGINE=InnoDB;
+CREATE TABLE t1 (pk INTEGER PRIMARY KEY, i INTEGER NOT NULL);
INSERT INTO t1 VALUES (11,0);
INSERT INTO t1 VALUES (12,5);
INSERT INTO t1 VALUES (15,0);
-CREATE TABLE t2 (pk INTEGER PRIMARY KEY, i INTEGER NOT NULL) ENGINE=InnoDB;
+CREATE TABLE t2 (pk INTEGER PRIMARY KEY, i INTEGER NOT NULL);
INSERT INTO t2 VALUES (11,1);
INSERT INTO t2 VALUES (12,2);
@@ -639,6 +639,16 @@ SELECT t1.d1, t2.pk, t2.i1 FROM t1 STRAIGHT_JOIN t2 ON t2.i1
SELECT t1.d1, t2.pk, t2.i1 FROM t1 STRAIGHT_JOIN t2 ON t2.i1
WHERE t2.pk <> t1.d1 AND t2.pk = 4;
+# MDEV-8189 field<>const and const<>field are not symmetric
+# Do the same EXPLAIN and SELECT
+# with "t1.d1 <> t2.pk" instead of "t2.pk <> t1.d1"
+
+EXPLAIN
+SELECT t1.d1, t2.pk, t2.i1 FROM t1 STRAIGHT_JOIN t2 ON t2.i1
+ WHERE t1.d1 <> t2.pk AND t2.pk = 4;
+SELECT t1.d1, t2.pk, t2.i1 FROM t1 STRAIGHT_JOIN t2 ON t2.i1
+ WHERE t1.d1 <> t2.pk AND t2.pk = 4;
+
DROP TABLE t1, t2;
--echo #
diff --git a/mysql-test/include/loaddata_autocom.inc b/mysql-test/include/loaddata_autocom.inc
index bb286fb4169..3bf88fefa6d 100644
--- a/mysql-test/include/loaddata_autocom.inc
+++ b/mysql-test/include/loaddata_autocom.inc
@@ -1,5 +1,4 @@
# Test if the engine does autocommit in LOAD DATA INFILE, or not
-# (NDB wants to do, others don't).
eval SET SESSION STORAGE_ENGINE = $engine_type;
@@ -9,8 +8,6 @@ drop table if exists t1;
let $load_file= $MYSQLTEST_VARDIR/std_data/loaddata2.dat;
-# NDB does not support the create option 'Binlog of table with BLOB attribute and no PK'
-# So use a dummy PK here.
create table t1 (id int unsigned not null auto_increment primary key, a text, b text);
start transaction;
--replace_result $load_file LOAD_FILE
diff --git a/mysql-test/include/maria_verify_recovery.inc b/mysql-test/include/maria_verify_recovery.inc
index 9b56061b2b4..b0f95d2a94b 100644
--- a/mysql-test/include/maria_verify_recovery.inc
+++ b/mysql-test/include/maria_verify_recovery.inc
@@ -78,6 +78,8 @@ let $mms_purpose=comparison;
let $mms_compare_physically=$mms_compare_physically_save;
while ($mms_table_to_use)
{
+ # the size of the index file is different for with/without encryption
+ --replace_result 372 <SIZE> 394 <SIZE>
eval check table $mms_tname$mms_table_to_use extended;
--echo * testing that checksum after recovery is as expected
let $new_checksum=`CHECKSUM TABLE $mms_tname$mms_table_to_use`;
diff --git a/mysql-test/include/max_indexes.inc b/mysql-test/include/max_indexes.inc
new file mode 100644
index 00000000000..ce233b9fb67
--- /dev/null
+++ b/mysql-test/include/max_indexes.inc
@@ -0,0 +1,2 @@
+# Warning: This is an auto-generated file. Please do not modify it.
+--let $max_indexes = 64U
diff --git a/mysql-test/include/mix2.inc b/mysql-test/include/mix2.inc
index d6becb2e37e..cdc39f8407f 100644
--- a/mysql-test/include/mix2.inc
+++ b/mysql-test/include/mix2.inc
@@ -500,7 +500,7 @@ drop table t1;
# Test of opening table twice and timestamps
#
set @a:=now();
-eval CREATE TABLE t1 (a int not null, b timestamp not null, primary key (a)) engine=$engine_type;
+eval CREATE TABLE t1 (a int not null, b timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, primary key (a)) engine=$engine_type;
insert into t1 (a) values(1),(2),(3);
select t1.a from t1 natural join t1 as t2 where t1.b >= @a order by t1.a;
select a from t1 natural join t1 as t2 where b >= @a order by a;
@@ -727,9 +727,9 @@ eval CREATE TABLE t1 (
cname char(15) NOT NULL default '',
carrier_id smallint(6) NOT NULL default '0',
privacy tinyint(4) NOT NULL default '0',
- last_mod_date timestamp NOT NULL,
+ last_mod_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
last_mod_id smallint(6) NOT NULL default '0',
- last_app_date timestamp NOT NULL,
+ last_app_date timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
last_app_id smallint(6) default '-1',
version smallint(6) NOT NULL default '0',
assigned_scps int(11) default '0',
@@ -746,9 +746,9 @@ eval CREATE TABLE t2 (
cname char(15) NOT NULL default '',
carrier_id smallint(6) NOT NULL default '0',
privacy tinyint(4) NOT NULL default '0',
- last_mod_date timestamp NOT NULL,
+ last_mod_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
last_mod_id smallint(6) NOT NULL default '0',
- last_app_date timestamp NOT NULL,
+ last_app_date timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
last_app_id smallint(6) default '-1',
version smallint(6) NOT NULL default '0',
assigned_scps int(11) default '0',
diff --git a/mysql-test/include/mtr_check.sql b/mysql-test/include/mtr_check.sql
index e34e32ad1a6..e54041da1bc 100644
--- a/mysql-test/include/mtr_check.sql
+++ b/mysql-test/include/mtr_check.sql
@@ -47,7 +47,7 @@ BEGIN
-- Show "mysql" database, tables and columns
SELECT CONCAT(table_schema, '.', table_name) AS tables_in_mysql
FROM INFORMATION_SCHEMA.TABLES
- WHERE table_schema='mysql' AND table_name != 'ndb_apply_status'
+ WHERE table_schema='mysql'
ORDER BY tables_in_mysql;
SELECT CONCAT(table_schema, '.', table_name) AS columns_in_mysql,
column_name, ordinal_position, column_default, is_nullable,
@@ -55,7 +55,7 @@ BEGIN
numeric_precision, numeric_scale, character_set_name,
collation_name, column_type, column_key, extra, column_comment
FROM INFORMATION_SCHEMA.COLUMNS
- WHERE table_schema='mysql' AND table_name != 'ndb_apply_status'
+ WHERE table_schema='mysql'
ORDER BY columns_in_mysql;
-- Dump all events, there should be none
diff --git a/mysql-test/include/mtr_warnings.sql b/mysql-test/include/mtr_warnings.sql
index 345968cd3f0..1ee0658204d 100644
--- a/mysql-test/include/mtr_warnings.sql
+++ b/mysql-test/include/mtr_warnings.sql
@@ -115,9 +115,6 @@ INSERT INTO global_suppressions VALUES
("unknown variable 'loose-"),
("You have forced lower_case_table_names to 0 through a command-line option"),
("Setting lower_case_table_names=2"),
- ("NDB Binlog:"),
- ("NDB: failed to setup table"),
- ("NDB: only row based binary logging"),
("Neither --relay-log nor --relay-log-index were used"),
("Query partially completed"),
("Slave I.O thread aborted while waiting for relay log"),
@@ -139,7 +136,6 @@ INSERT INTO global_suppressions VALUES
("Slave: The incident LOST_EVENTS occured on the master"),
("Slave: Unknown error.* 1105"),
("Slave: Can't drop database.* database doesn't exist"),
- ("Time-out in NDB"),
("Warning:\s+One can only use the --user.*root"),
("Warning:\s+Table:.* on (delete|rename)"),
("You have an error in your SQL syntax"),
@@ -169,6 +165,9 @@ INSERT INTO global_suppressions VALUES
("The slave I.O thread stops because a fatal error is encountered when it try to get the value of SERVER_ID variable from master."),
+ /*It will print a warning if server is run without --explicit_defaults_for_timestamp.*/
+ ("TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details)*"),
+
/* Added 2009-08-XX after fixing Bug #42408 */
("Although a path was specified for the .* option, log tables are used"),
diff --git a/mysql-test/include/ndb_backup.inc b/mysql-test/include/ndb_backup.inc
deleted file mode 100644
index eef3bf2bd1e..00000000000
--- a/mysql-test/include/ndb_backup.inc
+++ /dev/null
@@ -1,48 +0,0 @@
-######################################################
-# By JBM 2006-02-16 So that the code is not repeated #
-# in test cases and can be reused. #
-######################################################
-
---exec $NDB_MGM --no-defaults --ndb-connectstring="$NDB_CONNECTSTRING" -e "start backup" >> $NDB_TOOLS_OUTPUT
-
-# To find the backupid, we must dump this data to a table, and SELECT
-# what we want into an outfile. This could be accomplished with grep, but
-# grep isn't Windows-portable
-
---disable_query_log
-# create a table to help us out
---disable_warnings # leave this on until done with the entire process
-# cleanup
-DROP TABLE IF EXISTS helper1;
-CREATE TABLE helper1(c1 VARCHAR(20));
-# dump raw data to file
-let $ndb_backup_file1= $MYSQLTEST_VARDIR/ndb_backup_tmp.dat;
-let $ndb_backup_file2= $MYSQLTEST_VARDIR/tmp.dat;
---disable_warnings
---error 0,1
---remove_file $ndb_backup_file1
---enable_warnings
---exec $NDB_TOOLS_DIR/ndb_select_all --ndb-connectstring="$NDB_CONNECTSTRING" -d sys --delimiter=',' SYSTAB_0 > $ndb_backup_file1
-# load the table from the raw data file
-eval LOAD DATA INFILE '$ndb_backup_file1' INTO TABLE helper1;
---remove_file $ndb_backup_file1
-# output what we need
-eval SELECT * FROM helper1 WHERE c1 LIKE '%520093696%'
-INTO OUTFILE '$ndb_backup_file2';
-# cleanup
-DROP TABLE helper1;
---enable_warnings
---enable_query_log
-
-CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info
-(id INT, backup_id INT) ENGINE = MEMORY;
-
---replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
-eval LOAD DATA INFILE '$ndb_backup_file2' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
---remove_file $ndb_backup_file2
-
-# Load backup id into environment variable
-let the_backup_id=`SELECT backup_id from test.backup_info`;
-
-DROP TABLE test.backup_info;
-
diff --git a/mysql-test/include/ndb_backup_print.inc b/mysql-test/include/ndb_backup_print.inc
deleted file mode 100644
index 69faa8f421b..00000000000
--- a/mysql-test/include/ndb_backup_print.inc
+++ /dev/null
@@ -1,9 +0,0 @@
---exec $NDB_TOOLS_DIR/ndb_restore --no-defaults $ndb_restore_opts -b $the_backup_id -n 1 $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id $ndb_restore_filter > $MYSQLTEST_VARDIR/tmp/tmp.dat
---exec $NDB_TOOLS_DIR/ndb_restore --no-defaults $ndb_restore_opts -b $the_backup_id -n 2 $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id $ndb_restore_filter >> $MYSQLTEST_VARDIR/tmp/tmp.dat
---exec sort $MYSQLTEST_VARDIR/tmp/tmp.dat
---disable_warnings
---error 0,1
---remove_file $MYSQLTEST_VARDIR/tmp/tmp.dat
---enable_warnings
---let ndb_restore_opts=
---let ndb_restore_filter=
diff --git a/mysql-test/include/ndb_default_cluster.inc b/mysql-test/include/ndb_default_cluster.inc
deleted file mode 100644
index de7eda3c596..00000000000
--- a/mysql-test/include/ndb_default_cluster.inc
+++ /dev/null
@@ -1,4 +0,0 @@
--- require r/ndb_default_cluster.require
-disable_query_log;
-show status like "Ndb_config_from_host";
-enable_query_log;
diff --git a/mysql-test/include/ndb_master-slave.inc b/mysql-test/include/ndb_master-slave.inc
deleted file mode 100644
index 8305a310953..00000000000
--- a/mysql-test/include/ndb_master-slave.inc
+++ /dev/null
@@ -1,12 +0,0 @@
---source include/master-slave.inc
-
-connection slave;
-# Check that server is compiled and started with support for NDB
-disable_query_log;
---require r/true.require
-select (support = 'YES' or support = 'DEFAULT') as `TRUE` from information_schema.engines where engine = 'ndbcluster';
---source include/ndb_not_readonly.inc
-enable_query_log;
-
-# Set the default connection to 'master'
-connection master;
diff --git a/mysql-test/include/ndb_master-slave_2ch.inc b/mysql-test/include/ndb_master-slave_2ch.inc
deleted file mode 100644
index 17017d2b801..00000000000
--- a/mysql-test/include/ndb_master-slave_2ch.inc
+++ /dev/null
@@ -1,67 +0,0 @@
-# ==== Purpose ====
-#
-# Set up circular cluster replication where each
-# cluster has two mysqlds and replication directions are
-# following:
-# master ---> slave
-# / \
-# cluster A cluster B
-# \ /
-# master1 <--- slave1
-#
-# ==== Usage ====
-#
-# [--let $rpl_server_count= N]
-# [--let $rpl_skip_check_server_ids= 1]
-# [--let $rpl_skip_reset_master_and_slave= 1]
-# [--let $rpl_skip_change_master= 1]
-# [--let $rpl_skip_start_slave= 1]
-# [--let $rpl_debug= 1]
-# [--let $slave_timeout= NUMBER]
-# --source include/ndb_master-slave_2ch.inc
-#
-# Parameters:
-# $rpl_server_count, $rpl_skip_check_server_ids,
-# $rpl_skip_reset_master_and_slave, $rpl_skip_change_master,
-# $rpl_skip_start_slave, $rpl_debug, $slave_timeout
-# See include/master-slave.inc
-
---let $rpl_topology= 1->2,4->3
---let $rpl_skip_check_server_ids= 1
---source include/rpl_init.inc
-
-# Make connections to mysqlds
-
---let $rpl_connection_name= master
---let $rpl_server_number= 1
---source include/rpl_connect.inc
-
---let $rpl_connection_name= master1
---let $rpl_server_number= 1
---source include/rpl_connect.inc
-
---let $rpl_connection_name= slave
---let $rpl_server_number= 2
---source include/rpl_connect.inc
-
---let $rpl_connection_name= slave1
---let $rpl_server_number= 2
---source include/rpl_connect.inc
-
-
-# Check that all mysqld are compiled with ndb support
---let $_rpl_server= 4
-while ($_rpl_server)
-{
- --connection server_$_rpl_server
- if (`SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.ENGINES WHERE engine = 'ndbcluster' AND (support = 'YES' OR support = 'DEFAULT')`)
- {
- --skip Test requires NDB.
- }
- --source include/ndb_not_readonly.inc
- --dec $_rpl_server
-}
-
-
-# Set the default connection to 'master' (cluster A)
-connection master;
diff --git a/mysql-test/include/ndb_not_readonly.inc b/mysql-test/include/ndb_not_readonly.inc
deleted file mode 100644
index ebb343bb18d..00000000000
--- a/mysql-test/include/ndb_not_readonly.inc
+++ /dev/null
@@ -1,36 +0,0 @@
-# Check that server has come out ot readonly mode
-#
-# wait for server to connect properly to cluster
-#
-
---disable_query_log
-
-set @saved_log = @@sql_log_bin;
-set sql_log_bin = 0;
---error 0,ER_NO_SUCH_TABLE,ER_OPEN_AS_READONLY,ER_GET_ERRMSG,ER_KEY_NOT_FOUND
-delete from mysql.ndb_apply_status where server_id=0;
-let $mysql_errno= 1;
-let $counter= 600;
-while ($mysql_errno)
-{
- # Table is readonly until the mysqld has connected properly
- --error 0,ER_NO_SUCH_TABLE,ER_OPEN_AS_READONLY,ER_GET_ERRMSG
- replace into mysql.ndb_apply_status values(0,0,"",0,0);
- if ($mysql_errno)
- {
- if (!$counter)
- {
- die Failed while waiting for mysqld to come out of readonly mode;
- }
- dec $counter;
- --sleep 0.1
- }
-}
-delete from mysql.ndb_apply_status where server_id=0;
-set sql_log_bin = @saved_log;
-
---enable_query_log
-
-#
-# connected
-#
diff --git a/mysql-test/include/ndb_restore_master.inc b/mysql-test/include/ndb_restore_master.inc
deleted file mode 100644
index ae5f055b442..00000000000
--- a/mysql-test/include/ndb_restore_master.inc
+++ /dev/null
@@ -1,8 +0,0 @@
-######################################################
-# By JBM 2006-02-16 So that the code is not repeated #
-# in test cases and can be reused. #
-######################################################
-
---exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="$NDB_CONNECTSTRING" -p 8 -b $the_backup_id -n 1 -m -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
-
---exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="$NDB_CONNECTSTRING" -p 8 -b $the_backup_id -n 2 -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
diff --git a/mysql-test/include/ndb_restore_slave_eoption.inc b/mysql-test/include/ndb_restore_slave_eoption.inc
deleted file mode 100644
index a8657f68c8d..00000000000
--- a/mysql-test/include/ndb_restore_slave_eoption.inc
+++ /dev/null
@@ -1,11 +0,0 @@
-######################################################
-# By JBM 2006-03-08 So that the code is not repeated #
-# in test cases and can be reused. #
-######################################################
-
---exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="$NDB_CONNECTSTRING_SLAVE" -p 8 -b $the_backup_id -n 1 -m -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
-
---exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="$NDB_CONNECTSTRING_SLAVE" -p 8 -b $the_backup_id -n 2 -r -e --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
-
-
-
diff --git a/mysql-test/include/ndb_setup_slave.inc b/mysql-test/include/ndb_setup_slave.inc
deleted file mode 100644
index 5ee55150550..00000000000
--- a/mysql-test/include/ndb_setup_slave.inc
+++ /dev/null
@@ -1,27 +0,0 @@
-#
-# now setup replication to continue from last epoch
-# 1. get ndb_apply_status epoch from slave
-# 2. get corresponding _next_ binlog postition from master
-# 3. change master on slave
-
-# 1.
---connection slave
---replace_column 1 <the_epoch>
-SELECT @the_epoch:=MAX(epoch) FROM mysql.ndb_apply_status;
---let $the_epoch= `select @the_epoch`
-
-# 2.
---connection master
---replace_result $the_epoch <the_epoch>
---replace_column 1 <the_pos>
-eval SELECT @the_pos:=Position,@the_file:=SUBSTRING_INDEX(FILE, '/', -1)
- FROM mysql.ndb_binlog_index WHERE epoch > $the_epoch ORDER BY epoch ASC LIMIT 1;
---let $the_pos= `SELECT @the_pos`
---let $the_file= `SELECT @the_file`
-
-# 3.
---connection slave
---replace_result $the_pos <the_pos>
-eval CHANGE MASTER TO
- master_log_file = '$the_file',
- master_log_pos = $the_pos ;
diff --git a/mysql-test/include/ndb_wait_connected.inc b/mysql-test/include/ndb_wait_connected.inc
deleted file mode 100644
index cfea94db1f1..00000000000
--- a/mysql-test/include/ndb_wait_connected.inc
+++ /dev/null
@@ -1,26 +0,0 @@
-# Check that mysqld has reconnected to ndbd after
-# restart of ndbd
-#
---disable_query_log
---disable_result_log
-let $mysql_errno= 1;
-let $counter= 600;
-while ($mysql_errno)
-{
- --error 0,157
- CREATE TABLE ndb_wait_connected (a int primary key);
- if ($mysql_errno)
- {
- if (!$counter)
- {
- die Failed waiting for mysqld to reconnect to ndbd;
- }
- dec $counter;
- --sleep 0.1
- }
-}
-DROP TABLE ndb_wait_connected;
---enable_query_log
---enable_result_log
-
-
diff --git a/mysql-test/include/not_encrypted.inc b/mysql-test/include/not_encrypted.inc
new file mode 100644
index 00000000000..2702fb3d8f0
--- /dev/null
+++ b/mysql-test/include/not_encrypted.inc
@@ -0,0 +1,4 @@
+if (`select @@innodb_encrypt_tables = 1`)
+{
+ skip only without encryption;
+}
diff --git a/mysql-test/include/not_ndb.inc b/mysql-test/include/not_ndb.inc
deleted file mode 100644
index 965538c20a7..00000000000
--- a/mysql-test/include/not_ndb.inc
+++ /dev/null
@@ -1,7 +0,0 @@
--- require r/not_ndb.require
-disable_query_log;
-# so that both DISABLED and NO is output as NO
--- replace_result DISABLED NO
-show variables like "have_ndbcluster";
-enable_query_log;
-
diff --git a/mysql-test/include/not_ndb_default.inc b/mysql-test/include/not_ndb_default.inc
deleted file mode 100644
index 682a2944171..00000000000
--- a/mysql-test/include/not_ndb_default.inc
+++ /dev/null
@@ -1,4 +0,0 @@
---require r/not_ndb_default.require
-disable_query_log;
-select convert(@@storage_engine using latin1) NOT IN ("ndbcluster","NDBCLUSTER") as "TRUE";
-enable_query_log;
diff --git a/mysql-test/include/ps_create.inc b/mysql-test/include/ps_create.inc
index b2a6fc4b920..91528e2a9a1 100644
--- a/mysql-test/include/ps_create.inc
+++ b/mysql-test/include/ps_create.inc
@@ -33,7 +33,8 @@ eval create table t9
c1 tinyint, c2 smallint, c3 mediumint, c4 int,
c5 integer, c6 bigint, c7 float, c8 double,
c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4),
- c13 date, c14 datetime, c15 timestamp, c16 time,
+ c13 date, c14 datetime, c15 timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
+ ON UPDATE CURRENT_TIMESTAMP, c16 time,
c17 year, c18 tinyint, c19 bool, c20 char,
c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext,
c25 blob, c26 text, c27 mediumblob, c28 mediumtext,
diff --git a/mysql-test/include/ps_query.inc b/mysql-test/include/ps_query.inc
index 8148935cbe1..bae83c72c73 100644
--- a/mysql-test/include/ps_query.inc
+++ b/mysql-test/include/ps_query.inc
@@ -428,7 +428,6 @@ execute stmt1 using @arg01, @arg02;
prepare stmt1 from ' select a, b FROM t1 outer_table where
a = (select a from t1 where b = outer_table.b ) order by a ';
# also Bug#4000 (only BDB tables)
-# Bug#4106 : ndb table, query with correlated subquery, wrong result
execute stmt1 ;
# test case derived from client_test.c: test_subqueries_ref
let $1= 3 ;
@@ -768,6 +767,7 @@ select '------ explain select tests ------' as test_sequence ;
# table with many column types
prepare stmt1 from ' explain select * from t9 ' ;
--enable_metadata
+--replace_result 4096 4_OR_8_K 8192 4_OR_8_K
execute stmt1;
--disable_metadata
diff --git a/mysql-test/include/query_cache.inc b/mysql-test/include/query_cache.inc
index 29a82f112c3..56dae83db2f 100644
--- a/mysql-test/include/query_cache.inc
+++ b/mysql-test/include/query_cache.inc
@@ -15,6 +15,8 @@
# main code went into include/query_cache.inc
#
+SET global query_cache_type=ON;
+SET local query_cache_type=ON;
eval SET SESSION STORAGE_ENGINE = $engine_type;
# Initialise
@@ -193,3 +195,5 @@ disconnect connection1;
connection default;
set @@global.query_cache_size = @save_query_cache_size;
drop table t2;
+
+SET global query_cache_type=default;
diff --git a/mysql-test/include/query_cache_partitions.inc b/mysql-test/include/query_cache_partitions.inc
index e5bb7406c10..c69356f907d 100644
--- a/mysql-test/include/query_cache_partitions.inc
+++ b/mysql-test/include/query_cache_partitions.inc
@@ -4,6 +4,8 @@
# $engine_type -- storage engine to be tested
# have to be set before sourcing this script.
+SET global query_cache_type=ON;
+SET local query_cache_type=ON;
eval SET SESSION STORAGE_ENGINE = $engine_type;
# Initialise
@@ -124,3 +126,4 @@ show status like "Qcache_hits";
drop table t1;
set @@global.query_cache_size = @save_query_cache_size;
+SET global query_cache_type=default;
diff --git a/mysql-test/include/query_cache_sql_prepare.inc b/mysql-test/include/query_cache_sql_prepare.inc
index 769cd535f37..41276ed5a79 100644
--- a/mysql-test/include/query_cache_sql_prepare.inc
+++ b/mysql-test/include/query_cache_sql_prepare.inc
@@ -20,6 +20,8 @@
--source include/have_query_cache.inc
# embedded can't make more than one connection, which this test needs
-- source include/not_embedded.inc
+set GLOBAL query_cache_type=ON;
+set LOCAL query_cache_type=ON;
--echo ---- establish connection con1 (root) ----
connect (con1,localhost,root,,test,$MASTER_MYPORT,);
@@ -528,3 +530,4 @@ drop table t1;
set @@global.query_cache_size=@initial_query_cache_size;
flush status; # reset Qcache status variables for next tests
+set GLOBAL query_cache_type=default;
diff --git a/mysql-test/include/restart_mysqld.inc b/mysql-test/include/restart_mysqld.inc
index 71efb141917..dcaf47c55a2 100644
--- a/mysql-test/include/restart_mysqld.inc
+++ b/mysql-test/include/restart_mysqld.inc
@@ -35,7 +35,14 @@ if ($shutdown_timeout == 0)
shutdown_server $server_shutdown_timeout;
# Write file to make mysql-test-run.pl start up the server again
---exec echo "restart" > $_expect_file_name
+if ($restart_parameters)
+{
+ --exec echo "restart: $restart_parameters" > $_expect_file_name
+}
+if (!$restart_parameters)
+{
+ --exec echo "restart" > $_expect_file_name
+}
# Turn on reconnect
--enable_reconnect
diff --git a/mysql-test/include/rpl_init.inc b/mysql-test/include/rpl_init.inc
index 09569fc2b57..4ee4cccdc20 100644
--- a/mysql-test/include/rpl_init.inc
+++ b/mysql-test/include/rpl_init.inc
@@ -35,9 +35,7 @@
# (It is allowed, but not required, to configure SERVER_MYPORT_1
# and SERVER_MYPORT_2 too. If these variables are not set, the
# variables MASTER_MYPORT and SLAVE_MYPORT, configured in the
-# default my.cnf used by the rpl and rpl_ndb suites, are used
-# instead. In addition, in the rpl_ndb suite, SERVER_MYPORT_3 is
-# not needed since MASTER_MYPORT1 can be used instead.)
+# default my.cnf used by the rpl suite, are used instead.)
#
# 2. Execute the following near the top of the test:
#
@@ -124,18 +122,6 @@ if (!$SERVER_MYPORT_2)
{
--let SERVER_MYPORT_2= $SLAVE_MYPORT
}
-# Allow $MASTER_MYPORT1 as alias for $SERVER_MYPORT_3
-# (this alias is used by rpl_ndb tests)
-if (!$SERVER_MYPORT_3)
-{
- --let SERVER_MYPORT_3= $MASTER_MYPORT1
-}
-# Allow $SLAVE_MYPORT1 as alias for $SERVER_MYPORT_4
-# (this alias is used by rpl_ndb tests)
-if (!$SERVER_MYPORT_4)
-{
- --let SERVER_MYPORT_4= $SLAVE_MYPORT1
-}
# Check that $rpl_server_count is set
if (!$rpl_server_count)
{
diff --git a/mysql-test/include/rpl_multi_engine2.inc b/mysql-test/include/rpl_multi_engine2.inc
index e683a1d5838..24154220cb0 100644
--- a/mysql-test/include/rpl_multi_engine2.inc
+++ b/mysql-test/include/rpl_multi_engine2.inc
@@ -72,10 +72,6 @@ ORDER BY id;
connection master;
--echo --- Remove a record from t1 on master ---
-# Note: there is an error in replication of Delete_row
-# from NDB to MyISAM (BUG#28538). However, if there is
-# only one row in Delete_row event then it works fine,
-# as this test demonstrates.
DELETE FROM t1 WHERE id = 412;
--echo --- Show current count on master for t1 ---
diff --git a/mysql-test/include/rpl_row_img_general_loop.inc b/mysql-test/include/rpl_row_img_general_loop.inc
new file mode 100644
index 00000000000..3c7749e5135
--- /dev/null
+++ b/mysql-test/include/rpl_row_img_general_loop.inc
@@ -0,0 +1,42 @@
+#
+# This is a helper script for rpl_row_img.test. It creates
+# all combinations MyISAM / InnoDB in a three server replication
+# chain. Each engine combination is tested against the current
+# seetings for binlog_row_image (on each server).
+#
+# The test script that is executed on every combination is the
+# only argument to this wrapper script. See below.
+#
+# This script takes one parameter:
+# - $row_img_test_script
+# the name of the test script to include in every combination
+#
+# Sample usage:
+# -- let $row_img_test_script= extra/rpl_tests/rpl_row_img.test
+# -- source include/rpl_row_img_general_loop.test
+
+
+-- let $engine_type_a= 2
+-- let $server_1_engine= MyISAM
+while($engine_type_a)
+{
+ -- let $engine_type_b= 2
+ -- let $server_2_engine= MyISAM
+ while($engine_type_b)
+ {
+ -- let $engine_type_c= 2
+ -- let $server_3_engine= MyISAM
+ while($engine_type_c)
+ {
+ -- echo ### engines: $server_1_engine, $server_2_engine, $server_3_engine
+ -- source $row_img_test_script
+
+ -- let $server_3_engine= InnoDB
+ -- dec $engine_type_c
+ }
+ -- let $server_2_engine= InnoDB
+ -- dec $engine_type_b
+ }
+ -- let $server_1_engine= InnoDB
+ -- dec $engine_type_a
+}
diff --git a/mysql-test/include/rpl_row_img_set.inc b/mysql-test/include/rpl_row_img_set.inc
new file mode 100644
index 00000000000..d998c3f1d6c
--- /dev/null
+++ b/mysql-test/include/rpl_row_img_set.inc
@@ -0,0 +1,55 @@
+#
+# This is an auxiliar script that sets the binlog-row-image
+# on a set of connections. These connections are passed as
+# a parameter to this script. Its format is the following:
+#
+# <conid,value,Y_or_N>:[<conid,value,Y_or_N>:...]
+#
+# In detail:
+#
+# conid -- connection id (eg, master)
+# value -- binlog_row_image value to set (eg, FULL)
+# Y_or_N -- Issue stop and start slave (eg, Y)
+#
+# Sample usage:
+#
+# -- let $row_img_set=master:FULL:N,slave:MINIMAL:Y
+# -- source include/rpl_row_img_set.inc
+#
+# Notes:
+#
+# 1. This script saves and restores the original connection that was
+# in use at the time it was included.
+
+-- let $old_conn= $CURRENT_CONNECTION
+
+while (`SELECT HEX('$row_img_set') != HEX('')`)
+{
+
+ -- let $tuple= `SELECT SUBSTRING_INDEX('$row_img_set', ',', 1)`
+
+ -- let $conn= `SELECT SUBSTRING_INDEX('$tuple', ':', 1)`
+ -- let $rimg= `SELECT SUBSTRING_INDEX(LTRIM(SUBSTRING('$tuple', LENGTH('$conn') + 2)), ':', 1)`
+
+ -- let $is_slave_restart= `SELECT LTRIM(SUBSTRING('$tuple', LENGTH('$conn') + LENGTH('$rimg')+ 3))`
+
+ -- echo CON: '$conn', IMG: '$rimg', RESTART SLAVE: '$is_slave_restart'
+
+ -- connection $conn
+ -- eval SET SESSION binlog_row_image= '$rimg'
+ -- eval SET GLOBAL binlog_row_image= '$rimg'
+
+ if ($is_slave_restart == Y)
+ {
+ -- source include/stop_slave.inc
+ -- source include/start_slave.inc
+ }
+
+ FLUSH TABLES;
+ SHOW VARIABLES LIKE 'binlog_row_image';
+
+ -- let $row_img_set= `SELECT LTRIM(SUBSTRING('$row_img_set', LENGTH('$tuple') + 2 ))`
+
+}
+
+-- connection $old_conn
diff --git a/mysql-test/include/safe_set_to_maybe_ro_var.inc b/mysql-test/include/safe_set_to_maybe_ro_var.inc
deleted file mode 100644
index add7f2091b3..00000000000
--- a/mysql-test/include/safe_set_to_maybe_ro_var.inc
+++ /dev/null
@@ -1,23 +0,0 @@
-# to mask out the error - never abort neither log in result file - in setting
-# to read-only variable.
-# It is assumed that the new value is equal to one the var was set to.
-# Such situation happens particularily with binlog_format that becomes read-only
-# with ndb default storage.
-#
-# when generate results always watch the file to find what is expected,
-# the SET query may fail
-
-# script accepts $maybe_ro_var the var name and $val4var the value
-
-### USAGE:
-### let $maybe_ro_var= ...
-### let $val4var= ...
-### include/safe_set_to_maybe_ro_var.inc
-
---disable_result_log
---disable_abort_on_error
-eval SET $maybe_ro_var = $val4var;
---enable_abort_on_error
---enable_result_log
-
-eval SELECT $maybe_ro_var;
diff --git a/mysql-test/include/search_pattern_in_file.inc b/mysql-test/include/search_pattern_in_file.inc
index 0d09cdcd36e..84237026ed0 100644
--- a/mysql-test/include/search_pattern_in_file.inc
+++ b/mysql-test/include/search_pattern_in_file.inc
@@ -60,12 +60,12 @@
perl;
use strict;
- my $search_file= $ENV{'SEARCH_FILE'} or die "SEARCH_FILE not set";
- my $search_pattern= $ENV{'SEARCH_PATTERN'} or die "SEARCH_PATTERN not set";
- my $search_range= $ENV{'SEARCH_RANGE'};
+ my $search_file= $ENV{'SEARCH_FILE'} or die "SEARCH_FILE not set";
+ my $search_pattern= $ENV{'SEARCH_PATTERN'} or die "SEARCH_PATTERN not set";
+ my $search_range= $ENV{'SEARCH_RANGE'};
my $file_content;
$search_range= 50000 unless $search_range =~ /-?[0-9]+/;
- open(FILE, "$search_file") or die("Unable to open '$search_file': $!\n");
+ open(FILE, '<', $search_file) or die("Unable to open '$search_file': $!\n");
if ($search_range >= 0) {
read(FILE, $file_content, $search_range, 0);
} else {
@@ -75,7 +75,10 @@ perl;
read(FILE, $file_content, -$search_range, 0);
}
close(FILE);
- if ( not $file_content =~ m{$search_pattern} ) {
- die("# ERROR: The file '$search_file' does not contain the expected pattern $search_pattern\n->$file_content<-\n");
+ $search_file =~ s{^.*?([^/\\]+)$}{$1};
+ if ($file_content =~ m{$search_pattern}) {
+ print "FOUND /$search_pattern/ in $search_file\n"
+ } else {
+ print "NOT FOUND /$search_pattern/ in $search_file\n"
}
EOF
diff --git a/mysql-test/include/select_ndb_apply_status.inc b/mysql-test/include/select_ndb_apply_status.inc
deleted file mode 100644
index a676b7cfb06..00000000000
--- a/mysql-test/include/select_ndb_apply_status.inc
+++ /dev/null
@@ -1,13 +0,0 @@
-##################################################
-# Author: Jeb
-# Date: 2007/04
-# Purpose: To select out log name, start and end
-# positions from ndb_apply_status table
-##################################################
---replace_column 1 <log_name> 2 <start_pos> 3 <end_pos>
-select @log_name:=log_name, @start_pos:=start_pos, @end_pos:=end_pos
- from mysql.ndb_apply_status;
---let $start_pos = `select @start_pos`
---let $end_pos = `select @end_pos`
---let $log_name = `select @log_name`
-
diff --git a/mysql-test/include/show_all_slaves_status.inc b/mysql-test/include/show_all_slaves_status.inc
new file mode 100644
index 00000000000..4c96c31ce50
--- /dev/null
+++ b/mysql-test/include/show_all_slaves_status.inc
@@ -0,0 +1,65 @@
+# ==== Usage ====
+#
+# --let $status_items= Column_Name[, Column_Name[, ...]]
+# --source include/show_all_slaves_status.inc
+#
+# Parameters:
+# $status_items
+# Set to the name of the column in the output of SHOW SLAVE STATUS
+# that you want to display. Example:
+#
+# --let $status_items= Master_SSL_Allowed
+#
+# You can show multiple columns by setting $status_items to a
+# comma-separated list. Example:
+#
+# --let $status_items= Master_Log_File, Relay_Master_Log_File
+#
+# $slave_field_result_replace
+# If set, one or more regex patterns for replacing variable
+# text in the error message. Syntax as --replace-regex
+#
+# $slave_sql_mode
+# If set, change the slave sql mode during this macro, reverting
+# to the previous on exit. Default sql_mode is NO_BACKSLASH_ESCAPES
+# to allow replace '\' by '/' making paths OS independent. Example:
+#
+# --let $slave_sql_mode= NO_BACKSLASH_ESCAPES
+#
+
+
+--let $_show_slave_status_items=$status_items
+if (!$status_items)
+{
+ --die Bug in test case: The mysqltest variable $status_items is not set.
+}
+
+
+--let $_slave_sql_mode= NO_BACKSLASH_ESCAPES
+if ($slave_sql_mode)
+{
+ --let $_slave_sql_mode= $slave_sql_mode
+}
+--let $_previous_slave_sql_mode = `SELECT @@sql_mode`
+--disable_query_log
+eval SET sql_mode= '$_slave_sql_mode';
+--enable_query_log
+
+
+while ($_show_slave_status_items)
+{
+ --let $_show_slave_status_name= `SELECT SUBSTRING_INDEX('$_show_slave_status_items', ',', 1)`
+ --let $_show_slave_status_items= `SELECT LTRIM(SUBSTRING('$_show_slave_status_items', LENGTH('$_show_slave_status_name') + 2))`
+
+ --replace_regex /\.[\\\/]master/master/
+ --let $_show_slave_status_value= query_get_value(SHOW ALL SLAVES STATUS, $_show_slave_status_name, 1)
+ --let $_slave_field_result_replace= /[\\\\]/\// $slave_field_result_replace
+ --replace_regex $_slave_field_result_replace
+ --let $_show_slave_status_value= `SELECT REPLACE("$_show_slave_status_value", '$MYSQL_TEST_DIR', 'MYSQL_TEST_DIR')`
+ --echo $_show_slave_status_name = '$_show_slave_status_value'
+}
+
+
+--disable_query_log
+eval SET sql_mode= '$_previous_slave_sql_mode';
+--enable_query_log
diff --git a/mysql-test/include/show_binlog_events2.inc b/mysql-test/include/show_binlog_events2.inc
index b036709b81d..eefefe4bfbe 100644
--- a/mysql-test/include/show_binlog_events2.inc
+++ b/mysql-test/include/show_binlog_events2.inc
@@ -4,7 +4,7 @@ if ($binlog_start)
}
if (!$binlog_start)
{
- --let $_binlog_start=248
+ --let $_binlog_start=249
}
if ($binlog_file)
{
diff --git a/mysql-test/include/show_events.inc b/mysql-test/include/show_events.inc
index 7917b6740cf..368cfc9e3a7 100644
--- a/mysql-test/include/show_events.inc
+++ b/mysql-test/include/show_events.inc
@@ -15,7 +15,19 @@
--let $statement=show BINLOG events
if ($is_relay_log)
{
- --let $statement=show relaylog events
+ if ($master_name)
+ {
+ let _master_name='$master_name';
+ }
+ if (!$master_name)
+ {
+ let _master_name=`select @@default_master_connection`;
+ if ($_master_name)
+ {
+ let _master_name='$_master_name';
+ }
+ }
+ --let $statement=show relaylog $_master_name events
}
if ($binlog_file)
@@ -25,7 +37,7 @@ if ($binlog_file)
{
if ($is_relay_log)
{
- --let $_binlog_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1)
+ --let $_binlog_file= query_get_value(SHOW SLAVE $_master_name STATUS, Relay_Log_File, 1)
}
if (!$is_relay_log)
{
diff --git a/mysql-test/include/show_relaylog_events.inc b/mysql-test/include/show_relaylog_events.inc
index d1bd11f1642..c98e961da76 100644
--- a/mysql-test/include/show_relaylog_events.inc
+++ b/mysql-test/include/show_relaylog_events.inc
@@ -1,10 +1,11 @@
##############################################################################
# Show relay log events
#
-# Useage:
+# Usage:
# let $binlog_file= slave-relay-bin.000002;
# let $binlog_start= 106;
# let $binlog_limit= 1, 3;
+# let $master_name= master1;
# source include/show_relaylog_events.inc;
#
# It shows the first relay log file if $binlog_file is not given.
diff --git a/mysql-test/include/sync_slave_sql_with_master.inc b/mysql-test/include/sync_slave_sql_with_master.inc
new file mode 100644
index 00000000000..609c7f1b827
--- /dev/null
+++ b/mysql-test/include/sync_slave_sql_with_master.inc
@@ -0,0 +1,53 @@
+# ==== Purpose ====
+#
+# Waits until the slave SQL thread has been synced, i.e., all events
+# have been copied over to slave. This is like mtr's built-in command
+# sync_slave_with_master, but more flexible (e.g., you can set a
+# custom timeout and you can force it to use GTIDs instead of filename
+# and offset).
+#
+#
+# ==== Usage ====
+#
+# [--let $sync_slave_connection= <connection_name>]
+# [--let $use_gtids= 1]
+# [--let $slave_timeout= NUMBER]
+# [--let $rpl_debug= 1]
+# --source include/sync_slave_io_with_master.inc
+#
+# Must be called on the master. Will change connection to the slave.
+#
+# Parameters:
+#
+# $use_gtids
+# If set, uses GTIDs instead of filename and offset for positions.
+#
+# $sync_slave_connection
+# By default, this script switches connection to 'slave'. If
+# $sync_slave_connection is set, then '$sync_slave_connection' is
+# used instead of 'slave'.
+#
+# $slave_timeout
+# See include/wait_for_slave_param.inc.
+#
+# $rpl_debug
+# See include/rpl_init.inc
+
+
+--let $include_filename= sync_slave_sql_with_master.inc
+--source include/begin_include_file.inc
+
+save_master_pos;
+
+--let $rpl_connection_name= slave
+if ($sync_slave_connection)
+{
+ --let $rpl_connection_name= $sync_slave_connection
+}
+--source include/rpl_connection.inc
+
+sync_with_master;
+
+--let $include_filename= sync_slave_sql_with_master.inc
+--let $skip_restore_connection= 1
+--source include/end_include_file.inc
diff --git a/mysql-test/include/sync_with_master_gtid.inc b/mysql-test/include/sync_with_master_gtid.inc
index 97ada8eea29..777711b979c 100644
--- a/mysql-test/include/sync_with_master_gtid.inc
+++ b/mysql-test/include/sync_with_master_gtid.inc
@@ -34,6 +34,10 @@ let $_slave_timeout= $slave_timeout;
if (!$_slave_timeout)
{
let $_slave_timeout= 120;
+ if ($VALGRIND_TEST)
+ {
+ let $_slave_timeout= 1200;
+ }
}
--let $_result= `SELECT master_gtid_wait('$master_pos', $_slave_timeout)`
diff --git a/mysql-test/include/type_hrtime.inc b/mysql-test/include/type_hrtime.inc
index 5d847d72195..071dc7b161d 100644
--- a/mysql-test/include/type_hrtime.inc
+++ b/mysql-test/include/type_hrtime.inc
@@ -25,7 +25,12 @@ alter table t1 engine=innodb;
select * from t1 order by a;
select * from t1 order by a+0;
drop table t1;
-eval create table t1 (a $type(4)) engine=innodb;
+let attr=;
+if ($type == timestamp)
+{
+ let attr=NOT NULL DEFAULT CURRENT_TIMESTAMP(4) ON UPDATE CURRENT_TIMESTAMP(4);
+}
+eval create table t1 (a $type(4)$attr) engine=innodb;
insert t1 values ('2010-12-11 01:02:03.456789');
select * from t1;
select extract(microsecond from a + interval 100 microsecond) from t1 where a>'2010-11-12 01:02:03.456';
@@ -93,7 +98,12 @@ drop table t1, t2;
#
# SP
#
-eval create table t1 (a $type(6), b $type(6));
+let attr=;
+if ($type == timestamp)
+{
+ let attr=NOT NULL DEFAULT '0000-00-00 00:00:00.000000';
+}
+eval create table t1 (a $type(6)$attr, b $type(6)$attr);
eval create procedure foo(x $type, y $type(4)) insert into t1 values (x, y);
call foo('2010-02-03 4:5:6.789123', '2010-02-03 4:5:6.789123');
select * from t1;
diff --git a/mysql-test/include/type_temporal_zero_default.inc b/mysql-test/include/type_temporal_zero_default.inc
new file mode 100644
index 00000000000..500d25ea18f
--- /dev/null
+++ b/mysql-test/include/type_temporal_zero_default.inc
@@ -0,0 +1,75 @@
+--echo #
+--echo # MDEV-7824 [Bug #68041] Zero date can be inserted in strict no-zero mode through a default value
+--echo #
+
+# Testing direct INSERT
+
+SET sql_mode=DEFAULT;
+eval CREATE TABLE t1 (a $type DEFAULT $defval);
+SET sql_mode=TRADITIONAL;
+--error ER_TRUNCATED_WRONG_VALUE
+eval INSERT INTO t1 VALUES ($defval);
+--error ER_INVALID_DEFAULT_VALUE_FOR_FIELD
+INSERT INTO t1 VALUES ();
+--error ER_INVALID_DEFAULT_VALUE_FOR_FIELD
+INSERT INTO t1 VALUES (DEFAULT);
+DROP TABLE t1;
+SET sql_mode=DEFAULT;
+
+
+# Testing INSERT .. SELECT
+
+eval CREATE TABLE t1 (a $type NOT NULL DEFAULT $defval, b $type NOT NULL DEFAULT $defval);
+eval CREATE TABLE t2 (a $type NOT NULL DEFAULT $defval);
+eval INSERT INTO t2 VALUES ($defval);
+SET sql_mode=TRADITIONAL;
+--error ER_INVALID_DEFAULT_VALUE_FOR_FIELD
+INSERT INTO t1 (a) SELECT a FROM t2;
+DROP TABLE t1, t2;
+SET sql_mode=DEFAULT;
+
+
+# Testing LOAD
+
+--eval CREATE TABLE t1 (a $type DEFAULT $defval, b $type DEFAULT $defval)
+--eval INSERT INTO t1 VALUES (DEFAULT,DEFAULT);
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--eval SELECT a INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/mdev-7824.txt' FROM t1
+DELETE FROM t1;
+SET sql_mode=TRADITIONAL;
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--error ER_INVALID_DEFAULT_VALUE_FOR_FIELD
+--eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/mdev-7824.txt' INTO TABLE t1 (a)
+--remove_file $MYSQLTEST_VARDIR/tmp/mdev-7824.txt
+DROP TABLE t1;
+SET sql_mode=DEFAULT;
+
+# Testing ALTER when an old field default becomes invalid
+# Return an error, even if there is no STRICT_XXX_TABLES set
+--eval CREATE TABLE t1 (a $type DEFAULT $defval);
+SET sql_mode='NO_ZERO_DATE';
+--error ER_INVALID_DEFAULT
+ALTER TABLE t1 ADD b INT NOT NULL;
+DROP TABLE t1;
+SET sql_mode=DEFAULT;
+
+
+--echo #
+--echo # End of MDEV-7824 [Bug #68041] Zero date can be inserted in strict no-zero mode through a default value
+--echo #
+
+--echo #
+--echo # MDEV-8373 Zero date can be inserted in strict no-zero mode through CREATE TABLE AS SELECT timestamp_field
+--echo #
+
+SET sql_mode=DEFAULT;
+--eval CREATE TABLE t1 (a $type);
+INSERT INTO t1 VALUES (0);
+SET sql_mode='TRADITIONAL';
+--error ER_TRUNCATED_WRONG_VALUE
+CREATE TABLE t2 AS SELECT * FROM t1;
+DROP TABLE t1;
+
+--echo #
+--echo # End of MDEV-8373 Zero date can be inserted in strict no-zero mode through CREATE TABLE AS SELECT timestamp_field
+--echo #
diff --git a/mysql-test/include/wait_condition.inc b/mysql-test/include/wait_condition.inc
index ac61b76db32..5fbde6950c8 100644
--- a/mysql-test/include/wait_condition.inc
+++ b/mysql-test/include/wait_condition.inc
@@ -39,6 +39,7 @@ let $wait_timeout= 0;
let $wait_condition_reps= 0;
while ($wait_counter)
{
+ --error 0,ER_NO_SUCH_TABLE,ER_LOCK_WAIT_TIMEOUT,ER_UNKNOWN_COM_ERROR
let $success= `$wait_condition`;
inc $wait_condition_reps;
if ($success)
diff --git a/mysql-test/include/wait_for_ndb_to_binlog.inc b/mysql-test/include/wait_for_ndb_to_binlog.inc
deleted file mode 100644
index c1f94802724..00000000000
--- a/mysql-test/include/wait_for_ndb_to_binlog.inc
+++ /dev/null
@@ -1,26 +0,0 @@
-# ==== Purpose ====
-#
-# Several test primitives from mysql-test/extra/rpl_tests
-# are shared for test cases for MyISAM, InnoDB, NDB and
-# other engines.
-# For NDB engine all events will be added by NDB injector
-# so tests only can continue after injector is ready,
-# this test waits for proper injector thread state.
-#
-# ==== Usage ====
-#
-# let $engine_type= NDB;
-# --source include/wait_for_ndb_to_binlog.inc
-#
-# ==== Parameters =====
-#
-# $engine_type
-# Type of engine. If type is NDB then it waits for injector
-# thread proper state.
-
-if (`SELECT UPPER(LEFT('$engine_type',3)) = 'NDB'`) {
- let $show_statement= SHOW PROCESSLIST;
- let $field= State;
- let $condition= = 'Waiting for event from ndbcluster';
- source include/wait_show_condition.inc;
-}
diff --git a/mysql-test/include/wait_until_ready.inc b/mysql-test/include/wait_until_ready.inc
new file mode 100644
index 00000000000..e7a6940975a
--- /dev/null
+++ b/mysql-test/include/wait_until_ready.inc
@@ -0,0 +1,34 @@
+# If wsrep patch is enabled, wait for a minute until node is ready.
+# Note: include/wait_for_status_var.inc cannot be used here, as server rejects
+# all commands except SHOW & SET until its ready. (see wsrep_ready status
+# variable)
+
+--disable_result_log
+--disable_query_log
+--enable_reconnect
+
+let $counter= 600;
+
+# Check if wsrep_ready status variable exists.
+if (`SHOW STATUS LIKE 'wsrep_ready'`)
+{
+ let $wsrep_ready= query_get_value("SHOW STATUS LIKE 'wsrep_ready'", Value, 1);
+
+ while ($wsrep_ready == 'OFF')
+ {
+ if (!$counter)
+ {
+ echo ===============================================;
+ echo Node still not ready after a minute, giving up!;
+ echo ===============================================;
+ die;
+ }
+ dec $counter;
+ sleep 0.1;
+ let $wsrep_ready= query_get_value("SHOW STATUS LIKE 'wsrep_ready'", Value, 1);
+ }
+}
+
+--disable_reconnect
+--enable_query_log
+--enable_result_log
diff --git a/mysql-test/include/word_size.combinations b/mysql-test/include/word_size.combinations
new file mode 100644
index 00000000000..9b58a0c85c6
--- /dev/null
+++ b/mysql-test/include/word_size.combinations
@@ -0,0 +1,3 @@
+[32bit]
+
+[64bit]
diff --git a/mysql-test/include/word_size.inc b/mysql-test/include/word_size.inc
new file mode 100644
index 00000000000..fb796c251fc
--- /dev/null
+++ b/mysql-test/include/word_size.inc
@@ -0,0 +1,4 @@
+#
+# tests that include this file will be run for an appropriate combination.
+# See word_size.combinations for the list of combinations.
+#