diff --git a/mysql-test/include/ctype_filesort.inc b/mysql-test/include/ctype_filesort.inc index 2068463d4e2..b1b7f21064d 100644 --- a/mysql-test/include/ctype_filesort.inc +++ b/mysql-test/include/ctype_filesort.inc @@ -13,3 +13,14 @@ delete from t1; insert into t1 values ('a'), ('a '), ('a\t'); select collation(a),hex(a) from t1 order by a; drop table t1; + + +--echo # +--echo # MDEV-5453 Assertion `src' fails in my_strnxfrm_unicode on GROUP BY MID(..) WITH ROLLUP +--echo # +SELECT @@collation_connection; +CREATE TABLE t1 (i INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2); +SELECT * FROM t1 GROUP BY MID(CURRENT_USER,0) WITH ROLLUP; +SELECT * FROM t1 GROUP BY MID('test',0) WITH ROLLUP; +DROP TABLE t1; diff --git a/mysql-test/r/ctype_big5.result b/mysql-test/r/ctype_big5.result index 5f734e920f4..aaf7cc9a371 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'); @@ -250,6 +267,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_cp1250_ch.result b/mysql-test/r/ctype_cp1250_ch.result index b5e4da336cd..96e81f04613 100644 --- a/mysql-test/r/ctype_cp1250_ch.result +++ b/mysql-test/r/ctype_cp1250_ch.result @@ -263,6 +263,23 @@ cp1250_czech_cs 61 cp1250_czech_cs 6109 cp1250_czech_cs 6120 drop table t1; +# +# MDEV-5453 Assertion `src' fails in my_strnxfrm_unicode on GROUP BY MID(..) WITH ROLLUP +# +SELECT @@collation_connection; +@@collation_connection +cp1250_czech_cs +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; set global LC_MESSAGES=convert((@@global.log_bin_trust_function_creators) using cp1250); ERROR HY000: Unknown locale: '1' diff --git a/mysql-test/r/ctype_eucjpms.result b/mysql-test/r/ctype_eucjpms.result index 70cebf3f80d..8b56e5ceb24 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 4b395359373..525f14946d7 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 daefcc8e11d..a625c0f08d3 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'); @@ -251,6 +268,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 801436ac326..31d61a7e98a 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'); @@ -251,6 +268,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 48ab72a4b8b..630288ebcb7 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 54cc1a6e025..ceb0a65304b 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; "BEGIN ctype_german.inc" drop table if exists t1; create table t1 as select repeat(' ', 64) as s1; diff --git a/mysql-test/r/ctype_sjis.result b/mysql-test/r/ctype_sjis.result index 679b5208cf5..994a16261f5 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 c97d0507463..70f58f91d38 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 @@ -3057,6 +3074,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 d6407301b90..c92592cacd3 100644 --- a/mysql-test/r/ctype_uca.result +++ b/mysql-test/r/ctype_uca.result @@ -5883,6 +5883,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 ee69544b274..5ce58fd7617 100644 --- a/mysql-test/r/ctype_ucs.result +++ b/mysql-test/r/ctype_ucs.result @@ -744,6 +744,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 @@ -925,6 +942,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 4391029b765..aace88419fb 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 29abffa0d52..6925da6b206 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 d5d0c29ff11..edb620df974 100644 --- a/mysql-test/r/ctype_utf16_uca.result +++ b/mysql-test/r/ctype_utf16_uca.result @@ -2857,6 +2857,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_utf16le.result b/mysql-test/r/ctype_utf16le.result index 2d032b925ca..8f63dda2adc 100644 --- a/mysql-test/r/ctype_utf16le.result +++ b/mysql-test/r/ctype_utf16le.result @@ -627,6 +627,23 @@ utf16le_general_ci 61000900 utf16le_general_ci 6100 utf16le_general_ci 61002000 drop table t1; +# +# MDEV-5453 Assertion `src' fails in my_strnxfrm_unicode on GROUP BY MID(..) WITH ROLLUP +# +SELECT @@collation_connection; +@@collation_connection +utf16le_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 utf16le_general_ci @@ -656,6 +673,23 @@ utf16le_bin 6100 utf16le_bin 61002000 drop table t1; # +# MDEV-5453 Assertion `src' fails in my_strnxfrm_unicode on GROUP BY MID(..) WITH ROLLUP +# +SELECT @@collation_connection; +@@collation_connection +utf16le_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.result b/mysql-test/r/ctype_utf32.result index c72ae5ef90f..e0bede76fb7 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 56015076a63..7ea23bb0a08 100644 --- a/mysql-test/r/ctype_utf32_uca.result +++ b/mysql-test/r/ctype_utf32_uca.result @@ -2857,6 +2857,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 f98fe649f80..4d558b2902c 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -946,6 +946,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 @@ -1109,6 +1126,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 4580d90c5bc..73ceae39295 100644 --- a/mysql-test/r/ctype_utf8mb4.result +++ b/mysql-test/r/ctype_utf8mb4.result @@ -946,6 +946,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 @@ -1091,6 +1108,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 bcacdd4e16e..18c8ec69f83 100644 --- a/mysql-test/r/ctype_utf8mb4_heap.result +++ b/mysql-test/r/ctype_utf8mb4_heap.result @@ -885,6 +885,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 @@ -1029,6 +1046,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 2375ca3bb92..68986e28dea 100644 --- a/mysql-test/r/ctype_utf8mb4_innodb.result +++ b/mysql-test/r/ctype_utf8mb4_innodb.result @@ -946,6 +946,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 @@ -1090,6 +1107,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 b467f07ece9..8a2de245093 100644 --- a/mysql-test/r/ctype_utf8mb4_myisam.result +++ b/mysql-test/r/ctype_utf8mb4_myisam.result @@ -946,6 +946,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 @@ -1090,6 +1107,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/suite/binlog/r/binlog_row_ctype_cp932.result b/mysql-test/suite/binlog/r/binlog_row_ctype_cp932.result index 43108222866..8bdad1813ea 100644 --- a/mysql-test/suite/binlog/r/binlog_row_ctype_cp932.result +++ b/mysql-test/suite/binlog/r/binlog_row_ctype_cp932.result @@ -11418,6 +11418,23 @@ cp932_japanese_ci 6109 cp932_japanese_ci 61 cp932_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 +cp932_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); @@ -11445,6 +11462,23 @@ cp932_bin 6109 cp932_bin 61 cp932_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 +cp932_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/suite/binlog/r/binlog_stm_ctype_cp932.result b/mysql-test/suite/binlog/r/binlog_stm_ctype_cp932.result index 43108222866..8bdad1813ea 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_ctype_cp932.result +++ b/mysql-test/suite/binlog/r/binlog_stm_ctype_cp932.result @@ -11418,6 +11418,23 @@ cp932_japanese_ci 6109 cp932_japanese_ci 61 cp932_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 +cp932_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); @@ -11445,6 +11462,23 @@ cp932_bin 6109 cp932_bin 61 cp932_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 +cp932_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/strings/ctype-utf8.c b/strings/ctype-utf8.c index 159299a9ea0..e564a85c828 100644 --- a/strings/ctype-utf8.c +++ b/strings/ctype-utf8.c @@ -4596,7 +4596,7 @@ my_strnxfrm_unicode(CHARSET_INFO *cs, MY_UNICASE_INFO *uni_plane= (cs->state & MY_CS_BINSORT) ? NULL : cs->caseinfo; LINT_INIT(wc); - DBUG_ASSERT(src); + DBUG_ASSERT(!srclen || src); for (; dst < de && nweights; nweights--) { @@ -4648,7 +4648,7 @@ my_strnxfrm_unicode_full_bin(CHARSET_INFO *cs, const uchar *se = src + srclen; LINT_INIT(wc); - DBUG_ASSERT(src); + DBUG_ASSERT(!srclen || src); DBUG_ASSERT(cs->state & MY_CS_BINSORT); for ( ; dst < de && nweights; nweights--)