summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/CMakeLists.txt2
-rwxr-xr-xmysql-test/collections/default.weekly3
-rw-r--r--mysql-test/include/ctype_filesort2.inc9
-rw-r--r--mysql-test/include/mtr_check.sql15
-rw-r--r--mysql-test/lib/My/SafeProcess/safe_process.cc2
-rw-r--r--mysql-test/lib/My/SysInfo.pm3
-rwxr-xr-xmysql-test/mysql-test-run.pl1
-rw-r--r--mysql-test/r/ctype_utf16.result15
-rw-r--r--mysql-test/r/ctype_utf32.result15
-rw-r--r--mysql-test/r/ctype_utf8mb4.result15
-rw-r--r--mysql-test/r/distinct.result40
-rw-r--r--mysql-test/r/events_trans.result1
-rw-r--r--mysql-test/r/gis.result21
-rw-r--r--mysql-test/suite/innodb/r/innodb-change-buffer-recovery.result39
-rw-r--r--mysql-test/suite/innodb/t/innodb-change-buffer-recovery-master.opt1
-rw-r--r--mysql-test/suite/innodb/t/innodb-change-buffer-recovery.test70
-rw-r--r--mysql-test/suite/innodb_zip/r/innodb-create-options.result (renamed from mysql-test/suite/innodb/r/innodb-create-options.result)0
-rw-r--r--mysql-test/suite/innodb_zip/r/innodb-zip.result (renamed from mysql-test/suite/innodb/r/innodb-zip.result)0
-rw-r--r--mysql-test/suite/innodb_zip/r/innodb_bug36169.result (renamed from mysql-test/suite/innodb/r/innodb_bug36169.result)0
-rw-r--r--mysql-test/suite/innodb_zip/r/innodb_bug36172.result (renamed from mysql-test/suite/innodb/r/innodb_bug36172.result)0
-rw-r--r--mysql-test/suite/innodb_zip/r/innodb_bug52745.result (renamed from mysql-test/suite/innodb/r/innodb_bug52745.result)0
-rw-r--r--mysql-test/suite/innodb_zip/r/innodb_bug53591.result (renamed from mysql-test/suite/innodb/r/innodb_bug53591.result)0
-rw-r--r--mysql-test/suite/innodb_zip/r/innodb_bug56680.result (renamed from mysql-test/suite/innodb/r/innodb_bug56680.result)0
-rw-r--r--mysql-test/suite/innodb_zip/r/innodb_cmp_drop_table.result (renamed from mysql-test/suite/innodb/r/innodb_cmp_drop_table.result)0
-rw-r--r--mysql-test/suite/innodb_zip/r/innodb_index_large_prefix.result (renamed from mysql-test/suite/innodb/r/innodb_index_large_prefix.result)0
-rw-r--r--mysql-test/suite/innodb_zip/r/innodb_prefix_index_liftedlimit.result (renamed from mysql-test/suite/innodb/r/innodb_prefix_index_liftedlimit.result)0
-rw-r--r--mysql-test/suite/innodb_zip/t/innodb-create-options.test (renamed from mysql-test/suite/innodb/t/innodb-create-options.test)0
-rw-r--r--mysql-test/suite/innodb_zip/t/innodb-zip.test (renamed from mysql-test/suite/innodb/t/innodb-zip.test)0
-rw-r--r--mysql-test/suite/innodb_zip/t/innodb_bug36169.test (renamed from mysql-test/suite/innodb/t/innodb_bug36169.test)0
-rw-r--r--mysql-test/suite/innodb_zip/t/innodb_bug36172.test (renamed from mysql-test/suite/innodb/t/innodb_bug36172.test)0
-rw-r--r--mysql-test/suite/innodb_zip/t/innodb_bug52745.test (renamed from mysql-test/suite/innodb/t/innodb_bug52745.test)0
-rw-r--r--mysql-test/suite/innodb_zip/t/innodb_bug53591.test (renamed from mysql-test/suite/innodb/t/innodb_bug53591.test)0
-rw-r--r--mysql-test/suite/innodb_zip/t/innodb_bug56680.test (renamed from mysql-test/suite/innodb/t/innodb_bug56680.test)0
-rw-r--r--mysql-test/suite/innodb_zip/t/innodb_cmp_drop_table-master.opt (renamed from mysql-test/suite/innodb/t/innodb_cmp_drop_table-master.opt)0
-rw-r--r--mysql-test/suite/innodb_zip/t/innodb_cmp_drop_table.test (renamed from mysql-test/suite/innodb/t/innodb_cmp_drop_table.test)0
-rw-r--r--mysql-test/suite/innodb_zip/t/innodb_index_large_prefix.test (renamed from mysql-test/suite/innodb/t/innodb_index_large_prefix.test)0
-rw-r--r--mysql-test/suite/innodb_zip/t/innodb_prefix_index_liftedlimit.test (renamed from mysql-test/suite/innodb/t/innodb_prefix_index_liftedlimit.test)0
-rw-r--r--mysql-test/suite/perfschema/r/all_instances.result1
-rw-r--r--mysql-test/t/distinct.test38
-rw-r--r--mysql-test/t/events_trans.test1
-rw-r--r--mysql-test/t/gis.test18
41 files changed, 303 insertions, 7 deletions
diff --git a/mysql-test/CMakeLists.txt b/mysql-test/CMakeLists.txt
index 227e490331f..2948fb88069 100644
--- a/mysql-test/CMakeLists.txt
+++ b/mysql-test/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/mysql-test/collections/default.weekly b/mysql-test/collections/default.weekly
index 40f0548f374..a03e2593cfe 100755
--- a/mysql-test/collections/default.weekly
+++ b/mysql-test/collections/default.weekly
@@ -5,3 +5,6 @@ perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment
perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-tests-innodb-engine --experimental=collections/default.experimental --vardir=var-stmt-eits-tests-innodb-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=innodb --mysqld=--innodb --skip-test-list=collections/disabled-weekly.list
perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-rpl-binlog-row-tests-innodb-engine --experimental=collections/default.experimental --vardir=var-binlog-row-eits-tests-innodb-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=innodb --mysqld=--innodb --do-test=rpl --mysqld=--binlog-format=row --skip-test-list=collections/disabled-weekly.list
perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-rpl-binlog-mixed-tests-innodb-engine --experimental=collections/default.experimental --vardir=var-binlog-mixed-eits-tests-innodb-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=innodb --mysqld=--innodb --do-test=rpl --mysqld=--binlog-format=mixed --skip-test-list=collections/disabled-weekly.list
+
+# Run innodb compression tests
+perl mysql-test-run.pl --force --debug-server --comment=innodb_compression --vardir=var-innodb-zip --big-test --testcase-timeout=60 --parallel=auto --experimental=collections/default.experimental --suite=innodb_zip
diff --git a/mysql-test/include/ctype_filesort2.inc b/mysql-test/include/ctype_filesort2.inc
index 7b09eb482a5..7b576034136 100644
--- a/mysql-test/include/ctype_filesort2.inc
+++ b/mysql-test/include/ctype_filesort2.inc
@@ -14,3 +14,12 @@ SELECT HEX(a), HEX(CONVERT(a USING utf8mb4)) FROM t1 ORDER BY a;
ALTER TABLE t1 ADD KEY(a);
SELECT HEX(a), HEX(CONVERT(a USING utf8mb4)) FROM t1 ORDER BY a;
DROP TABLE IF EXISTS t1;
+--echo #
+--echo # BUG#16691598 - ORDER BY LOWER(COLUMN) PRODUCES
+--echo # OUT-OF-ORDER RESULTS
+--echo #
+CREATE TABLE t1 SELECT ('a a') as n;
+INSERT INTO t1 VALUES('a b');
+SELECT * FROM t1 ORDER BY LOWER(n) ASC;
+SELECT * FROM t1 ORDER BY LOWER(n) DESC;
+DROP TABLE t1;
diff --git a/mysql-test/include/mtr_check.sql b/mysql-test/include/mtr_check.sql
index e0d4f407633..7f990431762 100644
--- a/mysql-test/include/mtr_check.sql
+++ b/mysql-test/include/mtr_check.sql
@@ -1,4 +1,5 @@
--- Copyright (c) 2008, 2011, Oracle and/or its affiliates
+-- Copyright (c) 2008, 2013, Oracle and/or its affiliates
+-- Copyright (c) 2009, 2013, SkySQL Ab
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
@@ -55,6 +56,16 @@ BEGIN
WHERE table_schema='mysql' AND table_name != 'ndb_apply_status'
ORDER BY columns_in_mysql;
+ -- Dump all events, there should be none
+ SELECT * FROM INFORMATION_SCHEMA.EVENTS;
+ -- Dump all triggers except mtr internals, there should be none
+ SELECT * FROM INFORMATION_SCHEMA.TRIGGERS
+ WHERE TRIGGER_NAME NOT IN ('gs_insert', 'ts_insert');
+ -- Dump all created procedures, there should be none
+ SELECT * FROM INFORMATION_SCHEMA.ROUTINES;
+
+ SHOW STATUS LIKE 'slave_open_temp_tables';
+
-- Checksum system tables to make sure they have been properly
-- restored after test
checksum table
@@ -81,7 +92,5 @@ BEGIN
select * from information_schema.session_variables
where variable_name = 'debug_sync';
- show status like 'slave_open_temp_tables';
-
END||
diff --git a/mysql-test/lib/My/SafeProcess/safe_process.cc b/mysql-test/lib/My/SafeProcess/safe_process.cc
index 007acf77617..f19ca622278 100644
--- a/mysql-test/lib/My/SafeProcess/safe_process.cc
+++ b/mysql-test/lib/My/SafeProcess/safe_process.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2011, Oracle and/or its affiliates
+/* Copyright (c) 2008, 2012, Oracle and/or its affiliates
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/mysql-test/lib/My/SysInfo.pm b/mysql-test/lib/My/SysInfo.pm
index 36c50ab91d1..4cca116620e 100644
--- a/mysql-test/lib/My/SysInfo.pm
+++ b/mysql-test/lib/My/SysInfo.pm
@@ -1,6 +1,5 @@
# -*- cperl -*-
-# Copyright (c) 2013 MySQL AB, 2008 Sun Microsystems, Inc.
-# Use is subject to license terms.
+# Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index d909391f033..2e0ad39ee5f 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -173,6 +173,7 @@ my @DEFAULT_SUITES= qw(
handler-
heap-
innodb-
+ innodb_zip-
maria-
optimizer_unfixed_bugs-
oqgraph-
diff --git a/mysql-test/r/ctype_utf16.result b/mysql-test/r/ctype_utf16.result
index a1bd49d1926..5d70764f3f8 100644
--- a/mysql-test/r/ctype_utf16.result
+++ b/mysql-test/r/ctype_utf16.result
@@ -671,6 +671,21 @@ FF9D EFBE9D
D800DF84 F0908E84
DBC0DC00 F4808080
DROP TABLE IF EXISTS t1;
+#
+# BUG#16691598 - ORDER BY LOWER(COLUMN) PRODUCES
+# OUT-OF-ORDER RESULTS
+#
+CREATE TABLE t1 SELECT ('a a') as n;
+INSERT INTO t1 VALUES('a b');
+SELECT * FROM t1 ORDER BY LOWER(n) ASC;
+n
+a a
+a b
+SELECT * FROM t1 ORDER BY LOWER(n) DESC;
+n
+a b
+a a
+DROP TABLE t1;
select @@collation_connection;
@@collation_connection
utf16_bin
diff --git a/mysql-test/r/ctype_utf32.result b/mysql-test/r/ctype_utf32.result
index a46bcb33cc6..92327821b84 100644
--- a/mysql-test/r/ctype_utf32.result
+++ b/mysql-test/r/ctype_utf32.result
@@ -670,6 +670,21 @@ HEX(a) HEX(CONVERT(a USING utf8mb4))
00010384 F0908E84
00100000 F4808080
DROP TABLE IF EXISTS t1;
+#
+# BUG#16691598 - ORDER BY LOWER(COLUMN) PRODUCES
+# OUT-OF-ORDER RESULTS
+#
+CREATE TABLE t1 SELECT ('a a') as n;
+INSERT INTO t1 VALUES('a b');
+SELECT * FROM t1 ORDER BY LOWER(n) ASC;
+n
+a a
+a b
+SELECT * FROM t1 ORDER BY LOWER(n) DESC;
+n
+a b
+a a
+DROP TABLE t1;
select @@collation_connection;
@@collation_connection
utf32_bin
diff --git a/mysql-test/r/ctype_utf8mb4.result b/mysql-test/r/ctype_utf8mb4.result
index f1da956c0cb..64556308de2 100644
--- a/mysql-test/r/ctype_utf8mb4.result
+++ b/mysql-test/r/ctype_utf8mb4.result
@@ -1046,6 +1046,21 @@ EFBE9D EFBE9D
F0908E84 F0908E84
F4808080 F4808080
DROP TABLE IF EXISTS t1;
+#
+# BUG#16691598 - ORDER BY LOWER(COLUMN) PRODUCES
+# OUT-OF-ORDER RESULTS
+#
+CREATE TABLE t1 SELECT ('a a') as n;
+INSERT INTO t1 VALUES('a b');
+SELECT * FROM t1 ORDER BY LOWER(n) ASC;
+n
+a a
+a b
+SELECT * FROM t1 ORDER BY LOWER(n) DESC;
+n
+a b
+a a
+DROP TABLE t1;
select @@collation_connection;
@@collation_connection
utf8mb4_bin
diff --git a/mysql-test/r/distinct.result b/mysql-test/r/distinct.result
index 1ba078c1c1c..a91e960471b 100644
--- a/mysql-test/r/distinct.result
+++ b/mysql-test/r/distinct.result
@@ -999,4 +999,44 @@ c
11112222
33334444
DROP TABLE t1;
+#
+# Bug#16539979 BASIC SELECT COUNT(DISTINCT ID) IS BROKEN.
+# Bug#17867117 ERROR RESULT WHEN "COUNT + DISTINCT + CASE WHEN" NEED MERGE_WALK
+#
+SET @tmp_table_size_save= @@tmp_table_size;
+SET @@tmp_table_size= 1024;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8);
+INSERT INTO t1 SELECT a+8 FROM t1;
+INSERT INTO t1 SELECT a+16 FROM t1;
+INSERT INTO t1 SELECT a+32 FROM t1;
+INSERT INTO t1 SELECT a+64 FROM t1;
+INSERT INTO t1 VALUE(NULL);
+SELECT COUNT(DISTINCT a) FROM t1;
+COUNT(DISTINCT a)
+128
+SELECT COUNT(DISTINCT (a+0)) FROM t1;
+COUNT(DISTINCT (a+0))
+128
+DROP TABLE t1;
+create table tb(
+id int auto_increment primary key,
+v varchar(32))
+engine=myisam charset=gbk;
+insert into tb(v) values("aaa");
+insert into tb(v) (select v from tb);
+insert into tb(v) (select v from tb);
+insert into tb(v) (select v from tb);
+insert into tb(v) (select v from tb);
+insert into tb(v) (select v from tb);
+insert into tb(v) (select v from tb);
+update tb set v=concat(v, id);
+select count(distinct case when id<=64 then id end) from tb;
+count(distinct case when id<=64 then id end)
+64
+select count(distinct case when id<=63 then id end) from tb;
+count(distinct case when id<=63 then id end)
+63
+drop table tb;
+SET @@tmp_table_size= @tmp_table_size_save;
End of 5.5 tests
diff --git a/mysql-test/r/events_trans.result b/mysql-test/r/events_trans.result
index 37951c30787..084587079ba 100644
--- a/mysql-test/r/events_trans.result
+++ b/mysql-test/r/events_trans.result
@@ -135,3 +135,4 @@ SELECT * FROM t2;
a
ROLLBACK WORK TO SAVEPOINT A;
DROP TABLE t1, t2;
+DROP EVENT e1;
diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result
index eb9f1a57c32..c00f07e7a81 100644
--- a/mysql-test/r/gis.result
+++ b/mysql-test/r/gis.result
@@ -1574,6 +1574,27 @@ SELECT 1 FROM g1 WHERE a >= ANY
1
DROP TABLE g1;
#
+# Bug#16451878 GEOMETRY QUERY CRASHES SERVER
+#
+# should not crash
+SELECT ASTEXT(0x0100000000030000000100000000000010);
+ASTEXT(0x0100000000030000000100000000000010)
+NULL
+#should not crash
+SELECT ENVELOPE(0x0100000000030000000100000000000010);
+ENVELOPE(0x0100000000030000000100000000000010)
+NULL
+#should not crash
+SELECT
+GEOMETRYN(0x0100000000070000000100000001030000000200000000000000ffff0000, 1);
+GEOMETRYN(0x0100000000070000000100000001030000000200000000000000ffff0000, 1)
+NULL
+#should not crash
+SELECT
+GEOMETRYN(0x0100000000070000000100000001030000000200000000000000ffffff0f, 1);
+GEOMETRYN(0x0100000000070000000100000001030000000200000000000000ffffff0f, 1)
+NULL
+#
# MDEV-3819 missing constraints for spatial column types
#
create table t1 (pt point);
diff --git a/mysql-test/suite/innodb/r/innodb-change-buffer-recovery.result b/mysql-test/suite/innodb/r/innodb-change-buffer-recovery.result
new file mode 100644
index 00000000000..cc2a0373444
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb-change-buffer-recovery.result
@@ -0,0 +1,39 @@
+#
+# Bug#69122 - INNODB DOESN'T REDO-LOG INSERT BUFFER MERGE
+# OPERATION IF IT IS DONE IN-PLACE
+#
+SET GLOBAL innodb_change_buffering_debug = 1;
+CREATE TABLE t1(
+a INT AUTO_INCREMENT PRIMARY KEY,
+b CHAR(1),
+c INT,
+INDEX(b))
+ENGINE=InnoDB;
+INSERT INTO t1 VALUES(0,'x',1);
+INSERT INTO t1 SELECT 0,b,c FROM t1;
+INSERT INTO t1 SELECT 0,b,c FROM t1;
+INSERT INTO t1 SELECT 0,b,c FROM t1;
+INSERT INTO t1 SELECT 0,b,c FROM t1;
+INSERT INTO t1 SELECT 0,b,c FROM t1;
+INSERT INTO t1 SELECT 0,b,c FROM t1;
+INSERT INTO t1 SELECT 0,b,c FROM t1;
+INSERT INTO t1 SELECT 0,b,c FROM t1;
+INSERT INTO t1 SELECT 0,b,c FROM t1;
+INSERT INTO t1 SELECT 0,b,c FROM t1;
+INSERT INTO t1 SELECT 0,b,c FROM t1;
+BEGIN;
+SELECT b FROM t1 LIMIT 3;
+b
+x
+x
+x
+BEGIN;
+DELETE FROM t1 WHERE a=1;
+INSERT INTO t1 VALUES(1,'X',1);
+SET DEBUG_DBUG='+d,crash_after_log_ibuf_upd_inplace';
+SELECT b FROM t1 LIMIT 3;
+ERROR HY000: Lost connection to MySQL server during query
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/t/innodb-change-buffer-recovery-master.opt b/mysql-test/suite/innodb/t/innodb-change-buffer-recovery-master.opt
new file mode 100644
index 00000000000..33e2b863684
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-change-buffer-recovery-master.opt
@@ -0,0 +1 @@
+--log-error=$MYSQLTEST_VARDIR/tmp/my_restart.err
diff --git a/mysql-test/suite/innodb/t/innodb-change-buffer-recovery.test b/mysql-test/suite/innodb/t/innodb-change-buffer-recovery.test
new file mode 100644
index 00000000000..f54189a5cad
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-change-buffer-recovery.test
@@ -0,0 +1,70 @@
+--echo #
+--echo # Bug#69122 - INNODB DOESN'T REDO-LOG INSERT BUFFER MERGE
+--echo # OPERATION IF IT IS DONE IN-PLACE
+--echo #
+--source include/have_innodb.inc
+# innodb_change_buffering_debug option is debug only
+--source include/have_debug.inc
+# Embedded server does not support crashing
+--source include/not_embedded.inc
+# DBUG_SUICIDE() hangs under valgrind
+--source include/not_valgrind.inc
+
+# The flag innodb_change_buffering_debug is only available in debug builds.
+# It instructs InnoDB to try to evict pages from the buffer pool when
+# change buffering is possible, so that the change buffer will be used
+# whenever possible.
+SET GLOBAL innodb_change_buffering_debug = 1;
+let SEARCH_FILE = $MYSQLTEST_VARDIR/tmp/my_restart.err;
+
+CREATE TABLE t1(
+ a INT AUTO_INCREMENT PRIMARY KEY,
+ b CHAR(1),
+ c INT,
+ INDEX(b))
+ENGINE=InnoDB;
+
+# Create enough rows for the table, so that the change buffer will be
+# used for modifying the secondary index page. There must be multiple
+# index pages, because changes to the root page are never buffered.
+INSERT INTO t1 VALUES(0,'x',1);
+INSERT INTO t1 SELECT 0,b,c FROM t1;
+INSERT INTO t1 SELECT 0,b,c FROM t1;
+INSERT INTO t1 SELECT 0,b,c FROM t1;
+INSERT INTO t1 SELECT 0,b,c FROM t1;
+INSERT INTO t1 SELECT 0,b,c FROM t1;
+INSERT INTO t1 SELECT 0,b,c FROM t1;
+INSERT INTO t1 SELECT 0,b,c FROM t1;
+INSERT INTO t1 SELECT 0,b,c FROM t1;
+INSERT INTO t1 SELECT 0,b,c FROM t1;
+INSERT INTO t1 SELECT 0,b,c FROM t1;
+INSERT INTO t1 SELECT 0,b,c FROM t1;
+
+BEGIN;
+SELECT b FROM t1 LIMIT 3;
+
+connect (con1,localhost,root,,);
+connection con1;
+BEGIN;
+DELETE FROM t1 WHERE a=1;
+# This should be buffered, if innodb_change_buffering_debug = 1 is in effect.
+INSERT INTO t1 VALUES(1,'X',1);
+
+SET DEBUG_DBUG='+d,crash_after_log_ibuf_upd_inplace';
+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--error 2013
+# This should force a change buffer merge
+SELECT b FROM t1 LIMIT 3;
+
+let SEARCH_PATTERN=Wrote log record for ibuf update in place operation;
+--source include/search_pattern_in_file.inc
+
+# Write file to make mysql-test-run.pl start up the server again
+--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+CHECK TABLE t1;
+
+# Cleanup
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/innodb-create-options.result b/mysql-test/suite/innodb_zip/r/innodb-create-options.result
index 94c84fcf60f..94c84fcf60f 100644
--- a/mysql-test/suite/innodb/r/innodb-create-options.result
+++ b/mysql-test/suite/innodb_zip/r/innodb-create-options.result
diff --git a/mysql-test/suite/innodb/r/innodb-zip.result b/mysql-test/suite/innodb_zip/r/innodb-zip.result
index db7fd6d812c..db7fd6d812c 100644
--- a/mysql-test/suite/innodb/r/innodb-zip.result
+++ b/mysql-test/suite/innodb_zip/r/innodb-zip.result
diff --git a/mysql-test/suite/innodb/r/innodb_bug36169.result b/mysql-test/suite/innodb_zip/r/innodb_bug36169.result
index aa80e4d7aa4..aa80e4d7aa4 100644
--- a/mysql-test/suite/innodb/r/innodb_bug36169.result
+++ b/mysql-test/suite/innodb_zip/r/innodb_bug36169.result
diff --git a/mysql-test/suite/innodb/r/innodb_bug36172.result b/mysql-test/suite/innodb_zip/r/innodb_bug36172.result
index 195775f74c8..195775f74c8 100644
--- a/mysql-test/suite/innodb/r/innodb_bug36172.result
+++ b/mysql-test/suite/innodb_zip/r/innodb_bug36172.result
diff --git a/mysql-test/suite/innodb/r/innodb_bug52745.result b/mysql-test/suite/innodb_zip/r/innodb_bug52745.result
index 927ba0e0e53..927ba0e0e53 100644
--- a/mysql-test/suite/innodb/r/innodb_bug52745.result
+++ b/mysql-test/suite/innodb_zip/r/innodb_bug52745.result
diff --git a/mysql-test/suite/innodb/r/innodb_bug53591.result b/mysql-test/suite/innodb_zip/r/innodb_bug53591.result
index b0196318801..b0196318801 100644
--- a/mysql-test/suite/innodb/r/innodb_bug53591.result
+++ b/mysql-test/suite/innodb_zip/r/innodb_bug53591.result
diff --git a/mysql-test/suite/innodb/r/innodb_bug56680.result b/mysql-test/suite/innodb_zip/r/innodb_bug56680.result
index 5e798b69167..5e798b69167 100644
--- a/mysql-test/suite/innodb/r/innodb_bug56680.result
+++ b/mysql-test/suite/innodb_zip/r/innodb_bug56680.result
diff --git a/mysql-test/suite/innodb/r/innodb_cmp_drop_table.result b/mysql-test/suite/innodb_zip/r/innodb_cmp_drop_table.result
index 1f6d6948756..1f6d6948756 100644
--- a/mysql-test/suite/innodb/r/innodb_cmp_drop_table.result
+++ b/mysql-test/suite/innodb_zip/r/innodb_cmp_drop_table.result
diff --git a/mysql-test/suite/innodb/r/innodb_index_large_prefix.result b/mysql-test/suite/innodb_zip/r/innodb_index_large_prefix.result
index f966574506a..f966574506a 100644
--- a/mysql-test/suite/innodb/r/innodb_index_large_prefix.result
+++ b/mysql-test/suite/innodb_zip/r/innodb_index_large_prefix.result
diff --git a/mysql-test/suite/innodb/r/innodb_prefix_index_liftedlimit.result b/mysql-test/suite/innodb_zip/r/innodb_prefix_index_liftedlimit.result
index 0c68c8a6975..0c68c8a6975 100644
--- a/mysql-test/suite/innodb/r/innodb_prefix_index_liftedlimit.result
+++ b/mysql-test/suite/innodb_zip/r/innodb_prefix_index_liftedlimit.result
diff --git a/mysql-test/suite/innodb/t/innodb-create-options.test b/mysql-test/suite/innodb_zip/t/innodb-create-options.test
index 3215002a37c..3215002a37c 100644
--- a/mysql-test/suite/innodb/t/innodb-create-options.test
+++ b/mysql-test/suite/innodb_zip/t/innodb-create-options.test
diff --git a/mysql-test/suite/innodb/t/innodb-zip.test b/mysql-test/suite/innodb_zip/t/innodb-zip.test
index 73601dbe7dc..73601dbe7dc 100644
--- a/mysql-test/suite/innodb/t/innodb-zip.test
+++ b/mysql-test/suite/innodb_zip/t/innodb-zip.test
diff --git a/mysql-test/suite/innodb/t/innodb_bug36169.test b/mysql-test/suite/innodb_zip/t/innodb_bug36169.test
index 6426bd683ae..6426bd683ae 100644
--- a/mysql-test/suite/innodb/t/innodb_bug36169.test
+++ b/mysql-test/suite/innodb_zip/t/innodb_bug36169.test
diff --git a/mysql-test/suite/innodb/t/innodb_bug36172.test b/mysql-test/suite/innodb_zip/t/innodb_bug36172.test
index 015f461e532..015f461e532 100644
--- a/mysql-test/suite/innodb/t/innodb_bug36172.test
+++ b/mysql-test/suite/innodb_zip/t/innodb_bug36172.test
diff --git a/mysql-test/suite/innodb/t/innodb_bug52745.test b/mysql-test/suite/innodb_zip/t/innodb_bug52745.test
index 58bcc264677..58bcc264677 100644
--- a/mysql-test/suite/innodb/t/innodb_bug52745.test
+++ b/mysql-test/suite/innodb_zip/t/innodb_bug52745.test
diff --git a/mysql-test/suite/innodb/t/innodb_bug53591.test b/mysql-test/suite/innodb_zip/t/innodb_bug53591.test
index 9a1c2afbccb..9a1c2afbccb 100644
--- a/mysql-test/suite/innodb/t/innodb_bug53591.test
+++ b/mysql-test/suite/innodb_zip/t/innodb_bug53591.test
diff --git a/mysql-test/suite/innodb/t/innodb_bug56680.test b/mysql-test/suite/innodb_zip/t/innodb_bug56680.test
index f592bd16942..f592bd16942 100644
--- a/mysql-test/suite/innodb/t/innodb_bug56680.test
+++ b/mysql-test/suite/innodb_zip/t/innodb_bug56680.test
diff --git a/mysql-test/suite/innodb/t/innodb_cmp_drop_table-master.opt b/mysql-test/suite/innodb_zip/t/innodb_cmp_drop_table-master.opt
index a9a3d8c3db8..a9a3d8c3db8 100644
--- a/mysql-test/suite/innodb/t/innodb_cmp_drop_table-master.opt
+++ b/mysql-test/suite/innodb_zip/t/innodb_cmp_drop_table-master.opt
diff --git a/mysql-test/suite/innodb/t/innodb_cmp_drop_table.test b/mysql-test/suite/innodb_zip/t/innodb_cmp_drop_table.test
index 4263e839c85..4263e839c85 100644
--- a/mysql-test/suite/innodb/t/innodb_cmp_drop_table.test
+++ b/mysql-test/suite/innodb_zip/t/innodb_cmp_drop_table.test
diff --git a/mysql-test/suite/innodb/t/innodb_index_large_prefix.test b/mysql-test/suite/innodb_zip/t/innodb_index_large_prefix.test
index 6873c2a404c..6873c2a404c 100644
--- a/mysql-test/suite/innodb/t/innodb_index_large_prefix.test
+++ b/mysql-test/suite/innodb_zip/t/innodb_index_large_prefix.test
diff --git a/mysql-test/suite/innodb/t/innodb_prefix_index_liftedlimit.test b/mysql-test/suite/innodb_zip/t/innodb_prefix_index_liftedlimit.test
index d7540dff36d..d7540dff36d 100644
--- a/mysql-test/suite/innodb/t/innodb_prefix_index_liftedlimit.test
+++ b/mysql-test/suite/innodb_zip/t/innodb_prefix_index_liftedlimit.test
diff --git a/mysql-test/suite/perfschema/r/all_instances.result b/mysql-test/suite/perfschema/r/all_instances.result
index caf4f49034f..6e4206b2b51 100644
--- a/mysql-test/suite/perfschema/r/all_instances.result
+++ b/mysql-test/suite/perfschema/r/all_instances.result
@@ -149,6 +149,7 @@ wait/io/file/mysys/charset
wait/io/file/sql/casetest
wait/io/file/sql/dbopt
wait/io/file/sql/ERRMSG
+wait/io/file/sql/file_parser
wait/io/file/sql/FRM
wait/io/file/sql/pid
wait/io/file/sql/query_log
diff --git a/mysql-test/t/distinct.test b/mysql-test/t/distinct.test
index 71643a25c5a..952609be7e0 100644
--- a/mysql-test/t/distinct.test
+++ b/mysql-test/t/distinct.test
@@ -750,4 +750,42 @@ INSERT INTO t1 VALUES (1111, 2222), (3333, 4444);
SELECT DISTINCT CONCAT(a,b) AS c FROM t1 ORDER BY 1;
DROP TABLE t1;
+--echo #
+--echo # Bug#16539979 BASIC SELECT COUNT(DISTINCT ID) IS BROKEN.
+--echo # Bug#17867117 ERROR RESULT WHEN "COUNT + DISTINCT + CASE WHEN" NEED MERGE_WALK
+--echo #
+
+SET @tmp_table_size_save= @@tmp_table_size;
+SET @@tmp_table_size= 1024;
+
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8);
+INSERT INTO t1 SELECT a+8 FROM t1;
+INSERT INTO t1 SELECT a+16 FROM t1;
+INSERT INTO t1 SELECT a+32 FROM t1;
+INSERT INTO t1 SELECT a+64 FROM t1;
+INSERT INTO t1 VALUE(NULL);
+SELECT COUNT(DISTINCT a) FROM t1;
+SELECT COUNT(DISTINCT (a+0)) FROM t1;
+DROP TABLE t1;
+
+create table tb(
+id int auto_increment primary key,
+v varchar(32))
+engine=myisam charset=gbk;
+insert into tb(v) values("aaa");
+insert into tb(v) (select v from tb);
+insert into tb(v) (select v from tb);
+insert into tb(v) (select v from tb);
+insert into tb(v) (select v from tb);
+insert into tb(v) (select v from tb);
+insert into tb(v) (select v from tb);
+
+update tb set v=concat(v, id);
+select count(distinct case when id<=64 then id end) from tb;
+select count(distinct case when id<=63 then id end) from tb;
+drop table tb;
+
+SET @@tmp_table_size= @tmp_table_size_save;
+
--echo End of 5.5 tests
diff --git a/mysql-test/t/events_trans.test b/mysql-test/t/events_trans.test
index 4cf2583ac96..6d829379fea 100644
--- a/mysql-test/t/events_trans.test
+++ b/mysql-test/t/events_trans.test
@@ -146,3 +146,4 @@ SELECT * FROM t2;
ROLLBACK WORK TO SAVEPOINT A;
DROP TABLE t1, t2;
+DROP EVENT e1;
diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test
index cff93fc13ee..534cabaf7ea 100644
--- a/mysql-test/t/gis.test
+++ b/mysql-test/t/gis.test
@@ -1434,6 +1434,24 @@ SELECT 1 FROM g1 WHERE a >= ANY
DROP TABLE g1;
--echo #
+--echo # Bug#16451878 GEOMETRY QUERY CRASHES SERVER
+--echo #
+
+--echo # should not crash
+SELECT ASTEXT(0x0100000000030000000100000000000010);
+
+--echo #should not crash
+SELECT ENVELOPE(0x0100000000030000000100000000000010);
+
+--echo #should not crash
+SELECT
+ GEOMETRYN(0x0100000000070000000100000001030000000200000000000000ffff0000, 1);
+
+--echo #should not crash
+SELECT
+ GEOMETRYN(0x0100000000070000000100000001030000000200000000000000ffffff0f, 1);
+
+--echo #
--echo # MDEV-3819 missing constraints for spatial column types
--echo #