Skip to content

Commit a88c71b

Browse files
committed
MDEV-35041 Simple comparison causes "Illegal mix of collations" even with default server settings
The task "MDEV-25829 Change default Unicode collation to uca1400_ai_ci" previously changed collation derivation for string user variables from DERIVATION_EXPLICIT to DERIVATION_COERCIBLE, to resolve illegal collation mix conflicts between table columns and user variables when they have different collations. However, DERIVATION_COERCIBLE was a wrong choice because it caused conflicts between string literals and user variables when they have different collations. Adding a new collation derivation level DERIVATION_USERVAR. This makes the collation of a user variable: - weaker than a table column (like it was intended by MDEV-25829) - but stronger than a literal (like it was in pre-MDEV-25829) Cleanup in sql_type.h: Removing the line "- BINARY(expr)" from the before-DERIVATION_CAST comment, as it was on a wrong place. It's also listed on the correct place before DERIVATION_IMPLICIT.
1 parent 4e1e9ea commit a88c71b

31 files changed

+178
-117
lines changed

mysql-test/main/ctype_binary.result

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ t1 CREATE TABLE `t1` (
423423
drop table t1;
424424
select hex(concat(coercibility('a')));
425425
hex(concat(coercibility('a')))
426-
35
426+
36
427427
create table t1 as select concat(coercibility('a')) as c1;
428428
show create table t1;
429429
Table Create Table
@@ -811,7 +811,7 @@ t1 CREATE TABLE `t1` (
811811
drop table t1;
812812
select coercibility(uuid()), coercibility(cast('a' as char character set latin1));
813813
coercibility(uuid()) coercibility(cast('a' as char character set latin1))
814-
6 4
814+
7 4
815815
select charset(concat(uuid(), cast('a' as char character set latin1)));
816816
charset(concat(uuid(), cast('a' as char character set latin1)))
817817
latin1

mysql-test/main/ctype_collate.result

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ Variable_name Value
516516
character_set_client latin1
517517
SELECT charset('a'),collation('a'),coercibility('a'),'a'='A';
518518
charset('a') collation('a') coercibility('a') 'a'='A'
519-
latin1 latin1_swedish_ci 5 1
519+
latin1 latin1_swedish_ci 6 1
520520
explain extended SELECT charset('a'),collation('a'),coercibility('a'),'a'='A';
521521
id select_type table type possible_keys key key_len ref rows filtered Extra
522522
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
@@ -527,7 +527,7 @@ SHOW VARIABLES LIKE 'collation_client';
527527
Variable_name Value
528528
SELECT charset('a'),collation('a'),coercibility('a'),'a'='A';
529529
charset('a') collation('a') coercibility('a') 'a'='A'
530-
latin1 latin1_swedish_ci 5 1
530+
latin1 latin1_swedish_ci 6 1
531531
SET @@collation_database=@collation_database;
532532
SET CHARACTER SET 'DEFAULT';
533533
ERROR 42000: Unknown character set: 'DEFAULT'
@@ -687,7 +687,7 @@ RETURN "Testtext";
687687
END;//
688688
SELECT getText(), CHARSET(getText()), COLLATION(getText()), COERCIBILITY(getText());
689689
getText() CHARSET(getText()) COLLATION(getText()) COERCIBILITY(getText())
690-
Testtext latin1 latin1_swedish_ci 5
690+
Testtext latin1 latin1_swedish_ci 6
691691
CREATE TABLE t1 AS SELECT ' - ' AS a UNION SELECT getText();
692692
ERROR HY000: Illegal mix of collations for operation 'UNION'
693693
DROP FUNCTION getText;
@@ -700,7 +700,7 @@ RETURN "Testtext";
700700
END;//
701701
SELECT getText(), CHARSET(getText()), COLLATION(getText()), COERCIBILITY(getText());
702702
getText() CHARSET(getText()) COLLATION(getText()) COERCIBILITY(getText())
703-
Testtext latin1 latin1_german2_ci 5
703+
Testtext latin1 latin1_german2_ci 6
704704
CREATE TABLE t1 AS SELECT ' - ' AS a UNION SELECT getText();
705705
SHOW CREATE TABLE t1;
706706
Table Create Table
@@ -718,7 +718,7 @@ RETURN "Testtext";
718718
END;//
719719
SELECT getText(), CHARSET(getText()), COLLATION(getText()), COERCIBILITY(getText());
720720
getText() CHARSET(getText()) COLLATION(getText()) COERCIBILITY(getText())
721-
Testtext latin1 latin1_german2_ci 5
721+
Testtext latin1 latin1_german2_ci 6
722722
CREATE TABLE t1 AS SELECT ' - ' AS a UNION SELECT getText();
723723
SHOW CREATE TABLE t1;
724724
Table Create Table

mysql-test/main/ctype_cp1251.result

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,7 @@ t1 CREATE TABLE `t1` (
835835
drop table t1;
836836
select hex(concat(coercibility('a')));
837837
hex(concat(coercibility('a')))
838-
35
838+
36
839839
create table t1 as select concat(coercibility('a')) as c1;
840840
show create table t1;
841841
Table Create Table
@@ -1223,7 +1223,7 @@ t1 CREATE TABLE `t1` (
12231223
drop table t1;
12241224
select coercibility(uuid()), coercibility(cast('a' as char character set latin1));
12251225
coercibility(uuid()) coercibility(cast('a' as char character set latin1))
1226-
6 4
1226+
7 4
12271227
select charset(concat(uuid(), cast('a' as char character set latin1)));
12281228
charset(concat(uuid(), cast('a' as char character set latin1)))
12291229
latin1

mysql-test/main/ctype_latin1.result

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,7 +1144,7 @@ t1 CREATE TABLE `t1` (
11441144
drop table t1;
11451145
select hex(concat(coercibility('a')));
11461146
hex(concat(coercibility('a')))
1147-
35
1147+
36
11481148
create table t1 as select concat(coercibility('a')) as c1;
11491149
show create table t1;
11501150
Table Create Table
@@ -1532,7 +1532,7 @@ t1 CREATE TABLE `t1` (
15321532
drop table t1;
15331533
select coercibility(uuid()), coercibility(cast('a' as char character set latin1));
15341534
coercibility(uuid()) coercibility(cast('a' as char character set latin1))
1535-
6 4
1535+
7 4
15361536
select charset(concat(uuid(), cast('a' as char character set latin1)));
15371537
charset(concat(uuid(), cast('a' as char character set latin1)))
15381538
latin1

mysql-test/main/ctype_latin2.result

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -585,31 +585,31 @@ CHARSET('2013-11-15 00:41:28' - INTERVAL 7 DAY)
585585
latin2
586586
SELECT COERCIBILITY('2013-11-15 00:41:28' - INTERVAL 7 DAY);
587587
COERCIBILITY('2013-11-15 00:41:28' - INTERVAL 7 DAY)
588-
5
588+
6
589589
SELECT CHARSET(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY);
590590
CHARSET(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY)
591591
binary
592592
SELECT COERCIBILITY(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY);
593593
COERCIBILITY(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY)
594-
6
594+
7
595595
SELECT CHARSET(CONCAT('2013-11-15 00:41:28' - INTERVAL 7 DAY));
596596
CHARSET(CONCAT('2013-11-15 00:41:28' - INTERVAL 7 DAY))
597597
latin2
598598
SELECT COERCIBILITY(CONCAT('2013-11-15 00:41:28' - INTERVAL 7 DAY));
599599
COERCIBILITY(CONCAT('2013-11-15 00:41:28' - INTERVAL 7 DAY))
600-
5
600+
6
601601
SELECT CHARSET(CONCAT(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY));
602602
CHARSET(CONCAT(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY))
603603
latin2
604604
SELECT COERCIBILITY(CONCAT(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY));
605605
COERCIBILITY(CONCAT(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY))
606-
5
606+
6
607607
SELECT CHARSET(CONCAT('','2001-01-08 00:00:00' - INTERVAL 7 DAY));
608608
CHARSET(CONCAT('','2001-01-08 00:00:00' - INTERVAL 7 DAY))
609609
latin2
610610
SELECT COERCIBILITY(CONCAT('','2001-01-08 00:00:00' - INTERVAL 7 DAY));
611611
COERCIBILITY(CONCAT('','2001-01-08 00:00:00' - INTERVAL 7 DAY))
612-
5
612+
6
613613
SELECT HEX(CONCAT('','2001-01-08 00:00:00' - INTERVAL 7 DAY));
614614
HEX(CONCAT('','2001-01-08 00:00:00' - INTERVAL 7 DAY))
615615
323030312D30312D30312030303A30303A3030
@@ -618,7 +618,7 @@ CHARSET(CONCAT('',TIMESTAMP'2001-01-08 00:00:00' - INTERVAL 7 DAY))
618618
latin2
619619
SELECT COERCIBILITY(CONCAT('',TIMESTAMP'2001-01-08 00:00:00' - INTERVAL 7 DAY));
620620
COERCIBILITY(CONCAT('',TIMESTAMP'2001-01-08 00:00:00' - INTERVAL 7 DAY))
621-
5
621+
6
622622
SELECT HEX(CONCAT('',TIMESTAMP'2001-01-08 00:00:00' - INTERVAL 7 DAY));
623623
HEX(CONCAT('',TIMESTAMP'2001-01-08 00:00:00' - INTERVAL 7 DAY))
624624
323030312D30312D30312030303A30303A3030

mysql-test/main/ctype_ucs.result

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2027,7 +2027,7 @@ t1 CREATE TABLE `t1` (
20272027
drop table t1;
20282028
select hex(concat(coercibility('a')));
20292029
hex(concat(coercibility('a')))
2030-
0035
2030+
0036
20312031
create table t1 as select concat(coercibility('a')) as c1;
20322032
show create table t1;
20332033
Table Create Table
@@ -2415,7 +2415,7 @@ t1 CREATE TABLE `t1` (
24152415
drop table t1;
24162416
select coercibility(uuid()), coercibility(cast('a' as char character set latin1));
24172417
coercibility(uuid()) coercibility(cast('a' as char character set latin1))
2418-
6 4
2418+
7 4
24192419
select charset(concat(uuid(), cast('a' as char character set latin1)));
24202420
charset(concat(uuid(), cast('a' as char character set latin1)))
24212421
latin1
@@ -5194,31 +5194,31 @@ CHARSET('2013-11-15 00:41:28' - INTERVAL 7 DAY)
51945194
ucs2
51955195
SELECT COERCIBILITY('2013-11-15 00:41:28' - INTERVAL 7 DAY);
51965196
COERCIBILITY('2013-11-15 00:41:28' - INTERVAL 7 DAY)
5197-
5
5197+
6
51985198
SELECT CHARSET(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY);
51995199
CHARSET(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY)
52005200
binary
52015201
SELECT COERCIBILITY(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY);
52025202
COERCIBILITY(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY)
5203-
6
5203+
7
52045204
SELECT CHARSET(CONCAT('2013-11-15 00:41:28' - INTERVAL 7 DAY));
52055205
CHARSET(CONCAT('2013-11-15 00:41:28' - INTERVAL 7 DAY))
52065206
ucs2
52075207
SELECT COERCIBILITY(CONCAT('2013-11-15 00:41:28' - INTERVAL 7 DAY));
52085208
COERCIBILITY(CONCAT('2013-11-15 00:41:28' - INTERVAL 7 DAY))
5209-
5
5209+
6
52105210
SELECT CHARSET(CONCAT(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY));
52115211
CHARSET(CONCAT(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY))
52125212
ucs2
52135213
SELECT COERCIBILITY(CONCAT(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY));
52145214
COERCIBILITY(CONCAT(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY))
5215-
5
5215+
6
52165216
SELECT CHARSET(CONCAT('','2001-01-08 00:00:00' - INTERVAL 7 DAY));
52175217
CHARSET(CONCAT('','2001-01-08 00:00:00' - INTERVAL 7 DAY))
52185218
ucs2
52195219
SELECT COERCIBILITY(CONCAT('','2001-01-08 00:00:00' - INTERVAL 7 DAY));
52205220
COERCIBILITY(CONCAT('','2001-01-08 00:00:00' - INTERVAL 7 DAY))
5221-
5
5221+
6
52225222
SELECT HEX(CONCAT('','2001-01-08 00:00:00' - INTERVAL 7 DAY));
52235223
HEX(CONCAT('','2001-01-08 00:00:00' - INTERVAL 7 DAY))
52245224
0032003000300031002D00300031002D00300031002000300030003A00300030003A00300030
@@ -5227,7 +5227,7 @@ CHARSET(CONCAT('',TIMESTAMP'2001-01-08 00:00:00' - INTERVAL 7 DAY))
52275227
ucs2
52285228
SELECT COERCIBILITY(CONCAT('',TIMESTAMP'2001-01-08 00:00:00' - INTERVAL 7 DAY));
52295229
COERCIBILITY(CONCAT('',TIMESTAMP'2001-01-08 00:00:00' - INTERVAL 7 DAY))
5230-
5
5230+
6
52315231
SELECT HEX(CONCAT('',TIMESTAMP'2001-01-08 00:00:00' - INTERVAL 7 DAY));
52325232
HEX(CONCAT('',TIMESTAMP'2001-01-08 00:00:00' - INTERVAL 7 DAY))
52335233
0032003000300031002D00300031002D00300031002000300030003A00300030003A00300030

mysql-test/main/ctype_utf16.result

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1395,31 +1395,31 @@ CHARSET('2013-11-15 00:41:28' - INTERVAL 7 DAY)
13951395
utf16
13961396
SELECT COERCIBILITY('2013-11-15 00:41:28' - INTERVAL 7 DAY);
13971397
COERCIBILITY('2013-11-15 00:41:28' - INTERVAL 7 DAY)
1398-
5
1398+
6
13991399
SELECT CHARSET(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY);
14001400
CHARSET(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY)
14011401
binary
14021402
SELECT COERCIBILITY(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY);
14031403
COERCIBILITY(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY)
1404-
6
1404+
7
14051405
SELECT CHARSET(CONCAT('2013-11-15 00:41:28' - INTERVAL 7 DAY));
14061406
CHARSET(CONCAT('2013-11-15 00:41:28' - INTERVAL 7 DAY))
14071407
utf16
14081408
SELECT COERCIBILITY(CONCAT('2013-11-15 00:41:28' - INTERVAL 7 DAY));
14091409
COERCIBILITY(CONCAT('2013-11-15 00:41:28' - INTERVAL 7 DAY))
1410-
5
1410+
6
14111411
SELECT CHARSET(CONCAT(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY));
14121412
CHARSET(CONCAT(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY))
14131413
utf16
14141414
SELECT COERCIBILITY(CONCAT(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY));
14151415
COERCIBILITY(CONCAT(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY))
1416-
5
1416+
6
14171417
SELECT CHARSET(CONCAT('','2001-01-08 00:00:00' - INTERVAL 7 DAY));
14181418
CHARSET(CONCAT('','2001-01-08 00:00:00' - INTERVAL 7 DAY))
14191419
utf16
14201420
SELECT COERCIBILITY(CONCAT('','2001-01-08 00:00:00' - INTERVAL 7 DAY));
14211421
COERCIBILITY(CONCAT('','2001-01-08 00:00:00' - INTERVAL 7 DAY))
1422-
5
1422+
6
14231423
SELECT HEX(CONCAT('','2001-01-08 00:00:00' - INTERVAL 7 DAY));
14241424
HEX(CONCAT('','2001-01-08 00:00:00' - INTERVAL 7 DAY))
14251425
0032003000300031002D00300031002D00300031002000300030003A00300030003A00300030
@@ -1428,7 +1428,7 @@ CHARSET(CONCAT('',TIMESTAMP'2001-01-08 00:00:00' - INTERVAL 7 DAY))
14281428
utf16
14291429
SELECT COERCIBILITY(CONCAT('',TIMESTAMP'2001-01-08 00:00:00' - INTERVAL 7 DAY));
14301430
COERCIBILITY(CONCAT('',TIMESTAMP'2001-01-08 00:00:00' - INTERVAL 7 DAY))
1431-
5
1431+
6
14321432
SELECT HEX(CONCAT('',TIMESTAMP'2001-01-08 00:00:00' - INTERVAL 7 DAY));
14331433
HEX(CONCAT('',TIMESTAMP'2001-01-08 00:00:00' - INTERVAL 7 DAY))
14341434
0032003000300031002D00300031002D00300031002000300030003A00300030003A00300030

mysql-test/main/ctype_utf16le.result

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1666,31 +1666,31 @@ CHARSET('2013-11-15 00:41:28' - INTERVAL 7 DAY)
16661666
utf16le
16671667
SELECT COERCIBILITY('2013-11-15 00:41:28' - INTERVAL 7 DAY);
16681668
COERCIBILITY('2013-11-15 00:41:28' - INTERVAL 7 DAY)
1669-
5
1669+
6
16701670
SELECT CHARSET(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY);
16711671
CHARSET(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY)
16721672
binary
16731673
SELECT COERCIBILITY(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY);
16741674
COERCIBILITY(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY)
1675-
6
1675+
7
16761676
SELECT CHARSET(CONCAT('2013-11-15 00:41:28' - INTERVAL 7 DAY));
16771677
CHARSET(CONCAT('2013-11-15 00:41:28' - INTERVAL 7 DAY))
16781678
utf16le
16791679
SELECT COERCIBILITY(CONCAT('2013-11-15 00:41:28' - INTERVAL 7 DAY));
16801680
COERCIBILITY(CONCAT('2013-11-15 00:41:28' - INTERVAL 7 DAY))
1681-
5
1681+
6
16821682
SELECT CHARSET(CONCAT(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY));
16831683
CHARSET(CONCAT(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY))
16841684
utf16le
16851685
SELECT COERCIBILITY(CONCAT(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY));
16861686
COERCIBILITY(CONCAT(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY))
1687-
5
1687+
6
16881688
SELECT CHARSET(CONCAT('','2001-01-08 00:00:00' - INTERVAL 7 DAY));
16891689
CHARSET(CONCAT('','2001-01-08 00:00:00' - INTERVAL 7 DAY))
16901690
utf16le
16911691
SELECT COERCIBILITY(CONCAT('','2001-01-08 00:00:00' - INTERVAL 7 DAY));
16921692
COERCIBILITY(CONCAT('','2001-01-08 00:00:00' - INTERVAL 7 DAY))
1693-
5
1693+
6
16941694
SELECT HEX(CONCAT('','2001-01-08 00:00:00' - INTERVAL 7 DAY));
16951695
HEX(CONCAT('','2001-01-08 00:00:00' - INTERVAL 7 DAY))
16961696
32003000300031002D00300031002D00300031002000300030003A00300030003A0030003000
@@ -1699,7 +1699,7 @@ CHARSET(CONCAT('',TIMESTAMP'2001-01-08 00:00:00' - INTERVAL 7 DAY))
16991699
utf16le
17001700
SELECT COERCIBILITY(CONCAT('',TIMESTAMP'2001-01-08 00:00:00' - INTERVAL 7 DAY));
17011701
COERCIBILITY(CONCAT('',TIMESTAMP'2001-01-08 00:00:00' - INTERVAL 7 DAY))
1702-
5
1702+
6
17031703
SELECT HEX(CONCAT('',TIMESTAMP'2001-01-08 00:00:00' - INTERVAL 7 DAY));
17041704
HEX(CONCAT('',TIMESTAMP'2001-01-08 00:00:00' - INTERVAL 7 DAY))
17051705
32003000300031002D00300031002D00300031002000300030003A00300030003A0030003000

mysql-test/main/ctype_utf32.result

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1339,31 +1339,31 @@ CHARSET('2013-11-15 00:41:28' - INTERVAL 7 DAY)
13391339
utf32
13401340
SELECT COERCIBILITY('2013-11-15 00:41:28' - INTERVAL 7 DAY);
13411341
COERCIBILITY('2013-11-15 00:41:28' - INTERVAL 7 DAY)
1342-
5
1342+
6
13431343
SELECT CHARSET(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY);
13441344
CHARSET(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY)
13451345
binary
13461346
SELECT COERCIBILITY(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY);
13471347
COERCIBILITY(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY)
1348-
6
1348+
7
13491349
SELECT CHARSET(CONCAT('2013-11-15 00:41:28' - INTERVAL 7 DAY));
13501350
CHARSET(CONCAT('2013-11-15 00:41:28' - INTERVAL 7 DAY))
13511351
utf32
13521352
SELECT COERCIBILITY(CONCAT('2013-11-15 00:41:28' - INTERVAL 7 DAY));
13531353
COERCIBILITY(CONCAT('2013-11-15 00:41:28' - INTERVAL 7 DAY))
1354-
5
1354+
6
13551355
SELECT CHARSET(CONCAT(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY));
13561356
CHARSET(CONCAT(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY))
13571357
utf32
13581358
SELECT COERCIBILITY(CONCAT(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY));
13591359
COERCIBILITY(CONCAT(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY))
1360-
5
1360+
6
13611361
SELECT CHARSET(CONCAT('','2001-01-08 00:00:00' - INTERVAL 7 DAY));
13621362
CHARSET(CONCAT('','2001-01-08 00:00:00' - INTERVAL 7 DAY))
13631363
utf32
13641364
SELECT COERCIBILITY(CONCAT('','2001-01-08 00:00:00' - INTERVAL 7 DAY));
13651365
COERCIBILITY(CONCAT('','2001-01-08 00:00:00' - INTERVAL 7 DAY))
1366-
5
1366+
6
13671367
SELECT HEX(CONCAT('','2001-01-08 00:00:00' - INTERVAL 7 DAY));
13681368
HEX(CONCAT('','2001-01-08 00:00:00' - INTERVAL 7 DAY))
13691369
000000320000003000000030000000310000002D00000030000000310000002D00000030000000310000002000000030000000300000003A00000030000000300000003A0000003000000030
@@ -1372,7 +1372,7 @@ CHARSET(CONCAT('',TIMESTAMP'2001-01-08 00:00:00' - INTERVAL 7 DAY))
13721372
utf32
13731373
SELECT COERCIBILITY(CONCAT('',TIMESTAMP'2001-01-08 00:00:00' - INTERVAL 7 DAY));
13741374
COERCIBILITY(CONCAT('',TIMESTAMP'2001-01-08 00:00:00' - INTERVAL 7 DAY))
1375-
5
1375+
6
13761376
SELECT HEX(CONCAT('',TIMESTAMP'2001-01-08 00:00:00' - INTERVAL 7 DAY));
13771377
HEX(CONCAT('',TIMESTAMP'2001-01-08 00:00:00' - INTERVAL 7 DAY))
13781378
000000320000003000000030000000310000002D00000030000000310000002D00000030000000310000002000000030000000300000003A00000030000000300000003A0000003000000030

mysql-test/main/ctype_utf8.result

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1892,7 +1892,7 @@ insert into t1 values('t1_val');
18921892
create view v1 as select 'v1_val' as col1;
18931893
select coercibility(col1), collation(col1) from v1;
18941894
coercibility(col1) collation(col1)
1895-
5 utf8mb3_general_ci
1895+
6 utf8mb3_general_ci
18961896
create view v2 as select col1 from v1 union select col1 from t1;
18971897
select coercibility(col1), collation(col1)from v2;
18981898
coercibility(col1) collation(col1)
@@ -2772,7 +2772,7 @@ t1 CREATE TABLE `t1` (
27722772
drop table t1;
27732773
select hex(concat(coercibility('a')));
27742774
hex(concat(coercibility('a')))
2775-
35
2775+
36
27762776
create table t1 as select concat(coercibility('a')) as c1;
27772777
show create table t1;
27782778
Table Create Table
@@ -3160,7 +3160,7 @@ t1 CREATE TABLE `t1` (
31603160
drop table t1;
31613161
select coercibility(uuid()), coercibility(cast('a' as char character set latin1));
31623162
coercibility(uuid()) coercibility(cast('a' as char character set latin1))
3163-
6 4
3163+
7 4
31643164
select charset(concat(uuid(), cast('a' as char character set latin1)));
31653165
charset(concat(uuid(), cast('a' as char character set latin1)))
31663166
latin1
@@ -10805,3 +10805,23 @@ DROP TABLE t1;
1080510805
#
1080610806
# End of 10.9 tests
1080710807
#
10808+
#
10809+
# Start of 11.6 tests
10810+
#
10811+
#
10812+
# MDEV-35041 Simple comparison causes "Illegal mix of collations" even with default server settings
10813+
#
10814+
CREATE TABLE t1 (a INT);
10815+
SET NAMES utf8mb3;
10816+
SELECT COLUMN_TYPE INTO @col_type FROM INFORMATION_SCHEMA.COLUMNS
10817+
WHERE TABLE_NAME='t1';
10818+
SELECT @col_type != 'binary(128)';
10819+
@col_type != 'binary(128)'
10820+
1
10821+
SELECT COERCIBILITY(@col_type), COERCIBILITY('binary(128)');
10822+
COERCIBILITY(@col_type) COERCIBILITY('binary(128)')
10823+
5 6
10824+
DROP TABLE t1;
10825+
#
10826+
# End of 11.6 tests
10827+
#

0 commit comments

Comments
 (0)