summaryrefslogtreecommitdiff
path: root/mysql-test/t
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/t')
-rw-r--r--mysql-test/t/comments.test2
-rw-r--r--mysql-test/t/distinct.test38
-rw-r--r--mysql-test/t/error_simulation.test2
-rw-r--r--mysql-test/t/events_trans.test1
-rw-r--r--mysql-test/t/func_group.test12
-rw-r--r--mysql-test/t/func_misc.test11
-rw-r--r--mysql-test/t/gis-precise.test3
-rw-r--r--mysql-test/t/gis.test18
-rw-r--r--mysql-test/t/mysqldump.test15
-rw-r--r--mysql-test/t/partition.test332
-rw-r--r--mysql-test/t/ps.test15
-rw-r--r--mysql-test/t/rpl_mysqldump_slave.test9
-rw-r--r--mysql-test/t/subselect4.test35
-rw-r--r--mysql-test/t/subselect_sj.test18
-rw-r--r--mysql-test/t/subselect_sj2.test18
-rw-r--r--mysql-test/t/udf_debug_sync.test40
-rw-r--r--mysql-test/t/union_crash-714.test9
-rw-r--r--mysql-test/t/xml.test6
18 files changed, 579 insertions, 5 deletions
diff --git a/mysql-test/t/comments.test b/mysql-test/t/comments.test
index ce4f4d50675..6cf69635d1e 100644
--- a/mysql-test/t/comments.test
+++ b/mysql-test/t/comments.test
@@ -27,6 +27,8 @@ select 1 # The rest of the row will be ignored
select 1 /*M! +1 */;
select 1 /*M!50000 +1 */;
select 1 /*M!50300 +1 */;
+select 2 /*M!99999 +1 */;
+select 2 /*M!100000 +1 */;
select 2 /*M!999999 +1 */;
--error ER_PARSE_ERROR
select 2 /*M!0000 +1 */;
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/error_simulation.test b/mysql-test/t/error_simulation.test
index ea7dd12fb9e..58ead1e3ced 100644
--- a/mysql-test/t/error_simulation.test
+++ b/mysql-test/t/error_simulation.test
@@ -103,7 +103,7 @@ CREATE TABLE t2(f1 INT);
INSERT INTO t1 VALUES (1),(2);
INSERT INTO t2 VALUES (1),(2);
SET SESSION debug_dbug="+d,bug11747970_raise_error";
---error 1105
+--error ER_QUERY_INTERRUPTED
INSERT IGNORE INTO t2 SELECT f1 FROM t1 a WHERE NOT EXISTS (SELECT 1 FROM t2 b WHERE a.f1 = b.f1);
SET SESSION debug_dbug = DEFAULT;
DROP TABLE t1,t2;
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/func_group.test b/mysql-test/t/func_group.test
index cf5f00c3ee1..363f089e8d7 100644
--- a/mysql-test/t/func_group.test
+++ b/mysql-test/t/func_group.test
@@ -981,10 +981,13 @@ DROP TABLE D;
#
# Bug #39656: Behaviour different for agg functions with & without where -
# ONLY_FULL_GROUP_BY
+# MDEV-5617 mysqld crashes when running a query with ONLY_FULL_GROUP_BY
#
CREATE TABLE t1 (a INT, b INT);
INSERT INTO t1 VALUES (1,1), (1,2), (1,3);
+CREATE TABLE t2 (b INT);
+INSERT INTO t2 VALUES (3),(4);
SET SQL_MODE='ONLY_FULL_GROUP_BY';
@@ -1000,11 +1003,18 @@ SELECT COUNT(*) FROM t1 a JOIN t1 b ON a.a= b.a;
SELECT COUNT(*), (SELECT count(*) FROM t1 inr WHERE inr.a = outr.a)
FROM t1 outr;
+--error ER_MIX_OF_GROUP_FUNC_AND_FIELDS
+SELECT COUNT(*) FROM t1 outr, (SELECT b, count(*) FROM t2) as t3;
+
+SELECT COUNT(*) FROM t1 outr where (1,1) in (SELECT a, count(*) FROM t2);
+
SELECT COUNT(*) FROM t1 a JOIN t1 outr
ON a.a= (SELECT count(*) FROM t1 inr WHERE inr.a = outr.a);
+SELECT * FROM (SELECT a FROM t1 GROUP BY a) sq JOIN t2 ON a = b;
+
SET SQL_MODE=default;
-DROP TABLE t1;
+DROP TABLE t1,t2;
###
diff --git a/mysql-test/t/func_misc.test b/mysql-test/t/func_misc.test
index 22ebb6248e2..a7ae99cd2d0 100644
--- a/mysql-test/t/func_misc.test
+++ b/mysql-test/t/func_misc.test
@@ -298,6 +298,14 @@ DROP TABLE t1;
SELECT INET_NTOA(0);
SELECT '1' IN ('1', INET_NTOA(0));
+#
+# MDEV-5655 Server crashes on NAME_CONST containing AND/OR expressions
+#
+--error ER_WRONG_ARGUMENTS
+SELECT NAME_CONST('a', -(1 OR 2)) OR 1;
+--error ER_WRONG_ARGUMENTS
+SELECT NAME_CONST('a', -(1 AND 2)) AND 1;
+SELECT NAME_CONST('a', -(1)) OR 1;
--echo #
--echo # Bug #52165: Assertion failed: file .\dtoa.c, line 465
@@ -549,6 +557,3 @@ select release_lock(repeat('a', 193));
--echo # End of 5.5 tests
--echo #
---echo #
---echo # End of tests
---echo #
diff --git a/mysql-test/t/gis-precise.test b/mysql-test/t/gis-precise.test
index d021bb0b53d..0c6410b5a75 100644
--- a/mysql-test/t/gis-precise.test
+++ b/mysql-test/t/gis-precise.test
@@ -325,3 +325,6 @@ SELECT ST_NUMPOINTS(ST_EXTERIORRING(ST_BUFFER( POLYGONFROMTEXT( 'POLYGON( ( 0.0
0.0 -3.0
))' ), 3 )));
+# MDEV-5615 crash in Gcalc_function::add_operation
+select astext(buffer(st_linestringfromwkb(linestring(point(-1,1), point(-1,-2))),-1));
+
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 #
diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test
index 5af27607483..9824abe7d43 100644
--- a/mysql-test/t/mysqldump.test
+++ b/mysql-test/t/mysqldump.test
@@ -2437,6 +2437,21 @@ SET @@global.log_output= @old_log_output_state;
SET @@global.slow_query_log= @old_slow_query_log_state;
SET @@global.general_log= @old_general_log_state;
+--echo # MDEV-5481 mysqldump fails to dump geometry types properly
+
+create table t1 (g GEOMETRY) CHARSET koi8r;
+create table t2 (g GEOMETRY) CHARSET koi8r;
+insert into t1 values (point(1,1)), (point(2,2));
+--exec $MYSQL_DUMP --hex-blob --character-sets-dir=$MYSQL_SHAREDIR/charsets --tab=$MYSQLTEST_VARDIR/tmp/ test t1
+--echo ##################################################
+--cat_file $file
+--echo ##################################################
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--eval LOAD DATA INFILE '$file' INTO TABLE t2 CHARACTER SET koi8r
+--remove_file $file
+select astext(g) from t2;
+drop table t1, t2;
+
--echo #
--echo # End of 5.1 tests
--echo #
diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test
index bad59ff09c3..81aafb7ac9c 100644
--- a/mysql-test/t/partition.test
+++ b/mysql-test/t/partition.test
@@ -2495,6 +2495,338 @@ ALTER TABLE t1 ADD PARTITION PARTITIONS 2;
SELECT * from t1 order by i;
DROP TABLE t1;
+--echo #
+--echo # MDEV-5177: ha_partition and innodb index intersection produce fewer rows (MySQL Bug#70703)
+--echo #
+create table t1 (
+ a int not null,
+ b int not null,
+ pk int not null,
+ primary key (pk),
+ key(a),
+ key(b)
+) partition by hash(pk) partitions 10;
+
+insert into t1 values (1,2,4); # both
+insert into t1 values (1,0,17); # left
+insert into t1 values (1,2,25); # both
+
+insert into t1 values (10,20,122);
+insert into t1 values (10,20,123);
+
+# Now, fill in some data so that the optimizer choses index_merge
+create table t2 (a int);
+insert into t2 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+
+insert into t1 select 1,2, 200 + A.a + 10*B.a + 100*C.a from t2 A, t2 B, t2 C;
+
+insert into t1 select 10+A.a + 10*B.a + 100*C.a + 1000*D.a,
+ 10+A.a + 10*B.a + 100*C.a + 1000*D.a,
+ 2000 + A.a + 10*B.a + 100*C.a + 1000*D.a
+ from t2 A, t2 B, t2 C ,t2 D;
+
+# This should show index_merge, using intersect
+explain select * from t1 where a=1 and b=2 and pk between 1 and 999999 ;
+# 794 rows in output
+create temporary table t3 as
+select * from t1 where a=1 and b=2 and pk between 1 and 999 ;
+select count(*) from t3;
+drop table t3;
+
+# 802 rows in output
+create temporary table t3 as
+select * from t1 ignore index(a,b) where a=1 and b=2 and pk between 1 and 999 ;
+select count(*) from t3;
+drop table t3;
+
+drop table t1,t2;
+
+--echo #
+--echo # MDEV-5555: Incorrect index_merge on BTREE indices
+--echo #
+
+CREATE TABLE t1 (
+ id bigint(20) unsigned NOT NULL,
+ id2 bigint(20) unsigned NOT NULL,
+ dob date DEFAULT NULL,
+ address char(100) DEFAULT NULL,
+ city char(35) DEFAULT NULL,
+ hours_worked_per_week smallint(5) unsigned DEFAULT NULL,
+ weeks_worked_last_year tinyint(3) unsigned DEFAULT NULL,
+ KEY dob (dob),
+ KEY address (address),
+ KEY city (city),
+ KEY hours_worked_per_week (hours_worked_per_week),
+ KEY weeks_worked_last_year (weeks_worked_last_year)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+PARTITION BY KEY (id) PARTITIONS 5;
+
+--echo # Insert some rows
+--disable_query_log
+INSERT INTO t1 VALUES (123,123,'2001-04-14','address123','city123',40,51),
+(127,127,'1977-03-30','address127','city127',0,0),
+(131,131,'1985-07-29','address131','city131',50,52),
+(135,135,'1997-01-20','address135','city135',0,0),
+(139,139,'1963-04-27','address139','city139',27,52),
+(143,143,'1979-01-28','address143','city143',40,52),
+(147,147,'1985-08-28','address147','city147',0,0),
+(151,151,'1997-01-24','address151','city151',40,52),
+(156,156,'1975-02-19','address156','city156',46,52),
+(158,158,'1996-07-06','address158','city158',46,8),
+(164,164,'1925-12-30','address164','city164',0,0),
+(166,166,'2010-12-30','address166','city166',0,0),
+(172,172,'1996-08-15','address172','city172',0,0),
+(174,174,'2008-05-20','address174','city174',40,52),
+(180,180,'1969-09-05','address180','city180',25,52),
+(182,182,'1977-08-11','address182','city182',40,8),
+(188,188,'2012-03-29','address188','city188',0,0),
+(190,190,'1978-02-19','address190','city190',0,0),
+(215,215,'1982-02-07','address215','city215',40,36),
+(223,223,'2005-02-11','address223','city223',55,52),
+(247,247,'2005-07-02','address247','city247',30,51),
+(255,255,'1997-08-15','address255','city255',0,0),
+(2,2,'1973-05-05','address2','city2',25,52),
+(4,4,'2012-07-21','address4','city4',40,12),
+(6,6,'1982-07-15','address6','city6',0,0),
+(8,8,'1979-02-16','address8','city8',0,0),
+(10,10,'1955-10-06','address10','city10',60,52),
+(12,12,'1977-08-09','address12','city12',40,52),
+(14,14,'2005-03-28','address14','city14',0,0),
+(16,16,'1949-11-07','address16','city16',40,52),
+(18,18,'2012-01-04','address18','city18',0,0),
+(20,20,'2011-01-23','address20','city20',0,0),
+(22,22,'1954-10-14','address22','city22',20,52),
+(24,24,'2010-01-22','address24','city24',0,0),
+(26,26,'1999-08-15','address26','city26',0,0),
+(28,28,'1964-07-05','address28','city28',10,20),
+(30,30,'2004-10-13','address30','city30',0,0),
+(32,32,'2007-06-08','address32','city32',0,0),
+(34,34,'1977-02-23','address34','city34',40,52),
+(36,36,'2007-06-11','address36','city36',75,52),
+(38,38,'1932-04-12','address38','city38',0,0),
+(40,40,'1968-11-16','address40','city40',0,0),
+(42,42,'1996-10-01','address42','city42',38,52),
+(44,44,'1977-08-23','address44','city44',18,6),
+(46,46,'1978-11-23','address46','city46',0,0),
+(48,48,'1998-02-27','address48','city48',0,0),
+(50,50,'1923-09-08','address50','city50',40,52),
+(52,52,'1964-09-09','address52','city52',0,0),
+(55,55,'2001-01-27','address55','city55',40,40),
+(56,56,'1938-08-28','address56','city56',48,52),
+(59,59,'1967-12-19','address59','city59',40,52),
+(60,60,'1969-06-30','address60','city60',40,46),
+(63,63,'2002-04-05','address63','city63',0,0),
+(64,64,'1972-11-21','address64','city64',48,52),
+(67,67,'1988-04-04','address67','city67',0,0),
+(68,68,'1964-07-14','address68','city68',4,16),
+(71,71,'1998-03-09','address71','city71',0,0),
+(72,72,'1960-10-28','address72','city72',35,52),
+(75,75,'1968-04-14','address75','city75',40,52),
+(76,76,'1977-05-13','address76','city76',0,0),
+(79,79,'1982-12-19','address79','city79',0,0),
+(80,80,'1966-01-07','address80','city80',15,12),
+(83,83,'1947-02-09','address83','city83',10,18),
+(84,84,'1976-06-23','address84','city84',40,52),
+(87,87,'2000-10-24','address87','city87',25,4),
+(88,88,'2002-05-23','address88','city88',20,52),
+(91,91,'2000-11-28','address91','city91',60,52),
+(92,92,'1965-07-17','address92','city92',40,52),
+(95,95,'1977-09-16','address95','city95',30,52),
+(96,96,'1994-09-26','address96','city96',0,0),
+(99,99,'2008-02-19','address99','city99',0,0),
+(100,100,'1953-01-07','address100','city100',0,0),
+(103,103,'2010-12-29','address103','city103',0,0),
+(104,104,'1990-12-03','address104','city104',40,52),
+(107,107,'2003-10-27','address107','city107',0,0),
+(108,108,'1998-03-05','address108','city108',40,17),
+(111,111,'2002-10-18','address111','city111',0,0),
+(112,112,'1960-04-02','address112','city112',0,0),
+(115,115,'1989-05-28','address115','city115',40,52),
+(116,116,'1985-10-25','address116','city116',15,52),
+(119,119,'1974-04-15','address119','city119',0,0),
+(120,120,'1926-03-21','address120','city120',0,0),
+(157,157,'1972-03-23','address157','city157',0,0),
+(159,159,'2002-11-08','address159','city159',0,0),
+(165,165,'1998-07-10','address165','city165',0,0),
+(167,167,'1973-11-16','address167','city167',0,0),
+(173,173,'1966-06-26','address173','city173',0,0),
+(175,175,'1957-02-02','address175','city175',0,0),
+(181,181,'1964-11-16','address181','city181',45,26),
+(183,183,'1943-12-02','address183','city183',0,0),
+(189,189,'1986-06-30','address189','city189',0,0),
+(191,191,'2005-05-14','address191','city191',0,0),
+(196,196,'1961-03-23','address196','city196',0,0),
+(197,197,'1955-07-13','address197','city197',0,0),
+(198,198,'2006-11-26','address198','city198',0,0),
+(199,199,'1978-02-06','address199','city199',0,0),
+(208,208,'2012-04-13','address208','city208',48,52),
+(210,210,'1989-08-18','address210','city210',0,0),
+(211,211,'1982-08-17','address211','city211',40,52),
+(212,212,'1919-08-29','address212','city212',0,0),
+(213,213,'1987-03-25','address213','city213',0,0),
+(228,228,'1988-05-05','address228','city228',40,52),
+(229,229,'1936-10-15','address229','city229',0,0),
+(230,230,'1973-08-19','address230','city230',40,52),
+(231,231,'2002-06-18','address231','city231',50,52),
+(240,240,'2011-10-17','address240','city240',60,52),
+(242,242,'1981-07-24','address242','city242',0,0),
+(243,243,'1978-10-12','address243','city243',0,0),
+(244,244,'2003-01-15','address244','city244',0,0),
+(245,245,'1950-09-26','address245','city245',0,0),
+(125,125,'1939-08-02','address125','city125',28,32),
+(126,126,'1984-02-10','address126','city126',0,0),
+(129,129,'1992-01-20','address129','city129',0,0),
+(130,130,'1992-09-18','address130','city130',0,0),
+(133,133,'1996-05-07','address133','city133',24,20),
+(134,134,'1987-07-13','address134','city134',0,0),
+(137,137,'2004-03-10','address137','city137',0,0),
+(138,138,'1989-02-10','address138','city138',0,0),
+(141,141,'1970-03-21','address141','city141',0,0),
+(142,142,'1984-05-25','address142','city142',40,50),
+(145,145,'1959-05-24','address145','city145',0,0),
+(146,146,'1946-07-28','address146','city146',35,16),
+(149,149,'1993-09-16','address149','city149',0,0),
+(150,150,'1975-12-18','address150','city150',0,0),
+(153,153,'1993-12-20','address153','city153',0,0),
+(155,155,'1934-10-29','address155','city155',0,0),
+(161,161,'1969-11-04','address161','city161',50,50),
+(163,163,'1976-05-03','address163','city163',40,52),
+(169,169,'1982-12-19','address169','city169',0,0),
+(171,171,'1976-07-01','address171','city171',0,0),
+(177,177,'2002-11-16','address177','city177',0,0),
+(179,179,'1964-02-05','address179','city179',40,32),
+(185,185,'1981-02-06','address185','city185',0,0),
+(187,187,'1962-06-04','address187','city187',40,52),
+(216,216,'1996-05-21','address216','city216',48,52),
+(248,248,'1963-09-06','address248','city248',0,0),
+(256,256,'1966-07-14','address256','city256',0,0),
+(53,53,'1992-05-25','address53','city53',0,0),
+(57,57,'2003-11-12','address57','city57',25,20),
+(61,61,'1953-01-29','address61','city61',0,0),
+(65,65,'1975-05-02','address65','city65',10,10),
+(69,69,'1938-03-20','address69','city69',0,0),
+(73,73,'1969-05-05','address73','city73',0,0),
+(77,77,'1996-05-19','address77','city77',0,0),
+(81,81,'1985-06-22','address81','city81',0,0),
+(85,85,'2002-10-10','address85','city85',0,0),
+(89,89,'1958-06-16','address89','city89',0,0),
+(93,93,'1962-06-16','address93','city93',0,0),
+(97,97,'1964-10-08','address97','city97',0,0),
+(101,101,'1986-06-11','address101','city101',40,52),
+(105,105,'1999-05-14','address105','city105',40,45),
+(109,109,'2000-05-23','address109','city109',0,0),
+(113,113,'1960-08-03','address113','city113',8,15),
+(117,117,'1982-02-15','address117','city117',50,36),
+(121,121,'1998-10-18','address121','city121',24,52),
+(192,192,'1964-07-24','address192','city192',40,52),
+(193,193,'1973-05-03','address193','city193',0,0),
+(194,194,'1980-01-14','address194','city194',40,52),
+(195,195,'1975-07-15','address195','city195',45,52),
+(200,200,'2006-03-09','address200','city200',0,0),
+(201,201,'2008-05-20','address201','city201',3,28),
+(202,202,'2000-06-30','address202','city202',12,52),
+(203,203,'1992-07-08','address203','city203',50,52),
+(204,204,'1988-07-05','address204','city204',14,40),
+(205,205,'1950-10-29','address205','city205',0,0),
+(206,206,'1962-11-25','address206','city206',0,0),
+(207,207,'1946-06-03','address207','city207',0,0),
+(214,214,'1973-12-14','address214','city214',0,0),
+(217,217,'1945-11-06','address217','city217',40,36),
+(218,218,'2007-07-20','address218','city218',0,0),
+(219,219,'1979-10-05','address219','city219',0,0),
+(220,220,'1992-06-20','address220','city220',10,12),
+(221,221,'2007-03-26','address221','city221',50,52),
+(222,222,'1989-12-24','address222','city222',0,0),
+(224,224,'1975-07-14','address224','city224',0,0),
+(225,225,'1976-02-23','address225','city225',20,52),
+(226,226,'1974-06-22','address226','city226',0,0),
+(227,227,'2004-01-16','address227','city227',0,0),
+(232,232,'1958-01-01','address232','city232',0,0),
+(233,233,'1966-08-03','address233','city233',40,32),
+(234,234,'1975-10-22','address234','city234',40,52),
+(235,235,'1983-10-25','address235','city235',0,0),
+(236,236,'1974-03-07','address236','city236',0,0),
+(237,237,'1965-12-31','address237','city237',45,20),
+(238,238,'1971-10-16','address238','city238',0,0),
+(239,239,'1989-07-19','address239','city239',0,0),
+(246,246,'1960-07-08','address246','city246',0,0),
+(249,249,'1943-07-01','address249','city249',40,30),
+(250,250,'1983-10-15','address250','city250',30,52),
+(251,251,'1979-07-03','address251','city251',0,0),
+(252,252,'1985-10-04','address252','city252',15,4),
+(253,253,'1966-10-24','address253','city253',0,0),
+(254,254,'1956-02-02','address254','city254',0,0),
+(1,1,'2003-11-23','address1','city1',40,52),
+(3,3,'1938-01-23','address3','city3',0,0),
+(5,5,'2006-12-27','address5','city5',40,48),
+(7,7,'1969-04-09','address7','city7',0,0),
+(9,9,'2006-06-14','address9','city9',0,0),
+(11,11,'1999-01-12','address11','city11',40,52),
+(13,13,'1968-01-13','address13','city13',50,12),
+(15,15,'1960-04-11','address15','city15',0,0),
+(17,17,'2006-10-13','address17','city17',40,52),
+(19,19,'1950-08-19','address19','city19',0,0),
+(21,21,'2000-05-01','address21','city21',40,30),
+(23,23,'1952-06-09','address23','city23',40,52),
+(25,25,'1934-12-08','address25','city25',32,40),
+(27,27,'1995-04-19','address27','city27',40,45),
+(29,29,'1986-01-14','address29','city29',44,52),
+(31,31,'1978-04-19','address31','city31',10,20),
+(33,33,'1989-11-23','address33','city33',25,10),
+(35,35,'2012-01-02','address35','city35',8,48),
+(37,37,'2005-08-24','address37','city37',40,42),
+(39,39,'1973-11-02','address39','city39',40,52),
+(41,41,'2011-10-12','address41','city41',20,30),
+(43,43,'1960-12-24','address43','city43',0,0),
+(45,45,'1990-04-17','address45','city45',35,40),
+(47,47,'1964-04-02','address47','city47',0,0),
+(49,49,'1957-01-25','address49','city49',40,52),
+(51,51,'1970-10-20','address51','city51',0,0),
+(54,54,'1987-09-30','address54','city54',0,0),
+(58,58,'1975-05-07','address58','city58',0,0),
+(62,62,'1972-08-03','address62','city62',40,52),
+(66,66,'1995-11-04','address66','city66',0,0),
+(70,70,'1985-10-19','address70','city70',40,52),
+(74,74,'1969-06-09','address74','city74',0,0),
+(78,78,'2003-01-16','address78','city78',66,52),
+(82,82,'2012-04-29','address82','city82',50,30),
+(86,86,'2008-02-03','address86','city86',0,0),
+(90,90,'1973-05-15','address90','city90',35,12),
+(94,94,'1987-10-28','address94','city94',40,50),
+(98,98,'1973-06-10','address98','city98',65,50),
+(102,102,'2009-09-13','address102','city102',0,0),
+(106,106,'1986-07-03','address106','city106',0,0),
+(110,110,'1982-06-10','address110','city110',35,52),
+(114,114,'1963-10-08','address114','city114',48,52),
+(118,118,'1948-03-07','address118','city118',0,0),
+(122,122,'1997-12-19','address122','city122',0,0),
+(124,124,'1966-03-25','address124','city124',0,0),
+(128,128,'1968-08-13','address128','city128',0,0),
+(132,132,'1989-09-25','address132','city132',20,20),
+(136,136,'1993-09-02','address136','city136',0,0),
+(140,140,'1981-05-31','address140','city140',48,52),
+(144,144,'1960-09-15','address144','city144',0,0),
+(148,148,'1945-02-13','address148','city148',40,38),
+(152,152,'2010-11-13','address152','city152',20,52),
+(154,154,'1950-11-07','address154','city154',55,52),
+(160,160,'1981-01-17','address160','city160',0,0),
+(162,162,'2001-03-19','address162','city162',0,0),
+(168,168,'2003-03-28','address168','city168',0,0),
+(170,170,'1977-06-18','address170','city170',50,52),
+(176,176,'1967-04-15','address176','city176',30,50),
+(178,178,'1989-10-25','address178','city178',60,12),
+(184,184,'2004-04-21','address184','city184',0,0),
+(186,186,'1952-11-08','address186','city186',50,48),
+(209,209,'1943-03-15','address209','city209',40,30),
+(241,241,'1979-12-02','address241','city241',0,0),
+(257,257,'2010-03-06','address257','city257',40,47);
+--enable_query_log
+
+select * from t1 where hours_worked_per_week = 40 and weeks_worked_last_year = 52 and dob < '1949-11-21';
+select * from t1 IGNORE INDEX(dob, weeks_worked_last_year, hours_worked_per_week) where hours_worked_per_week = 40 and weeks_worked_last_year = 52 and dob < '1949-11-21';
+
+drop table t1;
+
#
# Test ALTER TABLE ADD/DROP PARTITION IF EXISTS
#
diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test
index 4200f7435fb..9775a8dc28e 100644
--- a/mysql-test/t/ps.test
+++ b/mysql-test/t/ps.test
@@ -3618,3 +3618,18 @@ DROP VIEW v2;
DROP TABLE t1, t2;
--echo # End of 5.3 tests
+
+--echo #
+--echo # MDEV-5505: Assertion `! is_set()' fails on PREPARE SELECT
+--echo # with out of range in GROUP BY
+--echo #
+CREATE TABLE t1 (a INT);
+
+--error ER_DATA_OUT_OF_RANGE
+PREPARE stmt FROM "SELECT 1 FROM t1 GROUP BY 0 OR 18446744073709551615+1";
+--error ER_DATA_OUT_OF_RANGE
+SELECT 1 FROM t1 GROUP BY 0 OR 18446744073709551615+1;
+
+drop table t1;
+
+--echo # End of 5.3 tests
diff --git a/mysql-test/t/rpl_mysqldump_slave.test b/mysql-test/t/rpl_mysqldump_slave.test
index 3f39fe19c0a..3fbcfe49324 100644
--- a/mysql-test/t/rpl_mysqldump_slave.test
+++ b/mysql-test/t/rpl_mysqldump_slave.test
@@ -27,4 +27,13 @@ connection slave;
# Execute mysqldump with --dump-slave ,--apply-slave-statements and --include-master-host-port
--exec $MYSQL_DUMP_SLAVE --compact --dump-slave --apply-slave-statements --include-master-host-port test
+#
+# MDEV-5624 mysqldump --dump-slave option does not restart the replication if the dump has failed
+#
+slave start;
+--replace_regex /MASTER_LOG_POS=[0-9]+/MASTER_LOG_POS=BINLOG_START/
+--error 2
+--exec $MYSQL_DUMP_SLAVE --compact --dump-slave no_such_db
+slave start;
+
--source include/rpl_end.inc
diff --git a/mysql-test/t/subselect4.test b/mysql-test/t/subselect4.test
index c9174c949a1..1c058c5e6e1 100644
--- a/mysql-test/t/subselect4.test
+++ b/mysql-test/t/subselect4.test
@@ -1853,6 +1853,41 @@ SELECT * FROM t1 AS t
WHERE a='r' AND (c,b) NOT IN (SELECT c,b FROM t2 WHERE (c,b)=(t.c,t.b));
DROP TABLE t1, t2;
+
+--echo #
+--echo # MDEV-5468: assertion failure with a simplified condition in subselect
+--echo #
+
+CREATE TABLE t1 (a int, b int) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1,1);
+
+CREATE TABLE t2 ( pk int PRIMARY KEY, c INT) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (1,4), (2,6);
+
+SELECT ( SELECT MAX(b) FROM t1, t2 WHERE pk = a AND b < from_sq.c ) AS select_sq,
+ COUNT( DISTINCT from_sq.c )
+FROM ( SELECT DISTINCT t2_1.* FROM t2 AS t2_1, t2 AS t2_2 ) AS from_sq
+GROUP BY select_sq ;
+
+DROP TABLE t1,t2;
+
+
+CREATE TABLE t1 (id int, a2 char(2), a3 char(3)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1,'BE','BEL');
+
+CREATE TABLE t2 (id int, a2 char(2), a3 char(3)) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (1,'BE','BEL'), (2,'MX','MEX');
+CREATE VIEW v2 AS SELECT DISTINCT * FROM t2;
+
+SELECT * FROM t1 AS outer_t1, v2
+WHERE v2.a3 = outer_t1.a3
+ AND EXISTS ( SELECT * FROM t1 WHERE a2 < v2.a2 AND id = outer_t1.id )
+ AND outer_t1.a3 < 'J'
+ORDER BY v2.id;
+
+DROP VIEW v2;
+DROP TABLE t1,t2;
+
--echo #
--echo # MDEV-3899 Valgrind warnings (blocks are definitely lost) in filesort on IN subquery with SUM and DISTINCT
--echo #
diff --git a/mysql-test/t/subselect_sj.test b/mysql-test/t/subselect_sj.test
index a6ce3f25617..1b0076fd1e6 100644
--- a/mysql-test/t/subselect_sj.test
+++ b/mysql-test/t/subselect_sj.test
@@ -2489,6 +2489,24 @@ INSERT INTO t1 VALUES ('mysql'),('information_schema');
SELECT * FROM t1 WHERE db IN (SELECT `SCHEMA_NAME` FROM information_schema.SCHEMATA);
DROP TABLE t1;
+--echo #
+--echo # MDEV-5581: Server crashes in in JOIN::prepare on 2nd execution of PS with materialization+semijoin
+--echo #
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (2),(3);
+
+CREATE TABLE t2 (b INT);
+INSERT INTO t2 VALUES (8),(9);
+
+CREATE TABLE t3 (c INT, INDEX(c));
+INSERT INTO t2 VALUES (5),(6);
+
+PREPARE stmt FROM
+"SELECT * FROM t1 WHERE ( 9, 5 ) IN ( SELECT b, COUNT(*) FROM t2 WHERE 1 IN ( SELECT MIN(c) FROM t3 ) )";
+EXECUTE stmt;
+EXECUTE stmt;
+
+DROP TABLE t1,t2,t3;
--echo #
--echo # MySQL Bug#13340270: assertion table->sort.record_pointers == __null
diff --git a/mysql-test/t/subselect_sj2.test b/mysql-test/t/subselect_sj2.test
index 18221c90bc0..9d9e7848415 100644
--- a/mysql-test/t/subselect_sj2.test
+++ b/mysql-test/t/subselect_sj2.test
@@ -1245,6 +1245,24 @@ SELECT * FROM t1 WHERE ( 1, 1 ) IN (
DROP TABLE t1,t2,t3;
+--echo #
+--echo # MDEV-5582: Plugin 'MEMORY' has ref_count=1 after shutdown with materialization+semijoin
+--echo #
+CREATE TABLE t1 (a INT) engine=innodb;
+INSERT INTO t1 VALUES (8),(9);
+
+CREATE TABLE t2 (b INT) engine=innodb;
+INSERT INTO t2 VALUES (2),(3);
+
+CREATE TABLE t3 (c INT, INDEX(c)) engine=innodb;
+INSERT INTO t2 VALUES (4),(5);
+
+explain
+SELECT * FROM t1 WHERE 9 IN ( SELECT b FROM t2 WHERE 1 IN ( SELECT MIN(c) FROM t3 ) );
+SELECT * FROM t1 WHERE 9 IN ( SELECT b FROM t2 WHERE 1 IN ( SELECT MIN(c) FROM t3 ) );
+
+DROP TABLE t1,t2,t3;
+
--source include/have_innodb.inc
--disable_warnings
diff --git a/mysql-test/t/udf_debug_sync.test b/mysql-test/t/udf_debug_sync.test
new file mode 100644
index 00000000000..593500c1e18
--- /dev/null
+++ b/mysql-test/t/udf_debug_sync.test
@@ -0,0 +1,40 @@
+--source include/have_debug_sync.inc
+--source include/have_udf.inc
+
+#
+# MDEV-5616 - Deadlock between CREATE/DROP FUNCTION and SELECT from view
+#
+--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
+eval CREATE FUNCTION myfunc_int RETURNS INTEGER SONAME "$UDF_EXAMPLE_SO";
+CREATE VIEW v1 AS SELECT myfunc_int(1);
+connect(con1, localhost, root,,);
+
+connection con1;
+SET debug_sync='mysql_create_function_after_lock SIGNAL locked WAIT_FOR go';
+--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
+send_eval CREATE FUNCTION myfunc_double RETURNS REAL SONAME "$UDF_EXAMPLE_SO";
+
+connection default;
+SET debug_sync='now WAIT_FOR locked';
+SET debug_sync='find_udf_before_lock SIGNAL go';
+SELECT * FROM v1;
+FLUSH TABLES;
+
+connection con1;
+reap;
+SET debug_sync='mysql_drop_function_after_lock SIGNAL locked WAIT_FOR go';
+send DROP FUNCTION myfunc_double;
+
+connection default;
+SET debug_sync='now WAIT_FOR locked';
+SET debug_sync='find_udf_before_lock SIGNAL go';
+SELECT * FROM v1;
+
+connection con1;
+reap;
+disconnect con1;
+
+connection default;
+SET debug_sync='RESET';
+DROP VIEW v1;
+DROP FUNCTION myfunc_int;
diff --git a/mysql-test/t/union_crash-714.test b/mysql-test/t/union_crash-714.test
new file mode 100644
index 00000000000..6c31a2202cb
--- /dev/null
+++ b/mysql-test/t/union_crash-714.test
@@ -0,0 +1,9 @@
+#
+# MDEV-714 LP:1020645 - crash (sig 11) with union query
+#
+--source include/have_debug.inc
+create table t1 (i tinyint);
+set debug_dbug='+d,bug11747970_raise_error';
+--error ER_QUERY_INTERRUPTED
+insert into t1 (i) select i from t1 union select i from t1;
+drop table t1;
diff --git a/mysql-test/t/xml.test b/mysql-test/t/xml.test
index b36bd2067cc..7013a306270 100644
--- a/mysql-test/t/xml.test
+++ b/mysql-test/t/xml.test
@@ -673,6 +673,12 @@ SELECT UPDATEXML('<a><c><a>x</a></c></a>','(a)/a','<b />');
SELECT UPDATEXML('<a><c><a>x</a></c></a>','(a)//a','<b />');
SELECT ExtractValue('<a><a>aa</a><b>bb</b></a>','(a)/a|(a)/b');
+#
+# MDEV-5689 ExtractValue(xml, 'substring(/x,/y)') crashes
+# MySQL bug#12428404 MYSQLD.EXE CRASHES WHEN EXTRACTVALUE() IS CALLED WITH MALFORMED XPATH EXP
+#
+SELECT ExtractValue('<a><b>abc</b><c>2</c><d>1</d></a>','substring(/a/b,..)');
+
--echo #
--echo # End of 5.5 tests
--echo #