diff options
Diffstat (limited to 'mysql-test/r')
31 files changed, 833 insertions, 2 deletions
diff --git a/mysql-test/r/comments.result b/mysql-test/r/comments.result index e65c886014d..ce817b5012f 100644 --- a/mysql-test/r/comments.result +++ b/mysql-test/r/comments.result @@ -40,6 +40,49 @@ select 2 /*M!999999 +1 */; 2 select 2 /*M!0000 +1 */; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '0000 +1 */' at line 1 +# +# Testing that MySQL versions >= 5.7.x and < 10.0.0 are ignored (MDEV-5009) +# +SELECT 1 /*!50699 +1*/; +1 +1 +2 +SELECT 1 /*!50700 +1*/; +1 +1 +SELECT 1 /*!50999 +1*/; +1 +1 +SELECT 1 /*!99999 +1*/; +1 +1 +SELECT 1 /*!100000 +1*/; +1 +1 +2 +SELECT 1 /*!110000 +1*/; +1 +1 +# +# Tesing that versions >= 5.7.x and < 10.0.0 are not ignored +# when used with the MariaDB executable comment syntax. +# +SELECT 1 /*M!50699 +1*/; +1 +1 +2 +SELECT 1 /*M!50700 +1*/; +1 +1 +2 +SELECT 1 /*M!50999 +1*/; +1 +1 +2 +SELECT 1 /*M!99999 +1*/; +1 +1 +2 +SELECT 1 /*M!100000 +1*/; +1 +1 +2 +SELECT 1 /*M!110000 +1*/; +1 +1 select 1/*!2*/; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '2*/' at line 1 select 1/*!0000002*/; diff --git a/mysql-test/r/ctype_big5.result b/mysql-test/r/ctype_big5.result index d81534ac84e..340c333c77e 100644 --- a/mysql-test/r/ctype_big5.result +++ b/mysql-test/r/ctype_big5.result @@ -103,6 +103,23 @@ big5_chinese_ci 6109 big5_chinese_ci 61 big5_chinese_ci 6120 drop table t1; +# +# MDEV-5453 Assertion `src' fails in my_strnxfrm_unicode on GROUP BY MID(..) WITH ROLLUP +# +SELECT @@collation_connection; +@@collation_connection +big5_chinese_ci +CREATE TABLE t1 (i INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2); +SELECT * FROM t1 GROUP BY MID(CURRENT_USER,0) WITH ROLLUP; +i +1 +1 +SELECT * FROM t1 GROUP BY MID('test',0) WITH ROLLUP; +i +1 +1 +DROP TABLE t1; create table t1 engine=innodb select repeat('a',50) as c1; alter table t1 add index(c1(5)); insert into t1 values ('abcdefg'),('abcde100'),('abcde110'),('abcde111'); @@ -170,6 +187,23 @@ big5_bin 6109 big5_bin 61 big5_bin 6120 drop table t1; +# +# MDEV-5453 Assertion `src' fails in my_strnxfrm_unicode on GROUP BY MID(..) WITH ROLLUP +# +SELECT @@collation_connection; +@@collation_connection +big5_bin +CREATE TABLE t1 (i INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2); +SELECT * FROM t1 GROUP BY MID(CURRENT_USER,0) WITH ROLLUP; +i +1 +1 +SELECT * FROM t1 GROUP BY MID('test',0) WITH ROLLUP; +i +1 +1 +DROP TABLE t1; create table t1 engine=innodb select repeat('a',50) as c1; alter table t1 add index(c1(5)); insert into t1 values ('abcdefg'),('abcde100'),('abcde110'),('abcde111'); diff --git a/mysql-test/r/ctype_eucjpms.result b/mysql-test/r/ctype_eucjpms.result index 5a402d57e65..9171d4dd30b 100644 --- a/mysql-test/r/ctype_eucjpms.result +++ b/mysql-test/r/ctype_eucjpms.result @@ -9809,6 +9809,23 @@ eucjpms_japanese_ci 6109 eucjpms_japanese_ci 61 eucjpms_japanese_ci 6120 drop table t1; +# +# MDEV-5453 Assertion `src' fails in my_strnxfrm_unicode on GROUP BY MID(..) WITH ROLLUP +# +SELECT @@collation_connection; +@@collation_connection +eucjpms_japanese_ci +CREATE TABLE t1 (i INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2); +SELECT * FROM t1 GROUP BY MID(CURRENT_USER,0) WITH ROLLUP; +i +1 +1 +SELECT * FROM t1 GROUP BY MID('test',0) WITH ROLLUP; +i +1 +1 +DROP TABLE t1; CREATE TABLE t1 AS SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d; ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b); @@ -9836,6 +9853,23 @@ eucjpms_bin 6109 eucjpms_bin 61 eucjpms_bin 6120 drop table t1; +# +# MDEV-5453 Assertion `src' fails in my_strnxfrm_unicode on GROUP BY MID(..) WITH ROLLUP +# +SELECT @@collation_connection; +@@collation_connection +eucjpms_bin +CREATE TABLE t1 (i INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2); +SELECT * FROM t1 GROUP BY MID(CURRENT_USER,0) WITH ROLLUP; +i +1 +1 +SELECT * FROM t1 GROUP BY MID('test',0) WITH ROLLUP; +i +1 +1 +DROP TABLE t1; CREATE TABLE t1 AS SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d; ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b); diff --git a/mysql-test/r/ctype_euckr.result b/mysql-test/r/ctype_euckr.result index c20504e9ed7..2006ac57769 100644 --- a/mysql-test/r/ctype_euckr.result +++ b/mysql-test/r/ctype_euckr.result @@ -103,6 +103,23 @@ euckr_korean_ci 6109 euckr_korean_ci 61 euckr_korean_ci 6120 drop table t1; +# +# MDEV-5453 Assertion `src' fails in my_strnxfrm_unicode on GROUP BY MID(..) WITH ROLLUP +# +SELECT @@collation_connection; +@@collation_connection +euckr_korean_ci +CREATE TABLE t1 (i INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2); +SELECT * FROM t1 GROUP BY MID(CURRENT_USER,0) WITH ROLLUP; +i +1 +1 +SELECT * FROM t1 GROUP BY MID('test',0) WITH ROLLUP; +i +1 +1 +DROP TABLE t1; create table t1 engine=innodb select repeat('a',50) as c1; alter table t1 add index(c1(5)); insert into t1 values ('abcdefg'),('abcde100'),('abcde110'),('abcde111'); @@ -170,6 +187,23 @@ euckr_bin 6109 euckr_bin 61 euckr_bin 6120 drop table t1; +# +# MDEV-5453 Assertion `src' fails in my_strnxfrm_unicode on GROUP BY MID(..) WITH ROLLUP +# +SELECT @@collation_connection; +@@collation_connection +euckr_bin +CREATE TABLE t1 (i INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2); +SELECT * FROM t1 GROUP BY MID(CURRENT_USER,0) WITH ROLLUP; +i +1 +1 +SELECT * FROM t1 GROUP BY MID('test',0) WITH ROLLUP; +i +1 +1 +DROP TABLE t1; create table t1 engine=innodb select repeat('a',50) as c1; alter table t1 add index(c1(5)); insert into t1 values ('abcdefg'),('abcde100'),('abcde110'),('abcde111'); diff --git a/mysql-test/r/ctype_gb2312.result b/mysql-test/r/ctype_gb2312.result index 9e9888aecd8..2d3ee3e0900 100644 --- a/mysql-test/r/ctype_gb2312.result +++ b/mysql-test/r/ctype_gb2312.result @@ -103,6 +103,23 @@ gb2312_chinese_ci 6109 gb2312_chinese_ci 61 gb2312_chinese_ci 6120 drop table t1; +# +# MDEV-5453 Assertion `src' fails in my_strnxfrm_unicode on GROUP BY MID(..) WITH ROLLUP +# +SELECT @@collation_connection; +@@collation_connection +gb2312_chinese_ci +CREATE TABLE t1 (i INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2); +SELECT * FROM t1 GROUP BY MID(CURRENT_USER,0) WITH ROLLUP; +i +1 +1 +SELECT * FROM t1 GROUP BY MID('test',0) WITH ROLLUP; +i +1 +1 +DROP TABLE t1; create table t1 engine=innodb select repeat('a',50) as c1; alter table t1 add index(c1(5)); insert into t1 values ('abcdefg'),('abcde100'),('abcde110'),('abcde111'); @@ -170,6 +187,23 @@ gb2312_bin 6109 gb2312_bin 61 gb2312_bin 6120 drop table t1; +# +# MDEV-5453 Assertion `src' fails in my_strnxfrm_unicode on GROUP BY MID(..) WITH ROLLUP +# +SELECT @@collation_connection; +@@collation_connection +gb2312_bin +CREATE TABLE t1 (i INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2); +SELECT * FROM t1 GROUP BY MID(CURRENT_USER,0) WITH ROLLUP; +i +1 +1 +SELECT * FROM t1 GROUP BY MID('test',0) WITH ROLLUP; +i +1 +1 +DROP TABLE t1; create table t1 engine=innodb select repeat('a',50) as c1; alter table t1 add index(c1(5)); insert into t1 values ('abcdefg'),('abcde100'),('abcde110'),('abcde111'); diff --git a/mysql-test/r/ctype_gbk.result b/mysql-test/r/ctype_gbk.result index 0abbbec1d7b..93e060868fb 100644 --- a/mysql-test/r/ctype_gbk.result +++ b/mysql-test/r/ctype_gbk.result @@ -103,6 +103,23 @@ gbk_chinese_ci 6109 gbk_chinese_ci 61 gbk_chinese_ci 6120 drop table t1; +# +# MDEV-5453 Assertion `src' fails in my_strnxfrm_unicode on GROUP BY MID(..) WITH ROLLUP +# +SELECT @@collation_connection; +@@collation_connection +gbk_chinese_ci +CREATE TABLE t1 (i INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2); +SELECT * FROM t1 GROUP BY MID(CURRENT_USER,0) WITH ROLLUP; +i +1 +1 +SELECT * FROM t1 GROUP BY MID('test',0) WITH ROLLUP; +i +1 +1 +DROP TABLE t1; create table t1 engine=innodb select repeat('a',50) as c1; alter table t1 add index(c1(5)); insert into t1 values ('abcdefg'),('abcde100'),('abcde110'),('abcde111'); @@ -170,6 +187,23 @@ gbk_bin 6109 gbk_bin 61 gbk_bin 6120 drop table t1; +# +# MDEV-5453 Assertion `src' fails in my_strnxfrm_unicode on GROUP BY MID(..) WITH ROLLUP +# +SELECT @@collation_connection; +@@collation_connection +gbk_bin +CREATE TABLE t1 (i INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2); +SELECT * FROM t1 GROUP BY MID(CURRENT_USER,0) WITH ROLLUP; +i +1 +1 +SELECT * FROM t1 GROUP BY MID('test',0) WITH ROLLUP; +i +1 +1 +DROP TABLE t1; create table t1 engine=innodb select repeat('a',50) as c1; alter table t1 add index(c1(5)); insert into t1 values ('abcdefg'),('abcde100'),('abcde110'),('abcde111'); diff --git a/mysql-test/r/ctype_latin1.result b/mysql-test/r/ctype_latin1.result index 2debf288f44..52b30808f34 100644 --- a/mysql-test/r/ctype_latin1.result +++ b/mysql-test/r/ctype_latin1.result @@ -318,6 +318,23 @@ latin1_swedish_ci 6109 latin1_swedish_ci 61 latin1_swedish_ci 6120 drop table t1; +# +# MDEV-5453 Assertion `src' fails in my_strnxfrm_unicode on GROUP BY MID(..) WITH ROLLUP +# +SELECT @@collation_connection; +@@collation_connection +latin1_swedish_ci +CREATE TABLE t1 (i INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2); +SELECT * FROM t1 GROUP BY MID(CURRENT_USER,0) WITH ROLLUP; +i +1 +1 +SELECT * FROM t1 GROUP BY MID('test',0) WITH ROLLUP; +i +1 +1 +DROP TABLE t1; select @@collation_connection; @@collation_connection latin1_swedish_ci @@ -365,6 +382,23 @@ latin1_bin 6109 latin1_bin 61 latin1_bin 6120 drop table t1; +# +# MDEV-5453 Assertion `src' fails in my_strnxfrm_unicode on GROUP BY MID(..) WITH ROLLUP +# +SELECT @@collation_connection; +@@collation_connection +latin1_bin +CREATE TABLE t1 (i INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2); +SELECT * FROM t1 GROUP BY MID(CURRENT_USER,0) WITH ROLLUP; +i +1 +1 +SELECT * FROM t1 GROUP BY MID('test',0) WITH ROLLUP; +i +1 +1 +DROP TABLE t1; select @@collation_connection; @@collation_connection latin1_bin diff --git a/mysql-test/r/ctype_latin1_de.result b/mysql-test/r/ctype_latin1_de.result index f826199bb1f..c07b89ce873 100644 --- a/mysql-test/r/ctype_latin1_de.result +++ b/mysql-test/r/ctype_latin1_de.result @@ -326,6 +326,23 @@ latin1_german2_ci 6109 latin1_german2_ci 61 latin1_german2_ci 6120 drop table t1; +# +# MDEV-5453 Assertion `src' fails in my_strnxfrm_unicode on GROUP BY MID(..) WITH ROLLUP +# +SELECT @@collation_connection; +@@collation_connection +latin1_german2_ci +CREATE TABLE t1 (i INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2); +SELECT * FROM t1 GROUP BY MID(CURRENT_USER,0) WITH ROLLUP; +i +1 +1 +SELECT * FROM t1 GROUP BY MID('test',0) WITH ROLLUP; +i +1 +1 +DROP TABLE t1; drop table if exists t1; create table t1 as select repeat(' ', 64) as s1; select collation(s1) from t1; diff --git a/mysql-test/r/ctype_sjis.result b/mysql-test/r/ctype_sjis.result index b776f1cf7d6..de402697e63 100644 --- a/mysql-test/r/ctype_sjis.result +++ b/mysql-test/r/ctype_sjis.result @@ -81,6 +81,23 @@ sjis_japanese_ci 6109 sjis_japanese_ci 61 sjis_japanese_ci 6120 drop table t1; +# +# MDEV-5453 Assertion `src' fails in my_strnxfrm_unicode on GROUP BY MID(..) WITH ROLLUP +# +SELECT @@collation_connection; +@@collation_connection +sjis_japanese_ci +CREATE TABLE t1 (i INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2); +SELECT * FROM t1 GROUP BY MID(CURRENT_USER,0) WITH ROLLUP; +i +1 +1 +SELECT * FROM t1 GROUP BY MID('test',0) WITH ROLLUP; +i +1 +1 +DROP TABLE t1; create table t1 engine=innodb select repeat('a',50) as c1; alter table t1 add index(c1(5)); insert into t1 values ('abcdefg'),('abcde100'),('abcde110'),('abcde111'); @@ -167,6 +184,23 @@ sjis_bin 6109 sjis_bin 61 sjis_bin 6120 drop table t1; +# +# MDEV-5453 Assertion `src' fails in my_strnxfrm_unicode on GROUP BY MID(..) WITH ROLLUP +# +SELECT @@collation_connection; +@@collation_connection +sjis_bin +CREATE TABLE t1 (i INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2); +SELECT * FROM t1 GROUP BY MID(CURRENT_USER,0) WITH ROLLUP; +i +1 +1 +SELECT * FROM t1 GROUP BY MID('test',0) WITH ROLLUP; +i +1 +1 +DROP TABLE t1; create table t1 engine=innodb select repeat('a',50) as c1; alter table t1 add index(c1(5)); insert into t1 values ('abcdefg'),('abcde100'),('abcde110'),('abcde111'); diff --git a/mysql-test/r/ctype_tis620.result b/mysql-test/r/ctype_tis620.result index 5699c044d70..19e3322eae9 100644 --- a/mysql-test/r/ctype_tis620.result +++ b/mysql-test/r/ctype_tis620.result @@ -2947,6 +2947,23 @@ tis620_thai_ci 6109 tis620_thai_ci 61 tis620_thai_ci 6120 drop table t1; +# +# MDEV-5453 Assertion `src' fails in my_strnxfrm_unicode on GROUP BY MID(..) WITH ROLLUP +# +SELECT @@collation_connection; +@@collation_connection +tis620_thai_ci +CREATE TABLE t1 (i INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2); +SELECT * FROM t1 GROUP BY MID(CURRENT_USER,0) WITH ROLLUP; +i +1 +1 +SELECT * FROM t1 GROUP BY MID('test',0) WITH ROLLUP; +i +1 +1 +DROP TABLE t1; select @@collation_connection; @@collation_connection tis620_thai_ci @@ -2975,6 +2992,23 @@ tis620_bin 6109 tis620_bin 61 tis620_bin 6120 drop table t1; +# +# MDEV-5453 Assertion `src' fails in my_strnxfrm_unicode on GROUP BY MID(..) WITH ROLLUP +# +SELECT @@collation_connection; +@@collation_connection +tis620_bin +CREATE TABLE t1 (i INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2); +SELECT * FROM t1 GROUP BY MID(CURRENT_USER,0) WITH ROLLUP; +i +1 +1 +SELECT * FROM t1 GROUP BY MID('test',0) WITH ROLLUP; +i +1 +1 +DROP TABLE t1; select @@collation_connection; @@collation_connection tis620_bin diff --git a/mysql-test/r/ctype_uca.result b/mysql-test/r/ctype_uca.result index 208318db8c5..9bd6618202b 100644 --- a/mysql-test/r/ctype_uca.result +++ b/mysql-test/r/ctype_uca.result @@ -2767,6 +2767,23 @@ utf8_unicode_ci 6109 utf8_unicode_ci 61 utf8_unicode_ci 6120 drop table t1; +# +# MDEV-5453 Assertion `src' fails in my_strnxfrm_unicode on GROUP BY MID(..) WITH ROLLUP +# +SELECT @@collation_connection; +@@collation_connection +utf8_unicode_ci +CREATE TABLE t1 (i INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2); +SELECT * FROM t1 GROUP BY MID(CURRENT_USER,0) WITH ROLLUP; +i +1 +1 +SELECT * FROM t1 GROUP BY MID('test',0) WITH ROLLUP; +i +1 +1 +DROP TABLE t1; select @@collation_connection; @@collation_connection utf8_unicode_ci diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result index 20aabdb528b..52ce5efa3e4 100644 --- a/mysql-test/r/ctype_ucs.result +++ b/mysql-test/r/ctype_ucs.result @@ -734,6 +734,23 @@ ucs2_general_ci 00610009 ucs2_general_ci 0061 ucs2_general_ci 00610020 drop table t1; +# +# MDEV-5453 Assertion `src' fails in my_strnxfrm_unicode on GROUP BY MID(..) WITH ROLLUP +# +SELECT @@collation_connection; +@@collation_connection +ucs2_general_ci +CREATE TABLE t1 (i INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2); +SELECT * FROM t1 GROUP BY MID(CURRENT_USER,0) WITH ROLLUP; +i +1 +1 +SELECT * FROM t1 GROUP BY MID('test',0) WITH ROLLUP; +i +1 +1 +DROP TABLE t1; select @@collation_connection; @@collation_connection ucs2_general_ci @@ -834,6 +851,23 @@ ucs2_bin 00610009 ucs2_bin 0061 ucs2_bin 00610020 drop table t1; +# +# MDEV-5453 Assertion `src' fails in my_strnxfrm_unicode on GROUP BY MID(..) WITH ROLLUP +# +SELECT @@collation_connection; +@@collation_connection +ucs2_bin +CREATE TABLE t1 (i INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2); +SELECT * FROM t1 GROUP BY MID(CURRENT_USER,0) WITH ROLLUP; +i +1 +1 +SELECT * FROM t1 GROUP BY MID('test',0) WITH ROLLUP; +i +1 +1 +DROP TABLE t1; select @@collation_connection; @@collation_connection ucs2_bin diff --git a/mysql-test/r/ctype_ujis.result b/mysql-test/r/ctype_ujis.result index b801a7f45a4..e4641ceeb54 100644 --- a/mysql-test/r/ctype_ujis.result +++ b/mysql-test/r/ctype_ujis.result @@ -2217,6 +2217,23 @@ ujis_japanese_ci 6109 ujis_japanese_ci 61 ujis_japanese_ci 6120 drop table t1; +# +# MDEV-5453 Assertion `src' fails in my_strnxfrm_unicode on GROUP BY MID(..) WITH ROLLUP +# +SELECT @@collation_connection; +@@collation_connection +ujis_japanese_ci +CREATE TABLE t1 (i INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2); +SELECT * FROM t1 GROUP BY MID(CURRENT_USER,0) WITH ROLLUP; +i +1 +1 +SELECT * FROM t1 GROUP BY MID('test',0) WITH ROLLUP; +i +1 +1 +DROP TABLE t1; create table t1 engine=innodb select repeat('a',50) as c1; alter table t1 add index(c1(5)); insert into t1 values ('abcdefg'),('abcde100'),('abcde110'),('abcde111'); @@ -2284,6 +2301,23 @@ ujis_bin 6109 ujis_bin 61 ujis_bin 6120 drop table t1; +# +# MDEV-5453 Assertion `src' fails in my_strnxfrm_unicode on GROUP BY MID(..) WITH ROLLUP +# +SELECT @@collation_connection; +@@collation_connection +ujis_bin +CREATE TABLE t1 (i INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2); +SELECT * FROM t1 GROUP BY MID(CURRENT_USER,0) WITH ROLLUP; +i +1 +1 +SELECT * FROM t1 GROUP BY MID('test',0) WITH ROLLUP; +i +1 +1 +DROP TABLE t1; create table t1 engine=innodb select repeat('a',50) as c1; alter table t1 add index(c1(5)); insert into t1 values ('abcdefg'),('abcde100'),('abcde110'),('abcde111'); diff --git a/mysql-test/r/ctype_utf16.result b/mysql-test/r/ctype_utf16.result index 2eb0f8e9ba6..a1bd49d1926 100644 --- a/mysql-test/r/ctype_utf16.result +++ b/mysql-test/r/ctype_utf16.result @@ -583,6 +583,23 @@ utf16_general_ci 00610009 utf16_general_ci 0061 utf16_general_ci 00610020 drop table t1; +# +# MDEV-5453 Assertion `src' fails in my_strnxfrm_unicode on GROUP BY MID(..) WITH ROLLUP +# +SELECT @@collation_connection; +@@collation_connection +utf16_general_ci +CREATE TABLE t1 (i INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2); +SELECT * FROM t1 GROUP BY MID(CURRENT_USER,0) WITH ROLLUP; +i +1 +1 +SELECT * FROM t1 GROUP BY MID('test',0) WITH ROLLUP; +i +1 +1 +DROP TABLE t1; select @@collation_connection; @@collation_connection utf16_general_ci @@ -613,6 +630,23 @@ utf16_bin 0061 utf16_bin 00610020 drop table t1; # +# MDEV-5453 Assertion `src' fails in my_strnxfrm_unicode on GROUP BY MID(..) WITH ROLLUP +# +SELECT @@collation_connection; +@@collation_connection +utf16_bin +CREATE TABLE t1 (i INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2); +SELECT * FROM t1 GROUP BY MID(CURRENT_USER,0) WITH ROLLUP; +i +1 +1 +SELECT * FROM t1 GROUP BY MID('test',0) WITH ROLLUP; +i +1 +1 +DROP TABLE t1; +# # Bug#55980 Character sets: supplementary character _bin ordering is wrong # CREATE TABLE t1 AS SELECT REPEAT('a',1) AS a LIMIT 0; diff --git a/mysql-test/r/ctype_utf16_uca.result b/mysql-test/r/ctype_utf16_uca.result index fe715ba1438..77d1048129a 100644 --- a/mysql-test/r/ctype_utf16_uca.result +++ b/mysql-test/r/ctype_utf16_uca.result @@ -2272,6 +2272,23 @@ utf16_unicode_ci 00610009 utf16_unicode_ci 0061 utf16_unicode_ci 00610020 drop table t1; +# +# MDEV-5453 Assertion `src' fails in my_strnxfrm_unicode on GROUP BY MID(..) WITH ROLLUP +# +SELECT @@collation_connection; +@@collation_connection +utf16_unicode_ci +CREATE TABLE t1 (i INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2); +SELECT * FROM t1 GROUP BY MID(CURRENT_USER,0) WITH ROLLUP; +i +1 +1 +SELECT * FROM t1 GROUP BY MID('test',0) WITH ROLLUP; +i +1 +1 +DROP TABLE t1; select @@collation_connection; @@collation_connection utf16_unicode_ci diff --git a/mysql-test/r/ctype_utf32.result b/mysql-test/r/ctype_utf32.result index 6cf24d768f7..a46bcb33cc6 100644 --- a/mysql-test/r/ctype_utf32.result +++ b/mysql-test/r/ctype_utf32.result @@ -582,6 +582,23 @@ utf32_general_ci 0000006100000009 utf32_general_ci 00000061 utf32_general_ci 0000006100000020 drop table t1; +# +# MDEV-5453 Assertion `src' fails in my_strnxfrm_unicode on GROUP BY MID(..) WITH ROLLUP +# +SELECT @@collation_connection; +@@collation_connection +utf32_general_ci +CREATE TABLE t1 (i INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2); +SELECT * FROM t1 GROUP BY MID(CURRENT_USER,0) WITH ROLLUP; +i +1 +1 +SELECT * FROM t1 GROUP BY MID('test',0) WITH ROLLUP; +i +1 +1 +DROP TABLE t1; select @@collation_connection; @@collation_connection utf32_general_ci @@ -612,6 +629,23 @@ utf32_bin 00000061 utf32_bin 0000006100000020 drop table t1; # +# MDEV-5453 Assertion `src' fails in my_strnxfrm_unicode on GROUP BY MID(..) WITH ROLLUP +# +SELECT @@collation_connection; +@@collation_connection +utf32_bin +CREATE TABLE t1 (i INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2); +SELECT * FROM t1 GROUP BY MID(CURRENT_USER,0) WITH ROLLUP; +i +1 +1 +SELECT * FROM t1 GROUP BY MID('test',0) WITH ROLLUP; +i +1 +1 +DROP TABLE t1; +# # Bug#55980 Character sets: supplementary character _bin ordering is wrong # CREATE TABLE t1 AS SELECT REPEAT('a',1) AS a LIMIT 0; diff --git a/mysql-test/r/ctype_utf32_uca.result b/mysql-test/r/ctype_utf32_uca.result index 695e250f4a8..f585d99941a 100644 --- a/mysql-test/r/ctype_utf32_uca.result +++ b/mysql-test/r/ctype_utf32_uca.result @@ -2272,6 +2272,23 @@ utf32_unicode_ci 0000006100000009 utf32_unicode_ci 00000061 utf32_unicode_ci 0000006100000020 drop table t1; +# +# MDEV-5453 Assertion `src' fails in my_strnxfrm_unicode on GROUP BY MID(..) WITH ROLLUP +# +SELECT @@collation_connection; +@@collation_connection +utf32_unicode_ci +CREATE TABLE t1 (i INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2); +SELECT * FROM t1 GROUP BY MID(CURRENT_USER,0) WITH ROLLUP; +i +1 +1 +SELECT * FROM t1 GROUP BY MID('test',0) WITH ROLLUP; +i +1 +1 +DROP TABLE t1; select @@collation_connection; @@collation_connection utf32_unicode_ci diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index a2324ff9dee..d1f94ac77fc 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -924,6 +924,23 @@ utf8_general_ci 6109 utf8_general_ci 61 utf8_general_ci 6120 drop table t1; +# +# MDEV-5453 Assertion `src' fails in my_strnxfrm_unicode on GROUP BY MID(..) WITH ROLLUP +# +SELECT @@collation_connection; +@@collation_connection +utf8_general_ci +CREATE TABLE t1 (i INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2); +SELECT * FROM t1 GROUP BY MID(CURRENT_USER,0) WITH ROLLUP; +i +1 +1 +SELECT * FROM t1 GROUP BY MID('test',0) WITH ROLLUP; +i +1 +1 +DROP TABLE t1; select @@collation_connection; @@collation_connection utf8_general_ci @@ -1006,6 +1023,23 @@ utf8_bin 6109 utf8_bin 61 utf8_bin 6120 drop table t1; +# +# MDEV-5453 Assertion `src' fails in my_strnxfrm_unicode on GROUP BY MID(..) WITH ROLLUP +# +SELECT @@collation_connection; +@@collation_connection +utf8_bin +CREATE TABLE t1 (i INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2); +SELECT * FROM t1 GROUP BY MID(CURRENT_USER,0) WITH ROLLUP; +i +1 +1 +SELECT * FROM t1 GROUP BY MID('test',0) WITH ROLLUP; +i +1 +1 +DROP TABLE t1; select @@collation_connection; @@collation_connection utf8_bin diff --git a/mysql-test/r/ctype_utf8mb4.result b/mysql-test/r/ctype_utf8mb4.result index d5618003e4d..2935da39387 100644 --- a/mysql-test/r/ctype_utf8mb4.result +++ b/mysql-test/r/ctype_utf8mb4.result @@ -924,6 +924,23 @@ utf8mb4_general_ci 6109 utf8mb4_general_ci 61 utf8mb4_general_ci 6120 drop table t1; +# +# MDEV-5453 Assertion `src' fails in my_strnxfrm_unicode on GROUP BY MID(..) WITH ROLLUP +# +SELECT @@collation_connection; +@@collation_connection +utf8mb4_general_ci +CREATE TABLE t1 (i INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2); +SELECT * FROM t1 GROUP BY MID(CURRENT_USER,0) WITH ROLLUP; +i +1 +1 +SELECT * FROM t1 GROUP BY MID('test',0) WITH ROLLUP; +i +1 +1 +DROP TABLE t1; select @@collation_connection; @@collation_connection utf8mb4_general_ci @@ -988,6 +1005,23 @@ utf8mb4_bin 61 utf8mb4_bin 6120 drop table t1; # +# MDEV-5453 Assertion `src' fails in my_strnxfrm_unicode on GROUP BY MID(..) WITH ROLLUP +# +SELECT @@collation_connection; +@@collation_connection +utf8mb4_bin +CREATE TABLE t1 (i INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2); +SELECT * FROM t1 GROUP BY MID(CURRENT_USER,0) WITH ROLLUP; +i +1 +1 +SELECT * FROM t1 GROUP BY MID('test',0) WITH ROLLUP; +i +1 +1 +DROP TABLE t1; +# # Bug#55980 Character sets: supplementary character _bin ordering is wrong # CREATE TABLE t1 AS SELECT REPEAT('a',1) AS a LIMIT 0; diff --git a/mysql-test/r/ctype_utf8mb4_heap.result b/mysql-test/r/ctype_utf8mb4_heap.result index 1eb806edc84..0a2b92041f9 100644 --- a/mysql-test/r/ctype_utf8mb4_heap.result +++ b/mysql-test/r/ctype_utf8mb4_heap.result @@ -863,6 +863,23 @@ utf8mb4_general_ci 6109 utf8mb4_general_ci 61 utf8mb4_general_ci 6120 drop table t1; +# +# MDEV-5453 Assertion `src' fails in my_strnxfrm_unicode on GROUP BY MID(..) WITH ROLLUP +# +SELECT @@collation_connection; +@@collation_connection +utf8mb4_general_ci +CREATE TABLE t1 (i INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2); +SELECT * FROM t1 GROUP BY MID(CURRENT_USER,0) WITH ROLLUP; +i +1 +1 +SELECT * FROM t1 GROUP BY MID('test',0) WITH ROLLUP; +i +1 +1 +DROP TABLE t1; select @@collation_connection; @@collation_connection utf8mb4_general_ci @@ -926,6 +943,23 @@ utf8mb4_bin 6109 utf8mb4_bin 61 utf8mb4_bin 6120 drop table t1; +# +# MDEV-5453 Assertion `src' fails in my_strnxfrm_unicode on GROUP BY MID(..) WITH ROLLUP +# +SELECT @@collation_connection; +@@collation_connection +utf8mb4_bin +CREATE TABLE t1 (i INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2); +SELECT * FROM t1 GROUP BY MID(CURRENT_USER,0) WITH ROLLUP; +i +1 +1 +SELECT * FROM t1 GROUP BY MID('test',0) WITH ROLLUP; +i +1 +1 +DROP TABLE t1; select @@collation_connection; @@collation_connection utf8mb4_bin diff --git a/mysql-test/r/ctype_utf8mb4_innodb.result b/mysql-test/r/ctype_utf8mb4_innodb.result index 6e9b943c0cb..e9ee649f2ba 100644 --- a/mysql-test/r/ctype_utf8mb4_innodb.result +++ b/mysql-test/r/ctype_utf8mb4_innodb.result @@ -924,6 +924,23 @@ utf8mb4_general_ci 6109 utf8mb4_general_ci 61 utf8mb4_general_ci 6120 drop table t1; +# +# MDEV-5453 Assertion `src' fails in my_strnxfrm_unicode on GROUP BY MID(..) WITH ROLLUP +# +SELECT @@collation_connection; +@@collation_connection +utf8mb4_general_ci +CREATE TABLE t1 (i INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2); +SELECT * FROM t1 GROUP BY MID(CURRENT_USER,0) WITH ROLLUP; +i +1 +1 +SELECT * FROM t1 GROUP BY MID('test',0) WITH ROLLUP; +i +1 +1 +DROP TABLE t1; select @@collation_connection; @@collation_connection utf8mb4_general_ci @@ -987,6 +1004,23 @@ utf8mb4_bin 6109 utf8mb4_bin 61 utf8mb4_bin 6120 drop table t1; +# +# MDEV-5453 Assertion `src' fails in my_strnxfrm_unicode on GROUP BY MID(..) WITH ROLLUP +# +SELECT @@collation_connection; +@@collation_connection +utf8mb4_bin +CREATE TABLE t1 (i INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2); +SELECT * FROM t1 GROUP BY MID(CURRENT_USER,0) WITH ROLLUP; +i +1 +1 +SELECT * FROM t1 GROUP BY MID('test',0) WITH ROLLUP; +i +1 +1 +DROP TABLE t1; select @@collation_connection; @@collation_connection utf8mb4_bin diff --git a/mysql-test/r/ctype_utf8mb4_myisam.result b/mysql-test/r/ctype_utf8mb4_myisam.result index 4343abb797a..1d12be15aa2 100644 --- a/mysql-test/r/ctype_utf8mb4_myisam.result +++ b/mysql-test/r/ctype_utf8mb4_myisam.result @@ -924,6 +924,23 @@ utf8mb4_general_ci 6109 utf8mb4_general_ci 61 utf8mb4_general_ci 6120 drop table t1; +# +# MDEV-5453 Assertion `src' fails in my_strnxfrm_unicode on GROUP BY MID(..) WITH ROLLUP +# +SELECT @@collation_connection; +@@collation_connection +utf8mb4_general_ci +CREATE TABLE t1 (i INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2); +SELECT * FROM t1 GROUP BY MID(CURRENT_USER,0) WITH ROLLUP; +i +1 +1 +SELECT * FROM t1 GROUP BY MID('test',0) WITH ROLLUP; +i +1 +1 +DROP TABLE t1; select @@collation_connection; @@collation_connection utf8mb4_general_ci @@ -987,6 +1004,23 @@ utf8mb4_bin 6109 utf8mb4_bin 61 utf8mb4_bin 6120 drop table t1; +# +# MDEV-5453 Assertion `src' fails in my_strnxfrm_unicode on GROUP BY MID(..) WITH ROLLUP +# +SELECT @@collation_connection; +@@collation_connection +utf8mb4_bin +CREATE TABLE t1 (i INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2); +SELECT * FROM t1 GROUP BY MID(CURRENT_USER,0) WITH ROLLUP; +i +1 +1 +SELECT * FROM t1 GROUP BY MID('test',0) WITH ROLLUP; +i +1 +1 +DROP TABLE t1; select @@collation_connection; @@collation_connection utf8mb4_bin diff --git a/mysql-test/r/derived.result b/mysql-test/r/derived.result index 9d31ceab4d1..699d3279e3e 100644 --- a/mysql-test/r/derived.result +++ b/mysql-test/r/derived.result @@ -465,6 +465,20 @@ t1.val=t3.val ; ERROR 42S22: Unknown column 'v.val' in 'field list' drop table t1, t2; +# +# MDEV-5353: server crash on subselect if WHERE applied to some +# result field +# +SELECT * FROM +( SELECT 100 a, subsel.b FROM ( SELECT 200 b ) subsel ) tmp +WHERE tmp.b; +a b +100 200 +SELECT * FROM +( SELECT 100 a, subsel.b FROM ( SELECT 200 b ) subsel ) tmp +WHERE tmp.a; +a b +100 200 # End of 5.3 tests # # Bug#58730 Assertion failed: table->key_read == 0 in close_thread_table, diff --git a/mysql-test/r/func_like.result b/mysql-test/r/func_like.result index 39590eb1c99..8d72b818cf8 100644 --- a/mysql-test/r/func_like.result +++ b/mysql-test/r/func_like.result @@ -188,3 +188,15 @@ DROP TABLE t1, t2; SELECT '' LIKE '1' ESCAPE COUNT(1); ERROR HY000: Incorrect arguments to ESCAPE End of 5.1 tests +# +# Start of 10.0 tests +# +# +# MDEV-5445 Server crashes in Item_func_like::fix_fields on LIKE ExtractValue(..) +# +SELECT 'a' LIKE REPEAT('',0); +'a' LIKE REPEAT('',0) +0 +SELECT 'a' LIKE EXTRACTVALUE('bar','qux'); +'a' LIKE EXTRACTVALUE('bar','qux') +0 diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result index 45457e6a4fd..938b0ee005f 100644 --- a/mysql-test/r/func_time.result +++ b/mysql-test/r/func_time.result @@ -365,7 +365,7 @@ extract(DAY_MINUTE FROM "02 10:11:12") 21011 select extract(DAY_SECOND FROM "225 10:11:12"); extract(DAY_SECOND FROM "225 10:11:12") -8385959 +34225959 Warnings: Warning 1292 Truncated incorrect time value: '225 10:11:12' select extract(HOUR FROM "1999-01-02 10:11:12"); @@ -1025,7 +1025,7 @@ Note 1105 Cast to unsigned converted negative integer to it's positive complemen Warning 1292 Truncated incorrect time value: '18446744073709551615:00:00' SELECT EXTRACT(HOUR FROM '10000:02:03'); EXTRACT(HOUR FROM '10000:02:03') -838 +22 Warnings: Warning 1292 Truncated incorrect time value: '10000:02:03' CREATE TABLE t1(f1 TIME); @@ -2347,3 +2347,30 @@ DROP TABLE t1; SELECT MAKETIME(0, 0, -0.1); MAKETIME(0, 0, -0.1) NULL +# +# MDEV-4857 Wrong result of HOUR('1 00:00:00') +# +SELECT HOUR('1 02:00:00'), HOUR('26:00:00'); +HOUR('1 02:00:00') HOUR('26:00:00') +26 26 +SELECT HOUR(TIME'1 02:00:00'), HOUR(TIME'26:00:00'); +HOUR(TIME'1 02:00:00') HOUR(TIME'26:00:00') +26 26 +SELECT HOUR(TIME('1 02:00:00')), HOUR(TIME('26:00:00')); +HOUR(TIME('1 02:00:00')) HOUR(TIME('26:00:00')) +26 26 +SELECT DAY(TIME('1 02:00:00')), DAY(TIME('26:00:00')); +DAY(TIME('1 02:00:00')) DAY(TIME('26:00:00')) +0 0 +SELECT EXTRACT(HOUR FROM '1 02:00:00'), EXTRACT(HOUR FROM '26:00:00'); +EXTRACT(HOUR FROM '1 02:00:00') EXTRACT(HOUR FROM '26:00:00') +2 2 +SELECT EXTRACT(HOUR FROM TIME'1 02:00:00'), EXTRACT(HOUR FROM TIME'26:00:00'); +EXTRACT(HOUR FROM TIME'1 02:00:00') EXTRACT(HOUR FROM TIME'26:00:00') +2 2 +SELECT EXTRACT(HOUR FROM TIME('1 02:00:00')), EXTRACT(HOUR FROM TIME('26:00:00')); +EXTRACT(HOUR FROM TIME('1 02:00:00')) EXTRACT(HOUR FROM TIME('26:00:00')) +2 2 +SELECT EXTRACT(DAY FROM TIME('1 02:00:00')), EXTRACT(DAY FROM TIME('26:00:00')); +EXTRACT(DAY FROM TIME('1 02:00:00')) EXTRACT(DAY FROM TIME('26:00:00')) +1 1 diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result index 5c4261e7d6d..c0b23651e70 100644 --- a/mysql-test/r/merge.result +++ b/mysql-test/r/merge.result @@ -2394,6 +2394,13 @@ REPAIR TABLE m1; Table Op Msg_type Msg_text test.m1 repair note The storage engine for the table doesn't support repair DROP TABLE m1, t1; +create temporary table t1_temp(i int); +create temporary table tm_temp_temp (i int) engine=merge union=(t1_temp) insert_method=last; +alter table tm_temp_temp insert_method=first; +check table tm_temp_temp; +Table Op Msg_type Msg_text +test.tm_temp_temp check status OK +drop temporary table t1_temp, tm_temp_temp; End of 5.1 tests # # MDEV-4277: Crash inside mi_killed_in_mariadb() with myisammrg diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result index 4f41151f555..fa15bcf5576 100644 --- a/mysql-test/r/ps.result +++ b/mysql-test/r/ps.result @@ -3996,4 +3996,27 @@ Handler_read_rnd_deleted 0 Handler_read_rnd_next 0 deallocate prepare st; drop table t1; +# +# Bug mdev-5410: crash at the execution of PS with subselect +# formed by UNION with global ORDER BY +# +CREATE TABLE t1 (a int DEFAULT NULL); +INSERT INTO t1 VALUES (2), (4); +CREATE TABLE t2 (b int DEFAULT NULL); +INSERT INTO t2 VALUES (1), (3); +PREPARE stmt FROM " +SELECT c1 FROM (SELECT (SELECT a FROM t1 WHERE t1.a <= t2.b + UNION ALL + SELECT a FROM t1 WHERE t1.a+3<= t2.b + ORDER BY a DESC) AS c1 FROM t2) t3; +"; +EXECUTE stmt; +c1 +NULL +2 +EXECUTE stmt; +c1 +NULL +2 +DROP TABLE t1,t2; # End of 5.3 tests diff --git a/mysql-test/r/selectivity.result b/mysql-test/r/selectivity.result index e213bc30778..3059431c2e5 100644 --- a/mysql-test/r/selectivity.result +++ b/mysql-test/r/selectivity.result @@ -1158,3 +1158,11 @@ Note 1003 select `test`.`t1`.`i1` AS `i1` from `test`.`t1` semi join (`test`.`t2 set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; DROP TABLE t1,t2,t3; set use_stat_tables=@save_use_stat_tables; +# +# Bug mdev-5415: query over an information schema table +# when optimizer_use_condition_selectivity=3 +# +set optimizer_use_condition_selectivity = 3; +SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE SQL_MODE != ''; +TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; diff --git a/mysql-test/r/selectivity_innodb.result b/mysql-test/r/selectivity_innodb.result index 1dbd9b56079..f4485cb0f73 100644 --- a/mysql-test/r/selectivity_innodb.result +++ b/mysql-test/r/selectivity_innodb.result @@ -1166,5 +1166,13 @@ Note 1003 select `test`.`t1`.`i1` AS `i1` from `test`.`t1` semi join (`test`.`t2 set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; DROP TABLE t1,t2,t3; set use_stat_tables=@save_use_stat_tables; +# +# Bug mdev-5415: query over an information schema table +# when optimizer_use_condition_selectivity=3 +# +set optimizer_use_condition_selectivity = 3; +SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE SQL_MODE != ''; +TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION +set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; set optimizer_switch=@save_optimizer_switch_for_selectivity_test; SET SESSION STORAGE_ENGINE=DEFAULT; diff --git a/mysql-test/r/table_elim.result b/mysql-test/r/table_elim.result index 59054607acb..ff488fea427 100644 --- a/mysql-test/r/table_elim.result +++ b/mysql-test/r/table_elim.result @@ -610,6 +610,34 @@ id select_type table type possible_keys key key_len ref rows Extra drop view v1; DROP TABLE t1,t2,t3; # +# MDEV-5344: LEFT OUTER JOIN table data is lost in ON DUPLICATE KEY UPDATE section +# +create table t1 ( +id int(10) unsigned NOT NULL DEFAULT '0', +v int(10) unsigned DEFAULT '0', +PRIMARY KEY (id) +); +create table t2 ( +id int(10) unsigned NOT NULL DEFAULT '0', +PRIMARY KEY (id) +) ; +create table t3 ( +id int(10) unsigned NOT NULL DEFAULT '0', +v int(10) unsigned DEFAULT '0', +PRIMARY KEY (id) +); +insert into t1 values (1, 10), (2, 10); +insert into t2 values (1), (2); +insert into t3 values (1, 20); +insert into t1 +select t2.id, 5 from t2 LEFT OUTER JOIN t3 ON t2.id = t3.id +on duplicate key update t1.v = t3.v; +select * from t1; +id v +1 20 +2 NULL +drop table t1,t2,t3; +# # BUG#919878: Assertion `!eliminated_tables... # CREATE TABLE t1 ( a INT ); diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result index d1be5e233df..a3ad63c035a 100644 --- a/mysql-test/r/union.result +++ b/mysql-test/r/union.result @@ -1734,6 +1734,21 @@ i 6 DROP VIEW v1; DROP TABLE t1; +# +# mdev-5382: UNION with ORDER BY in subselect +# +CREATE TABLE t1 (a int DEFAULT NULL); +INSERT INTO t1 VALUES (2), (4); +CREATE TABLE t2 (b int DEFAULT NULL); +INSERT INTO t2 VALUES (1), (3); +SELECT c1 FROM (SELECT (SELECT a FROM t1 WHERE t1.a <= t2.b +UNION ALL +SELECT a FROM t1 WHERE t1.a+3<= t2.b +ORDER BY a DESC) AS c1 FROM t2) t3; +c1 +NULL +2 +DROP TABLE t1,t2; End of 5.3 tests # # Bug#57986 ORDER BY clause is not used after a UNION, |