summaryrefslogtreecommitdiff
path: root/mysql-test/include
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/include')
-rw-r--r--mysql-test/include/add_anonymous_users.inc2
-rw-r--r--mysql-test/include/alter_table_mdev539.inc2
-rw-r--r--mysql-test/include/binlog_start_pos.inc8
-rw-r--r--mysql-test/include/bug38347.inc4
-rw-r--r--mysql-test/include/check-testcase.test3
-rw-r--r--mysql-test/include/commit.inc6
-rw-r--r--mysql-test/include/concurrent.inc62
-rw-r--r--mysql-test/include/ctype_common.inc2
-rw-r--r--mysql-test/include/ctype_numconv.inc1
-rw-r--r--mysql-test/include/ctype_pad.inc79
-rw-r--r--mysql-test/include/ctype_pad_all_engines.inc7
-rw-r--r--mysql-test/include/ctype_pad_space.inc10
-rw-r--r--mysql-test/include/ctype_unescape.inc3
-rw-r--r--mysql-test/include/ctype_utf8mb4.inc47
-rw-r--r--mysql-test/include/ddl_i18n.check_triggers.inc6
-rw-r--r--mysql-test/include/deadlock.inc18
-rw-r--r--mysql-test/include/expect_crash.inc5
-rw-r--r--mysql-test/include/func_hybrid_type.inc1
-rw-r--r--mysql-test/include/function_defaults.inc72
-rw-r--r--mysql-test/include/galera_connect.inc5
-rw-r--r--mysql-test/include/grant_cache.inc9
-rw-r--r--mysql-test/include/have_innodb.combinations22
-rw-r--r--mysql-test/include/have_innodb_32k.inc6
-rw-r--r--mysql-test/include/have_innodb_4k.inc6
-rw-r--r--mysql-test/include/have_innodb_64k.inc2
-rw-r--r--mysql-test/include/have_innodb_8k.inc6
-rw-r--r--mysql-test/include/have_innodb_bzip2.inc4
-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_max_16k.inc4
-rw-r--r--mysql-test/include/have_innodb_snappy.inc4
-rw-r--r--mysql-test/include/have_numa.inc9
-rw-r--r--mysql-test/include/icp_tests.inc6
-rw-r--r--mysql-test/include/kill_and_restart_mysqld.inc19
-rw-r--r--mysql-test/include/loaddata_autocom.inc4
-rw-r--r--mysql-test/include/mix1.inc166
-rw-r--r--mysql-test/include/mix2.inc4
-rw-r--r--mysql-test/include/mtr_check.sql1
-rw-r--r--mysql-test/include/mtr_warnings.sql8
-rw-r--r--mysql-test/include/ps_conv.inc12
-rw-r--r--mysql-test/include/ps_modify.inc2
-rw-r--r--mysql-test/include/query_cache.inc6
-rw-r--r--mysql-test/include/query_cache_sql_prepare.inc23
-rw-r--r--mysql-test/include/relocate_binlogs.inc6
-rw-r--r--mysql-test/include/rpl_assert.inc118
-rw-r--r--mysql-test/include/rpl_connect.inc2
-rw-r--r--mysql-test/include/rpl_connection.inc2
-rw-r--r--mysql-test/include/rpl_connection_master.inc2
-rw-r--r--mysql-test/include/rpl_connection_slave.inc2
-rw-r--r--mysql-test/include/rpl_connection_slave1.inc2
-rw-r--r--mysql-test/include/rpl_ip_mix.inc7
-rw-r--r--mysql-test/include/rpl_ip_mix2.inc7
-rw-r--r--mysql-test/include/rpl_ipv6.inc7
-rw-r--r--mysql-test/include/rpl_loaddata_charset.inc2
-rw-r--r--mysql-test/include/rpl_stmt_seq.inc18
-rw-r--r--mysql-test/include/rpl_stop_server.inc4
-rw-r--r--mysql-test/include/rpl_sync.inc8
-rw-r--r--mysql-test/include/rpl_udf.inc16
-rw-r--r--mysql-test/include/search_pattern_in_file.inc65
-rw-r--r--mysql-test/include/show_binlog_events2.inc2
-rw-r--r--mysql-test/include/show_delayed_slave_state.inc28
-rw-r--r--mysql-test/include/sync_with_master.inc26
-rw-r--r--mysql-test/include/type_hrtime.inc4
-rw-r--r--mysql-test/include/wait_for_slave_io_error.inc2
-rw-r--r--mysql-test/include/wait_innodb_all_purged.inc3
-rw-r--r--mysql-test/include/wait_until_connected_again.inc5
-rw-r--r--mysql-test/include/wait_until_disconnected.inc5
-rw-r--r--mysql-test/include/world.inc24
69 files changed, 616 insertions, 429 deletions
diff --git a/mysql-test/include/add_anonymous_users.inc b/mysql-test/include/add_anonymous_users.inc
index a59aa971d59..635a80e3dee 100644
--- a/mysql-test/include/add_anonymous_users.inc
+++ b/mysql-test/include/add_anonymous_users.inc
@@ -1,7 +1,7 @@
# Allow anonymous users to connect
disable_warnings;
disable_query_log;
-INSERT INTO mysql.user (host, user) VALUES ('localhost','');
+INSERT IGNORE INTO mysql.user (host, user) VALUES ('localhost','');
FLUSH PRIVILEGES;
enable_query_log;
enable_warnings;
diff --git a/mysql-test/include/alter_table_mdev539.inc b/mysql-test/include/alter_table_mdev539.inc
index a246434b779..66b32473961 100644
--- a/mysql-test/include/alter_table_mdev539.inc
+++ b/mysql-test/include/alter_table_mdev539.inc
@@ -2,6 +2,8 @@
--echo # mdev-539: fast build of unique/primary indexes for MyISAM/Aria
--echo #
+call mtr.add_suppression("Can't find record in '.*'");
+
--disable_warnings
DROP DATABASE IF EXISTS dbt3_s001;
--enable_warnings
diff --git a/mysql-test/include/binlog_start_pos.inc b/mysql-test/include/binlog_start_pos.inc
index 1fe2dd8d171..5412a7ea75f 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 */ +
-# 58 /* misc stuff in the Format description header */ +
+# 57 /* misc stuff in the Format description header */ +
# number of events +
# 1 /* Checksum algorithm */ +
# 4 /* CRC32 length */
#
-# With current number of events = 164,
+# With current number of events = 171,
#
-# binlog_start_pos = 4 + 19 + 57 + 163 + 1 + 4 = 249.
+# binlog_start_pos = 4 + 19 + 57 + 171 + 1 + 4 = 256.
#
##############################################################################
--disable_query_log
-set @binlog_start_pos=249 + @@encrypt_binlog * 36;
+set @binlog_start_pos=256 + @@encrypt_binlog * (36 + (@@binlog_checksum != 'NONE') * 4);
--enable_query_log
let $binlog_start_pos=`select @binlog_start_pos`;
diff --git a/mysql-test/include/bug38347.inc b/mysql-test/include/bug38347.inc
index ca1dbfa1bd2..9980084913f 100644
--- a/mysql-test/include/bug38347.inc
+++ b/mysql-test/include/bug38347.inc
@@ -2,16 +2,12 @@
--echo
SHOW GRANTS FOR mysqltest_u1@localhost;
---echo
---echo # connection: con1 (mysqltest_u1@mysqltest_db1)
--connect (con1,localhost,mysqltest_u1,,mysqltest_db1)
--connection con1
--echo
SHOW CREATE TABLE t1;
---echo
---echo # connection: default
--connection default
--disconnect con1
diff --git a/mysql-test/include/check-testcase.test b/mysql-test/include/check-testcase.test
index 20b5ded6e82..3b2c2a46590 100644
--- a/mysql-test/include/check-testcase.test
+++ b/mysql-test/include/check-testcase.test
@@ -67,6 +67,9 @@ if ($tmp)
--echo Replicate_Do_Domain_Ids
--echo Replicate_Ignore_Domain_Ids
--echo Parallel_Mode conservative
+ --echo SQL_Delay 0
+ --echo SQL_Remaining_Delay NULL
+ --echo Slave_SQL_Running_State
}
if (!$tmp) {
# Note: after WL#5177, fields 13-18 shall not be filtered-out.
diff --git a/mysql-test/include/commit.inc b/mysql-test/include/commit.inc
index e72ebba8527..a28d3e5f3d1 100644
--- a/mysql-test/include/commit.inc
+++ b/mysql-test/include/commit.inc
@@ -267,7 +267,7 @@ select * from t2;
insert into t2 (a) values (1026);
--replace_result $MYSQLTEST_VARDIR ..
--error ER_DUP_ENTRY
-eval load data infile "../../std_data/words.dat" into table t1 (a) set a:=f2(26);
+eval load data infile "../../std_data/words.dat" ignore into table t1 (a) set a:=f2(26);
select * from t2;
rollback;
@@ -430,9 +430,9 @@ call p_verify_status_increment(2, 2, 2, 2);
--echo # 4. Read-write statement: UPDATE, update 0 rows, 1 row matches WHERE
--echo #
update t1 set a=2;
-call p_verify_status_increment(2, 2, 1, 0);
+call p_verify_status_increment(2, 0, 1, 0);
commit;
-call p_verify_status_increment(2, 2, 1, 0);
+call p_verify_status_increment(2, 0, 1, 0);
--echo # 5. Read-write statement: UPDATE, update 0 rows, 0 rows match WHERE
--echo #
diff --git a/mysql-test/include/concurrent.inc b/mysql-test/include/concurrent.inc
index 2912287be8e..c6d8775af6b 100644
--- a/mysql-test/include/concurrent.inc
+++ b/mysql-test/include/concurrent.inc
@@ -64,7 +64,6 @@ drop table if exists t1;
--echo **
--echo ** two UPDATE's running and both changing distinct result sets
--echo **
- --echo ** connection thread1
connect (thread1, localhost, mysqltest,,);
connection thread1;
--echo ** Set up table
@@ -84,7 +83,6 @@ drop table if exists t1;
--echo ** Get user level lock (ULL) for thread 1
select get_lock("hello",10);
- --echo ** connection thread2
connect (thread2, localhost, mysqltest,,);
connection thread2;
--echo ** Start transaction for thread 2
@@ -93,7 +91,6 @@ drop table if exists t1;
--echo ** be created and blocked on the first row where tipo=11.
send update t1 set eta=1+get_lock("hello",10)*0 where tipo=11;
- --echo ** connection thread1
connection thread1;
let $wait_condition= select count(*)= 1 from information_schema.processlist where state= 'User lock';
--source include/wait_condition.inc
@@ -121,7 +118,6 @@ drop table if exists t1;
--echo ** Table is now updated with a new eta on tipo=22 for thread 1.
select * from t1;
- --echo ** connection thread2
connection thread2;
--echo ** Release the lock and collect result from update on thread 2
reap;
@@ -134,7 +130,6 @@ drop table if exists t1;
--echo ** Sending commit on thread 2.
commit;
- --echo ** connection thread1
connection thread1;
--echo ** Make sure table reads didn't change yet on thread 1.
select * from t1;
@@ -144,16 +139,13 @@ drop table if exists t1;
--echo ** thread 1,2.
select * from t1;
- --echo ** connection thread2
connection thread2;
--echo ** Make sure the output is similar for t1.
select * from t1;
- --echo ** connection thread1
connection thread1;
select * from t1;
---echo ** connection default
connection default;
drop table t1;
@@ -162,7 +154,6 @@ drop table t1;
--echo **
--echo ** two UPDATE's running and one changing result set
--echo **
- --echo ** connection thread1
#connect (thread1, localhost, mysqltest,,);
connection thread1;
--echo ** Set up table
@@ -182,7 +173,6 @@ drop table t1;
--echo ** Get ULL "hello" on thread 1
select get_lock("hello",10);
- --echo ** connection thread2
#connect (thread2, localhost, mysqltest,,);
connection thread2;
--echo ** Start transaction on thread 2
@@ -192,7 +182,6 @@ drop table t1;
--echo ** blocking ULL is released.
send update t1 set eta=1+get_lock("hello",10)*0 where tipo=1;
---echo ** connection thread1
connection thread1;
let $wait_condition= select count(*)= 1 from information_schema.processlist where state= 'User lock';
--source include/wait_condition.inc
@@ -219,7 +208,6 @@ drop table t1;
--echo ** The table should still be updated with updates for thread 1 only:
select * from t1;
- --echo ** connection thread2
connection thread2;
--echo ** Release the lock and collect result from thread 2:
reap;
@@ -231,7 +219,6 @@ drop table t1;
select * from t1;
commit;
- --echo ** connection thread1
connection thread1;
--echo ** Thread 2 has committed but the result should remain the same for
--echo ** thread 1 (updated on three places):
@@ -242,15 +229,12 @@ drop table t1;
--echo ** This select should show both updates:
select * from t1;
- --echo ** connection thread2
connection thread2;
select * from t1;
- --echo ** connection thread1
connection thread1;
select * from t1;
---echo ** connection default
connection default;
drop table t1;
@@ -259,7 +243,6 @@ drop table t1;
--echo **
--echo ** One UPDATE and one INSERT .... Monty's test
--echo **
- --echo ** connection thread1
#connect (thread1, localhost, mysqltest,,);
connection thread1;
--echo ** Set up table
@@ -269,7 +252,6 @@ drop table t1;
--echo ** Create ULL 'hello2'
select get_lock("hello2",10);
- --echo ** connection thread2
#connect (thread2, localhost, mysqltest,,);
connection thread2;
--echo ** Begin a new transaction on thread 2
@@ -278,7 +260,6 @@ drop table t1;
--echo ** this will hang waiting on thread 1.
send update t1 set b=10+get_lock(concat("hello",a),10)*0 where a=2;
- --echo ** connection thread1
connection thread1;
let $wait_condition= select count(*)= 1 from information_schema.processlist where state= 'User lock';
--source include/wait_condition.inc
@@ -292,7 +273,6 @@ drop table t1;
--echo ** ..but thread 1 will still see t1 as if nothing has happend:
select * from t1;
- --echo ** connection thread2
connection thread2;
--echo ** Collect results from thread 2 and release the lock.
reap;
@@ -305,7 +285,6 @@ drop table t1;
--echo ** Commit changes from thread 2
commit;
---echo ** connection default
connection default;
drop table t1;
@@ -314,7 +293,6 @@ drop table t1;
--echo **
--echo ** one UPDATE changing result set and SELECT ... FOR UPDATE
--echo **
- --echo ** connection thread1
#connect (thread1, localhost, mysqltest,,);
connection thread1;
--echo ** Set up table
@@ -332,7 +310,6 @@ drop table t1;
insert into t1 values (80,22,"jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj");
insert into t1 values (90,11,"kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk");
- --echo ** connection thread2
#connect (thread2, localhost, mysqltest,,);
connection thread2;
--echo ** Begin a new transaction on thread 2
@@ -340,7 +317,6 @@ drop table t1;
--echo ** Select a range for update.
select * from t1 where tipo=2 FOR UPDATE;
- --echo ** connection thread1
connection thread1;
--echo ** Begin a new transaction on thread 1
begin;
@@ -352,7 +328,6 @@ drop table t1;
--echo ** transaction failed and was rolled back.
select * from t1;
- --echo ** connection thread2
connection thread2;
--echo ** The table should look unmodified from thread 2.
select * from t1;
@@ -360,22 +335,18 @@ drop table t1;
--echo ** thread 1 to complete the transaction.
commit;
- --echo ** connection thread1
connection thread1;
--echo ** Commit on thread 1.
commit;
- --echo ** connection thread2
connection thread2;
--echo ** The table should not have been changed.
select * from t1;
- --echo ** connection thread1
connection thread1;
--echo ** Even on thread 1:
select * from t1;
---echo ** connection default
connection default;
drop table t1;
@@ -384,7 +355,6 @@ drop table t1;
--echo **
--echo ** one UPDATE not changing result set and SELECT ... FOR UPDATE
--echo **
- --echo ** connection thread1
#connect (thread1, localhost, mysqltest,,);
connection thread1;
--echo ** Set up table
@@ -402,7 +372,6 @@ drop table t1;
insert into t1 values (80,22,"jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj");
insert into t1 values (90,11,"kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk");
- --echo ** connection thread2
#connect (thread2, localhost, mysqltest,,);
connection thread2;
--echo ** Starting new transaction on thread 2.
@@ -410,7 +379,6 @@ drop table t1;
--echo ** Starting SELECT .. FOR UPDATE
select * from t1 where tipo=2 FOR UPDATE;
- --echo ** connection thread1
connection thread1;
--echo
--echo ** Starting new transaction on thread 1
@@ -433,28 +401,23 @@ drop table t1;
--echo ** have changed.
select * from t1;
- --echo ** connection thread2
connection thread2;
--echo ** The same thing should hold true for the transaction on
--echo ** thread 2
select * from t1;
send commit;
- --echo ** connection thread1
connection thread1;
commit;
- --echo ** connection thread2
connection thread2;
--echo ** Even after committing:
reap;
select * from t1;
- --echo ** connection thread1
connection thread1;
select * from t1;
---echo ** connection default
connection default;
drop table t1;
@@ -463,7 +426,6 @@ drop table t1;
--echo **
--echo ** two SELECT ... FOR UPDATE
--echo **
- --echo ** connection thread1
#connect (thread1, localhost, mysqltest,,);
connection thread1;
--echo ** Set up table
@@ -481,14 +443,12 @@ drop table t1;
insert into t1 values (80,22,"jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj");
insert into t1 values (90,11,"kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk");
- --echo ** connection thread2
#connect (thread2, localhost, mysqltest,,);
connection thread2;
--echo ** Begin a new transaction on thread 2
begin;
select * from t1 where tipo=2 FOR UPDATE;
- --echo ** connection thread1
connection thread1;
--echo ** Begin a new transaction on thread 1
begin;
@@ -497,7 +457,6 @@ drop table t1;
--error ER_LOCK_WAIT_TIMEOUT
select * from t1 where tipo=1 FOR UPDATE;
- --echo ** connection thread2
connection thread2;
--echo ** Table will be unchanged and the select command will not be
--echo ** blocked:
@@ -505,22 +464,18 @@ drop table t1;
--echo ** Commit transacton on thread 2.
commit;
- --echo ** connection thread1
connection thread1;
--echo ** Commit transaction on thread 1.
commit;
- --echo ** connection thread2
connection thread2;
--echo ** Make sure table isn't blocked on thread 2:
select * from t1;
- --echo ** connection thread1
connection thread1;
--echo ** Make sure table isn't blocked on thread 1:
select * from t1;
---echo ** connection default
connection default;
drop table t1;
@@ -529,7 +484,6 @@ drop table t1;
--echo **
--echo ** one UPDATE changing result set and DELETE
--echo **
- --echo ** connection thread1
#connect (thread1, localhost, mysqltest,,);
connection thread1;
--echo ** Set up table
@@ -547,7 +501,6 @@ drop table t1;
insert into t1 values (80,22,"jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj");
insert into t1 values (90,11,"kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk");
- --echo ** connection thread2
#connect (thread2, localhost, mysqltest,,);
connection thread2;
begin;
@@ -557,33 +510,27 @@ drop table t1;
# 'innodb_deleted_rows' and infos in processlist where not sucessful.
sleep 1;
- --echo ** connection thread1
connection thread1;
begin;
--error ER_LOCK_WAIT_TIMEOUT
update t1 set tipo=1 where tipo=2;
select * from t1;
- --echo ** connection thread2
connection thread2;
reap;
select * from t1;
send commit;
- --echo ** connection thread1
connection thread1;
commit;
- --echo ** connection thread2
connection thread2;
reap;
select * from t1;
- --echo ** connection thread1
connection thread1;
select * from t1;
---echo ** connection default
connection default;
drop table t1;
@@ -592,7 +539,6 @@ drop table t1;
--echo **
--echo ** one UPDATE not changing result set and DELETE
--echo **
- --echo ** connection thread1
#connect (thread1, localhost, mysqltest,,);
connection thread1;
--echo ** Set up table
@@ -610,7 +556,6 @@ drop table t1;
insert into t1 values (80,22,"jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj");
insert into t1 values (90,11,"kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk");
- --echo ** connection thread2
#connect (thread2, localhost, mysqltest,,);
connection thread2;
begin;
@@ -620,7 +565,6 @@ drop table t1;
# 'innodb_deleted_rows' and infos in processlist where not sucessful.
sleep 1;
- --echo ** connection thread1
connection thread1;
begin;
--echo ** Update on t1 will cause a table scan which will be blocked because
@@ -639,22 +583,18 @@ drop table t1;
}
select * from t1;
- --echo ** connection thread2
connection thread2;
reap;
select * from t1;
send commit;
- --echo ** connection thread1
connection thread1;
commit;
- --echo ** connection thread2
connection thread2;
reap;
select * from t1;
- --echo ** connection thread1
connection thread1;
select * from t1;
@@ -662,11 +602,9 @@ drop table t1;
connection thread1;
disconnect thread1;
--source include/wait_until_disconnected.inc
---echo ** connection thread2
connection thread2;
disconnect thread2;
--source include/wait_until_disconnected.inc
---echo ** connection default
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 4cb04599679..a39c25f2cc8 100644
--- a/mysql-test/include/ctype_common.inc
+++ b/mysql-test/include/ctype_common.inc
@@ -58,7 +58,7 @@ DROP TABLE t1;
# Bug #32726: crash with cast in order by clause and cp932 charset
#
create table t1 (a set('a') not null);
-insert into t1 values (),();
+insert ignore into t1 values (),();
select cast(a as char(1)) from t1;
select a sounds like a from t1;
select 1 from t1 order by cast(a as char(1));
diff --git a/mysql-test/include/ctype_numconv.inc b/mysql-test/include/ctype_numconv.inc
index 6bda2205c0e..07298b1d47b 100644
--- a/mysql-test/include/ctype_numconv.inc
+++ b/mysql-test/include/ctype_numconv.inc
@@ -739,6 +739,7 @@ show create table t1;
drop table t1;
select hex(concat(period_diff(200902, 200802)));
+SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
create table t1 as select concat(period_add(200902, 200802)) as c1;
show create table t1;
drop table t1;
diff --git a/mysql-test/include/ctype_pad.inc b/mysql-test/include/ctype_pad.inc
new file mode 100644
index 00000000000..4cefc575cdd
--- /dev/null
+++ b/mysql-test/include/ctype_pad.inc
@@ -0,0 +1,79 @@
+--echo #
+--echo # Start of ctype_pad.inc
+--echo #
+
+--echo #
+--echo # Unique indexes
+--echo #
+
+eval CREATE TABLE t1 (a VARCHAR(10) PRIMARY KEY) COLLATE $coll;
+SHOW CREATE TABLE t1;
+INSERT INTO t1 VALUES ('abc'),('abc '),(' a'),(' a '),('a ');
+SELECT HEX(a), a FROM t1 ORDER BY a;
+SELECT HEX(a), a FROM t1 IGNORE INDEX(PRIMARY) ORDER BY a;
+SELECT HEX(a), a FROM t1 IGNORE INDEX(PRIMARY) ORDER BY a DESC;
+
+--echo #
+--echo # UNION
+--echo #
+
+eval CREATE TABLE t2 (a VARCHAR(10)) COLLATE $coll;
+INSERT INTO t2 VALUES ('abc '),('abc '),(' a'),('a ');
+SELECT HEX(a),a FROM (SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a) td;
+DROP TABLE t1;
+DROP TABLE t2;
+
+--echo #
+--echo # DISTINCT, COUNT, MAX
+--echo #
+
+eval CREATE TABLE t1 (a VARCHAR(10)) COLLATE $coll;
+INSERT INTO t1 VALUES ('a'),('a '),(' a'),(' a '),('a ');
+SELECT HEX(a), a FROM (SELECT DISTINCT a FROM t1 ORDER BY a) td;
+SELECT COUNT(DISTINCT a) FROM t1 ORDER BY a;
+SELECT HEX(MAX(a)), MAX(a) FROM t1;
+
+--echo #
+--echo # GROUP BY
+--echo #
+
+eval CREATE TABLE t2 (a VARCHAR(10), b int, c varchar(10)) COLLATE $coll;
+INSERT t2 values('ab', 12, 'cd'), ('ab', 2, 'ed'), ('aa', 20, 'er'), ('aa ', 0, 'er ');
+SELECT HEX(a), cnt FROM (SELECT a, COUNT(a) AS cnt FROM t2 GROUP BY a ORDER BY a) AS td;
+DROP TABLE t2;
+
+--echo #
+--echo # Weights
+--echo #
+
+SELECT HEX(WEIGHT_STRING(a AS CHAR(10))) FROM t1;
+DROP TABLE t1;
+
+--echo #
+--echo # IF, CASE, LEAST
+--echo #
+
+eval SELECT IF('abc' COLLATE $coll = 'abc ', 'pad', 'nopad');
+eval SELECT CASE 'abc' COLLATE $coll WHEN 'abc ' THEN 'pad' ELSE 'nopad' END;
+eval SELECT CASE WHEN 'abc' COLLATE $coll = 'abc ' THEN 'pad' ELSE 'nopad' END;
+eval SELECT HEX(LEAST('abc ' COLLATE $coll, 'abc '));
+eval SELECT HEX(GREATEST('abc ' COLLATE $coll, 'abc '));
+
+--echo #
+--echo # Collation mix
+--echo #
+
+eval CREATE TABLE t1 (a VARCHAR(10)) COLLATE $coll_pad;
+INSERT INTO t1 VALUES ('a'),('a ');
+SELECT COUNT(*) FROM t1 WHERE a='a';
+eval SELECT COUNT(*) FROM t1 WHERE a='a' COLLATE $coll_pad;
+eval SELECT COUNT(*) FROM t1 WHERE a='a' COLLATE $coll;
+eval ALTER TABLE t1 MODIFY a VARCHAR(10) COLLATE $coll;
+SELECT COUNT(*) FROM t1 WHERE a='a';
+eval SELECT COUNT(*) FROM t1 WHERE a='a' COLLATE $coll_pad;
+eval SELECT COUNT(*) FROM t1 WHERE a='a' COLLATE $coll;
+DROP TABLE t1;
+
+--echo #
+--echo # End of ctype_pad.inc
+--echo #
diff --git a/mysql-test/include/ctype_pad_all_engines.inc b/mysql-test/include/ctype_pad_all_engines.inc
new file mode 100644
index 00000000000..29371676a19
--- /dev/null
+++ b/mysql-test/include/ctype_pad_all_engines.inc
@@ -0,0 +1,7 @@
+SET STORAGE_ENGINE=MyISAM;
+--source include/ctype_pad.inc
+
+SET STORAGE_ENGINE=HEAP;
+--source include/ctype_pad.inc
+
+SET STORAGE_ENGINE=Default;
diff --git a/mysql-test/include/ctype_pad_space.inc b/mysql-test/include/ctype_pad_space.inc
index 667f97de710..491225bd55a 100644
--- a/mysql-test/include/ctype_pad_space.inc
+++ b/mysql-test/include/ctype_pad_space.inc
@@ -1,5 +1,5 @@
-SELECT strcmp('a','a ');
-SELECT strcmp('a\0','a' );
-SELECT strcmp('a\0','a ');
-SELECT strcmp('a\t','a' );
-SELECT strcmp('a\t','a ');
+SELECT strcmp('a','a '), strcmp('a ','a');
+SELECT strcmp('a\0','a' ), strcmp('a','a\0');
+SELECT strcmp('a\0','a '), strcmp('a ','a\0');
+SELECT strcmp('a\t','a' ), strcmp('a', 'a\t');
+SELECT strcmp('a\t','a '), strcmp('a ', 'a\t');
diff --git a/mysql-test/include/ctype_unescape.inc b/mysql-test/include/ctype_unescape.inc
index 5d67bf8d189..171843ff66a 100644
--- a/mysql-test/include/ctype_unescape.inc
+++ b/mysql-test/include/ctype_unescape.inc
@@ -1,5 +1,7 @@
--echo # Start of ctype_unescape.inc
+SET sql_mode = '';
+
#
# Testing how string literals with backslash and quote-quote are unescaped.
# The tests assume that single quote (') is used as a delimiter.
@@ -323,5 +325,6 @@ DROP FUNCTION wellformedness;
DROP FUNCTION mysql_real_escape_string_generated;
DROP FUNCTION iswellformed;
DROP TABLE allbytes;
+SET sql_mode = DEFAULT;
--echo # End of ctype_backslash.inc
diff --git a/mysql-test/include/ctype_utf8mb4.inc b/mysql-test/include/ctype_utf8mb4.inc
index 71993a946b3..2d48f9373f6 100644
--- a/mysql-test/include/ctype_utf8mb4.inc
+++ b/mysql-test/include/ctype_utf8mb4.inc
@@ -124,7 +124,7 @@ set LC_TIME_NAMES='en_US';
#
set names koi8r;
eval create table t1 (s1 char(1) character set utf8mb4) engine $engine;
-insert into t1 values (_koi8r'ÁÂ');
+insert ignore into t1 values (_koi8r'ÁÂ');
select s1,hex(s1),char_length(s1),octet_length(s1) from t1;
drop table t1;
@@ -136,11 +136,11 @@ if ($is_heap)
{
eval create table t1 (s1 varchar(255) character set utf8mb4) engine $engine;
}
-insert into t1 select repeat('a',300);
-insert into t1 select repeat('Ñ',300);
-insert into t1 select repeat('aÑ',300);
-insert into t1 select repeat('Ña',300);
-insert into t1 select repeat('ÑÑ',300);
+insert ignore into t1 select repeat('a',300);
+insert ignore into t1 select repeat('Ñ',300);
+insert ignore into t1 select repeat('aÑ',300);
+insert ignore into t1 select repeat('Ña',300);
+insert ignore into t1 select repeat('ÑÑ',300);
--sorted_result
select hex(s1) from t1;
--sorted_result
@@ -155,11 +155,11 @@ if ($is_heap)
{
eval create table t1 (s1 varchar(255) character set utf8mb4) engine $engine;
}
-insert into t1 select repeat('a',66000);
-insert into t1 select repeat('Ñ',66000);
-insert into t1 select repeat('aÑ',66000);
-insert into t1 select repeat('Ña',66000);
-insert into t1 select repeat('ÑÑ',66000);
+insert ignore into t1 select repeat('a',66000);
+insert ignore into t1 select repeat('Ñ',66000);
+insert ignore into t1 select repeat('aÑ',66000);
+insert ignore into t1 select repeat('Ña',66000);
+insert ignore into t1 select repeat('ÑÑ',66000);
--sorted_result
select length(s1),char_length(s1) from t1;
drop table t1;
@@ -168,19 +168,19 @@ drop table t1;
# Bug #2368 Multibyte charsets do not check that incoming data is well-formed
#
eval create table t1 (s1 char(10) character set utf8mb4) engine $engine;
-insert into t1 values (0x41FF);
+insert ignore into t1 values (0x41FF);
select hex(s1) from t1;
drop table t1;
eval create table t1 (s1 varchar(10) character set utf8mb4) engine $engine;
-insert into t1 values (0x41FF);
+insert ignore into t1 values (0x41FF);
select hex(s1) from t1;
drop table t1;
if (!$is_heap)
{
eval create table t1 (s1 text character set utf8mb4) engine $engine;
-insert into t1 values (0x41FF);
+insert ignore into t1 values (0x41FF);
select hex(s1) from t1;
drop table t1;
}
@@ -895,6 +895,7 @@ DROP TABLE t1,t2;
#
eval create table t1 (a char(20) character set utf8mb4) engine $engine;
insert into t1 values ('123456'),('андрей');
+SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
alter table t1 modify a char(2) character set utf8mb4;
select char_length(a), length(a), a from t1 order by a;
drop table t1;
@@ -1282,15 +1283,19 @@ eval create table t1 (
insert into t1 (a) values ('abcdefghijklmnopqrstuvwxyz');
select * from t1;
# varchar to varchar
+SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
alter table t1 change a a varchar(20) character set utf8mb4 not null;
select * from t1;
# varchar to char
+SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
alter table t1 change a a char(15) character set utf8mb4 not null;
select * from t1;
# char to char
+SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
alter table t1 change a a char(10) character set utf8mb4 not null;
select * from t1;
# char to varchar
+SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
alter table t1 change a a varchar(5) character set utf8mb4 not null;
select * from t1;
drop table t1;
@@ -1302,6 +1307,7 @@ eval create table t1 (
a varchar(4000) not null
) default character set utf8mb4 engine $engine;
insert into t1 values (repeat('a',4000));
+SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
alter table t1 change a a varchar(3000) character set utf8mb4 not null;
select length(a) from t1;
drop table t1;
@@ -1552,7 +1558,7 @@ eval create table t1 (utf8mb4 char(1) character set utf8mb4) engine $engine;
--echo Testing [F0][90..BF][80..BF][80..BF]
insert into t1 values (0xF0908080);
insert into t1 values (0xF0BFBFBF);
-insert into t1 values (0xF08F8080);
+insert ignore into t1 values (0xF08F8080);
--sorted_result
select hex(utf8mb4) from t1;
delete from t1;
@@ -1567,7 +1573,7 @@ delete from t1;
--echo Testing [F4][80..8F][80..BF][80..BF]
insert into t1 values (0xF4808080);
insert into t1 values (0xF48F8080);
-insert into t1 values (0xF4908080);
+insert ignore into t1 values (0xF4908080);
--sorted_result
select hex(utf8mb4) from t1;
drop table t1;
@@ -1648,13 +1654,13 @@ INSERT INTO t1 VALUES (119070, x'f09d849ef09d859ef09d859ef09d8480f09d859ff09d859
# Mix of 3-byte and 4-byte chars
INSERT INTO t1 VALUES (65131, x'efb9abf09d849ef09d859ef09d859ef09d8480f09d859fefb9abefb9abf09d85a0efb9ab');
# All from musical chars, but 11 instead of 10 chars. truncated
-INSERT INTO t1 VALUES (119070, x'f09d849ef09d859ef09d859ef09d8480f09d859ff09d859ff09d859ff09d85a0f09d85a0f09d8480f09d85a0');
+INSERT IGNORE INTO t1 VALUES (119070, x'f09d849ef09d859ef09d859ef09d8480f09d859ff09d859ff09d859ff09d85a0f09d85a0f09d8480f09d85a0');
--sorted_result
SELECT u_decimal, hex(utf8mb4_encoding) FROM t1 ORDER BY utf8mb4_encoding COLLATE utf8mb4_general_ci, BINARY utf8mb4_encoding;
# First invalid 4 byte value
-INSERT INTO t1 VALUES (1114111, x'f5808080');
+INSERT IGNORE INTO t1 VALUES (1114111, x'f5808080');
--sorted_result
SELECT character_maximum_length, character_octet_length FROM information_schema.columns WHERE
@@ -1672,14 +1678,14 @@ INSERT INTO t2 VALUES (42856, x'ea9da8');
# SMALL COMMERCIAL AT
INSERT INTO t2 VALUES (65131, x'efb9ab');
# <Plane 16 Private Use, Last> (last 4 byte character)
-INSERT INTO t2 VALUES (1114111, x'f48fbfbf');
+INSERT IGNORE INTO t2 VALUES (1114111, x'f48fbfbf');
--sorted_result
SELECT character_maximum_length, character_octet_length FROM information_schema.columns WHERE
table_name= 't2' AND column_name= 'utf8mb3_encoding';
# Update a 3-byte char col with a 4-byte char, error
-UPDATE t2 SET utf8mb3_encoding= x'f48fbfbd' where u_decimal= 42856;
+UPDATE IGNORE t2 SET utf8mb3_encoding= x'f48fbfbd' where u_decimal= 42856;
# Update to a 3-byte char casted to 4-byte, error?
UPDATE t2 SET utf8mb3_encoding= _utf8mb4 x'ea9da8' where u_decimal= 42856;
@@ -1700,6 +1706,7 @@ SELECT count(*) FROM t1, t2
# Alter from 4-byte charset to 3-byte charset, error
--disable_warnings
+SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
ALTER TABLE t1 CONVERT TO CHARACTER SET utf8;
--enable_warnings
SHOW CREATE TABLE t1;
diff --git a/mysql-test/include/ddl_i18n.check_triggers.inc b/mysql-test/include/ddl_i18n.check_triggers.inc
index 832ab8091e8..2073021fc9e 100644
--- a/mysql-test/include/ddl_i18n.check_triggers.inc
+++ b/mysql-test/include/ddl_i18n.check_triggers.inc
@@ -3,12 +3,16 @@
--echo
--echo
+--replace_column 7 #
SHOW CREATE TRIGGER trg1|
--echo
+--replace_column 7 #
SHOW CREATE TRIGGER trg2|
--echo
+--replace_column 7 #
SHOW CREATE TRIGGER mysqltest2.trg3|
--echo
+--replace_column 7 #
SHOW CREATE TRIGGER mysqltest2.trg4|
# - Check SHOW statement;
@@ -16,6 +20,7 @@ SHOW CREATE TRIGGER mysqltest2.trg4|
--echo
--echo
+--replace_column 6 #
SHOW TRIGGERS|
--echo
@@ -24,6 +29,7 @@ use mysqltest2|
--echo
+--replace_column 6 #
SHOW TRIGGERS|
use mysqltest1|
diff --git a/mysql-test/include/deadlock.inc b/mysql-test/include/deadlock.inc
index 84d23b80811..2fa61f48624 100644
--- a/mysql-test/include/deadlock.inc
+++ b/mysql-test/include/deadlock.inc
@@ -10,9 +10,7 @@
# main code went into include/deadlock.inc
#
---echo # Establish connection con1 (user=root)
connect (con1,localhost,root,,);
---echo # Establish connection con2 (user=root)
connect (con2,localhost,root,,);
--disable_warnings
@@ -23,14 +21,12 @@ drop table if exists t1,t2;
# Testing of FOR UPDATE
#
---echo # Switch to connection con1
connection con1;
eval create table t1 (id integer, x integer) engine = $engine_type;
insert into t1 values(0, 0);
set autocommit=0;
SELECT * from t1 where id = 0 FOR UPDATE;
---echo # Switch to connection con2
connection con2;
set autocommit=0;
@@ -39,18 +35,15 @@ set autocommit=0;
update t1 set x=2 where id = 0;
--sleep 2
---echo # Switch to connection con1
connection con1;
update t1 set x=1 where id = 0;
select * from t1;
commit;
---echo # Switch to connection con2
connection con2;
reap;
commit;
---echo # Switch to connection con1
connection con1;
select * from t1;
commit;
@@ -60,7 +53,6 @@ drop table t1;
# Testing of FOR UPDATE
#
---echo # Switch to connection con1
connection con1;
eval create table t1 (id integer, x integer) engine = $engine_type;
eval create table t2 (b integer, a integer) engine = $engine_type;
@@ -73,7 +65,6 @@ update t2 set a=100 where b=(SELECT x from t1 where id = b FOR UPDATE);
select * from t2;
select * from t1;
---echo # Switch to connection con2
connection con2;
set autocommit=0;
@@ -82,18 +73,15 @@ set autocommit=0;
update t1 set x=2 where id = 0;
--sleep 2
---echo # Switch to connection con1
connection con1;
update t1 set x=1 where id = 0;
select * from t1;
commit;
---echo # Switch to connection con2
connection con2;
reap;
commit;
---echo # Switch to connection con1
connection con1;
select * from t1;
commit;
@@ -105,13 +93,11 @@ insert into t1 values(0, 0), (300, 300);
insert into t2 values(0, 0), (1, 20), (2, 30);
commit;
---echo # Switch to connection con1
connection con1;
select a,b from t2 UNION SELECT id, x from t1 FOR UPDATE;
select * from t2;
select * from t1;
---echo # Switch to connection con2
connection con2;
# The following query should hang because con1 is locking the record
@@ -121,24 +107,20 @@ select * from t2;
update t1 set x=2 where id = 0;
--sleep 2
---echo # Switch to connection con1
connection con1;
update t1 set x=1 where id = 0;
select * from t1;
commit;
---echo # Switch to connection con2
connection con2;
reap;
commit;
---echo # Switch to connection con1
connection con1;
select * from t1;
commit;
# Cleanup
---echo # Switch to connection default + disconnect con1 and con2
connection default;
disconnect con1;
disconnect con2;
diff --git a/mysql-test/include/expect_crash.inc b/mysql-test/include/expect_crash.inc
new file mode 100644
index 00000000000..af8b0908104
--- /dev/null
+++ b/mysql-test/include/expect_crash.inc
@@ -0,0 +1,5 @@
+--let $_server_id= `SELECT @@server_id`
+--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect
+
+# There should be a debug crash after using this .inc file
+--exec echo "wait" > $_expect_file_name
diff --git a/mysql-test/include/func_hybrid_type.inc b/mysql-test/include/func_hybrid_type.inc
index 854c7ebd34e..0eed936db38 100644
--- a/mysql-test/include/func_hybrid_type.inc
+++ b/mysql-test/include/func_hybrid_type.inc
@@ -62,6 +62,7 @@ SELECT
FROM t1;
SHOW CREATE TABLE t2;
DROP TABLE t2;
+SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
CREATE TABLE t2 AS
SELECT
CASE WHEN a IS NOT NULL THEN a ELSE b END AS case_____a_b,
diff --git a/mysql-test/include/function_defaults.inc b/mysql-test/include/function_defaults.inc
index cb8e8f86f93..23822aa24dc 100644
--- a/mysql-test/include/function_defaults.inc
+++ b/mysql-test/include/function_defaults.inc
@@ -4,51 +4,43 @@ SET TIME_ZONE = "+00:00";
--echo # Test of errors for column data types that dont support function
--echo # defaults.
--echo #
---error ER_INVALID_DEFAULT
-eval CREATE TABLE t1( a BIT DEFAULT $current_timestamp );
---error ER_INVALID_DEFAULT
-eval CREATE TABLE t1( a TINYINT DEFAULT $current_timestamp );
---error ER_INVALID_DEFAULT
-eval CREATE TABLE t1( a SMALLINT DEFAULT $current_timestamp );
---error ER_INVALID_DEFAULT
-eval CREATE TABLE t1( a MEDIUMINT DEFAULT $current_timestamp );
---error ER_INVALID_DEFAULT
-eval CREATE TABLE t1( a INT DEFAULT $current_timestamp );
---error ER_INVALID_DEFAULT
-eval CREATE TABLE t1( a BIGINT DEFAULT $current_timestamp );
---error ER_INVALID_DEFAULT
-eval CREATE TABLE t1( a FLOAT DEFAULT $current_timestamp );
---error ER_INVALID_DEFAULT
-eval CREATE TABLE t1( a DECIMAL DEFAULT $current_timestamp );
---error ER_INVALID_DEFAULT
-eval CREATE TABLE t1( a DATE DEFAULT $current_timestamp );
---error ER_INVALID_DEFAULT
-eval CREATE TABLE t1( a TIME DEFAULT $current_timestamp );
---error ER_INVALID_DEFAULT
-eval CREATE TABLE t1( a YEAR DEFAULT $current_timestamp );
+
+eval CREATE OR REPLACE TABLE t1( a BIT DEFAULT $current_timestamp );
+eval CREATE OR REPLACE TABLE t1( a TINYINT DEFAULT $current_timestamp );
+eval CREATE OR REPLACE TABLE t1( a SMALLINT DEFAULT $current_timestamp );
+eval CREATE OR REPLACE TABLE t1( a MEDIUMINT DEFAULT $current_timestamp );
+eval CREATE OR REPLACE TABLE t1( a INT DEFAULT $current_timestamp );
+eval CREATE OR REPLACE TABLE t1( a BIGINT DEFAULT $current_timestamp );
+eval CREATE OR REPLACE TABLE t1( a FLOAT DEFAULT $current_timestamp );
+eval CREATE OR REPLACE TABLE t1( a DECIMAL DEFAULT $current_timestamp );
+eval CREATE OR REPLACE TABLE t1( a DATE DEFAULT $current_timestamp );
+eval CREATE OR REPLACE TABLE t1( a TIME DEFAULT $current_timestamp );
+eval CREATE OR REPLACE TABLE t1( a YEAR DEFAULT $current_timestamp );
--error ER_INVALID_ON_UPDATE
-eval CREATE TABLE t1( a BIT ON UPDATE $current_timestamp );
+eval CREATE OR REPLACE TABLE t1( a BIT ON UPDATE $current_timestamp );
--error ER_INVALID_ON_UPDATE
-eval CREATE TABLE t1( a TINYINT ON UPDATE $current_timestamp );
+eval CREATE OR REPLACE TABLE t1( a TINYINT ON UPDATE $current_timestamp );
--error ER_INVALID_ON_UPDATE
-eval CREATE TABLE t1( a SMALLINT ON UPDATE $current_timestamp );
+eval CREATE OR REPLACE TABLE t1( a SMALLINT ON UPDATE $current_timestamp );
--error ER_INVALID_ON_UPDATE
-eval CREATE TABLE t1( a MEDIUMINT ON UPDATE $current_timestamp );
+eval CREATE OR REPLACE TABLE t1( a MEDIUMINT ON UPDATE $current_timestamp );
--error ER_INVALID_ON_UPDATE
-eval CREATE TABLE t1( a INT ON UPDATE $current_timestamp );
+eval CREATE OR REPLACE TABLE t1( a INT ON UPDATE $current_timestamp );
--error ER_INVALID_ON_UPDATE
-eval CREATE TABLE t1( a BIGINT ON UPDATE $current_timestamp );
+eval CREATE OR REPLACE TABLE t1( a BIGINT ON UPDATE $current_timestamp );
--error ER_INVALID_ON_UPDATE
-eval CREATE TABLE t1( a FLOAT ON UPDATE $current_timestamp );
+eval CREATE OR REPLACE TABLE t1( a FLOAT ON UPDATE $current_timestamp );
--error ER_INVALID_ON_UPDATE
-eval CREATE TABLE t1( a DECIMAL ON UPDATE $current_timestamp );
+eval CREATE OR REPLACE TABLE t1( a DECIMAL ON UPDATE $current_timestamp );
--error ER_INVALID_ON_UPDATE
-eval CREATE TABLE t1( a DATE ON UPDATE $current_timestamp );
+eval CREATE OR REPLACE TABLE t1( a DATE ON UPDATE $current_timestamp );
--error ER_INVALID_ON_UPDATE
-eval CREATE TABLE t1( a TIME ON UPDATE $current_timestamp );
+eval CREATE OR REPLACE TABLE t1( a TIME ON UPDATE $current_timestamp );
--error ER_INVALID_ON_UPDATE
-eval CREATE TABLE t1( a YEAR ON UPDATE $current_timestamp );
+eval CREATE OR REPLACE TABLE t1( a YEAR ON UPDATE $current_timestamp );
+
+drop table if exists t1;
--echo #
--echo # Test that the default clause behaves like NOW() regarding time zones.
@@ -843,10 +835,10 @@ SELECT 1, 2 INTO OUTFILE 't5.dat' FROM dual;
--echo # Mon Aug 1 15:11:19 2011 UTC
SET TIMESTAMP = 1312211479.918273;
-LOAD DATA INFILE 't3.dat' INTO TABLE t1;
+LOAD DATA INFILE 't3.dat' IGNORE INTO TABLE t1;
--query_vertical SELECT * FROM t1
-LOAD DATA INFILE 't4.dat' INTO TABLE t2;
+LOAD DATA INFILE 't4.dat' IGNORE INTO TABLE t2;
SELECT a FROM t2;
SELECT b FROM t2;
SELECT c FROM t2;
@@ -874,7 +866,7 @@ DELETE FROM t2;
--echo # (read_fixed_length()) than under the LOAD ... INTO TABLE t1 command
--echo # above. The code in this path is copy-pasted code from the path taken
--echo # under the syntax used in the previous LOAD command.
-LOAD DATA INFILE 't3.dat' INTO TABLE t1
+LOAD DATA INFILE 't3.dat' IGNORE INTO TABLE t1
FIELDS TERMINATED BY '' ENCLOSED BY '';
SELECT b FROM t1;
@@ -962,7 +954,7 @@ CREATE TABLE t1 (
--echo # There is no promotion
SHOW CREATE TABLE t1;
-LOAD DATA INFILE "file1.dat" INTO table t1;
+LOAD DATA INFILE "file1.dat" IGNORE INTO table t1;
--echo # It is strange that "like_b" gets NULL when "b" gets 0. But
--echo # this is consistent with how "a" gets NULL when "b" gets 0,
@@ -979,7 +971,7 @@ modify f TIMESTAMP NULL default CURRENT_TIMESTAMP;
--echo # There is no promotion
SHOW CREATE TABLE t1;
-LOAD DATA INFILE "file1.dat" INTO table t1;
+LOAD DATA INFILE "file1.dat" IGNORE INTO table t1;
--query_vertical SELECT * FROM t1
delete from t1;
@@ -1015,7 +1007,7 @@ CREATE TABLE t1 (
--echo # There is no promotion
SHOW CREATE TABLE t1;
-LOAD DATA INFILE "file2.dat" INTO table t1;
+LOAD DATA INFILE "file2.dat" IGNORE INTO table t1;
--query_vertical SELECT * FROM t1
delete from t1;
@@ -1026,7 +1018,7 @@ modify f TIMESTAMP NULL default CURRENT_TIMESTAMP;
--echo # There is no promotion
SHOW CREATE TABLE t1;
-LOAD DATA INFILE "file2.dat" INTO table t1;
+LOAD DATA INFILE "file2.dat" IGNORE INTO table t1;
--query_vertical SELECT * FROM t1
delete from t1;
diff --git a/mysql-test/include/galera_connect.inc b/mysql-test/include/galera_connect.inc
index 9d458c5e063..a40b03bf421 100644
--- a/mysql-test/include/galera_connect.inc
+++ b/mysql-test/include/galera_connect.inc
@@ -37,12 +37,15 @@ if (!$_galera_port)
if ($galera_debug)
{
+--disable_query_log
--echo connect($galera_connection_name,127.0.0.1,root,,test,$_galera_port,)
+--enable_query_log
}
# Temporal solution to avoid concurrent IST MDEV-7178
--sleep 1
# Open a connection
+--disable_query_log
--connect($galera_connection_name,127.0.0.1,root,,test,$_galera_port,)
-
+--enable_query_log
diff --git a/mysql-test/include/grant_cache.inc b/mysql-test/include/grant_cache.inc
index 111b35d6940..cb495e7feae 100644
--- a/mysql-test/include/grant_cache.inc
+++ b/mysql-test/include/grant_cache.inc
@@ -51,7 +51,6 @@ set GLOBAL query_cache_size=1355776;
reset query cache;
flush status;
---echo ----- establish connection root -----
connect (root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
connection root;
show grants for current_user;
@@ -67,7 +66,6 @@ insert into mysqltest.t2 values (3,3,3);
create table test.t1 (a char (10));
insert into test.t1 values ("test.t1");
select * from t1;
---echo ----- establish connection root2 -----
connect (root2,localhost,root,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK);
connection root2;
# put queries in cache
@@ -86,7 +84,6 @@ grant SELECT on test.t1 to mysqltest_2@localhost;
grant SELECT(a) on mysqltest.t1 to mysqltest_3@localhost;
# The following queries should be fetched from cache
---echo ----- establish connection user1 (user=mysqltest_1) -----
connect (user1,localhost,mysqltest_1,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK);
connection user1;
show grants for current_user();
@@ -112,14 +109,12 @@ show status like "Qcache_hits";
show status like "Qcache_not_cached";
---echo ----- establish connection unkuser (user=unkuser) -----
# Don't use '' as user because it will pick Unix login
connect (unkuser,localhost,unkuser,,,$MASTER_MYPORT,$MASTER_MYSOCK);
connection unkuser;
show grants for current_user();
# The following queries should be fetched from cache
---echo ----- establish connection user2 (user=mysqltest_2) -----
connect (user2,localhost,mysqltest_2,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK);
connection user2;
select "user2";
@@ -135,7 +130,6 @@ show status like "Qcache_hits";
show status like "Qcache_not_cached";
# The following queries should not be fetched from cache
---echo ----- establish connection user3 (user=mysqltest_3) -----
connect (user3,localhost,mysqltest_3,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK);
connection user3;
select "user3";
@@ -157,7 +151,6 @@ show status like "Qcache_hits";
show status like "Qcache_not_cached";
# Connect without a database
---echo ----- establish connection user4 (user=mysqltest_1) -----
connect (user4,localhost,mysqltest_1,,*NO-ONE*,$MASTER_MYPORT,$MASTER_MYSOCK);
connection user4;
select "user4";
@@ -175,7 +168,6 @@ show status like "Qcache_not_cached";
# Cleanup
---echo ----- close connections -----
connection root;
disconnect root;
--source include/wait_until_disconnected.inc
@@ -197,7 +189,6 @@ disconnect user4;
connection unkuser;
disconnect unkuser;
--source include/wait_until_disconnected.inc
---echo ----- switch to connection default -----
connection default;
#
diff --git a/mysql-test/include/have_innodb.combinations b/mysql-test/include/have_innodb.combinations
index 49ae741b269..7e9e6b9e3b0 100644
--- a/mysql-test/include/have_innodb.combinations
+++ b/mysql-test/include/have_innodb.combinations
@@ -9,9 +9,13 @@ innodb-locks
innodb-buffer-pool-stats
innodb-buffer-page
innodb-buffer-page-lru
+innodb-sys-columns
+innodb-sys-fields
innodb-sys-foreign
innodb-sys-foreign-cols
+innodb-sys-indexes
innodb-sys-tables
+innodb-sys-virtual
innodb-metrics
[xtradb_plugin]
@@ -43,3 +47,21 @@ innodb-buffer-page-lru
innodb-sys-foreign
innodb-sys-foreign-cols
innodb-sys-tables
+
+[innodb]
+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-columns
+innodb-sys-fields
+innodb-sys-foreign
+innodb-sys-foreign-cols
+innodb-sys-indexes
+innodb-sys-tables
+innodb-sys-virtual
diff --git a/mysql-test/include/have_innodb_32k.inc b/mysql-test/include/have_innodb_32k.inc
index 76a8d2d59a3..4f7f5454e87 100644
--- a/mysql-test/include/have_innodb_32k.inc
+++ b/mysql-test/include/have_innodb_32k.inc
@@ -1,6 +1,4 @@
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
+ --skip Test requires InnoDB with 32k page size.
+}
diff --git a/mysql-test/include/have_innodb_4k.inc b/mysql-test/include/have_innodb_4k.inc
new file mode 100644
index 00000000000..f51b8bf66b9
--- /dev/null
+++ b/mysql-test/include/have_innodb_4k.inc
@@ -0,0 +1,6 @@
+--disable_warnings
+if (`SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE LOWER(variable_name) = 'innodb_page_size' AND variable_value = 4096`)
+{
+ --skip Test requires InnoDB with 4k Page size.
+}
+--enable_warnings
diff --git a/mysql-test/include/have_innodb_64k.inc b/mysql-test/include/have_innodb_64k.inc
index bcb76c4f54e..6f0fadc25ac 100644
--- a/mysql-test/include/have_innodb_64k.inc
+++ b/mysql-test/include/have_innodb_64k.inc
@@ -1,4 +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.
+ --skip Test requires InnoDB with 64k page size.
}
diff --git a/mysql-test/include/have_innodb_8k.inc b/mysql-test/include/have_innodb_8k.inc
new file mode 100644
index 00000000000..125a4e4d6af
--- /dev/null
+++ b/mysql-test/include/have_innodb_8k.inc
@@ -0,0 +1,6 @@
+--disable_warnings
+if (`SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE LOWER(variable_name) = 'innodb_page_size' AND variable_value = 8192`)
+{
+ --skip Test requires InnoDB with 8k Page size.
+}
+--enable_warnings
diff --git a/mysql-test/include/have_innodb_bzip2.inc b/mysql-test/include/have_innodb_bzip2.inc
deleted file mode 100644
index afbe78f0cf9..00000000000
--- a/mysql-test/include/have_innodb_bzip2.inc
+++ /dev/null
@@ -1,4 +0,0 @@
-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_lz4.inc b/mysql-test/include/have_innodb_lz4.inc
deleted file mode 100644
index bda3ffa8623..00000000000
--- a/mysql-test/include/have_innodb_lz4.inc
+++ /dev/null
@@ -1,4 +0,0 @@
-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
deleted file mode 100644
index 86eda33f194..00000000000
--- a/mysql-test/include/have_innodb_lzma.inc
+++ /dev/null
@@ -1,4 +0,0 @@
-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
deleted file mode 100644
index f40418b00fb..00000000000
--- a/mysql-test/include/have_innodb_lzo.inc
+++ /dev/null
@@ -1,4 +0,0 @@
-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_max_16k.inc b/mysql-test/include/have_innodb_max_16k.inc
new file mode 100644
index 00000000000..f8346666299
--- /dev/null
+++ b/mysql-test/include/have_innodb_max_16k.inc
@@ -0,0 +1,4 @@
+if (`SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE LOWER(variable_name) = 'innodb_page_size' AND variable_value <= 16384`)
+{
+ --skip Test requires InnoDB with page size not greater than 16k.
+}
diff --git a/mysql-test/include/have_innodb_snappy.inc b/mysql-test/include/have_innodb_snappy.inc
deleted file mode 100644
index c4dca4c19ee..00000000000
--- a/mysql-test/include/have_innodb_snappy.inc
+++ /dev/null
@@ -1,4 +0,0 @@
-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_numa.inc b/mysql-test/include/have_numa.inc
new file mode 100644
index 00000000000..18bca99e04d
--- /dev/null
+++ b/mysql-test/include/have_numa.inc
@@ -0,0 +1,9 @@
+let $numa_support = `SELECT COUNT(VARIABLE_VALUE) = 1 FROM
+ INFORMATION_SCHEMA.GLOBAL_VARIABLES
+ WHERE VARIABLE_NAME='innodb_numa_interleave'`;
+
+if ( $numa_support == 0 )
+{
+ --skip Test requires: Binary must be built with NUMA support.
+}
+
diff --git a/mysql-test/include/icp_tests.inc b/mysql-test/include/icp_tests.inc
index 88d6923d8f9..f29088887d0 100644
--- a/mysql-test/include/icp_tests.inc
+++ b/mysql-test/include/icp_tests.inc
@@ -509,7 +509,7 @@ CREATE TABLE t2 (
);
--disable_warnings
-INSERT INTO t2 VALUES ();
+INSERT IGNORE INTO t2 VALUES ();
INSERT INTO t1 VALUES ();
--enable_warnings
@@ -610,7 +610,7 @@ CREATE TABLE t1 (
KEY idx4267 (col1000, col1003)
);
-INSERT INTO t1 VALUES (),();
+INSERT IGNORE INTO t1 VALUES (),();
SELECT col999 FROM t1 WHERE col1000 = "3" AND col1003 <=> sysdate();
DROP TABLE t1;
@@ -888,7 +888,7 @@ DROP TABLE t1;
# MDEV-308 lp:1008516 - Failing assertion: templ->mysql_col_len == len
#
create table t1 (a int,b char(5),primary key (a), key (b(1)));
-insert into t1 values ('a','b');
+insert ignore into t1 values ('a','b');
select 1 from t1 where a and b >= 'aa';
drop table t1;
diff --git a/mysql-test/include/kill_and_restart_mysqld.inc b/mysql-test/include/kill_and_restart_mysqld.inc
deleted file mode 100644
index f2ac9b504d2..00000000000
--- a/mysql-test/include/kill_and_restart_mysqld.inc
+++ /dev/null
@@ -1,19 +0,0 @@
---let $_server_id= `SELECT @@server_id`
---let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect
-
-if ($restart_parameters)
-{
- --echo # Kill and restart: $restart_parameters
- --exec echo "restart: $restart_parameters" > $_expect_file_name
-}
-if (!$restart_parameters)
-{
- --echo # Kill and restart
- --exec echo "restart" > $_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/loaddata_autocom.inc b/mysql-test/include/loaddata_autocom.inc
index 3bf88fefa6d..7b0c67d2ca8 100644
--- a/mysql-test/include/loaddata_autocom.inc
+++ b/mysql-test/include/loaddata_autocom.inc
@@ -11,13 +11,13 @@ let $load_file= $MYSQLTEST_VARDIR/std_data/loaddata2.dat;
create table t1 (id int unsigned not null auto_increment primary key, a text, b text);
start transaction;
--replace_result $load_file LOAD_FILE
-eval load data infile '$load_file' into table t1 fields terminated by ',' enclosed by '''' (a, b);
+eval load data infile '$load_file' ignore into table t1 fields terminated by ',' enclosed by '''' (a, b);
commit;
select count(*) from t1;
truncate table t1;
start transaction;
--replace_result $load_file LOAD_FILE
-eval load data infile '$load_file' into table t1 fields terminated by ',' enclosed by '''' (a, b);
+eval load data infile '$load_file' ignore into table t1 fields terminated by ',' enclosed by '''' (a, b);
rollback;
select count(*) from t1;
diff --git a/mysql-test/include/mix1.inc b/mysql-test/include/mix1.inc
index c837eb7a7ad..6a47b39e5bc 100644
--- a/mysql-test/include/mix1.inc
+++ b/mysql-test/include/mix1.inc
@@ -236,6 +236,15 @@ create table t2i (a int);
insert into t2m values (5);
insert into t2i values (5);
+-- disable_query_log
+-- disable_result_log
+analyze table t1i;
+analyze table t1m;
+analyze table t2i;
+analyze table t2m;
+-- enable_result_log
+-- enable_query_log
+
# test with $engine_type
select min(a) from t1i;
select min(7) from t1i;
@@ -411,6 +420,13 @@ if ($test_foreign_keys)
INSERT INTO t1 VALUES (1,'A1'),(2,'A2'),(3,'B');
INSERT INTO t2 VALUES (1,1),(2,2),(3,2),(4,3),(5,3);
+-- disable_query_log
+-- disable_result_log
+ANALYZE TABLE t1;
+ANALYZE TABLE t2;
+-- enable_result_log
+-- enable_query_log
+
EXPLAIN
SELECT COUNT(*) FROM t2 LEFT JOIN t1 ON t2.fkey = t1.id
WHERE t1.name LIKE 'A%';
@@ -557,14 +573,14 @@ INSERT INTO t1(stat_id,acct_id) VALUES
INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
-INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
-INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
-INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
-INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
-INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
-INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
-INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
-INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+INSERT IGNORE INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+INSERT IGNORE INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+INSERT IGNORE INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+INSERT IGNORE INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+INSERT IGNORE INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+INSERT IGNORE INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+INSERT IGNORE INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+INSERT IGNORE INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
UPDATE t1 SET acct_id=785
WHERE MOD(stat_id,2)=0 AND MOD(id,stat_id)=MOD(acct_id,stat_id);
OPTIMIZE TABLE t1;
@@ -572,12 +588,22 @@ OPTIMIZE TABLE t1;
SELECT COUNT(*) FROM t1;
SELECT COUNT(*) FROM t1 WHERE acct_id=785;
+-- disable_query_log
+-- disable_result_log
+ANALYZE TABLE t1;
+-- enable_result_log
+-- enable_query_log
+
EXPLAIN SELECT COUNT(*) FROM t1 WHERE stat_id IN (1,3) AND acct_id=785;
INSERT INTO t2 SELECT * FROM t1;
OPTIMIZE TABLE t2;
-EXPLAIN SELECT COUNT(*) FROM t2 WHERE stat_id IN (1,3) AND acct_id=785;
+-- disable_query_log
+-- disable_result_log
+ANALYZE TABLE t2;
+-- enable_result_log
+-- enable_query_log
DROP TABLE t1,t2;
@@ -624,6 +650,11 @@ DROP TABLE t1,t2,t3;
# Test bug when trying to drop data file which no InnoDB directory entry
#
+--disable_query_log
+call mtr.add_suppression("InnoDB: Table .*bug29807.*");
+call mtr.add_suppression("InnoDB: Cannot open table test/bug29807 from");
+--enable_query_log
+
create table t1 (a int) engine=innodb;
let $MYSQLD_DATADIR= `select @@datadir`;
copy_file $MYSQLD_DATADIR/test/t1.frm $MYSQLD_DATADIR/test/bug29807.frm;
@@ -631,10 +662,6 @@ copy_file $MYSQLD_DATADIR/test/t1.frm $MYSQLD_DATADIR/test/bug29807.frm;
select * from bug29807;
drop table t1;
drop table bug29807;
---disable_query_log
-call mtr.add_suppression("InnoDB: Error: table .test...bug29807. does not exist in the InnoDB internal");
-call mtr.add_suppression("InnoDB: Cannot open table test/bug29807 from");
---enable_query_log
#
@@ -647,23 +674,21 @@ CREATE TABLE t2 (a INT) ENGINE=InnoDB;
CONNECT (c1,localhost,root,,);
CONNECT (c2,localhost,root,,);
---echo switch to connection c1
CONNECTION c1;
SET AUTOCOMMIT=0;
INSERT INTO t2 VALUES (1);
---echo switch to connection c2
CONNECTION c2;
SET AUTOCOMMIT=0;
+SET @old_lock_wait_timeout= @@lock_wait_timeout;
+SET lock_wait_timeout= 1;
--error ER_LOCK_WAIT_TIMEOUT
LOCK TABLES t1 READ, t2 READ;
-
---echo switch to connection c1
+SET @@lock_wait_timeout= @old_lock_wait_timeout;
CONNECTION c1;
COMMIT;
INSERT INTO t1 VALUES (1);
---echo switch to connection default
CONNECTION default;
SET AUTOCOMMIT=default;
DISCONNECT c1;
@@ -705,6 +730,13 @@ INSERT INTO t1(b,c) SELECT b,c FROM t2;
UPDATE t2 SET c='2007-01-03';
INSERT INTO t1(b,c) SELECT b,c FROM t2;
+-- disable_query_log
+-- disable_result_log
+ANALYZE TABLE t1;
+ANALYZE TABLE t2;
+-- enable_result_log
+-- enable_query_log
+
set @@sort_buffer_size=8192;
SELECT COUNT(*) FROM t1;
@@ -794,6 +826,12 @@ INSERT INTO t1 SELECT a + 16, MOD(a + 16, 20), 1 FROM t1;
INSERT INTO t1 SELECT a + 32, MOD(a + 32, 20), 1 FROM t1;
INSERT INTO t1 SELECT a + 64, MOD(a + 64, 20), 1 FROM t1;
+-- disable_query_log
+-- disable_result_log
+ANALYZE TABLE t1;
+-- enable_result_log
+-- enable_query_log
+
EXPLAIN SELECT b, SUM(c) FROM t1 GROUP BY b;
EXPLAIN SELECT SQL_BIG_RESULT b, SUM(c) FROM t1 GROUP BY b;
DROP TABLE t1;
@@ -856,6 +894,11 @@ CREATE TABLE t1 (a int, b int, PRIMARY KEY (a), KEY bkey (b)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1,2),(3,2),(2,2),(4,2),(5,2),(6,2),(7,2),(8,2);
INSERT INTO t1 SELECT a + 8, 2 FROM t1;
INSERT INTO t1 SELECT a + 16, 1 FROM t1;
+-- disable_query_log
+-- disable_result_log
+ANALYZE TABLE t1;
+-- enable_result_log
+-- enable_query_log
query_vertical EXPLAIN SELECT * FROM t1 WHERE b=2 ORDER BY a;
SELECT * FROM t1 WHERE b=2 ORDER BY a;
query_vertical EXPLAIN SELECT * FROM t1 WHERE b BETWEEN 1 AND 2 ORDER BY a;
@@ -869,6 +912,12 @@ INSERT INTO t2 VALUES (1,1,1),(3,1,1),(2,1,1),(4,1,1);
INSERT INTO t2 SELECT a + 4, 1, 1 FROM t2;
INSERT INTO t2 SELECT a + 8, 1, 1 FROM t2;
+-- disable_query_log
+-- disable_result_log
+ANALYZE TABLE t2;
+-- enable_result_log
+-- enable_query_log
+
query_vertical EXPLAIN SELECT * FROM t2 WHERE b=1 ORDER BY a;
SELECT * FROM t2 WHERE b=1 ORDER BY a;
query_vertical EXPLAIN SELECT * FROM t2 WHERE b=1 AND c=1 ORDER BY a;
@@ -938,6 +987,7 @@ DROP TABLE t1;
#
create table t1(a text) engine=innodb default charset=utf8;
insert into t1 values('aaa');
+set statement sql_mode = 'NO_ENGINE_SUBSTITUTION' for
alter table t1 add index(a(1024));
show create table t1;
drop table t1;
@@ -960,7 +1010,7 @@ SELECT * FROM t1 WHERE b=20 FOR UPDATE;
--connect (conn2, localhost, root,,test)
-# This statement gives a "failed: 1205: Lock wait timeout exceeded; try
+# This statement gives a "failed: 1205: Lock wait timeout exceeded; try
# restarting transaction" message when the bug is present.
START TRANSACTION;
SELECT * FROM t1 WHERE b=10 ORDER BY A FOR UPDATE;
@@ -985,6 +1035,12 @@ CREATE TABLE t1(
INSERT INTO t1 VALUES (1,1,1,50), (1,2,3,40), (2,1,3,4);
+-- disable_query_log
+-- disable_result_log
+ANALYZE TABLE t1;
+-- enable_result_log
+-- enable_query_log
+
EXPLAIN SELECT c,b,d FROM t1 GROUP BY c,b,d;
SELECT c,b,d FROM t1 GROUP BY c,b,d;
EXPLAIN SELECT c,b,d FROM t1 GROUP BY c,b,d ORDER BY NULL;
@@ -1005,6 +1061,12 @@ DROP TABLE t1;
CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a), INDEX b (b)) ENGINE=InnoDB;
INSERT INTO t1(a,b) VALUES (1,1), (2,2), (3,2);
+-- disable_query_log
+-- disable_result_log
+ANALYZE TABLE t1;
+-- enable_result_log
+-- enable_query_log
+
#The two queries below should produce different results, but they don't.
query_vertical EXPLAIN SELECT * FROM t1 WHERE b=2 ORDER BY a ASC;
SELECT * FROM t1 WHERE b=2 ORDER BY a ASC;
@@ -1088,6 +1150,12 @@ CREATE TABLE t1 (id int, type char(6), d int, INDEX idx(id,d)) ENGINE=InnoDB;
INSERT INTO t1 VALUES
(191, 'member', 1), (NULL, 'member', 3), (NULL, 'member', 4), (201, 'member', 2);
+-- disable_query_log
+-- disable_result_log
+ANALYZE TABLE t1;
+-- enable_result_log
+-- enable_query_log
+
EXPLAIN SELECT * FROM t1 WHERE id=191 OR id IS NULL ORDER BY d;
SELECT * FROM t1 WHERE id=191 OR id IS NULL ORDER BY d;
@@ -1116,12 +1184,13 @@ CREATE TABLE t1 (a int, b int, c int, PRIMARY KEY (a), KEY t1_b (b))
INSERT INTO t1 (a,b,c) VALUES (1,1,1), (2,1,1), (3,1,1), (4,1,1);
INSERT INTO t1 (a,b,c) SELECT a+4,b,c FROM t1;
-# should be range access
+-- disable_query_log
+-- disable_result_log
+ANALYZE TABLE t1;
+-- enable_result_log
+-- enable_query_log
-#
-# InnoDB uses "where", while xtradb "index condition"
-#
---replace_regex /where/index condition/
+# should be range access
EXPLAIN SELECT a, b, c FROM t1 WHERE b = 1 ORDER BY a DESC LIMIT 5;
# should produce '8 7 6 5 4' for a
@@ -1327,7 +1396,6 @@ connect (con2,localhost,root,,);
SET SESSION AUTOCOMMIT = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
set binlog_format=mixed;
---echo # Switch to connection con1
connection con1;
eval
@@ -1343,7 +1411,6 @@ UPDATE t1 SET b = 12 WHERE a = 1;
--disable_info
SELECT * FROM t1;
---echo # Switch to connection con2
connection con2;
--enable_info
@@ -1352,16 +1419,13 @@ connection con2;
UPDATE t1 SET b = 21 WHERE a = 1;
--disable_info
---echo # Switch to connection con1
connection con1;
SELECT * FROM t1;
ROLLBACK;
---echo # Switch to connection con2
connection con2;
ROLLBACK;
---echo # Switch to connection con1
connection con1;
--echo # 2. test for serialized update:
@@ -1395,12 +1459,10 @@ UPDATE t1 SET b = CONCAT(b, '+con1') WHERE a = 1;
--disable_info
SELECT * FROM t1;
---echo # Switch to connection con2
connection con2;
--send CALL p1;
---echo # Switch to connection con1
connection con1;
SELECT * FROM t1;
COMMIT;
@@ -1413,13 +1475,11 @@ while ($bug31310)
SELECT * FROM t1;
---echo # Switch to connection con2
connection con2;
--reap
SELECT * FROM t1;
COMMIT;
---echo # Switch to connection con1
connection con1;
--echo # 3. test for updated key column:
@@ -1435,12 +1495,10 @@ UPDATE t1 SET a = 2, b = CONCAT(b, '+con1') WHERE a = 1;
--disable_info
SELECT * FROM t1;
---echo # Switch to connection con2
connection con2;
--send CALL p1;
---echo # Switch to connection con1
connection con1;
SELECT * FROM t1;
COMMIT;
@@ -1453,7 +1511,6 @@ while ($bug31310)
SELECT * FROM t1;
---echo # Switch to connection con2
connection con2;
--reap
SELECT * FROM t1;
@@ -1502,6 +1559,7 @@ if ($test_foreign_keys)
# auto_increment keys
#
create table t1 (a int auto_increment primary key) engine=innodb;
+set statement sql_mode = 'NO_ENGINE_SUBSTITUTION' for
alter table t1 order by a;
drop table t1;
@@ -1527,6 +1585,12 @@ INSERT INTO t1 VALUES
(4,1,3,'pk',NULL),(5,1,3,'c2',NULL),
(2,1,4,'c_extra',NULL),(3,1,4,'c_extra',NULL);
+-- disable_query_log
+-- disable_result_log
+ANALYZE TABLE t1;
+-- enable_result_log
+-- enable_query_log
+
EXPLAIN SELECT * FROM t1 FORCE INDEX (PRIMARY) WHERE tid = 1 AND vid = 3 ORDER BY idx DESC;
SELECT * FROM t1 FORCE INDEX (PRIMARY) WHERE tid = 1 AND vid = 3 ORDER BY idx DESC;
@@ -1544,6 +1608,12 @@ CREATE TABLE t1 (c1 INT, c2 INT, c3 INT, KEY (c3), KEY (c2, c3))
ENGINE=$engine_type;
INSERT INTO t1 VALUES (1,1,1), (1,1,1), (1,1,2), (1,1,1), (1,1,2);
+-- disable_query_log
+-- disable_result_log
+ANALYZE TABLE t1;
+-- enable_result_log
+-- enable_query_log
+
SELECT 1 FROM (SELECT COUNT(DISTINCT c1)
FROM t1 WHERE c2 IN (1, 1) AND c3 = 2 GROUP BY c2) x;
EXPLAIN
@@ -1557,6 +1627,12 @@ CREATE TABLE t1 (c1 REAL, c2 REAL, c3 REAL, KEY (c3), KEY (c2, c3))
ENGINE=$engine_type;
INSERT INTO t1 VALUES (1,1,1), (1,1,1), (1,1,2), (1,1,1), (1,1,2);
+-- disable_query_log
+-- disable_result_log
+ANALYZE TABLE t1;
+-- enable_result_log
+-- enable_query_log
+
SELECT 1 FROM (SELECT COUNT(DISTINCT c1)
FROM t1 WHERE c2 IN (1, 1) AND c3 = 2 GROUP BY c2) x;
EXPLAIN
@@ -1571,6 +1647,12 @@ CREATE TABLE t1 (c1 DECIMAL(12,2), c2 DECIMAL(12,2), c3 DECIMAL(12,2),
ENGINE=$engine_type;
INSERT INTO t1 VALUES (1,1,1), (1,1,1), (1,1,2), (1,1,1), (1,1,2);
+-- disable_query_log
+-- disable_result_log
+ANALYZE TABLE t1;
+-- enable_result_log
+-- enable_query_log
+
SELECT 1 FROM (SELECT COUNT(DISTINCT c1)
FROM t1 WHERE c2 IN (1, 1) AND c3 = 2 GROUP BY c2) x;
EXPLAIN
@@ -1598,6 +1680,13 @@ CREATE TABLE t2 (
insert into t1 values (0),(1),(2),(3),(4);
insert into t2 select A.a + 10 *B.a, 1, 'filler' from t1 A, t1 B;
+-- disable_query_log
+-- disable_result_log
+analyze table t1;
+analyze table t2;
+-- enable_result_log
+-- enable_query_log
+
explain select * from t1, t2 where t2.a=t1.a and t2.b + 1;
select * from t1, t2 where t2.a=t1.a and t2.b + 1;
@@ -1616,23 +1705,18 @@ eval CREATE TABLE t1 (a INT) ENGINE=$engine_type;
INSERT INTO t1 VALUES (1),(2),(3);
BEGIN;
SELECT * FROM t1 ORDER BY a;
---echo # Connection con1
connect (con1, localhost, root,,);
--send TRUNCATE TABLE t1;
---echo # Connection default
connection default;
let $wait_condition= SELECT COUNT(*)=1 FROM information_schema.processlist
WHERE state='Waiting for table metadata lock' AND info='TRUNCATE TABLE t1';
--source include/wait_condition.inc
SELECT * FROM t1 ORDER BY a;
ROLLBACK;
---echo # Connection con1
connection con1;
--echo # Reaping TRUNCATE TABLE
--reap
SELECT * FROM t1;
---echo # Disconnect con1
disconnect con1;
---echo # Connection default
connection default;
DROP TABLE t1;
diff --git a/mysql-test/include/mix2.inc b/mysql-test/include/mix2.inc
index cdc39f8407f..53c1ffd36a3 100644
--- a/mysql-test/include/mix2.inc
+++ b/mysql-test/include/mix2.inc
@@ -54,7 +54,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 explicitely,
+# the storage engine is assigned explicitly,
eval SET SESSION STORAGE_ENGINE = $other_engine_type;
#
@@ -1470,9 +1470,11 @@ source include/varchar.inc;
--replace_result \\ / $MYSQL_TEST_DIR . /var/mysqld.1/data/ / t1.frm t1
create table t1 (v varchar(65530), key(v));
drop table t1;
+SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
create table t1 (v varchar(65536));
show create table t1;
drop table t1;
+SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
create table t1 (v varchar(65530) character set utf8);
show create table t1;
drop table t1;
diff --git a/mysql-test/include/mtr_check.sql b/mysql-test/include/mtr_check.sql
index 6b25c75276c..d47e7d322b5 100644
--- a/mysql-test/include/mtr_check.sql
+++ b/mysql-test/include/mtr_check.sql
@@ -32,6 +32,7 @@ BEGIN
AND variable_name not like "Last_IO_Err*"
AND variable_name != 'INNODB_IBUF_MAX_SIZE'
AND variable_name != 'INNODB_USE_NATIVE_AIO'
+ AND variable_name != 'INNODB_BUFFER_POOL_LOAD_AT_STARTUP'
AND variable_name not like 'GTID%POS'
AND variable_name != 'GTID_BINLOG_STATE'
ORDER BY variable_name;
diff --git a/mysql-test/include/mtr_warnings.sql b/mysql-test/include/mtr_warnings.sql
index 535090b75dd..71c693961c1 100644
--- a/mysql-test/include/mtr_warnings.sql
+++ b/mysql-test/include/mtr_warnings.sql
@@ -206,14 +206,6 @@ INSERT INTO global_suppressions VALUES
("==[0-9]*== Warning: invalid file descriptor -1 in syscall read()"),
/*
- BUG#42147 - Concurrent DML and LOCK TABLE ... READ for InnoDB
- table cause warnings in errlog
- Note: This is a temporary suppression until Bug#42147 can be
- fixed properly. See bug page for more information.
- */
- ("Found lock of type 6 that is write and read locked"),
-
- /*
Transient network failures that cause warnings on reconnect.
BUG#47743 and BUG#47983.
*/
diff --git a/mysql-test/include/ps_conv.inc b/mysql-test/include/ps_conv.inc
index 2e42542d19a..d31f41ef39d 100644
--- a/mysql-test/include/ps_conv.inc
+++ b/mysql-test/include/ps_conv.inc
@@ -576,6 +576,7 @@ prepare my_delete from "delete from t9 where c21 = 'O' ";
#
# Use the maximum BIGINT from the manual
set @arg00= 9223372036854775807 ;
+set statement sql_mode = '' for
execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
@arg00, @arg00, @arg00, @arg00, @arg00 ;
--vertical_results
@@ -585,6 +586,7 @@ execute my_select ;
--replace_result e+0 e+
execute my_delete ;
set @arg00= '9223372036854775807' ;
+set statement sql_mode = '' for
execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
@arg00, @arg00, @arg00, @arg00, @arg00 ;
--vertical_results
@@ -596,6 +598,7 @@ execute my_delete ;
# Use the minimum BIGINT from the manual
#
set @arg00= -9223372036854775808 ;
+set statement sql_mode = '' for
execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
@arg00, @arg00, @arg00, @arg00, @arg00 ;
--vertical_results
@@ -605,6 +608,7 @@ execute my_select ;
--replace_result e+0 e+
execute my_delete ;
set @arg00= '-9223372036854775808' ;
+set statement sql_mode = '' for
execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
@arg00, @arg00, @arg00, @arg00, @arg00 ;
--vertical_results
@@ -618,6 +622,7 @@ execute my_delete ;
# (FLOAT,REAL,DOUBLE) during insert
#
set @arg00= 1.11111111111111111111e+50 ;
+set statement sql_mode = '' for
execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
@arg00, @arg00, @arg00, @arg00, @arg00 ;
--vertical_results
@@ -630,6 +635,7 @@ execute my_delete ;
# because the string is treated as written integer and
# '.11111111111111111111e+50' is cut away.
set @arg00= '1.11111111111111111111e+50' ;
+set statement sql_mode = '' for
execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
@arg00, @arg00, @arg00, @arg00, @arg00 ;
--vertical_results
@@ -639,6 +645,7 @@ execute my_select ;
--replace_result e+0 e+
execute my_delete ;
set @arg00= -1.11111111111111111111e+50 ;
+set statement sql_mode = '' for
execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
@arg00, @arg00, @arg00, @arg00, @arg00 ;
--vertical_results
@@ -651,6 +658,7 @@ execute my_delete ;
# because the string is treated as written integer and
# '.11111111111111111111e+50' is cut away.
set @arg00= '-1.11111111111111111111e+50' ;
+set statement sql_mode = '' for
execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
@arg00, @arg00, @arg00, @arg00, @arg00 ;
--vertical_results
@@ -672,6 +680,7 @@ select '-- insert into string columns --' as test_sequence ;
--enable_query_log
######## INSERT into .. string columns values(CHAR(n),LONGTEXT) ########
+set sql_mode = '';
insert into t9
( c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30 )
values
@@ -803,6 +812,7 @@ values
( 57, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ;
execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
@arg00, @arg00, @arg00, @arg00 ;
+set sql_mode = default;
######## INSERT into .. string columns values(LONGBLOB,NULL) ########
@@ -984,6 +994,7 @@ delete from t9 ;
select '-- insert into date/time columns --' as test_sequence ;
--enable_query_log
######## INSERT into .. date/time columns values(VARCHAR(19),LONGTEXT) ########
+set sql_mode = '';
set @arg00= '1991-01-01 01:01:01' ;
insert into t9
( c1, c13, c14, c15, c16, c17 )
@@ -1079,6 +1090,7 @@ prepare stmt2 from "insert into t9
values
( 53, ?, ?, ?, ?, ? )" ;
execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00 ;
+set sql_mode = default;
######## INSERT into .. date/time columns values(LONGBLOB,NULL) ########
diff --git a/mysql-test/include/ps_modify.inc b/mysql-test/include/ps_modify.inc
index f66f888261d..d4cd4dbe346 100644
--- a/mysql-test/include/ps_modify.inc
+++ b/mysql-test/include/ps_modify.inc
@@ -108,7 +108,9 @@ execute stmt1 using @arg00, @arg01;
select a,b from t1 where a=@arg00;
set @arg00=NULL;
set @arg01=2;
+set sql_mode = '';
execute stmt1 using @arg00, @arg01;
+set sql_mode = default;
select a,b from t1 order by a;
set @arg00=0;
execute stmt1 using @arg01, @arg00;
diff --git a/mysql-test/include/query_cache.inc b/mysql-test/include/query_cache.inc
index 56dae83db2f..fcb9c2494d4 100644
--- a/mysql-test/include/query_cache.inc
+++ b/mysql-test/include/query_cache.inc
@@ -124,7 +124,6 @@ eval SET SESSION STORAGE_ENGINE = $engine_type;
SET @@autocommit=1;
connection default;
---echo connection default
# This should be 'YES'.
SHOW VARIABLES LIKE 'have_query_cache';
@@ -142,7 +141,6 @@ SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
show status like "Qcache_queries_in_cache";
connection connection1;
---echo connection connection1
START TRANSACTION;
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
INSERT INTO t2 VALUES (5,'w');
@@ -153,7 +151,6 @@ SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
show status like "Qcache_queries_in_cache";
connection default;
---echo connection default
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
COMMIT;
@@ -163,7 +160,6 @@ SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
show status like "Qcache_queries_in_cache";
connection connection1;
---echo connection connection1
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
START TRANSACTION;
@@ -172,7 +168,6 @@ INSERT INTO t2 VALUES (6,'w');
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
connection default;
---echo connection default
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
START TRANSACTION;
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
@@ -181,7 +176,6 @@ SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
COMMIT;
connection connection1;
---echo connection connection1
COMMIT;
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
diff --git a/mysql-test/include/query_cache_sql_prepare.inc b/mysql-test/include/query_cache_sql_prepare.inc
index 41276ed5a79..1bc7c94a172 100644
--- a/mysql-test/include/query_cache_sql_prepare.inc
+++ b/mysql-test/include/query_cache_sql_prepare.inc
@@ -23,9 +23,7 @@
set GLOBAL query_cache_type=ON;
set LOCAL query_cache_type=ON;
---echo ---- establish connection con1 (root) ----
connect (con1,localhost,root,,test,$MASTER_MYPORT,);
---echo ---- switch to connection default ----
connection default;
set @initial_query_cache_size = @@global.query_cache_size;
@@ -55,7 +53,6 @@ show status like 'Qcache_hits';
execute stmt2;
show status like 'Qcache_hits';
# Another prepared statement (same text, other connection), should hit the QC
---echo ---- switch to connection con1 ----
connection con1;
prepare stmt3 from "select * from t1 where c1=10";
execute stmt3;
@@ -64,7 +61,6 @@ execute stmt3;
show status like 'Qcache_hits';
execute stmt3;
show status like 'Qcache_hits';
---echo ---- switch to connection default ----
connection default;
# Mixup tests, where statements without PREPARE.../EXECUTE.... meet statements
@@ -89,20 +85,16 @@ execute stmt10;
show status like 'Qcache_hits';
eval $my_stmt;
show status like 'Qcache_hits';
---echo ---- switch to connection con1 ----
connection con1;
eval $my_stmt;
show status like 'Qcache_hits';
---echo ---- switch to connection default ----
connection default;
#
# Statement without PREPARE.../EXECUTE.... first
let $my_stmt= SELECT * FROM t1 WHERE c1 = 1;
eval prepare stmt11 from "$my_stmt";
---echo ---- switch to connection con1 ----
connection con1;
eval prepare stmt12 from "$my_stmt";
---echo ---- switch to connection default ----
connection default;
eval $my_stmt;
show status like 'Qcache_hits';
@@ -110,11 +102,9 @@ eval $my_stmt;
show status like 'Qcache_hits';
execute stmt11;
show status like 'Qcache_hits';
---echo ---- switch to connection con1 ----
connection con1;
execute stmt12;
show status like 'Qcache_hits';
---echo ---- switch to connection default ----
connection default;
# Query caching also works when statement has parameters
@@ -127,7 +117,6 @@ execute stmt1 using @a;
show status like 'Qcache_hits';
execute stmt1 using @a;
show status like 'Qcache_hits';
---echo ---- switch to connection con1 ----
connection con1;
set @a=1;
prepare stmt4 from "select * from t1 where c1=?";
@@ -139,7 +128,6 @@ execute stmt4 using @a;
show status like 'Qcache_hits';
execute stmt4 using @a;
show status like 'Qcache_hits';
---echo ---- switch to connection default ----
connection default;
# See if enabling/disabling the query cache between PREPARE and
@@ -168,7 +156,6 @@ execute stmt1;
show status like 'Qcache_hits';
# The QC is global = affects also other connections.
# Expect to see no additional Qcache_hits.
---echo ---- switch to connection con1 ----
connection con1;
execute stmt3;
show status like 'Qcache_hits';
@@ -178,7 +165,6 @@ execute stmt3;
show status like 'Qcache_hits';
#
# then QC is re-enabled for more EXECUTE.
---echo ---- switch to connection default ----
connection default;
set global query_cache_size=102400;
# Expect to see additional Qcache_hits.
@@ -193,7 +179,6 @@ show status like 'Qcache_hits';
execute stmt1;
show status like 'Qcache_hits';
# The QC is global = affects also other connections.
---echo ---- switch to connection con1 ----
connection con1;
execute stmt3;
show status like 'Qcache_hits';
@@ -201,7 +186,6 @@ execute stmt3;
show status like 'Qcache_hits';
execute stmt3;
show status like 'Qcache_hits';
---echo ---- switch to connection default ----
connection default;
#
# then QC is re-disabled for more EXECUTE.
@@ -216,7 +200,6 @@ show status like 'Qcache_hits';
execute stmt1;
show status like 'Qcache_hits';
# The QC is global = affects also other connections.
---echo ---- switch to connection con1 ----
connection con1;
execute stmt3;
show status like 'Qcache_hits';
@@ -226,15 +209,12 @@ execute stmt3;
show status like 'Qcache_hits';
#
---echo ---- switch to connection default ----
connection default;
# QC is disabled at PREPARE
set global query_cache_size=0;
prepare stmt1 from "select * from t1 where c1=10";
---echo ---- switch to connection con1 ----
connection con1;
prepare stmt3 from "select * from t1 where c1=10";
---echo ---- switch to connection default ----
connection default;
# then QC is enabled at EXECUTE
set global query_cache_size=102400;
@@ -246,7 +226,6 @@ show status like 'Qcache_hits';
execute stmt1;
show status like 'Qcache_hits';
# The QC is global = affects also other connections.
---echo ---- switch to connection con1 ----
connection con1;
show status like 'Qcache_hits';
execute stmt3;
@@ -255,7 +234,6 @@ execute stmt3;
show status like 'Qcache_hits';
execute stmt3;
show status like 'Qcache_hits';
---echo ---- switch to connection default ----
connection default;
#
# QC is disabled at PREPARE
@@ -276,7 +254,6 @@ show status like 'Qcache_hits';
drop table t1;
---echo ---- disconnect connection con1 ----
disconnect con1;
#
diff --git a/mysql-test/include/relocate_binlogs.inc b/mysql-test/include/relocate_binlogs.inc
index d5d1135dda3..593ea0e9fbf 100644
--- a/mysql-test/include/relocate_binlogs.inc
+++ b/mysql-test/include/relocate_binlogs.inc
@@ -101,16 +101,16 @@ if ($relocate_index_file)
--eval LOAD DATA INFILE '$relocate_fix_relay_log_info' INTO TABLE tmp (entry)
--let $count= `SELECT count(*) FROM tmp`
- --let $_curr_entry= `SELECT entry FROM tmp WHERE id=1`
+ --let $_curr_entry= `SELECT entry FROM tmp WHERE id=2`
--let $_curr_entry_basename= `SELECT RIGHT(RTRIM("$_curr_entry"), LOCATE("$_path_separator",REVERSE(RTRIM("$_curr_entry"))) -1)`
if ($relocate_is_windows)
{
- --eval UPDATE tmp SET entry='$_to\$_curr_entry_basename' WHERE id=1
+ --eval UPDATE tmp SET entry='$_to\$_curr_entry_basename' WHERE id=2
}
if (!$relocate_is_windows)
{
- --eval UPDATE tmp SET entry='$_to/$_curr_entry_basename' WHERE id=1
+ --eval UPDATE tmp SET entry='$_to/$_curr_entry_basename' WHERE id=2
}
--remove_file $relocate_fix_relay_log_info
diff --git a/mysql-test/include/rpl_assert.inc b/mysql-test/include/rpl_assert.inc
new file mode 100644
index 00000000000..d9963e8e782
--- /dev/null
+++ b/mysql-test/include/rpl_assert.inc
@@ -0,0 +1,118 @@
+# ==== Purpose ====
+#
+# Check if a condition holds, fail with debug info if not.
+#
+# The condition is parsed before executed. The following constructs
+# are supported:
+#
+# [SQL STATEMENT, COLUMN, ROW]
+# The square bracket is replaced by the result from SQL STATEMENT,
+# in the given COLUMN and ROW.
+#
+# <1>
+# This is a shorthand for the result of the first executed square
+# bracket. <2> is a shorthand for the second executed square
+# bracket, and so on.
+#
+# ==== Usage ====
+#
+# --let $assert_text= Relay_Log_Pos must be smaller than pos.
+# --let $assert_cond= [SHOW SLAVE STATUS, Relay_Log_Pos, 1] >= $min_pos AND <1> <= $max_pos
+# [--let $assert_quiet= 1]
+# [--let $rpl_debug= 1]
+# --source include/rpl_assert.inc
+#
+# Parameters:
+#
+# $assert_text
+# Text that describes what is being checked. By default, this text
+# is written to the query log.
+#
+# $assert_cond
+# Condition to check. See above for details about the format. The
+# condition will be executed as `SELECT $assert_cond`. Note: this
+# condition is parsed using SQL statements, quoted inside single
+# quotes, so it must not contain single quotes itself (use double
+# quotes for strings).
+#
+# $assert_quiet
+# Do not print $assert_text to the query log.
+#
+# $rpl_debug
+# Print extra debug info.
+
+
+if ($rpl_debug)
+{
+ --echo # debug: assert_text='$assert_text' assert_cond='$assert_cond'
+}
+
+# Sanity-check input
+if (`SELECT "$assert_text" = ""`)
+{
+ --die ERROR IN TEST: the mysqltest variable rpl_test must be set
+}
+
+# Evaluate square brackets in cond.
+--let $_rpl_assert_substmt_number= 1
+--let $_rpl_interpolated_cond= $assert_cond
+--let $_rpl_assert_lbracket= `SELECT LOCATE('[', '$_rpl_interpolated_cond')`
+while ($_rpl_assert_lbracket)
+{
+ # Get position of right bracket
+ --let $_rpl_assert_rbracket= `SELECT LOCATE(']', '$_rpl_interpolated_cond')`
+ if (!$_rpl_assert_rbracket)
+ {
+ --echo BUG IN TEST: Mismatching square brackets in assert_cond: '$assert_cond'
+ --die BUG IN TEST: Mismatching square brackets in $assert_cond
+ }
+ # Get sub-statement and result of it
+ --let $_rpl_assert_substmt= `SELECT SUBSTRING('$_rpl_interpolated_cond', $_rpl_assert_lbracket + 1, $_rpl_assert_rbracket - $_rpl_assert_lbracket - 1)`
+ --let $_rpl_assert_substmt_result= query_get_value($_rpl_assert_substmt)
+ if ($rpl_debug)
+ {
+ --echo # debug: sub-statement='$_rpl_assert_substmt' result='$rpl_assert_result'
+ }
+ # Replace sub-statement by its result
+ --let $_rpl_interpolated_cond= `SELECT REPLACE('$_rpl_interpolated_cond', '[$_rpl_assert_substmt]', '$_rpl_assert_substmt_result')`
+ # Replace result references by result
+ --let $_rpl_interpolated_cond= `SELECT REPLACE('$_rpl_interpolated_cond', '<$_rpl_assert_substmt_number>', '$_rpl_assert_substmt_result')`
+
+ --let $_rpl_assert_lbracket= `SELECT LOCATE('[', '$_rpl_interpolated_cond')`
+
+ --inc $_rpl_assert_substmt_number
+}
+
+if ($rpl_debug)
+{
+ --echo # debug: interpolated_cond='$_rpl_interpolated_cond'
+}
+
+# Execute.
+--let $_rpl_assert_result= `SELECT $_rpl_interpolated_cond`
+
+if ($rpl_debug)
+{
+ --echo # debug: result='$_rpl_assert_result'
+}
+
+# Check.
+if (!$_rpl_assert_result)
+{
+ --echo ######## Test assertion failed: $assert_text ########
+ --echo Dumping debug info:
+ --source include/show_rpl_debug_info.inc
+ --echo Assertion text: '$assert_text'
+ --echo Assertion condition: '$assert_cond'
+ --echo Assertion condition, interpolated: '$_rpl_interpolated_cond'
+ --echo Assertion result: '$_rpl_assert_result'
+ --die Test assertion failed in rpl_assertion.inc
+}
+
+if (!$assert_quiet)
+{
+ --echo # Asserted this: $assert_text
+}
+
+--let $assert_text=
+--let $assert_cond=
diff --git a/mysql-test/include/rpl_connect.inc b/mysql-test/include/rpl_connect.inc
index 11927833f53..e30769eb335 100644
--- a/mysql-test/include/rpl_connect.inc
+++ b/mysql-test/include/rpl_connect.inc
@@ -51,7 +51,9 @@ if ($rpl_debug)
{
--echo connect ($rpl_connection_name,127.0.0.1,root,,test,$_rpl_port,)
}
+disable_connect_log;
--connect ($rpl_connection_name,127.0.0.1,root,,test,$_rpl_port,)
+enable_connect_log;
--let $include_filename= rpl_connect.inc
diff --git a/mysql-test/include/rpl_connection.inc b/mysql-test/include/rpl_connection.inc
index 1988568a4d2..256a4756e3a 100644
--- a/mysql-test/include/rpl_connection.inc
+++ b/mysql-test/include/rpl_connection.inc
@@ -43,5 +43,7 @@ if ($_include_file_depth)
--echo [connection $rpl_connection_name]
}
}
+disable_connect_log;
--connection $rpl_connection_name
+enable_connect_log;
--let $rpl_connection_name=
diff --git a/mysql-test/include/rpl_connection_master.inc b/mysql-test/include/rpl_connection_master.inc
deleted file mode 100644
index fa09cc8a610..00000000000
--- a/mysql-test/include/rpl_connection_master.inc
+++ /dev/null
@@ -1,2 +0,0 @@
-let $rpl_connection_name= master;
-source include/rpl_connection.inc;
diff --git a/mysql-test/include/rpl_connection_slave.inc b/mysql-test/include/rpl_connection_slave.inc
deleted file mode 100644
index 8dcfb3b611b..00000000000
--- a/mysql-test/include/rpl_connection_slave.inc
+++ /dev/null
@@ -1,2 +0,0 @@
-let $rpl_connection_name= slave;
-source include/rpl_connection.inc;
diff --git a/mysql-test/include/rpl_connection_slave1.inc b/mysql-test/include/rpl_connection_slave1.inc
deleted file mode 100644
index a408d14596b..00000000000
--- a/mysql-test/include/rpl_connection_slave1.inc
+++ /dev/null
@@ -1,2 +0,0 @@
-let $rpl_connection_name= slave1;
-source include/rpl_connection.inc;
diff --git a/mysql-test/include/rpl_ip_mix.inc b/mysql-test/include/rpl_ip_mix.inc
index 96766e7dbdd..d547d77a3cc 100644
--- a/mysql-test/include/rpl_ip_mix.inc
+++ b/mysql-test/include/rpl_ip_mix.inc
@@ -1,13 +1,9 @@
---echo connect (master,$IPv6,root,,test,MASTER_MYPORT);
connect (master,$IPv6,root,,test,$MASTER_MYPORT);
---echo connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT);
connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT);
---echo connection master;
connection master;
reset master;
source include/show_master_status.inc;
save_master_pos;
---echo connection slave;
connection slave;
reset slave;
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
@@ -15,10 +11,7 @@ let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
eval change master to master_host='$IPv6';
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
--echo Master-Host: $master_host
---echo disconnect slave;
disconnect slave;
---echo disconnect master;
disconnect master;
---echo connection default;
connection default;
diff --git a/mysql-test/include/rpl_ip_mix2.inc b/mysql-test/include/rpl_ip_mix2.inc
index 390c788a461..72011558d45 100644
--- a/mysql-test/include/rpl_ip_mix2.inc
+++ b/mysql-test/include/rpl_ip_mix2.inc
@@ -1,13 +1,9 @@
---echo connect (master,127.0.0.1,root,,test,MASTER_MYPORT);
connect (master,127.0.0.1,root,,test,$MASTER_MYPORT);
---echo connect (slave,$IPv6,root,,test,SLAVE_MYPORT);
connect (slave,$IPv6,root,,test,$SLAVE_MYPORT);
---echo connection master;
connection master;
reset master;
source include/show_master_status.inc;
save_master_pos;
---echo connection slave;
connection slave;
reset slave;
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
@@ -15,10 +11,7 @@ let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
eval change master to master_host='$IPv6';
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
--echo Master-Host: $master_host
---echo disconnect slave;
disconnect slave;
---echo disconnect master;
disconnect master;
---echo connection default;
connection default;
diff --git a/mysql-test/include/rpl_ipv6.inc b/mysql-test/include/rpl_ipv6.inc
index d2d53a4841a..69f282e22d9 100644
--- a/mysql-test/include/rpl_ipv6.inc
+++ b/mysql-test/include/rpl_ipv6.inc
@@ -1,22 +1,15 @@
---echo connect (master,$IPv6,root,,test,MASTER_MYPORT);
connect (master,$IPv6,root,,test,$MASTER_MYPORT);
---echo connect (slave,$IPv6,root,,test,SLAVE_MYPORT);
connect (slave,$IPv6,root,,test,$SLAVE_MYPORT);
---echo connection master;
connection master;
reset master;
source include/show_master_status.inc;
save_master_pos;
---echo connection slave;
connection slave;
reset slave;
eval change master to master_host='$IPv6';
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
--echo Master-Host: $master_host
---echo disconnect slave;
disconnect slave;
---echo disconnect master;
disconnect master;
---echo connection default;
connection default;
diff --git a/mysql-test/include/rpl_loaddata_charset.inc b/mysql-test/include/rpl_loaddata_charset.inc
index 0e445446a38..46a701aa2f7 100644
--- a/mysql-test/include/rpl_loaddata_charset.inc
+++ b/mysql-test/include/rpl_loaddata_charset.inc
@@ -19,12 +19,10 @@ if ($LOAD_LOCAL)
}
save_master_pos;
-echo ----------content on master----------;
SELECT hex(cl) FROM t;
connection slave;
sync_with_master;
-echo ----------content on slave----------;
USE mysqltest;
SELECT hex(cl) FROM t;
diff --git a/mysql-test/include/rpl_stmt_seq.inc b/mysql-test/include/rpl_stmt_seq.inc
index 08f6e44aba0..b23178ee534 100644
--- a/mysql-test/include/rpl_stmt_seq.inc
+++ b/mysql-test/include/rpl_stmt_seq.inc
@@ -70,8 +70,6 @@ let $_log_num_s= `select @aux`;
###############################################################
# INSERT
###############################################################
---echo
---echo -------- switch to master -------
connection master;
# Maybe it would be smarter to use a table with an autoincrement column.
let $MAX= `SELECT MAX(f1) FROM t1` ;
@@ -85,8 +83,6 @@ if ($show_binlog)
}
sync_slave_with_master;
---echo
---echo -------- switch to slave --------
connection slave;
# results before DDL(to be tested)
SELECT MAX(f1) FROM t1;
@@ -99,8 +95,6 @@ if ($show_binlog)
###############################################################
# command to be tested
###############################################################
---echo
---echo -------- switch to master -------
connection master;
eval $my_stmt;
# Devaluate $my_stmt, to detect script bugs
@@ -114,8 +108,6 @@ if ($show_binlog)
}
sync_slave_with_master;
---echo
---echo -------- switch to slave --------
connection slave;
# results after DDL(to be tested)
SELECT MAX(f1) FROM t1;
@@ -128,8 +120,6 @@ if ($show_binlog)
###############################################################
# ROLLBACK
###############################################################
---echo
---echo -------- switch to master -------
connection master;
ROLLBACK;
# results after final ROLLBACK
@@ -151,8 +141,6 @@ if ($show_binlog)
}
sync_slave_with_master;
---echo
---echo -------- switch to slave --------
connection slave;
# results after final ROLLBACK
SELECT MAX(f1) FROM t1;
@@ -181,16 +169,12 @@ if ($manipulate)
# - flush the master and the slave log
# ---> both start to write into new logs with incremented number
# - increment $_log_num_n
---echo
---echo -------- switch to master -------
connection master;
flush logs;
# sleep 1;
# eval SHOW BINLOG EVENTS IN 'master-bin.$_log_num_s';
sync_slave_with_master;
---echo
---echo -------- switch to slave --------
connection slave;
# the final content of the binary log
flush logs;
@@ -202,6 +186,4 @@ flush logs;
inc $_log_num_n;
}
---echo
---echo -------- switch to master -------
connection master;
diff --git a/mysql-test/include/rpl_stop_server.inc b/mysql-test/include/rpl_stop_server.inc
index e1f8839dd69..978cfec1885 100644
--- a/mysql-test/include/rpl_stop_server.inc
+++ b/mysql-test/include/rpl_stop_server.inc
@@ -47,8 +47,8 @@ if ($rpl_debug)
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.$rpl_server_number.expect
# Send shutdown to the connected server and give
-# it 10 seconds to die before zapping it
-shutdown_server 10;
+# it 60 seconds to die before zapping it
+shutdown_server 60;
--source include/wait_until_disconnected.inc
diff --git a/mysql-test/include/rpl_sync.inc b/mysql-test/include/rpl_sync.inc
index be2904528ff..83d4a2e4628 100644
--- a/mysql-test/include/rpl_sync.inc
+++ b/mysql-test/include/rpl_sync.inc
@@ -81,7 +81,9 @@ while ($_rpl_i) {
}
if ($rpl_only_running_threads)
{
+ disable_connect_log;
--connection server_$_rpl_server
+ enable_connect_log;
--let $_rpl_slave_io_running= query_get_value(SHOW SLAVE STATUS, Slave_IO_Running, 1)
--let $_rpl_slave_sql_running= query_get_value(SHOW SLAVE STATUS, Slave_SQL_Running, 1)
if ($rpl_debug)
@@ -92,7 +94,9 @@ while ($_rpl_i) {
--let $_rpl_slave_sql_running= `SELECT IF('$_rpl_slave_sql_running' = 'Yes', 1, '')`
if ($_rpl_slave_io_running)
{
+ disable_query_log;
--connection server_$_rpl_prev_server
+ enable_query_log;
if ($_rpl_slave_sql_running)
{
if ($rpl_debug)
@@ -101,7 +105,9 @@ while ($_rpl_i) {
--let $_rpl_master_pos= query_get_value("SHOW MASTER STATUS", Position, 1)
--echo syncing master_file='$_rpl_master_file' master_pos='$_rpl_master_pos'
}
+ disable_connect_log;
--sync_slave_with_master server_$_rpl_server
+ enable_connect_log;
}
if (!$_rpl_slave_sql_running)
{
@@ -119,6 +125,7 @@ while ($_rpl_i) {
}
if (!$rpl_only_running_threads)
{
+ disable_connect_log;
--connection server_$_rpl_prev_server
if ($rpl_debug)
{
@@ -127,6 +134,7 @@ while ($_rpl_i) {
--echo syncing master_file='$_rpl_master_file' master_pos='$_rpl_master_pos'
}
--sync_slave_with_master server_$_rpl_server
+ enable_connect_log;
}
}
diff --git a/mysql-test/include/rpl_udf.inc b/mysql-test/include/rpl_udf.inc
index 71a6304c303..95b953efc2f 100644
--- a/mysql-test/include/rpl_udf.inc
+++ b/mysql-test/include/rpl_udf.inc
@@ -30,7 +30,6 @@ drop table if exists t1;
# Test 1) Test UDFs via loadable libraries
#
--echo "*** Test 1) Test UDFs via loadable libraries ***
---echo "Running on the master"
--enable_info
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
eval CREATE FUNCTION myfunc_double RETURNS REAL SONAME "$UDF_EXAMPLE_SO";
@@ -48,7 +47,6 @@ connection slave;
sync_with_master;
# Check to see that UDF CREATE statements were replicated
---echo "Running on the slave"
--enable_info
--replace_column 3 UDF_LIB
SELECT * FROM mysql.func ORDER BY name;
@@ -57,7 +55,6 @@ SELECT * FROM mysql.func ORDER BY name;
connection master;
# Use the UDFs to do something
---echo "Running on the master"
--enable_info
eval CREATE TABLE t1(sum INT, price FLOAT(24)) ENGINE=$engine_type;
--disable_warnings
@@ -72,7 +69,6 @@ SELECT * FROM t1 ORDER BY sum;
sync_slave_with_master;
# Check to see if data was replicated
---echo "Running on the slave"
--enable_info
SELECT * FROM t1 ORDER BY sum;
@@ -84,7 +80,6 @@ SELECT myfunc_double(75.00);
connection master;
# Drop the functions
---echo "Running on the master"
--enable_info
DROP FUNCTION myfunc_double;
DROP FUNCTION myfunc_int;
@@ -94,7 +89,6 @@ SELECT * FROM mysql.func ORDER BY name;
sync_slave_with_master;
# Check to see if the UDFs were dropped on the slave
---echo "Running on the slave"
--enable_info
SELECT * FROM mysql.func ORDER BY name;
--disable_info
@@ -102,7 +96,6 @@ SELECT * FROM mysql.func ORDER BY name;
connection master;
# Cleanup
---echo "Running on the master"
--enable_info
DROP TABLE t1;
--disable_info
@@ -111,7 +104,6 @@ DROP TABLE t1;
# Test 2) Test UDFs with SQL body
#
--echo "*** Test 2) Test UDFs with SQL body ***
---echo "Running on the master"
--enable_info
CREATE FUNCTION myfuncsql_int(i INT) RETURNS INTEGER DETERMINISTIC RETURN i;
CREATE FUNCTION myfuncsql_double(d DOUBLE) RETURNS INTEGER DETERMINISTIC RETURN d * 2.00;
@@ -121,7 +113,6 @@ SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'te
sync_slave_with_master;
# Check to see that UDF CREATE statements were replicated
---echo "Running on the slave"
--enable_info
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name;
--disable_info
@@ -129,7 +120,6 @@ SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'te
connection master;
# Use the UDFs to do something
---echo "Running on the master"
--enable_info
eval CREATE TABLE t1(sum INT, price FLOAT(24)) ENGINE=$engine_type;
INSERT INTO t1 VALUES(myfuncsql_int(100), myfuncsql_double(50.00));
@@ -142,7 +132,6 @@ SELECT * FROM t1 ORDER BY sum;
sync_slave_with_master;
# Check to see if data was replicated
---echo "Running on the slave"
--enable_info
SELECT * FROM t1 ORDER BY sum;
--disable_info
@@ -150,7 +139,6 @@ SELECT * FROM t1 ORDER BY sum;
connection master;
# Modify the UDFs to add a comment
---echo "Running on the master"
--enable_info
ALTER FUNCTION myfuncsql_int COMMENT "This was altered.";
ALTER FUNCTION myfuncsql_double COMMENT "This was altered.";
@@ -160,7 +148,6 @@ SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'te
sync_slave_with_master;
# Check to see if data was replicated
---echo "Running on the slave"
--enable_info
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name;
@@ -172,7 +159,6 @@ SELECT myfuncsql_double(75.00);
connection master;
# Drop the functions
---echo "Running on the master"
--enable_info
DROP FUNCTION myfuncsql_double;
DROP FUNCTION myfuncsql_int;
@@ -182,7 +168,6 @@ SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'te
sync_slave_with_master;
# Check to see if the UDFs were dropped on the slave
---echo "Running on the slave"
--enable_info
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name;
--disable_info
@@ -190,7 +175,6 @@ SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'te
connection master;
# Cleanup
---echo "Running on the master"
--enable_info
DROP TABLE t1;
--disable_info
diff --git a/mysql-test/include/search_pattern_in_file.inc b/mysql-test/include/search_pattern_in_file.inc
index f77a7c60916..3c5529989bb 100644
--- a/mysql-test/include/search_pattern_in_file.inc
+++ b/mysql-test/include/search_pattern_in_file.inc
@@ -12,37 +12,22 @@
#
# 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
-# file. The default is to search only the first 50000 bytes of the file.
+# file. By default the search happens from the last CURRENT_TEST:
+# marker till the end of file (appropriate for searching error logs).
+#
+# Optionally, SEARCH_ABORT can be set to "FOUND" or "NOT FOUND" and this
+# will abort if the search result doesn't match the requested one.
#
# In case of
# - SEARCH_FILE and/or SEARCH_PATTERN is not set
# - SEARCH_FILE cannot be opened
-# - SEARCH_FILE does not contain SEARCH_PATTERN
# the test will abort immediate.
-# MTR will report something like
-# ....
-# worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 13000..13009
-# main.1st [ pass ] 3
-# innodb.innodb_page_size [ fail ]
-# Test ended at 2011-11-11 18:15:58
-#
-# CURRENT_TEST: innodb.innodb_page_size
-# # ERROR: The file '<name>' does not contain the expected pattern <pattern>
-# mysqltest: In included file "./include/search_pattern_in_file.inc":
-# included from ./include/search_pattern_in_file.inc at line 36:
-# At line 25: command "perl" failed with error 255. my_errno=175
-#
-# The result from queries just before the failure was:
-# ...
-# - saving '<some path>' to '<some path>'
-# main.1st [ pass ] 2
#
# Typical use case (check invalid server startup options):
# let $error_log= $MYSQLTEST_VARDIR/log/my_restart.err;
# --error 0,1
# --remove_file $error_log
# let SEARCH_FILE= $error_log;
-# let SEARCH_RANGE= -50000;
# # Stop the server
# let $restart_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect;
# --exec echo "wait" > $restart_file
@@ -60,36 +45,36 @@
perl;
use strict;
- die "SEARCH_FILE not set" unless $ENV{'SEARCH_FILE'};
- my @search_files= glob($ENV{'SEARCH_FILE'});
- my $search_pattern= $ENV{'SEARCH_PATTERN'} or die "SEARCH_PATTERN not set";
- my $search_range= $ENV{'SEARCH_RANGE'};
+ die "SEARCH_FILE not set" unless $ENV{SEARCH_FILE};
+ my @search_files= glob($ENV{SEARCH_FILE});
+ my $search_pattern= $ENV{SEARCH_PATTERN} or die "SEARCH_PATTERN not set";
+ my $search_range= $ENV{SEARCH_RANGE};
my $content;
- $search_range= 50000 unless $search_range =~ /-?[0-9]+/;
foreach my $search_file (@search_files) {
- open(FILE, '<', $search_file) or die("Unable to open '$search_file': $!\n");
+ open(FILE, '<', $search_file) || die("Can't open file $search_file: $!");
my $file_content;
- if ($search_range >= 0) {
+ if ($search_range > 0) {
read(FILE, $file_content, $search_range, 0);
- } else {
+ } elsif ($search_range < 0) {
my $size= -s $search_file;
$search_range = -$size if $size > -$search_range;
seek(FILE, $search_range, 2);
read(FILE, $file_content, -$search_range, 0);
+ } else {
+ while(<FILE>) { # error log
+ if (/^CURRENT_TEST:/) {
+ $content='';
+ } else {
+ $content.=$_;
+ }
+ }
}
close(FILE);
$content.= $file_content;
}
- $ENV{'SEARCH_FILE'} =~ s{^.*?([^/\\]+)$}{$1};
- if ($content =~ m{$search_pattern}) {
- die "FOUND /$search_pattern/ in $ENV{'SEARCH_FILE'}\n"
- if $ENV{SEARCH_ABORT} eq 'FOUND';
- print "FOUND /$search_pattern/ in $ENV{'SEARCH_FILE'}\n"
- unless defined $ENV{SEARCH_ABORT};
- } else {
- die "NOT FOUND /$search_pattern/ in $ENV{'SEARCH_FILE'}\n"
- if $ENV{SEARCH_ABORT} eq 'NOT FOUND';
- print "NOT FOUND /$search_pattern/ in $ENV{'SEARCH_FILE'}\n"
- unless defined $ENV{SEARCH_ABORT};
- }
+ my @matches=($content =~ m/$search_pattern/gs);
+ my $res=@matches ? "FOUND " . scalar(@matches) : "NOT FOUND";
+ $ENV{SEARCH_FILE} =~ s{^.*?([^/\\]+)$}{$1};
+ print "$res /$search_pattern/ in $ENV{SEARCH_FILE}\n";
+ exit $ENV{SEARCH_ABORT} && $res =~ /^$ENV{SEARCH_ABORT}/;
EOF
diff --git a/mysql-test/include/show_binlog_events2.inc b/mysql-test/include/show_binlog_events2.inc
index eefefe4bfbe..84c62cced66 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=249
+ --let $_binlog_start=256
}
if ($binlog_file)
{
diff --git a/mysql-test/include/show_delayed_slave_state.inc b/mysql-test/include/show_delayed_slave_state.inc
new file mode 100644
index 00000000000..8eb7232a206
--- /dev/null
+++ b/mysql-test/include/show_delayed_slave_state.inc
@@ -0,0 +1,28 @@
+# ==== Purpose ====
+#
+# Display the delay state of the SQL thread.
+#
+# ==== Usage ====
+#
+# --let $verbose_delayed_slave_state= [0|1]
+# --source extra/rpl_tests/show_delayed_slave_state.inc
+#
+# By default, the output is normalized so that it does not depend on
+# exact timing or exact binlog positions. If
+# $verbose_delayed_slave_state is set, then it outputs exact times and
+# binlog positions. This can be useful for debugging.
+
+--let $_delayed_slave_status= query_get_value(SHOW SLAVE STATUS, Slave_SQL_Running_State, 1)
+
+--let $_delayed_slave_remaining_delay= query_get_value(SHOW SLAVE STATUS, SQL_Remaining_Delay, 1)
+--let $_delayed_slave_qualitative_delay= `SELECT CASE WHEN "$_delayed_slave_remaining_delay" = "NULL" THEN "NULL" WHEN "$_delayed_slave_remaining_delay" = "0" THEN "0" ELSE "greater than zero" END`
+
+--let $_delayed_slave_io_pos= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1)
+--let $_delayed_slave_sql_pos= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1)
+--let $_delayed_slave_qualitative_log_pos= `SELECT IF($_delayed_slave_io_pos > $_delayed_slave_sql_pos, "behind", "in sync with")`
+
+--echo Slave_SQL_Running_State='$_delayed_slave_status'; SQL_Remaining_Delay is $_delayed_slave_qualitative_delay; SQL thread is $_delayed_slave_qualitative_log_pos IO thread
+
+if ($verbose_delayed_slave_state) {
+ --echo SQL_Remaining_Delay='$_delayed_slave_remaining_delay'; Read_master_log_pos='$_delayed_slave_io_pos'; Exec_Master_Log_Pos='$_delayed_slave_sql_pos'
+}
diff --git a/mysql-test/include/sync_with_master.inc b/mysql-test/include/sync_with_master.inc
new file mode 100644
index 00000000000..dcb995a3ca9
--- /dev/null
+++ b/mysql-test/include/sync_with_master.inc
@@ -0,0 +1,26 @@
+# ==== Purpose ====
+#
+# This file does the same as the built-in command sync_with_master,
+# but can be configured to use a custom timeout. This has the benefit
+# that it accepts the same $slave_timeout and $master_connection
+# parameters as wait_for_slave_param.inc
+#
+#
+# ==== Usage ====
+#
+# --connection master
+# --source include/save_master_pos.inc
+# --connection slave
+# --source include/sync_with_master.inc
+#
+# Parameters to this macro are $slave_timeout and
+# $master_connection. See wait_for_slave_param.inc for
+# descriptions.
+
+--let $slave_param= Relay_Master_Log_File
+--let $slave_param_value= $_master_file
+--source include/wait_for_slave_param.inc
+
+--let $slave_param= Exec_Master_Log_Pos
+--let $slave_param_value= $_master_pos
+--source include/wait_for_slave_param.inc
diff --git a/mysql-test/include/type_hrtime.inc b/mysql-test/include/type_hrtime.inc
index 071dc7b161d..55fd3d665fe 100644
--- a/mysql-test/include/type_hrtime.inc
+++ b/mysql-test/include/type_hrtime.inc
@@ -15,7 +15,7 @@ insert t1 values ('2010-12-11 00:20:03.1234');
insert t1 values ('2010-12-11 15:47:11.1234');
insert t1 values (20101211010203.45678);
insert t1 values (20101211030405.789e0);
-insert t1 values (99991231235959e1);
+insert ignore t1 values (99991231235959e1);
select * from t1;
--replace_regex /121000/121094/ /457000/457031/ /789000/789062/
select truncate(a, 6) from t1; # Field::val_real()
@@ -50,7 +50,7 @@ select a, a+interval 9876543 microsecond from t1;
update t1 set a=a+interval 9876543 microsecond;
select * from t1;
select a, a + interval 2 year from t1;
-insert t1 select a + interval 2 year from t1;
+insert ignore t1 select a + interval 2 year from t1;
select * from t1;
delete from t1 where a < 20110101;
select * from t1;
diff --git a/mysql-test/include/wait_for_slave_io_error.inc b/mysql-test/include/wait_for_slave_io_error.inc
index 4177bf4b858..96844106fa9 100644
--- a/mysql-test/include/wait_for_slave_io_error.inc
+++ b/mysql-test/include/wait_for_slave_io_error.inc
@@ -18,7 +18,7 @@
# $slave_io_errno
# The expected IO error numbers. This can be either a single
# number, or a comma-separated list of numbers. Examples:
-# --let $slave_io_errno= 1040, 1053, 2002, 2003, 2006, 2013
+# --let $slave_io_errno= 1053, 2002, 2003, 2006, 2013
# --let $slave_io_errno= 1045
# (After BUG#41956 has been fixed, this will be required to be
# symbolic names instead of numbers.)
diff --git a/mysql-test/include/wait_innodb_all_purged.inc b/mysql-test/include/wait_innodb_all_purged.inc
index 97b038acc44..a77e6ec1573 100644
--- a/mysql-test/include/wait_innodb_all_purged.inc
+++ b/mysql-test/include/wait_innodb_all_purged.inc
@@ -9,8 +9,8 @@
# --source include/wait_innodb_all_purged.inc
#
--source include/have_innodb.inc
---source include/have_debug.inc
+if (`select version() like '%debug%'`) {
--disable_query_log
let $wait_counter_init= 300;
@@ -57,3 +57,4 @@ if (!$success)
}
--enable_query_log
+}
diff --git a/mysql-test/include/wait_until_connected_again.inc b/mysql-test/include/wait_until_connected_again.inc
index 6f64ef45440..bdd99af2fc1 100644
--- a/mysql-test/include/wait_until_connected_again.inc
+++ b/mysql-test/include/wait_until_connected_again.inc
@@ -11,10 +11,7 @@ let $counter= 5000;
let $mysql_errno= 9999;
while ($mysql_errno)
{
- # Strangely enough, the server might return "Too many connections"
- # while being shutdown, thus 1040 is an "allowed" error
- # See BUG#36228
- --error 0,1040,1053,2002,2003,2005,2006,2013,1927
+ --error 0,ER_SERVER_SHUTDOWN,ER_CONNECTION_KILLED,2002,2006,2013
show status;
dec $counter;
diff --git a/mysql-test/include/wait_until_disconnected.inc b/mysql-test/include/wait_until_disconnected.inc
index 658bf0be739..15bc6474995 100644
--- a/mysql-test/include/wait_until_disconnected.inc
+++ b/mysql-test/include/wait_until_disconnected.inc
@@ -9,10 +9,7 @@ let $counter= 600;
let $mysql_errno= 0;
while (!$mysql_errno)
{
- # Strangely enough, the server might return "Too many connections"
- # while being shutdown, thus 1040 is an "allowed" error.
- # See BUG#36228.
- --error 0,1040,1053,2002,2003,2005,2006,2013,1927
+ --error 0,ER_SERVER_SHUTDOWN,ER_CONNECTION_KILLED,2002,2006,2013
show status;
dec $counter;
diff --git a/mysql-test/include/world.inc b/mysql-test/include/world.inc
index eae6556c422..1e81c5c1aa7 100644
--- a/mysql-test/include/world.inc
+++ b/mysql-test/include/world.inc
@@ -4,7 +4,7 @@
# Table Country
-INSERT INTO Country VALUES
+INSERT IGNORE INTO Country VALUES
('AFG','Afghanistan',652090.00,22720000,1),
('NLD','Netherlands',41526.00,15864000,5),
('ANT','Netherlands Antilles',800.00,217000,33),
@@ -649,7 +649,7 @@ INSERT INTO City VALUES
(398,'Franco da Rocha','BRA',108964),
(399,'Teixeira de Freitas','BRA',108441),
(400,'Varginha','BRA',108314);
-INSERT INTO City VALUES
+INSERT IGNORE INTO City VALUES
(401,'Ribeirão Pires','BRA',108121),
(402,'Sabará','BRA',107781),
(403,'Catanduva','BRA',107761),
@@ -1855,7 +1855,7 @@ INSERT INTO City VALUES
(1598,'Aomori','JPN',295969),
(1599,'Hakodate','JPN',294788),
(1600,'Akashi','JPN',292253);
-INSERT INTO City VALUES
+INSERT IGNORE INTO City VALUES
(1601,'Yokkaichi','JPN',288173),
(1602,'Fukushima','JPN',287525),
(1603,'Morioka','JPN',287353),
@@ -2056,7 +2056,7 @@ INSERT INTO City VALUES
(1798,'Subotica','YUG',100386),
(1799,'Prizren','YUG',92303),
(1800,'Phnom Penh','KHM',570155);
-INSERT INTO City VALUES
+INSERT IGNORE INTO City VALUES
(1801,'Battambang','KHM',129800),
(1802,'Siem Reap','KHM',105100),
(1803,'Douala','CMR',1448300),
@@ -2659,7 +2659,7 @@ INSERT INTO City VALUES
(2398,'Namwon','KOR',103544),
(2399,'Tonghae','KOR',95472),
(2400,'Mun-gyong','KOR',92239);
-INSERT INTO City VALUES
+INSERT IGNORE INTO City VALUES
(2401,'Athenai','GRC',772072),
(2402,'Thessaloniki','GRC',383967),
(2403,'Pireus','GRC',182671),
@@ -3463,7 +3463,7 @@ INSERT INTO City VALUES
(3198,'Dakar','SEN',785071),
(3199,'Thiès','SEN',248000),
(3200,'Kaolack','SEN',199000);
-INSERT INTO City VALUES
+INSERT IGNORE INTO City VALUES
(3201,'Ziguinchor','SEN',192000),
(3202,'Rufisque','SEN',150000),
(3203,'Saint-Louis','SEN',132400),
@@ -3664,7 +3664,7 @@ INSERT INTO City VALUES
(3398,'Çorlu','TUR',123300),
(3399,'Isparta','TUR',121911),
(3400,'Karabük','TUR',118285);
-INSERT INTO City VALUES
+INSERT IGNORE INTO City VALUES
(3401,'Kilis','TUR',118245),
(3402,'Alanya','TUR',117300),
(3403,'Kiziltepe','TUR',112000),
@@ -3865,7 +3865,7 @@ INSERT INTO City VALUES
(3598,'Izevsk','RUS',652800),
(3599,'Krasnodar','RUS',639000),
(3600,'Jaroslavl','RUS',616700);
-INSERT INTO City VALUES
+INSERT IGNORE INTO City VALUES
(3601,'Habarovsk','RUS',609400),
(3602,'Vladivostok','RUS',606200),
(3603,'Irkutsk','RUS',593700),
@@ -4350,7 +4350,7 @@ INSERT INTO City VALUES
# Table CountryLanguage
-INSERT INTO CountryLanguage VALUES
+INSERT IGNORE INTO CountryLanguage VALUES
('AFG','Pashto',52.4),
('NLD','Dutch',95.6),
('ANT','Papiamento',86.2),
@@ -4551,7 +4551,7 @@ INSERT INTO CountryLanguage VALUES
('TJK','Tadzhik',62.2),
('TWN','Min',66.7),
('TZA','Nyamwesi',21.1);
-INSERT INTO CountryLanguage VALUES
+INSERT IGNORE INTO CountryLanguage VALUES
('DNK','Danish',93.5),
('THA','Thai',52.6),
('TGO','Ewe',23.2),
@@ -4752,7 +4752,7 @@ INSERT INTO CountryLanguage VALUES
('WSM','Samoan',47.5),
('STP','French',0.7),
('SEN','Ful',21.7);
-INSERT INTO CountryLanguage VALUES
+INSERT IGNORE INTO CountryLanguage VALUES
('SYC','English',3.8),
('SLE','Temne',31.8),
('SGP','Malay',14.1),
@@ -4953,7 +4953,7 @@ INSERT INTO CountryLanguage VALUES
('AGO','Luimbe-nganguela',5.4),
('ABW','Dutch',5.3),
('AUS','Canton Chinese',1.1);
-INSERT INTO CountryLanguage VALUES
+INSERT IGNORE INTO CountryLanguage VALUES
('AZE','Armenian',2.0),
('BGD','Garo',0.1),
('BEL','Arabic',1.6),