Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
9290a580
Commit
9290a580
authored
Oct 28, 2013
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merging more ctype_* tests from MySQL-5.6.
parent
91edb6f7
Changes
32
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
32 changed files
with
4568 additions
and
46 deletions
+4568
-46
mysql-test/include/ctype_ascii_order.inc
mysql-test/include/ctype_ascii_order.inc
+14
-0
mysql-test/r/ctype_big5.result
mysql-test/r/ctype_big5.result
+80
-0
mysql-test/r/ctype_collate.result
mysql-test/r/ctype_collate.result
+59
-0
mysql-test/r/ctype_cp1250_ch.result
mysql-test/r/ctype_cp1250_ch.result
+25
-0
mysql-test/r/ctype_gb2312.result
mysql-test/r/ctype_gb2312.result
+81
-0
mysql-test/r/ctype_gbk.result
mysql-test/r/ctype_gbk.result
+81
-0
mysql-test/r/ctype_latin2_ch.result
mysql-test/r/ctype_latin2_ch.result
+327
-0
mysql-test/r/ctype_like_range.result
mysql-test/r/ctype_like_range.result
+597
-0
mysql-test/r/ctype_many.result
mysql-test/r/ctype_many.result
+11
-0
mysql-test/r/ctype_tis620.result
mysql-test/r/ctype_tis620.result
+82
-0
mysql-test/r/ctype_uca.result
mysql-test/r/ctype_uca.result
+2332
-0
mysql-test/r/ctype_ucs.result
mysql-test/r/ctype_ucs.result
+184
-1
mysql-test/r/ctype_ujis.result
mysql-test/r/ctype_ujis.result
+1
-0
mysql-test/r/ctype_utf16_uca.result
mysql-test/r/ctype_utf16_uca.result
+113
-0
mysql-test/r/ctype_utf32_uca.result
mysql-test/r/ctype_utf32_uca.result
+113
-0
mysql-test/r/ctype_utf8.result
mysql-test/r/ctype_utf8.result
+35
-0
mysql-test/t/ctype_big5.test
mysql-test/t/ctype_big5.test
+1
-0
mysql-test/t/ctype_collate.test
mysql-test/t/ctype_collate.test
+53
-0
mysql-test/t/ctype_cp1250_ch.test
mysql-test/t/ctype_cp1250_ch.test
+4
-0
mysql-test/t/ctype_gb2312.test
mysql-test/t/ctype_gb2312.test
+1
-0
mysql-test/t/ctype_gbk.test
mysql-test/t/ctype_gbk.test
+1
-0
mysql-test/t/ctype_latin2_ch.test
mysql-test/t/ctype_latin2_ch.test
+178
-0
mysql-test/t/ctype_like_range.test
mysql-test/t/ctype_like_range.test
+23
-0
mysql-test/t/ctype_many.test
mysql-test/t/ctype_many.test
+12
-0
mysql-test/t/ctype_tis620.test
mysql-test/t/ctype_tis620.test
+1
-0
mysql-test/t/ctype_uca.test
mysql-test/t/ctype_uca.test
+73
-0
mysql-test/t/ctype_ucs.test
mysql-test/t/ctype_ucs.test
+46
-43
mysql-test/t/ctype_ujis.test
mysql-test/t/ctype_ujis.test
+1
-0
mysql-test/t/ctype_utf16_uca.test
mysql-test/t/ctype_utf16_uca.test
+1
-0
mysql-test/t/ctype_utf32_uca.test
mysql-test/t/ctype_utf32_uca.test
+1
-0
mysql-test/t/ctype_utf8.test
mysql-test/t/ctype_utf8.test
+35
-0
sql/field.cc
sql/field.cc
+2
-2
No files found.
mysql-test/include/ctype_ascii_order.inc
0 → 100644
View file @
9290a580
--
disable_warnings
drop
table
if
exists
t1
;
--
enable_warnings
create
table
t1
select
repeat
(
'a'
,
10
)
as
c1
;
delete
from
t1
;
insert
into
t1
values
(
0x20
),(
0x21
),(
0x22
),(
0x23
),(
0x24
),(
0x25
),(
0x26
),(
0x27
),(
0x28
),(
0x29
),(
0x2A
),(
0x2B
),(
0x2C
),(
0x2D
),(
0x2E
),(
0x2F
);
insert
into
t1
values
(
0x30
),(
0x31
),(
0x32
),(
0x33
),(
0x34
),(
0x35
),(
0x36
),(
0x37
),(
0x38
),(
0x39
),(
0x3A
),(
0x3B
),(
0x3C
),(
0x3D
),(
0x3E
),(
0x3F
);
insert
into
t1
values
(
0x40
),(
0x41
),(
0x42
),(
0x43
),(
0x44
),(
0x45
),(
0x46
),(
0x47
),(
0x48
),(
0x49
),(
0x4A
),(
0x4B
),(
0x4C
),(
0x4D
),(
0x4E
),(
0x4F
);
insert
into
t1
values
(
0x50
),(
0x51
),(
0x52
),(
0x53
),(
0x54
),(
0x55
),(
0x56
),(
0x57
),(
0x58
),(
0x59
),(
0x5A
),(
0x5B
),(
0x5C
),(
0x5D
),(
0x5E
),(
0x5F
);
insert
into
t1
values
(
0x60
),(
0x61
),(
0x62
),(
0x63
),(
0x64
),(
0x65
),(
0x66
),(
0x67
),(
0x68
),(
0x69
),(
0x6A
),(
0x6B
),(
0x6C
),(
0x6D
),(
0x6E
),(
0x6F
);
insert
into
t1
values
(
0x70
),(
0x71
),(
0x72
),(
0x73
),(
0x74
),(
0x75
),(
0x76
),(
0x77
),(
0x78
),(
0x79
),(
0x7A
),(
0x7B
),(
0x7C
),(
0x7D
),(
0x7E
),(
0x7F
);
SELECT
GROUP_CONCAT
(
c1
ORDER
BY
binary
c1
SEPARATOR
''
),
GROUP_CONCAT
(
hex
(
c1
)
ORDER
BY
BINARY
c1
)
FROM
t1
GROUP
BY
c1
;
drop
table
t1
;
mysql-test/r/ctype_big5.result
View file @
9290a580
...
...
@@ -160,6 +160,86 @@ a hex(b) c
3 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
4 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
DROP TABLE t1;
drop table if exists t1;
create table t1 select repeat('a',10) as c1;
delete from t1;
insert into t1 values (0x20),(0x21),(0x22),(0x23),(0x24),(0x25),(0x26),(0x27),(0x28),(0x29),(0x2A),(0x2B),(0x2C),(0x2D),(0x2E),(0x2F);
insert into t1 values (0x30),(0x31),(0x32),(0x33),(0x34),(0x35),(0x36),(0x37),(0x38),(0x39),(0x3A),(0x3B),(0x3C),(0x3D),(0x3E),(0x3F);
insert into t1 values (0x40),(0x41),(0x42),(0x43),(0x44),(0x45),(0x46),(0x47),(0x48),(0x49),(0x4A),(0x4B),(0x4C),(0x4D),(0x4E),(0x4F);
insert into t1 values (0x50),(0x51),(0x52),(0x53),(0x54),(0x55),(0x56),(0x57),(0x58),(0x59),(0x5A),(0x5B),(0x5C),(0x5D),(0x5E),(0x5F);
insert into t1 values (0x60),(0x61),(0x62),(0x63),(0x64),(0x65),(0x66),(0x67),(0x68),(0x69),(0x6A),(0x6B),(0x6C),(0x6D),(0x6E),(0x6F);
insert into t1 values (0x70),(0x71),(0x72),(0x73),(0x74),(0x75),(0x76),(0x77),(0x78),(0x79),(0x7A),(0x7B),(0x7C),(0x7D),(0x7E),(0x7F);
SELECT GROUP_CONCAT(c1 ORDER BY binary c1 SEPARATOR ''), GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) FROM t1 GROUP BY c1;
GROUP_CONCAT(c1 ORDER BY binary c1 SEPARATOR '') GROUP_CONCAT(hex(c1) ORDER BY BINARY c1)
20
! 21
" 22
# 23
$ 24
% 25
& 26
' 27
( 28
) 29
* 2A
+ 2B
, 2C
- 2D
. 2E
/ 2F
0 30
1 31
2 32
3 33
4 34
5 35
6 36
7 37
8 38
9 39
: 3A
; 3B
< 3C
= 3D
> 3E
? 3F
@ 40
Aa 41,61
Bb 42,62
Cc 43,63
Dd 44,64
E`e 45,60,65
Ff 46,66
Gg 47,67
Hh 48,68
Ii 49,69
Jj 4A,6A
Kk 4B,6B
Ll 4C,6C
Mm 4D,6D
Nn 4E,6E
Oo 4F,6F
Pp 50,70
Qq 51,71
Rr 52,72
Ss 53,73
Tt 54,74
Uu 55,75
Vv 56,76
Ww 57,77
Xx 58,78
Yy~ 59,79,7E
Zz 5A,7A
] 5D
[ 5B
\ 5C
^ 5E
_ 5F
{ 7B
| 7C
} 7D
7F
drop table t1;
SET collation_connection='big5_bin';
create table t1 select repeat('a',4000) a;
delete from t1;
...
...
mysql-test/r/ctype_collate.result
View file @
9290a580
...
...
@@ -660,3 +660,62 @@ latin5_turkish_ci then 2 else 3 end
select concat(_latin1'a',_latin2'b',_latin5'c' collate latin5_turkish_ci);
concat(_latin1'a',_latin2'b',_latin5'c' collate latin5_turkish_ci)
abc
#
# Bug#11765016 57926: ILLEGAL MIX OF COLLATIONS FOR OPERATION 'UNION' .. USING CONCAT/FUNCTION/
# Not a bug: only adding coverage tests
#
SET NAMES latin1 COLLATE latin1_german2_ci;
CREATE DATABASE test1 DEFAULT CHARACTER SET latin1 COLLATE latin1_german2_ci;
USE test1;
#
# Using "COLLATE latin1_swedish_ci" as the default collation for latin1
#
CREATE FUNCTION `getText`() RETURNS varchar(20) CHARSET latin1
BEGIN
RETURN "Testtext";
END;//
SELECT getText(), CHARSET(getText()), COLLATION(getText()), COERCIBILITY(getText());
getText() CHARSET(getText()) COLLATION(getText()) COERCIBILITY(getText())
Testtext latin1 latin1_swedish_ci 4
CREATE TABLE t1 AS SELECT ' - ' AS a UNION SELECT getText();
ERROR HY000: Illegal mix of collations for operation 'UNION'
DROP FUNCTION getText;
#
# Using "CHARACTER SET latin1 COLLATE latin1_german2_ci" as the database defaults
#
CREATE FUNCTION `getText`() RETURNS varchar(20)
BEGIN
RETURN "Testtext";
END;//
SELECT getText(), CHARSET(getText()), COLLATION(getText()), COERCIBILITY(getText());
getText() CHARSET(getText()) COLLATION(getText()) COERCIBILITY(getText())
Testtext latin1 latin1_german2_ci 4
CREATE TABLE t1 AS SELECT ' - ' AS a UNION SELECT getText();
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(20) COLLATE latin1_german2_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german2_ci
DROP TABLE t1;
DROP FUNCTION getText;
#
# Using explicit "CHARACTER SET latin1 COLLATE latin1_german2_ci"
#
CREATE FUNCTION `getText`() RETURNS varchar(20) CHARACTER SET latin1 COLLATE latin1_german2_ci
BEGIN
RETURN "Testtext";
END;//
SELECT getText(), CHARSET(getText()), COLLATION(getText()), COERCIBILITY(getText());
getText() CHARSET(getText()) COLLATION(getText()) COERCIBILITY(getText())
Testtext latin1 latin1_german2_ci 4
CREATE TABLE t1 AS SELECT ' - ' AS a UNION SELECT getText();
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(20) COLLATE latin1_german2_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german2_ci
DROP TABLE t1;
DROP FUNCTION getText;
DROP DATABASE test1;
USE test;
SET NAMES latin1;
mysql-test/r/ctype_cp1250_ch.result
View file @
9290a580
...
...
@@ -238,6 +238,31 @@ select a from t1 where a like "abcdefgh
a
abcdefgh
drop table t1;
set names cp1250 collate cp1250_czech_cs;
SELECT strcmp('a','a ');
strcmp('a','a ')
0
SELECT strcmp('a\0','a' );
strcmp('a\0','a' )
1
SELECT strcmp('a\0','a ');
strcmp('a\0','a ')
1
SELECT strcmp('a\t','a' );
strcmp('a\t','a' )
1
SELECT strcmp('a\t','a ');
strcmp('a\t','a ')
1
create table t1 select repeat('a',4000) a;
delete from t1;
insert into t1 values ('a'), ('a '), ('a\t');
select collation(a),hex(a) from t1 order by a;
collation(a) hex(a)
cp1250_czech_cs 61
cp1250_czech_cs 6109
cp1250_czech_cs 6120
drop table t1;
set global LC_MESSAGES=convert((@@global.log_bin_trust_function_creators)
using cp1250);
ERROR HY000: Unknown locale: '1'
...
...
mysql-test/r/ctype_gb2312.result
View file @
9290a580
...
...
@@ -160,6 +160,87 @@ a hex(b) c
3 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
4 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
DROP TABLE t1;
drop table if exists t1;
create table t1 select repeat('a',10) as c1;
delete from t1;
insert into t1 values (0x20),(0x21),(0x22),(0x23),(0x24),(0x25),(0x26),(0x27),(0x28),(0x29),(0x2A),(0x2B),(0x2C),(0x2D),(0x2E),(0x2F);
insert into t1 values (0x30),(0x31),(0x32),(0x33),(0x34),(0x35),(0x36),(0x37),(0x38),(0x39),(0x3A),(0x3B),(0x3C),(0x3D),(0x3E),(0x3F);
insert into t1 values (0x40),(0x41),(0x42),(0x43),(0x44),(0x45),(0x46),(0x47),(0x48),(0x49),(0x4A),(0x4B),(0x4C),(0x4D),(0x4E),(0x4F);
insert into t1 values (0x50),(0x51),(0x52),(0x53),(0x54),(0x55),(0x56),(0x57),(0x58),(0x59),(0x5A),(0x5B),(0x5C),(0x5D),(0x5E),(0x5F);
insert into t1 values (0x60),(0x61),(0x62),(0x63),(0x64),(0x65),(0x66),(0x67),(0x68),(0x69),(0x6A),(0x6B),(0x6C),(0x6D),(0x6E),(0x6F);
insert into t1 values (0x70),(0x71),(0x72),(0x73),(0x74),(0x75),(0x76),(0x77),(0x78),(0x79),(0x7A),(0x7B),(0x7C),(0x7D),(0x7E),(0x7F);
SELECT GROUP_CONCAT(c1 ORDER BY binary c1 SEPARATOR ''), GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) FROM t1 GROUP BY c1;
GROUP_CONCAT(c1 ORDER BY binary c1 SEPARATOR '') GROUP_CONCAT(hex(c1) ORDER BY BINARY c1)
20
! 21
" 22
# 23
$ 24
% 25
& 26
' 27
( 28
) 29
* 2A
+ 2B
, 2C
- 2D
. 2E
/ 2F
0 30
1 31
2 32
3 33
4 34
5 35
6 36
7 37
8 38
9 39
: 3A
; 3B
< 3C
= 3D
> 3E
? 3F
@ 40
Aa 41,61
Bb 42,62
Cc 43,63
Dd 44,64
Ee 45,65
Ff 46,66
Gg 47,67
Hh 48,68
Ii 49,69
Jj 4A,6A
Kk 4B,6B
Ll 4C,6C
Mm 4D,6D
Nn 4E,6E
Oo 4F,6F
Pp 50,70
Qq 51,71
Rr 52,72
Ss 53,73
Tt 54,74
Uu 55,75
Vv 56,76
Ww 57,77
Xx 58,78
Yy~ 59,79,7E
Zz 5A,7A
] 5D
[ 5B
\ 5C
^ 5E
_ 5F
` 60
{ 7B
| 7C
} 7D
7F
drop table t1;
SET collation_connection='gb2312_bin';
create table t1 select repeat('a',4000) a;
delete from t1;
...
...
mysql-test/r/ctype_gbk.result
View file @
9290a580
...
...
@@ -160,6 +160,87 @@ a hex(b) c
3 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
4 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2
DROP TABLE t1;
drop table if exists t1;
create table t1 select repeat('a',10) as c1;
delete from t1;
insert into t1 values (0x20),(0x21),(0x22),(0x23),(0x24),(0x25),(0x26),(0x27),(0x28),(0x29),(0x2A),(0x2B),(0x2C),(0x2D),(0x2E),(0x2F);
insert into t1 values (0x30),(0x31),(0x32),(0x33),(0x34),(0x35),(0x36),(0x37),(0x38),(0x39),(0x3A),(0x3B),(0x3C),(0x3D),(0x3E),(0x3F);
insert into t1 values (0x40),(0x41),(0x42),(0x43),(0x44),(0x45),(0x46),(0x47),(0x48),(0x49),(0x4A),(0x4B),(0x4C),(0x4D),(0x4E),(0x4F);
insert into t1 values (0x50),(0x51),(0x52),(0x53),(0x54),(0x55),(0x56),(0x57),(0x58),(0x59),(0x5A),(0x5B),(0x5C),(0x5D),(0x5E),(0x5F);
insert into t1 values (0x60),(0x61),(0x62),(0x63),(0x64),(0x65),(0x66),(0x67),(0x68),(0x69),(0x6A),(0x6B),(0x6C),(0x6D),(0x6E),(0x6F);
insert into t1 values (0x70),(0x71),(0x72),(0x73),(0x74),(0x75),(0x76),(0x77),(0x78),(0x79),(0x7A),(0x7B),(0x7C),(0x7D),(0x7E),(0x7F);
SELECT GROUP_CONCAT(c1 ORDER BY binary c1 SEPARATOR ''), GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) FROM t1 GROUP BY c1;
GROUP_CONCAT(c1 ORDER BY binary c1 SEPARATOR '') GROUP_CONCAT(hex(c1) ORDER BY BINARY c1)
20
! 21
" 22
# 23
$ 24
% 25
& 26
' 27
( 28
) 29
* 2A
+ 2B
, 2C
- 2D
. 2E
/ 2F
0 30
1 31
2 32
3 33
4 34
5 35
6 36
7 37
8 38
9 39
: 3A
; 3B
< 3C
= 3D
> 3E
? 3F
@ 40
Aa 41,61
Bb 42,62
Cc 43,63
Dd 44,64
Ee 45,65
Ff 46,66
Gg 47,67
Hh 48,68
Ii 49,69
Jj 4A,6A
Kk 4B,6B
Ll 4C,6C
Mm 4D,6D
Nn 4E,6E
Oo 4F,6F
Pp 50,70
Qq 51,71
Rr 52,72
Ss 53,73
Tt 54,74
Uu 55,75
Vv 56,76
Ww 57,77
Xx 58,78
Yy~ 59,79,7E
Zz 5A,7A
] 5D
[ 5B
\ 5C
^ 5E
_ 5F
` 60
{ 7B
| 7C
} 7D
7F
drop table t1;
SET collation_connection='gbk_bin';
create table t1 select repeat('a',4000) a;
delete from t1;
...
...
mysql-test/r/ctype_latin2_ch.result
View file @
9290a580
...
...
@@ -29,6 +29,333 @@ id tt
select * from t1 where tt like '%AA%';
id tt
drop table t1;
set names latin2 collate latin2_czech_cs;
SELECT strcmp('a','a ');
strcmp('a','a ')
0
SELECT strcmp('a\0','a' );
strcmp('a\0','a' )
1
SELECT strcmp('a\0','a ');
strcmp('a\0','a ')
1
SELECT strcmp('a\t','a' );
strcmp('a\t','a' )
0
SELECT strcmp('a\t','a ');
strcmp('a\t','a ')
0
create table t1 (
a varchar(2) character set latin2 collate latin2_czech_cs,
primary key(a)
);
insert into t1 set a=0x5ff;
insert into t1 set a=0xff;
select hex(a) from t1;
hex(a)
05FF
FF
drop table t1;
create table t1 (
ch varchar(1),
name varchar(64)
) character set latin2 collate latin2_czech_cs;
insert into t1 values (0x6F,'LATIN SMALL LETTER O');
insert into t1 values (0xF3,'LATIN SMALL LETTER O WITH ACUTE');
insert into t1 values (0xF4,'LATIN SMALL LETTER O WITH CIRCUMFLEX');
insert into t1 values (0xF6,'LATIN SMALL LETTER O WITH DIAERESIS');
insert into t1 values (0xF5,'LATIN SMALL LETTER O WITH DOUBLE ACUTE');
insert into t1 values (0x4F,'LATIN CAPITAL LETTER O');
insert into t1 values (0xD3,'LATIN CAPITAL LETTER O WITH ACUTE');
insert into t1 values (0xD4,'LATIN CAPITAL LETTER O WITH CURCUMFLEX');
insert into t1 values (0xD6,'LATIN CAPITAL LETTER O WITH DIAERESIS');
insert into t1 values (0xD5,'LATIN CAPITAL LETTER O WITH DOUBLE ACUTE');
insert into t1 values (0x75,'LATIN SMALL LETTER U');
insert into t1 values (0xFA,'LATIN SMALL LETTER U WITH ACUTE');
insert into t1 values (0xF9,'LATIN SMALL LETTER U WITH RING ABOVE');
insert into t1 values (0xFC,'LATIN SMALL LETTER U WITH DIAERESIS');
insert into t1 values (0xFB,'LATIN SMALL LETTER U WITH DOUBLE ACUTE');
insert into t1 values (0x55,'LATIN CAPITAL LETTER U');
insert into t1 values (0xDA,'LATIN CAPITAL LETTER U WITH ACUTE');
insert into t1 values (0xD9,'LATIN CAPITAL LETTER U WITH RING ABOVE');
insert into t1 values (0xDC,'LATIN CAPITAL LETTER U WITH DIAERESIS');
insert into t1 values (0xDB,'LATIN CAPITAL LETTER U WITH DOUBLE ACUTE');
select
hex(weight_string(ch level 1)) l1,
hex(weight_string(ch level 2)) l2,
hex(weight_string(ch level 3)) l3,
hex(weight_string(ch level 4)) l4,
name from t1 order by binary l1, binary l2, binary l3, binary l4;
l1 l2 l3 l4 name
1401 2701 4C01 4C00 LATIN SMALL LETTER O
1401 2701 4D01 4D00 LATIN CAPITAL LETTER O
1401 2801 4E01 4E00 LATIN SMALL LETTER O WITH ACUTE
1401 2801 4F01 4F00 LATIN CAPITAL LETTER O WITH ACUTE
1401 2901 5001 5000 LATIN SMALL LETTER O WITH CIRCUMFLEX
1401 2901 5101 5100 LATIN CAPITAL LETTER O WITH CURCUMFLEX
1401 2A01 5201 5200 LATIN SMALL LETTER O WITH DIAERESIS
1401 2A01 5301 5300 LATIN CAPITAL LETTER O WITH DIAERESIS
1401 2B01 5401 5400 LATIN SMALL LETTER O WITH DOUBLE ACUTE
1401 2B01 5501 5500 LATIN CAPITAL LETTER O WITH DOUBLE ACUTE
1C01 3801 6E01 6E00 LATIN SMALL LETTER U
1C01 3801 6F01 6F00 LATIN CAPITAL LETTER U
1C01 3901 7001 7000 LATIN SMALL LETTER U WITH ACUTE
1C01 3901 7101 7100 LATIN CAPITAL LETTER U WITH ACUTE
1C01 3A01 7201 7200 LATIN SMALL LETTER U WITH RING ABOVE
1C01 3A01 7301 7300 LATIN CAPITAL LETTER U WITH RING ABOVE
1C01 3B01 7401 7400 LATIN SMALL LETTER U WITH DIAERESIS
1C01 3B01 7501 7500 LATIN CAPITAL LETTER U WITH DIAERESIS
1C01 3C01 7601 7600 LATIN SMALL LETTER U WITH DOUBLE ACUTE
1C01 3C01 7701 7700 LATIN CAPITAL LETTER U WITH DOUBLE ACUTE
drop table t1;
set names utf8;
create table t1 (
ch varchar(1),
name varchar(64)
) character set latin2 collate latin2_czech_cs;
insert into t1 values (0x4F,'LATIN CAPITAL LETTER O');
insert into t1 values (0xD3,'LATIN CAPITAL LETTER O WITH ACUTE');
insert into t1 values (0xD4,'LATIN CAPITAL LETTER O WITH CURCUMFLEX');
insert into t1 values (0xD6,'LATIN CAPITAL LETTER O WITH DIAERESIS');
insert into t1 values (0xD5,'LATIN CAPITAL LETTER O WITH DOUBLE ACUTE');
insert into t1 values (0x75,'LATIN _SMALL_ LETTER U');
insert into t1 values (0xFA,'LATIN _SMALL_ LETTER U WITH ACUTE');
insert into t1 values (0xF9,'LATIN _SMALL_ LETTER U WITH RING ABOVE');
insert into t1 values (0xFC,'LATIN _SMALL_ LETTER U WITH DIAERESIS');
insert into t1 values (0xFB,'LATIN _SMALL_ LETTER U WITH DOUBLE ACUTE');
select ch,
hex(weight_string(ch level 1)) l1,
hex(weight_string(ch level 2)) l2,
hex(weight_string(ch level 3)) l3,
hex(weight_string(ch level 4)) l4,
name from t1 order by ch;
ch l1 l2 l3 l4 name
O 1401 2701 4D01 4D00 LATIN CAPITAL LETTER O
Ó 1401 2801 4F01 4F00 LATIN CAPITAL LETTER O WITH ACUTE
Ô 1401 2901 5101 5100 LATIN CAPITAL LETTER O WITH CURCUMFLEX
Ö 1401 2A01 5301 5300 LATIN CAPITAL LETTER O WITH DIAERESIS
Ő 1401 2B01 5501 5500 LATIN CAPITAL LETTER O WITH DOUBLE ACUTE
u 1C01 3801 6E01 6E00 LATIN _SMALL_ LETTER U
ú 1C01 3901 7001 7000 LATIN _SMALL_ LETTER U WITH ACUTE
ů 1C01 3A01 7201 7200 LATIN _SMALL_ LETTER U WITH RING ABOVE
ü 1C01 3B01 7401 7400 LATIN _SMALL_ LETTER U WITH DIAERESIS
ű 1C01 3C01 7601 7600 LATIN _SMALL_ LETTER U WITH DOUBLE ACUTE
alter table t1 modify ch char(1), modify name char(64);
select ch,
hex(weight_string(ch level 1)) l1,
hex(weight_string(ch level 2)) l2,
hex(weight_string(ch level 3)) l3,
hex(weight_string(ch level 4)) l4,
name from t1 order by ch;
ch l1 l2 l3 l4 name
O 1401 2701 4D01 4D00 LATIN CAPITAL LETTER O
Ó 1401 2801 4F01 4F00 LATIN CAPITAL LETTER O WITH ACUTE
Ô 1401 2901 5101 5100 LATIN CAPITAL LETTER O WITH CURCUMFLEX
Ö 1401 2A01 5301 5300 LATIN CAPITAL LETTER O WITH DIAERESIS
Ő 1401 2B01 5501 5500 LATIN CAPITAL LETTER O WITH DOUBLE ACUTE
u 1C01 3801 6E01 6E00 LATIN _SMALL_ LETTER U
ú 1C01 3901 7001 7000 LATIN _SMALL_ LETTER U WITH ACUTE
ů 1C01 3A01 7201 7200 LATIN _SMALL_ LETTER U WITH RING ABOVE
ü 1C01 3B01 7401 7400 LATIN _SMALL_ LETTER U WITH DIAERESIS
ű 1C01 3C01 7601 7600 LATIN _SMALL_ LETTER U WITH DOUBLE ACUTE
select ch,
hex(weight_string(ch level 1)) l1,
hex(weight_string(ch level 2)) l2,
hex(weight_string(ch level 3)) l3,
hex(weight_string(ch level 4)) l4,
name from t1 order by concat(ch);
ch l1 l2 l3 l4 name
O 1401 2701 4D01 4D00 LATIN CAPITAL LETTER O
Ó 1401 2801 4F01 4F00 LATIN CAPITAL LETTER O WITH ACUTE
Ô 1401 2901 5101 5100 LATIN CAPITAL LETTER O WITH CURCUMFLEX
Ö 1401 2A01 5301 5300 LATIN CAPITAL LETTER O WITH DIAERESIS
Ő 1401 2B01 5501 5500 LATIN CAPITAL LETTER O WITH DOUBLE ACUTE
u 1C01 3801 6E01 6E00 LATIN _SMALL_ LETTER U
ú 1C01 3901 7001 7000 LATIN _SMALL_ LETTER U WITH ACUTE
ů 1C01 3A01 7201 7200 LATIN _SMALL_ LETTER U WITH RING ABOVE
ü 1C01 3B01 7401 7400 LATIN _SMALL_ LETTER U WITH DIAERESIS
ű 1C01 3C01 7601 7600 LATIN _SMALL_ LETTER U WITH DOUBLE ACUTE
drop table t1;
SET collation_connection=latin2_czech_cs;
CREATE TABLE t1 ENGINE=MYISAM AS SELECT repeat('a', 5) AS s1 LIMIT 0;
INSERT INTO t1 VALUES ('x'),('y'),('z'),('X'),('Y'),('Z');
SELECT * FROM t1 GROUP BY s1;
s1
x
X
y
Y
z
Z
SELECT * FROM t1 ORDER BY s1;
s1
x
X
y
Y
z
Z
CREATE INDEX i1 ON t1 (s1);
SELECT * FROM t1 GROUP BY s1;
s1
x
X
y
Y
z
Z
SELECT * FROM t1 ORDER BY s1;
s1
x
X
y
Y
z
Z
DROP TABLE t1;
CREATE TABLE t1 ENGINE=INNODB AS SELECT repeat('a', 5) AS s1 LIMIT 0;
INSERT INTO t1 VALUES ('x'),('y'),('z'),('X'),('Y'),('Z');
SELECT * FROM t1 GROUP BY s1;
s1
x
X
y
Y
z
Z
SELECT * FROM t1 ORDER BY s1;
s1
x
X
y
Y
z
Z
CREATE INDEX i1 ON t1 (s1);
SELECT * FROM t1 GROUP BY s1;
s1
x
X
y
Y
z
Z
SELECT * FROM t1 ORDER BY s1;
s1
x
X
y
Y
z
Z
DROP TABLE t1;
SET sql_mode='';
CREATE TABLE t1 ENGINE=FALCON AS SELECT repeat('a', 5) AS s1 LIMIT 0;
SET sql_mode=DEFAULT;
INSERT INTO t1 VALUES ('x'),('y'),('z'),('X'),('Y'),('Z');
SELECT * FROM t1 GROUP BY s1;
s1
x
X
y
Y
z
Z
SELECT * FROM t1 ORDER BY s1;
s1
x
X
y
Y
z
Z
CREATE INDEX i1 ON t1 (s1);
SELECT * FROM t1 GROUP BY s1;
s1
x
X
y
Y
z
Z
SELECT * FROM t1 ORDER BY s1;
s1
x
X
y
Y
z
Z
DROP TABLE t1;
SET sql_mode='';
CREATE TABLE t1 ENGINE=MARIA AS SELECT repeat('a', 5) AS s1 LIMIT 0;
SET sql_mode=DEFAULT;
INSERT INTO t1 VALUES ('x'),('y'),('z'),('X'),('Y'),('Z');
SELECT * FROM t1 GROUP BY s1;
s1
x
X
y
Y
z
Z
SELECT * FROM t1 ORDER BY s1;
s1
x
X
y
Y
z
Z
CREATE INDEX i1 ON t1 (s1);
SELECT * FROM t1 GROUP BY s1;
s1
x
X
y
Y
z
Z
SELECT * FROM t1 ORDER BY s1;
s1
x
X
y
Y
z
Z
DROP TABLE t1;
SET NAMES latin2;
CREATE TABLE t2(colours SET('red','blue','yellow'))CHARACTER SET latin2 COLLATE
latin2_czech_cs;
CREATE TABLE t1(continent ENUM('Asia', 'Europe','Africa','Antartica'))CHARACTER SET latin2
COLLATE latin2_czech_cs;
INSERT INTO t1 VALUES('Asia');
INSERT INTO t2 VALUES('blue');
SELECT * FROM t1;
continent
Asia
SELECT * FROM t2;
colours
blue
DROP TABLE t1, t2;
CREATE TABLE `t1` (
`ID` smallint(5) unsigned zerofill NOT NULL AUTO_INCREMENT,
`Post` enum('','B','O','Z','U') COLLATE latin2_czech_cs DEFAULT NULL,
PRIMARY KEY (`ID`)
) ENGINE=MyISAM AUTO_INCREMENT=135 DEFAULT CHARSET=latin2;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`ID` smallint(5) unsigned zerofill NOT NULL AUTO_INCREMENT,
`Post` enum('','B','O','Z','U') CHARACTER SET latin2 COLLATE latin2_czech_cs DEFAULT NULL,
PRIMARY KEY (`ID`)
) ENGINE=MyISAM AUTO_INCREMENT=135 DEFAULT CHARSET=latin2
INSERT INTO t1 (ID,Post) VALUES (00041,'');
SELECT ID, Post, HEX(WEIGHT_STRING(Post)) FROM t1;
ID Post HEX(WEIGHT_STRING(Post))
00041 01010100
DROP TABLE t1;
#
# Start of 5.6 tests
#
...
...
mysql-test/r/ctype_like_range.result
View file @
9290a580
This diff is collapsed.
Click to expand it.
mysql-test/r/ctype_many.result
View file @
9290a580
No preview for this file type
mysql-test/r/ctype_tis620.result
View file @
9290a580
...
...
@@ -2965,6 +2965,88 @@ select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
c2h
ab_def
drop table t1;
drop table if exists t1;
create table t1 select repeat('a',10) as c1;
delete from t1;
insert into t1 values (0x20),(0x21),(0x22),(0x23),(0x24),(0x25),(0x26),(0x27),(0x28),(0x29),(0x2A),(0x2B),(0x2C),(0x2D),(0x2E),(0x2F);
insert into t1 values (0x30),(0x31),(0x32),(0x33),(0x34),(0x35),(0x36),(0x37),(0x38),(0x39),(0x3A),(0x3B),(0x3C),(0x3D),(0x3E),(0x3F);
insert into t1 values (0x40),(0x41),(0x42),(0x43),(0x44),(0x45),(0x46),(0x47),(0x48),(0x49),(0x4A),(0x4B),(0x4C),(0x4D),(0x4E),(0x4F);
insert into t1 values (0x50),(0x51),(0x52),(0x53),(0x54),(0x55),(0x56),(0x57),(0x58),(0x59),(0x5A),(0x5B),(0x5C),(0x5D),(0x5E),(0x5F);
insert into t1 values (0x60),(0x61),(0x62),(0x63),(0x64),(0x65),(0x66),(0x67),(0x68),(0x69),(0x6A),(0x6B),(0x6C),(0x6D),(0x6E),(0x6F);
insert into t1 values (0x70),(0x71),(0x72),(0x73),(0x74),(0x75),(0x76),(0x77),(0x78),(0x79),(0x7A),(0x7B),(0x7C),(0x7D),(0x7E),(0x7F);
SELECT GROUP_CONCAT(c1 ORDER BY binary c1 SEPARATOR ''), GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) FROM t1 GROUP BY c1;
GROUP_CONCAT(c1 ORDER BY binary c1 SEPARATOR '') GROUP_CONCAT(hex(c1) ORDER BY BINARY c1)
20
! 21
" 22
# 23
$ 24
% 25
& 26
' 27
( 28
) 29
* 2A
+ 2B
, 2C
- 2D
. 2E
/ 2F
0 30
1 31
2 32
3 33
4 34
5 35
6 36
7 37
8 38
9 39
: 3A
; 3B
< 3C
= 3D
> 3E
? 3F
@ 40
[ 5B
\ 5C
] 5D
^ 5E
_ 5F
` 60
Aa 41,61
Bb 42,62
Cc 43,63
Dd 44,64
Ee 45,65
Ff 46,66
Gg 47,67
Hh 48,68
Ii 49,69
Jj 4A,6A
Kk 4B,6B
Ll 4C,6C
Mm 4D,6D
Nn 4E,6E
Oo 4F,6F
Pp 50,70
Qq 51,71
Rr 52,72
Ss 53,73
Tt 54,74
Uu 55,75
Vv 56,76
Ww 57,77
Xx 58,78
Yy 59,79
Zz 5A,7A
{ 7B
| 7C
} 7D
~ 7E
7F
drop table t1;
SET collation_connection='tis620_bin';
create table t1 select repeat('a',4000) a;
delete from t1;
...
...
mysql-test/r/ctype_uca.result
View file @
9290a580
This diff is collapsed.
Click to expand it.
mysql-test/r/ctype_ucs.result
View file @
9290a580
...
...
@@ -228,7 +228,17 @@ lpad(f1, 12, "-o-/")
drop table t2;
SET NAMES koi8r;
SET character_set_connection=ucs2;
create table t1 (a varchar(10) character set ucs2, key(a));
select @@collation_connection;
@@collation_connection
ucs2_general_ci
create table t1 as select repeat(' ',10) as a union select null;
alter table t1 add key(a);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) CHARACTER SET ucs2 DEFAULT NULL,
KEY `a` (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
insert into t1 values ("a"),("abc"),("abcd"),("hello"),("test");
explain select * from t1 where a like 'abc%';
id select_type table type possible_keys key key_len ref rows Extra
...
...
@@ -4814,6 +4824,167 @@ select hex(weight_string('abc' as char(5) LEVEL 1 DESC REVERSE));
hex(weight_string('abc' as char(5) LEVEL 1 DESC REVERSE))
DFFFDFFF9CFF9DFF9EFF
#
# Bug #36418 Character sets: crash if char(256 using utf32)
#
select hex(char(0x01 using ucs2));
hex(char(0x01 using ucs2))
0001
select hex(char(0x0102 using ucs2));
hex(char(0x0102 using ucs2))
0102
select hex(char(0x010203 using ucs2));
hex(char(0x010203 using ucs2))
00010203
select hex(char(0x01020304 using ucs2));
hex(char(0x01020304 using ucs2))
01020304
#
# Bug#10094 Displays wrong error message for UNIQUE key index on CHAR(255) Unicode datatype
#
CREATE TABLE t1 (f1 CHAR(255) unicode);
INSERT INTO t1 values ('abc'),('bcd'),('abc');
ALTER TABLE t1 ADD UNIQUE Index_1 (f1);
ERROR 23000: Duplicate entry 'abc' for key 'Index_1'
DROP TABLE t1;
#
# Test how character set works with date/time
#
SET collation_connection=ucs2_general_ci;
CREATE TABLE t1 AS SELECT repeat('a',20) AS s1 LIMIT 0;
SET timestamp=1216359724;
INSERT INTO t1 VALUES (current_date);
INSERT INTO t1 VALUES (current_time);
INSERT INTO t1 VALUES (current_timestamp);
SELECT s1, hex(s1) FROM t1;
s1 hex(s1)
2008-07-18 0032003000300038002D00300037002D00310038
08:42:04 00300038003A00340032003A00300034
2008-07-18 08:42:04 0032003000300038002D00300037002D00310038002000300038003A00340032003A00300034
DROP TABLE t1;
SET timestamp=0;
SET NAMES latin1;
#
# WL#4013 Unicode german2 collation
#
SET collation_connection=ucs2_german2_ci;
"BEGIN ctype_german.inc"
drop table if exists t1;
create table t1 as select repeat(' ', 64) as s1;
select collation(s1) from t1;
collation(s1)
ucs2_german2_ci
delete from t1;
INSERT INTO t1 VALUES ('ud'),('uf');
INSERT INTO t1 VALUES ('od'),('of');
INSERT INTO t1 VALUES ('e');
INSERT INTO t1 VALUES ('ad'),('af');
insert into t1 values ('a'),('ae'),(_latin1 0xE4);
insert into t1 values ('o'),('oe'),(_latin1 0xF6);
insert into t1 values ('s'),('ss'),(_latin1 0xDF);
insert into t1 values ('u'),('ue'),(_latin1 0xFC);
INSERT INTO t1 VALUES (_latin1 0xE6), (_latin1 0xC6);
INSERT INTO t1 VALUES (_latin1 0x9C), (_latin1 0x8C);
select s1, hex(s1) from t1 order by s1, binary s1;
s1 hex(s1)
a 0061
ad 00610064
ae 00610065
00C6
00E4
00E6
af 00610066
e 0065
o 006F
od 006F0064
oe 006F0065
00F6
0152
0153
of 006F0066
s 0073
ss 00730073
00DF
u 0075
ud 00750064
ue 00750065
00FC
uf 00750066
select group_concat(s1 order by binary s1) from t1 group by s1;
group_concat(s1 order by binary s1)
a
ad
ae,,,
af
e
o
od
oe,,,
of
s
ss,
u
ud
ue,
uf
SELECT s1, hex(s1), hex(weight_string(s1)) FROM t1 ORDER BY s1, BINARY(s1);
s1 hex(s1) hex(weight_string(s1))
a 0061 0E33
ad 00610064 0E330E6D
ae 00610065 0E330E8B
00C6 0E330E8B
00E4 0E330E8B
00E6 0E330E8B
af 00610066 0E330EB9
e 0065 0E8B
o 006F 0F82
od 006F0064 0F820E6D
oe 006F0065 0F820E8B
00F6 0F820E8B
0152 0F820E8B
0153 0F820E8B
of 006F0066 0F820EB9
s 0073 0FEA
ss 00730073 0FEA0FEA
00DF 0FEA0FEA
u 0075 101F
ud 00750064 101F0E6D
ue 00750065 101F0E8B
00FC 101F0E8B
uf 00750066 101F0EB9
SELECT s1, hex(s1) FROM t1 WHERE s1='ae' ORDER BY s1, BINARY(s1);
s1 hex(s1)
ae 00610065
00C6
00E4
00E6
drop table t1;
CREATE TABLE t1 AS SELECT REPEAT('a',1) AS a, 1 AS b LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(1) CHARACTER SET ucs2 COLLATE ucs2_german2_ci NOT NULL DEFAULT '',
`b` int(1) NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('s',0),(_latin1 0xDF,1);
SELECT * FROM t1 ORDER BY a, b;
a b
s 0
1
SELECT * FROM t1 ORDER BY a DESC, b;
a b
1
s 0
SELECT * FROM t1 ORDER BY CONCAT(a), b;
a b
s 0
1
SELECT * FROM t1 ORDER BY CONCAT(a) DESC, b;
a b
1
s 0
DROP TABLE t1;
"END ctype_german.inc"
#
# Bug#59145 valgrind warnings for uninitialized values in my_strtoll10_mb2
#
SET NAMES latin1;
...
...
@@ -4827,5 +4998,17 @@ DO CAST(CONVERT('' USING ucs2) AS UNSIGNED);
Warnings:
Warning 1292 Truncated incorrect INTEGER value: ''
#
# Test error message for conversion using different charset
#
CREATE TABLE t1 (a DECIMAL(2,0));
SET sql_mode='strict_all_tables';
INSERT INTO t1 VALUES (CONVERT('9e99999999' USING ucs2));
ERROR 22007: Incorrect decimal value: '9e99999999' for column 'a' at row 1
SET sql_mode=DEFAULT;
INSERT INTO t1 VALUES (CONVERT('aaa' USING ucs2));
Warnings:
Warning 1366 Incorrect decimal value: 'aaa' for column 'a' at row 1
DROP TABLE t1;
#
# End of 5.6 tests
#
mysql-test/r/ctype_ujis.result
View file @
9290a580
...
...
@@ -2387,6 +2387,7 @@ Warning 1292 Truncated incorrect INTEGER value: 'a'
set names default;
set character_set_database=default;
set character_set_server=default;
End of 5.1 tests
#
# Start of 5.5 tests
#
...
...
mysql-test/r/ctype_utf16_uca.result
View file @
9290a580
...
...
@@ -2177,6 +2177,119 @@ ZzŹźŻżŽž
ǁ
ǂ
ǃ
select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_croatian_ci;
group_concat(c1 order by binary c1 separator '')
÷
×
AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặ
AAAaaAaa
AEAeaEae
ÆæǢǣǼǽ
Bb
ƀ
Ɓ
Ƃƃ
CcÇçĈĉĊċ
CHChcHch
Čč
Ćć
Ƈƈ
DdĎď
DZDzdZdzDZDzdz
dŽ
DŽDždžDŽDždž
Đđ
Ɖ
Ɗ
Ƌƌ
Ðð
EeÈÉÊËèéêëĒēĔĕĖėĘęĚěẸẹẺẻẼẽẾếỀềỂểỄễỆệ
Ǝǝ
Ə
Ɛ
Ff
Ƒƒ
GgĜĝĞğĠġĢģǦǧǴǵ
Ǥǥ
Ɠ
Ɣ
Ƣƣ
HhĤĥ
ƕǶ
Ħħ
IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐỈỉỊị
IJIjiJijIJij
ı
Ɨ
Ɩ
JjĴĵǰ
KkĶķǨǩ
Ƙƙ
LlĹĺĻļĽľ
Ŀŀ
lJ
LLLllLll
LJLjljLJLjlj
Łł
ƚ
ƛ
Mm
NnÑñŃńŅņŇňǸǹ
nJ
NJNjnjNJNjnj
Ɲ
ƞ
Ŋŋ
OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợ
OEOeoEoeŒœ
ØøǾǿ
Ɔ
Ɵ
Pp
Ƥƥ
Qq
ĸ
RrŔŕŖŗŘř
RRRrrRrr
Ʀ
SsŚśŜŝŞşſ
SSSssSssß
Šš
Ʃ
ƪ
TtŢţŤť
ƾ
Ŧŧ
ƫ
Ƭƭ
Ʈ
UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜỤụỦủỨứỪừỬửỮữỰự
Ɯ
Ʊ
Vv
Ʋ
WwŴŵ
Xx
YyÝýÿŶŷŸ
Ƴƴ
ZzŹźŻż
ƍ
Žž
Ƶƶ
ƷǮǯ
Ƹƹ
ƺ
Þþ
ƿǷ
ƻ
Ƨƨ
Ƽƽ
Ƅƅ
ʼn
ǀ
ǁ
ǂ
ǃ
select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_german2_ci;
group_concat(c1 order by binary c1 separator '')
÷
...
...
mysql-test/r/ctype_utf32_uca.result
View file @
9290a580
...
...
@@ -2177,6 +2177,119 @@ ZzŹźŻżŽž
ǁ
ǂ
ǃ
select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_croatian_ci;
group_concat(c1 order by binary c1 separator '')
÷
×
AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặ
AAAaaAaa
AEAeaEae
ÆæǢǣǼǽ
Bb
ƀ
Ɓ
Ƃƃ
CcÇçĈĉĊċ
CHChcHch
Čč
Ćć
Ƈƈ
DdĎď
DZDzdZdzDZDzdz
dŽ
DŽDždžDŽDždž
Đđ
Ɖ
Ɗ
Ƌƌ
Ðð
EeÈÉÊËèéêëĒēĔĕĖėĘęĚěẸẹẺẻẼẽẾếỀềỂểỄễỆệ
Ǝǝ
Ə
Ɛ
Ff
Ƒƒ
GgĜĝĞğĠġĢģǦǧǴǵ
Ǥǥ
Ɠ
Ɣ
Ƣƣ
HhĤĥ
ƕǶ
Ħħ
IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐỈỉỊị
IJIjiJijIJij
ı
Ɨ
Ɩ
JjĴĵǰ
KkĶķǨǩ
Ƙƙ
LlĹĺĻļĽľ
Ŀŀ
lJ
LLLllLll
LJLjljLJLjlj
Łł
ƚ
ƛ
Mm
NnÑñŃńŅņŇňǸǹ
nJ
NJNjnjNJNjnj
Ɲ
ƞ
Ŋŋ
OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợ
OEOeoEoeŒœ
ØøǾǿ
Ɔ
Ɵ
Pp
Ƥƥ
Qq
ĸ
RrŔŕŖŗŘř
RRRrrRrr
Ʀ
SsŚśŜŝŞşſ
SSSssSssß
Šš
Ʃ
ƪ
TtŢţŤť
ƾ
Ŧŧ
ƫ
Ƭƭ
Ʈ
UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜỤụỦủỨứỪừỬửỮữỰự
Ɯ
Ʊ
Vv
Ʋ
WwŴŵ
Xx
YyÝýÿŶŷŸ
Ƴƴ
ZzŹźŻż
ƍ
Žž
Ƶƶ
ƷǮǯ
Ƹƹ
ƺ
Þþ
ƿǷ
ƻ
Ƨƨ
Ƽƽ
Ƅƅ
ʼn
ǀ
ǁ
ǂ
ǃ
select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_german2_ci;
group_concat(c1 order by binary c1 separator '')
÷
...
...
mysql-test/r/ctype_utf8.result
View file @
9290a580
...
...
@@ -1625,6 +1625,41 @@ substr(Z.a,-1) a
3 123
6 456
drop table t1;
SET CHARACTER SET utf8;
SHOW VARIABLES LIKE 'character\_set\_%';
Variable_name Value
character_set_client utf8
character_set_connection latin1
character_set_database latin1
character_set_filesystem binary
character_set_results utf8
character_set_server latin1
character_set_system utf8
CREATE DATABASE crashtest DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
USE crashtest;
CREATE TABLE crashtest (crash char(10)) DEFAULT CHARSET=utf8;
INSERT INTO crashtest VALUES ('35'), ('36'), ('37');
SELECT * FROM crashtest ORDER BY CHAR(crash USING utf8);
crash
35
36
37
INSERT INTO crashtest VALUES ('-1000');
EXPLAIN SELECT * FROM crashtest ORDER BY CHAR(crash USING utf8);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE crashtest ALL NULL NULL NULL NULL 4 Using filesort
SELECT * FROM crashtest ORDER BY CHAR(crash USING utf8);
crash
-1000
35
36
37
Warnings:
Warning 1300 Invalid utf8 character string: 'FFFFFC'
DROP TABLE crashtest;
DROP DATABASE crashtest;
USE test;
SET CHARACTER SET default;
CREATE TABLE t1(id varchar(20) NOT NULL) DEFAULT CHARSET=utf8;
INSERT INTO t1 VALUES ('xxx'), ('aa'), ('yyy'), ('aa');
SELECT id FROM t1;
...
...
mysql-test/t/ctype_big5.test
View file @
9290a580
...
...
@@ -17,6 +17,7 @@ SET collation_connection='big5_chinese_ci';
--
source
include
/
ctype_innodb_like
.
inc
--
source
include
/
ctype_like_escape
.
inc
--
source
include
/
ctype_like_range_f1f2
.
inc
--
source
include
/
ctype_ascii_order
.
inc
SET
collation_connection
=
'big5_bin'
;
--
source
include
/
ctype_filesort
.
inc
--
source
include
/
ctype_innodb_like
.
inc
...
...
mysql-test/t/ctype_collate.test
View file @
9290a580
...
...
@@ -255,3 +255,56 @@ select case _latin1'a' when _latin2'b' then 1 when _latin5'c' collate
latin5_turkish_ci
then
2
else
3
end
;
select
concat
(
_latin1
'a'
,
_latin2
'b'
,
_latin5
'c'
collate
latin5_turkish_ci
);
--
echo
#
--
echo
# Bug#11765016 57926: ILLEGAL MIX OF COLLATIONS FOR OPERATION 'UNION' .. USING CONCAT/FUNCTION/
--
echo
# Not a bug: only adding coverage tests
--
echo
#
SET
NAMES
latin1
COLLATE
latin1_german2_ci
;
CREATE
DATABASE
test1
DEFAULT
CHARACTER
SET
latin1
COLLATE
latin1_german2_ci
;
USE
test1
;
DELIMITER
//;
--
echo
#
--
echo
# Using "COLLATE latin1_swedish_ci" as the default collation for latin1
--
echo
#
CREATE
FUNCTION
`
getText
`() RETURNS varchar(20) CHARSET latin1
BEGIN
RETURN "Testtext";
END;//
DELIMITER ;//
SELECT getText(), CHARSET(getText()), COLLATION(getText()), COERCIBILITY(getText());
--error ER_CANT_AGGREGATE_NCOLLATIONS
CREATE TABLE t1 AS SELECT ' - ' AS a UNION SELECT getText();
DROP FUNCTION getText;
--echo #
--echo # Using "CHARACTER SET latin1 COLLATE latin1_german2_ci" as the database defaults
--echo #
DELIMITER //;
CREATE FUNCTION `
getText
`() RETURNS varchar(20)
BEGIN
RETURN "Testtext";
END;//
DELIMITER ;//
SELECT getText(), CHARSET(getText()), COLLATION(getText()), COERCIBILITY(getText());
CREATE TABLE t1 AS SELECT ' - ' AS a UNION SELECT getText();
SHOW CREATE TABLE t1;
DROP TABLE t1;
DROP FUNCTION getText;
--echo #
--echo # Using explicit "CHARACTER SET latin1 COLLATE latin1_german2_ci"
--echo #
DELIMITER //;
CREATE FUNCTION `
getText
`
()
RETURNS
varchar
(
20
)
CHARACTER
SET
latin1
COLLATE
latin1_german2_ci
BEGIN
RETURN
"Testtext"
;
END
;
//
DELIMITER
;
//
SELECT
getText
(),
CHARSET
(
getText
()),
COLLATION
(
getText
()),
COERCIBILITY
(
getText
());
CREATE
TABLE
t1
AS
SELECT
' - '
AS
a
UNION
SELECT
getText
();
SHOW
CREATE
TABLE
t1
;
DROP
TABLE
t1
;
DROP
FUNCTION
getText
;
DROP
DATABASE
test1
;
USE
test
;
SET
NAMES
latin1
;
mysql-test/t/ctype_cp1250_ch.test
View file @
9290a580
...
...
@@ -71,6 +71,10 @@ insert into t1 values("
select
a
from
t1
where
a
like
"abcdefgh"
;
drop
table
t1
;
set
names
cp1250
collate
cp1250_czech_cs
;
--
source
include
/
ctype_pad_space
.
inc
--
source
include
/
ctype_filesort
.
inc
# End of 4.1 tests
#
...
...
mysql-test/t/ctype_gb2312.test
View file @
9290a580
...
...
@@ -17,6 +17,7 @@ SET collation_connection='gb2312_chinese_ci';
--
source
include
/
ctype_innodb_like
.
inc
--
source
include
/
ctype_like_escape
.
inc
--
source
include
/
ctype_like_range_f1f2
.
inc
--
source
include
/
ctype_ascii_order
.
inc
SET
collation_connection
=
'gb2312_bin'
;
--
source
include
/
ctype_filesort
.
inc
--
source
include
/
ctype_innodb_like
.
inc
...
...
mysql-test/t/ctype_gbk.test
View file @
9290a580
...
...
@@ -17,6 +17,7 @@ SET collation_connection='gbk_chinese_ci';
--
source
include
/
ctype_innodb_like
.
inc
--
source
include
/
ctype_like_escape
.
inc
--
source
include
/
ctype_like_range_f1f2
.
inc
--
source
include
/
ctype_ascii_order
.
inc
SET
collation_connection
=
'gbk_bin'
;
--
source
include
/
ctype_filesort
.
inc
--
source
include
/
ctype_innodb_like
.
inc
...
...
mysql-test/t/ctype_latin2_ch.test
View file @
9290a580
...
...
@@ -27,10 +27,187 @@ select * from t1 where tt like 'AA%';
select
*
from
t1
ignore
index
(
primary
)
where
tt
like
'AA%'
;
select
*
from
t1
where
tt
like
'%AA%'
;
drop
table
t1
;
# End of 4.1 tests
set
names
latin2
collate
latin2_czech_cs
;
--
source
include
/
ctype_pad_space
.
inc
# We can not use ctype_filesort.inc because
# order of SPACE and TAB is not strict
#--source include/ctype_filesort.inc
#
#
# Bug#29459 server died handling latin2 collate latin2_czech_cs
#
create
table
t1
(
a
varchar
(
2
)
character
set
latin2
collate
latin2_czech_cs
,
primary
key
(
a
)
);
insert
into
t1
set
a
=
0x5ff
;
insert
into
t1
set
a
=
0xff
;
select
hex
(
a
)
from
t1
;
drop
table
t1
;
#
# Bug#33452 Primary difference between capital and small letters U and O
#
create
table
t1
(
ch
varchar
(
1
),
name
varchar
(
64
)
)
character
set
latin2
collate
latin2_czech_cs
;
insert
into
t1
values
(
0x6F
,
'LATIN SMALL LETTER O'
);
insert
into
t1
values
(
0xF3
,
'LATIN SMALL LETTER O WITH ACUTE'
);
insert
into
t1
values
(
0xF4
,
'LATIN SMALL LETTER O WITH CIRCUMFLEX'
);
insert
into
t1
values
(
0xF6
,
'LATIN SMALL LETTER O WITH DIAERESIS'
);
insert
into
t1
values
(
0xF5
,
'LATIN SMALL LETTER O WITH DOUBLE ACUTE'
);
insert
into
t1
values
(
0x4F
,
'LATIN CAPITAL LETTER O'
);
insert
into
t1
values
(
0xD3
,
'LATIN CAPITAL LETTER O WITH ACUTE'
);
insert
into
t1
values
(
0xD4
,
'LATIN CAPITAL LETTER O WITH CURCUMFLEX'
);
insert
into
t1
values
(
0xD6
,
'LATIN CAPITAL LETTER O WITH DIAERESIS'
);
insert
into
t1
values
(
0xD5
,
'LATIN CAPITAL LETTER O WITH DOUBLE ACUTE'
);
insert
into
t1
values
(
0x75
,
'LATIN SMALL LETTER U'
);
insert
into
t1
values
(
0xFA
,
'LATIN SMALL LETTER U WITH ACUTE'
);
insert
into
t1
values
(
0xF9
,
'LATIN SMALL LETTER U WITH RING ABOVE'
);
insert
into
t1
values
(
0xFC
,
'LATIN SMALL LETTER U WITH DIAERESIS'
);
insert
into
t1
values
(
0xFB
,
'LATIN SMALL LETTER U WITH DOUBLE ACUTE'
);
insert
into
t1
values
(
0x55
,
'LATIN CAPITAL LETTER U'
);
insert
into
t1
values
(
0xDA
,
'LATIN CAPITAL LETTER U WITH ACUTE'
);
insert
into
t1
values
(
0xD9
,
'LATIN CAPITAL LETTER U WITH RING ABOVE'
);
insert
into
t1
values
(
0xDC
,
'LATIN CAPITAL LETTER U WITH DIAERESIS'
);
insert
into
t1
values
(
0xDB
,
'LATIN CAPITAL LETTER U WITH DOUBLE ACUTE'
);
select
hex
(
weight_string
(
ch
level
1
))
l1
,
hex
(
weight_string
(
ch
level
2
))
l2
,
hex
(
weight_string
(
ch
level
3
))
l3
,
hex
(
weight_string
(
ch
level
4
))
l4
,
name
from
t1
order
by
binary
l1
,
binary
l2
,
binary
l3
,
binary
l4
;
drop
table
t1
;
#
# Bug#33791 Wrong ORDER BY with latin2_czech_cs
#
set
names
utf8
;
create
table
t1
(
ch
varchar
(
1
),
name
varchar
(
64
)
)
character
set
latin2
collate
latin2_czech_cs
;
insert
into
t1
values
(
0x4F
,
'LATIN CAPITAL LETTER O'
);
insert
into
t1
values
(
0xD3
,
'LATIN CAPITAL LETTER O WITH ACUTE'
);
insert
into
t1
values
(
0xD4
,
'LATIN CAPITAL LETTER O WITH CURCUMFLEX'
);
insert
into
t1
values
(
0xD6
,
'LATIN CAPITAL LETTER O WITH DIAERESIS'
);
insert
into
t1
values
(
0xD5
,
'LATIN CAPITAL LETTER O WITH DOUBLE ACUTE'
);
insert
into
t1
values
(
0x75
,
'LATIN _SMALL_ LETTER U'
);
insert
into
t1
values
(
0xFA
,
'LATIN _SMALL_ LETTER U WITH ACUTE'
);
insert
into
t1
values
(
0xF9
,
'LATIN _SMALL_ LETTER U WITH RING ABOVE'
);
insert
into
t1
values
(
0xFC
,
'LATIN _SMALL_ LETTER U WITH DIAERESIS'
);
insert
into
t1
values
(
0xFB
,
'LATIN _SMALL_ LETTER U WITH DOUBLE ACUTE'
);
# Testing order by Field_varchar
select
ch
,
hex
(
weight_string
(
ch
level
1
))
l1
,
hex
(
weight_string
(
ch
level
2
))
l2
,
hex
(
weight_string
(
ch
level
3
))
l3
,
hex
(
weight_string
(
ch
level
4
))
l4
,
name
from
t1
order
by
ch
;
alter
table
t1
modify
ch
char
(
1
),
modify
name
char
(
64
);
# Testing order by Field_char
select
ch
,
hex
(
weight_string
(
ch
level
1
))
l1
,
hex
(
weight_string
(
ch
level
2
))
l2
,
hex
(
weight_string
(
ch
level
3
))
l3
,
hex
(
weight_string
(
ch
level
4
))
l4
,
name
from
t1
order
by
ch
;
# Testing order by Item
select
ch
,
hex
(
weight_string
(
ch
level
1
))
l1
,
hex
(
weight_string
(
ch
level
2
))
l2
,
hex
(
weight_string
(
ch
level
3
))
l3
,
hex
(
weight_string
(
ch
level
4
))
l4
,
name
from
t1
order
by
concat
(
ch
);
drop
table
t1
;
#
# Bug #30462 Character sets: search failures with case sensitive collations
#
SET
collation_connection
=
latin2_czech_cs
;
CREATE
TABLE
t1
ENGINE
=
MYISAM
AS
SELECT
repeat
(
'a'
,
5
)
AS
s1
LIMIT
0
;
INSERT
INTO
t1
VALUES
(
'x'
),(
'y'
),(
'z'
),(
'X'
),(
'Y'
),(
'Z'
);
SELECT
*
FROM
t1
GROUP
BY
s1
;
SELECT
*
FROM
t1
ORDER
BY
s1
;
CREATE
INDEX
i1
ON
t1
(
s1
);
SELECT
*
FROM
t1
GROUP
BY
s1
;
SELECT
*
FROM
t1
ORDER
BY
s1
;
DROP
TABLE
t1
;
--
disable_warnings
CREATE
TABLE
t1
ENGINE
=
INNODB
AS
SELECT
repeat
(
'a'
,
5
)
AS
s1
LIMIT
0
;
--
enable_warnings
INSERT
INTO
t1
VALUES
(
'x'
),(
'y'
),(
'z'
),(
'X'
),(
'Y'
),(
'Z'
);
SELECT
*
FROM
t1
GROUP
BY
s1
;
SELECT
*
FROM
t1
ORDER
BY
s1
;
CREATE
INDEX
i1
ON
t1
(
s1
);
SELECT
*
FROM
t1
GROUP
BY
s1
;
SELECT
*
FROM
t1
ORDER
BY
s1
;
DROP
TABLE
t1
;
--
disable_warnings
SET
sql_mode
=
''
;
CREATE
TABLE
t1
ENGINE
=
FALCON
AS
SELECT
repeat
(
'a'
,
5
)
AS
s1
LIMIT
0
;
SET
sql_mode
=
DEFAULT
;
--
enable_warnings
INSERT
INTO
t1
VALUES
(
'x'
),(
'y'
),(
'z'
),(
'X'
),(
'Y'
),(
'Z'
);
SELECT
*
FROM
t1
GROUP
BY
s1
;
SELECT
*
FROM
t1
ORDER
BY
s1
;
CREATE
INDEX
i1
ON
t1
(
s1
);
SELECT
*
FROM
t1
GROUP
BY
s1
;
SELECT
*
FROM
t1
ORDER
BY
s1
;
DROP
TABLE
t1
;
--
disable_warnings
SET
sql_mode
=
''
;
CREATE
TABLE
t1
ENGINE
=
MARIA
AS
SELECT
repeat
(
'a'
,
5
)
AS
s1
LIMIT
0
;
SET
sql_mode
=
DEFAULT
;
--
enable_warnings
INSERT
INTO
t1
VALUES
(
'x'
),(
'y'
),(
'z'
),(
'X'
),(
'Y'
),(
'Z'
);
SELECT
*
FROM
t1
GROUP
BY
s1
;
SELECT
*
FROM
t1
ORDER
BY
s1
;
CREATE
INDEX
i1
ON
t1
(
s1
);
SELECT
*
FROM
t1
GROUP
BY
s1
;
SELECT
*
FROM
t1
ORDER
BY
s1
;
DROP
TABLE
t1
;
SET
NAMES
latin2
;
#
# Bug#37854 Test fails/aborts for collate latin2_czech_cs used with SET and ENUM datatypes
#
CREATE
TABLE
t2
(
colours
SET
(
'red'
,
'blue'
,
'yellow'
))
CHARACTER
SET
latin2
COLLATE
latin2_czech_cs
;
CREATE
TABLE
t1
(
continent
ENUM
(
'Asia'
,
'Europe'
,
'Africa'
,
'Antartica'
))
CHARACTER
SET
latin2
COLLATE
latin2_czech_cs
;
INSERT
INTO
t1
VALUES
(
'Asia'
);
INSERT
INTO
t2
VALUES
(
'blue'
);
SELECT
*
FROM
t1
;
SELECT
*
FROM
t2
;
DROP
TABLE
t1
,
t2
;
#
# Bug#40805 Cannot restore table
#
CREATE
TABLE
`t1`
(
`ID`
smallint
(
5
)
unsigned
zerofill
NOT
NULL
AUTO_INCREMENT
,
`Post`
enum
(
''
,
'B'
,
'O'
,
'Z'
,
'U'
)
COLLATE
latin2_czech_cs
DEFAULT
NULL
,
PRIMARY
KEY
(
`ID`
)
)
ENGINE
=
MyISAM
AUTO_INCREMENT
=
135
DEFAULT
CHARSET
=
latin2
;
SHOW
CREATE
TABLE
t1
;
INSERT
INTO
t1
(
ID
,
Post
)
VALUES
(
00041
,
''
);
SELECT
ID
,
Post
,
HEX
(
WEIGHT_STRING
(
Post
))
FROM
t1
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# Start of 5.6 tests
...
...
@@ -62,3 +239,4 @@ set names latin2 collate latin2_czech_cs;
--
echo
#
--
echo
# End of 5.6 tests
--
echo
#
mysql-test/t/ctype_like_range.test
View file @
9290a580
...
...
@@ -2,6 +2,7 @@
--
source
include
/
have_ucs2
.
inc
--
source
include
/
have_utf16
.
inc
--
source
include
/
have_utf32
.
inc
--
source
include
/
have_utf8mb4
.
inc
--
disable_warnings
DROP
TABLE
IF
EXISTS
t1
;
...
...
@@ -20,6 +21,7 @@ INSERT INTO t1 (a) VALUES ('aaa'),('ccc'),('cch');
INSERT
INTO
t1
(
a
)
VALUES
(
'aaa_'
),(
'ccc_'
),(
'cch_'
);
INSERT
INTO
t1
(
a
)
VALUES
(
'aaa%'
),(
'ccc%'
),(
'cch%'
);
INSERT
INTO
t1
(
a
)
VALUES
(
'aaaaaaaaaaaaaaaaaaaa'
);
INSERT
INTO
t1
(
a
)
VALUES
(
'caaaaaaaaaaaaaaaaaaa'
);
CREATE
VIEW
v1
AS
SELECT
id
,
'a'
AS
name
,
a
AS
val
FROM
t1
...
...
@@ -44,9 +46,27 @@ SELECT * FROM v1;
ALTER
TABLE
t1
MODIFY
a
VARCHAR
(
32
)
CHARACTER
SET
utf8
COLLATE
utf8_czech_ci
;
SELECT
*
FROM
v1
;
# Note, 16 bytes is enough for 16/3= 5 characters
# For the 'aaaaaaaa' value contraction breaks apart
# For the 'caaaaaaa' value contraction does not break apart
ALTER
TABLE
t1
MODIFY
a
VARCHAR
(
32
)
CHARACTER
SET
utf8
COLLATE
utf8_danish_ci
;
SELECT
*
FROM
v1
;
ALTER
TABLE
t1
MODIFY
a
VARCHAR
(
32
)
CHARACTER
SET
utf8mb4
;
SELECT
*
FROM
v1
;
ALTER
TABLE
t1
MODIFY
a
VARCHAR
(
32
)
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_unicode_ci
;
SELECT
*
FROM
v1
;
ALTER
TABLE
t1
MODIFY
a
VARCHAR
(
32
)
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_czech_ci
;
SELECT
*
FROM
v1
;
# Note, 16 bytes is enough for 16/4= 4 characters
# For the 'aaaaaaaa' value contraction does not break apart
# For the 'caaaaaaa' value contraction breaks apart
ALTER
TABLE
t1
MODIFY
a
VARCHAR
(
32
)
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_danish_ci
;
SELECT
*
FROM
v1
;
ALTER
TABLE
t1
MODIFY
a
VARCHAR
(
32
)
CHARACTER
SET
ucs2
;
SELECT
*
FROM
v1
;
...
...
@@ -68,6 +88,9 @@ SELECT * FROM v1;
ALTER
TABLE
t1
MODIFY
a
VARCHAR
(
32
)
CHARACTER
SET
utf16
COLLATE
utf16_czech_ci
;
SELECT
*
FROM
v1
;
# Note, 16 bytes is enough for 16/3= 5 characters
# For the 'aaaaaaaa' value contraction does not break apart
# For the 'caaaaaaa' value contraction breaks apart
ALTER
TABLE
t1
MODIFY
a
VARCHAR
(
32
)
CHARACTER
SET
utf16
COLLATE
utf16_danish_ci
;
SELECT
*
FROM
v1
;
...
...
mysql-test/t/ctype_many.test
View file @
9290a580
...
...
@@ -319,3 +319,15 @@ DROP TABLE t2;
--
echo
#
--
echo
# End of 5.5 tests
--
echo
#
--
echo
#
--
echo
# Bug#11766143 59185: ASSERTION FAILED: (FIXED == 1), FILE
--
echo
# ITEM_STRFUNC.CC, LINE 2760
--
echo
#
CREATE
TABLE
t1
(
a
CHAR
(
1
)
CHARSET
UTF8
);
INSERT
INTO
t1
VALUES
(
'a'
),
(
'b'
);
CREATE
TABLE
t2
(
a
BINARY
(
1
));
--
error
ER_SUBQUERY_NO_1_ROW
SELECT
*
FROM
t2
WHERE
a
=
(
SELECT
a
FROM
t1
)
AND
a
=
_LATIN1
'x'
;
DROP
TABLE
t2
;
DROP
TABLE
t1
;
mysql-test/t/ctype_tis620.test
View file @
9290a580
...
...
@@ -156,6 +156,7 @@ DROP TABLE t1;
SET
collation_connection
=
'tis620_thai_ci'
;
--
source
include
/
ctype_filesort
.
inc
--
source
include
/
ctype_like_escape
.
inc
--
source
include
/
ctype_ascii_order
.
inc
SET
collation_connection
=
'tis620_bin'
;
--
source
include
/
ctype_filesort
.
inc
--
source
include
/
ctype_like_escape
.
inc
...
...
mysql-test/t/ctype_uca.test
View file @
9290a580
...
...
@@ -68,6 +68,28 @@ select group_concat(c1 order by c1) from t1 group by c1 collate utf8_hungarian_c
select
group_concat
(
c1
order
by
c1
)
from
t1
group
by
c1
collate
utf8_croatian_ci
;
select
group_concat
(
c1
order
by
c1
)
from
t1
group
by
c1
collate
utf8_german2_ci
;
ALTER
TABLE
t1
CONVERT
TO
CHARACTER
SET
ucs2
COLLATE
ucs2_bin
;
SELECT
GROUP_CONCAT
(
c1
ORDER
BY
c1
)
FROM
t1
GROUP
BY
c1
COLLATE
ucs2_unicode_ci
;
SELECT
GROUP_CONCAT
(
c1
ORDER
BY
c1
)
FROM
t1
GROUP
BY
c1
COLLATE
ucs2_icelandic_ci
;
SELECT
GROUP_CONCAT
(
c1
ORDER
BY
c1
)
FROM
t1
GROUP
BY
c1
COLLATE
ucs2_latvian_ci
;
SELECT
GROUP_CONCAT
(
c1
ORDER
BY
c1
)
FROM
t1
GROUP
BY
c1
COLLATE
ucs2_romanian_ci
;
SELECT
GROUP_CONCAT
(
c1
ORDER
BY
c1
)
FROM
t1
GROUP
BY
c1
COLLATE
ucs2_slovenian_ci
;
SELECT
GROUP_CONCAT
(
c1
ORDER
BY
c1
)
FROM
t1
GROUP
BY
c1
COLLATE
ucs2_polish_ci
;
SELECT
GROUP_CONCAT
(
c1
ORDER
BY
c1
)
FROM
t1
GROUP
BY
c1
COLLATE
ucs2_estonian_ci
;
SELECT
GROUP_CONCAT
(
c1
ORDER
BY
c1
)
FROM
t1
GROUP
BY
c1
COLLATE
ucs2_spanish_ci
;
SELECT
GROUP_CONCAT
(
c1
ORDER
BY
c1
)
FROM
t1
GROUP
BY
c1
COLLATE
ucs2_swedish_ci
;
SELECT
GROUP_CONCAT
(
c1
ORDER
BY
c1
)
FROM
t1
GROUP
BY
c1
COLLATE
ucs2_turkish_ci
;
SELECT
GROUP_CONCAT
(
c1
ORDER
BY
c1
)
FROM
t1
GROUP
BY
c1
COLLATE
ucs2_czech_ci
;
SELECT
GROUP_CONCAT
(
c1
ORDER
BY
c1
)
FROM
t1
GROUP
BY
c1
COLLATE
ucs2_danish_ci
;
SELECT
GROUP_CONCAT
(
c1
ORDER
BY
c1
)
FROM
t1
GROUP
BY
c1
COLLATE
ucs2_lithuanian_ci
;
SELECT
GROUP_CONCAT
(
c1
ORDER
BY
c1
)
FROM
t1
GROUP
BY
c1
COLLATE
ucs2_slovak_ci
;
SELECT
GROUP_CONCAT
(
c1
ORDER
BY
c1
)
FROM
t1
GROUP
BY
c1
COLLATE
ucs2_spanish2_ci
;
SELECT
GROUP_CONCAT
(
c1
ORDER
BY
c1
)
FROM
t1
GROUP
BY
c1
COLLATE
ucs2_roman_ci
;
SELECT
GROUP_CONCAT
(
c1
ORDER
BY
c1
)
FROM
t1
GROUP
BY
c1
COLLATE
ucs2_esperanto_ci
;
SELECT
GROUP_CONCAT
(
c1
ORDER
BY
c1
)
FROM
t1
GROUP
BY
c1
COLLATE
ucs2_hungarian_ci
;
SELECT
GROUP_CONCAT
(
c1
ORDER
BY
c1
)
FROM
t1
GROUP
BY
c1
COLLATE
ucs2_croatian_ci
;
SELECT
GROUP_CONCAT
(
c1
ORDER
BY
c1
)
FROM
t1
GROUP
BY
c1
COLLATE
ucs2_german2_ci
;
drop
table
t1
;
#
...
...
@@ -297,6 +319,55 @@ INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06450647064506270646 USING utf8));
SELECT
HEX
(
CONVERT
(
col1
USING
ucs2
))
FROM
t1
ORDER
BY
col1
COLLATE
utf8_persian_ci
,
col1
COLLATE
utf8_bin
;
DROP
TABLE
t1
;
#
# Test all characters that appear in utf8_persia_ci tailoring
#
CREATE
TABLE
t1
(
a
VARCHAR
(
10
)
CHARACTER
SET
utf8
COLLATE
utf8_persian_ci
,
offs
INT
NOT
NULL
);
INSERT
INTO
t1
VALUES
(
_ucs2
0x066D
,
1
),(
_ucs2
0x064E
,
2
),(
_ucs2
0xFE76
,
3
),(
_ucs2
0xFE77
,
4
),
(
_ucs2
0x0650
,
5
),(
_ucs2
0xFE7A
,
6
),(
_ucs2
0xFE7B
,
7
),(
_ucs2
0x064F
,
8
),
(
_ucs2
0xFE78
,
9
),(
_ucs2
0xFE79
,
10
),(
_ucs2
0x064B
,
11
),(
_ucs2
0xFE70
,
12
),
(
_ucs2
0xFE71
,
13
),(
_ucs2
0x064D
,
14
),(
_ucs2
0xFE74
,
15
),(
_ucs2
0x064C
,
16
),
(
_ucs2
0xFE72
,
17
),
(
_ucs2
0xFE7F
,
1
),(
_ucs2
0x0653
,
2
),(
_ucs2
0x0654
,
3
),(
_ucs2
0x0655
,
4
),
(
_ucs2
0x0670
,
5
),
(
_ucs2
0x0669
,
1
),(
_ucs2
0x0622
,
2
),(
_ucs2
0x0627
,
3
),(
_ucs2
0x0671
,
4
),
(
_ucs2
0x0621
,
5
),(
_ucs2
0x0623
,
6
),(
_ucs2
0x0625
,
7
),(
_ucs2
0x0624
,
8
),
(
_ucs2
0x0626
,
9
),
(
_ucs2
0x0642
,
1
),(
_ucs2
0x06A9
,
2
),(
_ucs2
0x0643
,
3
),
(
_ucs2
0x0648
,
1
),(
_ucs2
0x0647
,
2
),(
_ucs2
0x0629
,
3
),(
_ucs2
0x06C0
,
4
),
(
_ucs2
0x06CC
,
5
),(
_ucs2
0x0649
,
6
),(
_ucs2
0x064A
,
7
),
(
_ucs2
0xFE80
,
1
),(
_ucs2
0xFE81
,
2
),(
_ucs2
0xFE82
,
3
),(
_ucs2
0xFE8D
,
4
),
(
_ucs2
0xFE8E
,
5
),(
_ucs2
0xFB50
,
6
),(
_ucs2
0xFB51
,
7
),(
_ucs2
0xFE80
,
8
),
(
_ucs2
0xFE83
,
9
),(
_ucs2
0xFE84
,
10
),(
_ucs2
0xFE87
,
11
),(
_ucs2
0xFE88
,
12
),
(
_ucs2
0xFE85
,
13
),(
_ucs2
0xFE86
,
14
),(
_ucs2
0x0689
,
16
),(
_ucs2
0x068A
,
17
),
(
_ucs2
0xFEAE
,
1
),(
_ucs2
0xFDFC
,
2
),
(
_ucs2
0xFED8
,
1
),(
_ucs2
0xFB8E
,
2
),(
_ucs2
0xFB8F
,
3
),(
_ucs2
0xFB90
,
4
),
(
_ucs2
0xFB91
,
5
),(
_ucs2
0xFED9
,
6
),(
_ucs2
0xFEDA
,
7
),(
_ucs2
0xFEDB
,
8
),
(
_ucs2
0xFEDC
,
9
),
(
_ucs2
0xFEEE
,
1
),(
_ucs2
0xFEE9
,
2
),(
_ucs2
0xFEEA
,
3
),(
_ucs2
0xFEEB
,
4
),
(
_ucs2
0xFEEC
,
5
),(
_ucs2
0xFE93
,
6
),(
_ucs2
0xFE94
,
7
),(
_ucs2
0xFBA4
,
8
),
(
_ucs2
0xFBA5
,
9
),(
_ucs2
0xFBFC
,
10
),(
_ucs2
0xFBFD
,
11
),(
_ucs2
0xFBFE
,
12
),
(
_ucs2
0xFBFF
,
13
),(
_ucs2
0xFEEF
,
14
),(
_ucs2
0xFEF0
,
15
),(
_ucs2
0xFEF1
,
16
),
(
_ucs2
0xFEF2
,
17
),(
_ucs2
0xFEF3
,
18
),(
_ucs2
0xFEF4
,
19
),(
_ucs2
0xFEF5
,
20
),
(
_ucs2
0xFEF6
,
21
),(
_ucs2
0xFEF7
,
22
),(
_ucs2
0xFEF8
,
23
),(
_ucs2
0xFEF9
,
24
),
(
_ucs2
0xFEFA
,
25
),(
_ucs2
0xFEFB
,
26
),(
_ucs2
0xFEFC
,
27
);
SELECT
HEX
(
CONVERT
(
a
USING
ucs2
)),
offs
,
hex
(
weight_string
(
a
)),
a
FROM
t1
ORDER
BY
a
,
offs
,
BINARY
a
;
DROP
TABLE
t1
;
SET
@
test_character_set
=
'utf8'
;
SET
@
test_collation
=
'utf8_swedish_ci'
;
--
source
include
/
ctype_common
.
inc
...
...
@@ -399,6 +470,7 @@ set collation_connection=ucs2_unicode_ci;
set
names
utf8
;
--
echo
End
for
5.0
tests
--
echo
End
of
5.1
tests
--
echo
#
--
echo
# Start of 5.5 tests
...
...
@@ -433,6 +505,7 @@ drop table t1;
--
echo
# End of 5.5 tests
--
echo
#
--
echo
#
--
echo
# Start of 5.6 tests
--
echo
#
...
...
mysql-test/t/ctype_ucs.test
View file @
9290a580
...
...
@@ -116,49 +116,7 @@ drop table t2;
SET
NAMES
koi8r
;
SET
character_set_connection
=
ucs2
;
create
table
t1
(
a
varchar
(
10
)
character
set
ucs2
,
key
(
a
));
insert
into
t1
values
(
"a"
),(
"abc"
),(
"abcd"
),(
"hello"
),(
"test"
);
explain
select
*
from
t1
where
a
like
'abc%'
;
explain
select
*
from
t1
where
a
like
concat
(
'abc'
,
'%'
);
select
*
from
t1
where
a
like
"abc%"
;
select
*
from
t1
where
a
like
concat
(
"abc"
,
"%"
);
select
*
from
t1
where
a
like
"ABC%"
;
select
*
from
t1
where
a
like
"test%"
;
select
*
from
t1
where
a
like
"te_t"
;
select
*
from
t1
where
a
like
"%a%"
;
select
*
from
t1
where
a
like
"%abcd%"
;
select
*
from
t1
where
a
like
"%abc\d%"
;
drop
table
t1
;
#
# More LIKE test: bug#2619
#
select
'AA'
like
'AA'
;
select
'AA'
like
'A%A'
;
select
'AA'
like
'A%%A'
;
select
'AA'
like
'AA%'
;
select
'AA'
like
'%AA%'
;
select
'AA'
like
'%A'
;
select
'AA'
like
'%AA'
;
select
'AA'
like
'A%A%'
;
select
'AA'
like
'_%_%'
;
select
'AA'
like
'%A%A'
;
select
'AAA'
like
'A%A%A'
;
select
'AZ'
like
'AZ'
;
select
'AZ'
like
'A%Z'
;
select
'AZ'
like
'A%%Z'
;
select
'AZ'
like
'AZ%'
;
select
'AZ'
like
'%AZ%'
;
select
'AZ'
like
'%Z'
;
select
'AZ'
like
'%AZ'
;
select
'AZ'
like
'A%Z%'
;
select
'AZ'
like
'_%_%'
;
select
'AZ'
like
'%A%Z'
;
select
'AZ'
like
'A_'
;
select
'AZ'
like
'_Z'
;
select
'AMZ'
like
'A%M%Z'
;
--
source
include
/
ctype_like
.
inc
CREATE
TABLE
t1
(
a
VARCHAR
(
10
)
CHARACTER
SET
ucs2
);
INSERT
INTO
t1
VALUES
(
''
),(
''
),(
''
),(
''
),(
''
),(
''
);
...
...
@@ -859,6 +817,36 @@ set collation_connection=ucs2_bin;
--
source
include
/
weight_string_euro
.
inc
--
source
include
/
weight_string_l1
.
inc
--
echo
#
--
echo
# Bug #36418 Character sets: crash if char(256 using utf32)
--
echo
#
select
hex
(
char
(
0x01
using
ucs2
));
select
hex
(
char
(
0x0102
using
ucs2
));
select
hex
(
char
(
0x010203
using
ucs2
));
select
hex
(
char
(
0x01020304
using
ucs2
));
--
echo
#
--
echo
# Bug#10094 Displays wrong error message for UNIQUE key index on CHAR(255) Unicode datatype
--
echo
#
CREATE
TABLE
t1
(
f1
CHAR
(
255
)
unicode
);
INSERT
INTO
t1
values
(
'abc'
),(
'bcd'
),(
'abc'
);
--
error
ER_DUP_ENTRY
ALTER
TABLE
t1
ADD
UNIQUE
Index_1
(
f1
);
DROP
TABLE
t1
;
--
echo
#
--
echo
# Test how character set works with date/time
--
echo
#
SET
collation_connection
=
ucs2_general_ci
;
--
source
include
/
ctype_datetime
.
inc
SET
NAMES
latin1
;
--
echo
#
--
echo
# WL#4013 Unicode german2 collation
--
echo
#
SET
collation_connection
=
ucs2_german2_ci
;
--
source
include
/
ctype_german
.
inc
--
echo
#
--
echo
# Bug#59145 valgrind warnings for uninitialized values in my_strtoll10_mb2
--
echo
#
...
...
@@ -867,6 +855,21 @@ SELECT CONVERT(CHAR(NULL USING ucs2), UNSIGNED);
DO
IFNULL
(
CHAR
(
NULL
USING
ucs2
),
''
);
DO
CAST
(
CONVERT
(
''
USING
ucs2
)
AS
UNSIGNED
);
--
echo
#
--
echo
# Test error message for conversion using different charset
--
echo
#
CREATE
TABLE
t1
(
a
DECIMAL
(
2
,
0
));
SET
sql_mode
=
'strict_all_tables'
;
--
error
ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
INSERT
INTO
t1
VALUES
(
CONVERT
(
'9e99999999'
USING
ucs2
));
SET
sql_mode
=
DEFAULT
;
INSERT
INTO
t1
VALUES
(
CONVERT
(
'aaa'
USING
ucs2
));
DROP
TABLE
t1
;
--
echo
#
--
echo
# End of 5.6 tests
--
echo
#
mysql-test/t/ctype_ujis.test
View file @
9290a580
...
...
@@ -1220,6 +1220,7 @@ set names default;
set
character_set_database
=
default
;
set
character_set_server
=
default
;
--
echo
End
of
5.1
tests
--
echo
#
--
echo
# Start of 5.5 tests
...
...
mysql-test/t/ctype_utf16_uca.test
View file @
9290a580
...
...
@@ -52,6 +52,7 @@ select group_concat(c1 order by binary c1 separator '') from t1 group by c1 coll
select
group_concat
(
c1
order
by
binary
c1
separator
''
)
from
t1
group
by
c1
collate
utf16_roman_ci
;
select
group_concat
(
c1
order
by
binary
c1
separator
''
)
from
t1
group
by
c1
collate
utf16_esperanto_ci
;
select
group_concat
(
c1
order
by
binary
c1
separator
''
)
from
t1
group
by
c1
collate
utf16_hungarian_ci
;
select
group_concat
(
c1
order
by
binary
c1
separator
''
)
from
t1
group
by
c1
collate
utf16_croatian_ci
;
select
group_concat
(
c1
order
by
binary
c1
separator
''
)
from
t1
group
by
c1
collate
utf16_german2_ci
;
drop
table
t1
;
...
...
mysql-test/t/ctype_utf32_uca.test
View file @
9290a580
...
...
@@ -53,6 +53,7 @@ select group_concat(c1 order by binary c1 separator '') from t1 group by c1 coll
select
group_concat
(
c1
order
by
binary
c1
separator
''
)
from
t1
group
by
c1
collate
utf32_roman_ci
;
select
group_concat
(
c1
order
by
binary
c1
separator
''
)
from
t1
group
by
c1
collate
utf32_esperanto_ci
;
select
group_concat
(
c1
order
by
binary
c1
separator
''
)
from
t1
group
by
c1
collate
utf32_hungarian_ci
;
select
group_concat
(
c1
order
by
binary
c1
separator
''
)
from
t1
group
by
c1
collate
utf32_croatian_ci
;
select
group_concat
(
c1
order
by
binary
c1
separator
''
)
from
t1
group
by
c1
collate
utf32_german2_ci
;
drop
table
t1
;
...
...
mysql-test/t/ctype_utf8.test
View file @
9290a580
...
...
@@ -1153,6 +1153,11 @@ DROP TABLE t1;
create
table
t1
(
a
char
(
200
)
collate
utf8_unicode_ci
NOT
NULL
default
''
)
default
charset
=
utf8
collate
=
utf8_unicode_ci
;
insert
into
t1
values
(
unhex
(
'65'
)),
(
unhex
(
'C3A9'
)),
(
unhex
(
'65'
));
--
disable_query_log
--
disable_result_log
analyze
table
t1
;
--
enable_result_log
--
enable_query_log
explain
select
distinct
a
from
t1
;
select
distinct
a
from
t1
;
explain
select
a
from
t1
group
by
a
;
...
...
@@ -1165,11 +1170,41 @@ drop table t1;
create
table
t1
(
a
char
(
10
))
default
charset
utf8
;
insert
into
t1
values
(
'123'
),
(
'456'
);
--
disable_query_log
--
disable_result_log
analyze
table
t1
;
--
enable_result_log
--
enable_query_log
explain
select
substr
(
Z
.
a
,
-
1
),
Z
.
a
from
t1
as
Y
join
t1
as
Z
on
Y
.
a
=
Z
.
a
order
by
1
;
select
substr
(
Z
.
a
,
-
1
),
Z
.
a
from
t1
as
Y
join
t1
as
Z
on
Y
.
a
=
Z
.
a
order
by
1
;
drop
table
t1
;
#
# Bug #34349: Passing invalid parameter to CHAR() in an ORDER BY causes
# MySQL to hang
#
SET
CHARACTER
SET
utf8
;
SHOW
VARIABLES
LIKE
'character\_set\_%'
;
CREATE
DATABASE
crashtest
DEFAULT
CHARACTER
SET
utf8
COLLATE
utf8_bin
;
USE
crashtest
;
CREATE
TABLE
crashtest
(
crash
char
(
10
))
DEFAULT
CHARSET
=
utf8
;
INSERT
INTO
crashtest
VALUES
(
'35'
),
(
'36'
),
(
'37'
);
SELECT
*
FROM
crashtest
ORDER
BY
CHAR
(
crash
USING
utf8
);
INSERT
INTO
crashtest
VALUES
(
'-1000'
);
--
disable_query_log
--
disable_result_log
ANALYZE
TABLE
crashtest
;
--
enable_result_log
--
enable_query_log
EXPLAIN
SELECT
*
FROM
crashtest
ORDER
BY
CHAR
(
crash
USING
utf8
);
SELECT
*
FROM
crashtest
ORDER
BY
CHAR
(
crash
USING
utf8
);
DROP
TABLE
crashtest
;
DROP
DATABASE
crashtest
;
USE
test
;
SET
CHARACTER
SET
default
;
# End of 4.1 tests
#
...
...
sql/field.cc
View file @
9290a580
...
...
@@ -2816,7 +2816,7 @@ int Field_new_decimal::store(const char *from, uint length,
&
decimal_value
))
&&
thd
->
abort_on_warning
)
{
ErrConvString
errmsg
(
from
,
length
,
&
my_charset_bin
);
ErrConvString
errmsg
(
from
,
length
,
charset_arg
);
push_warning_printf
(
thd
,
Sql_condition
::
WARN_LEVEL_WARN
,
ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
,
ER
(
ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
),
...
...
@@ -2836,7 +2836,7 @@ int Field_new_decimal::store(const char *from, uint length,
break
;
case
E_DEC_BAD_NUM
:
{
ErrConvString
errmsg
(
from
,
length
,
&
my_charset_bin
);
ErrConvString
errmsg
(
from
,
length
,
charset_arg
);
push_warning_printf
(
thd
,
Sql_condition
::
WARN_LEVEL_WARN
,
ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
,
ER
(
ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment