Commit acf5ba7d authored by bar@bar.mysql.r18.ru's avatar bar@bar.mysql.r18.ru

New test for UTF8 functionality

parent 1c5b5ee0
set names utf8;
select left(_utf8 0xD0B0D0B1D0B2,1);
left(_utf8 0xD0B0D0B1D0B2,1)
а
select right(_utf8 0xD0B0D0B2D0B2,1);
right(_utf8 0xD0B0D0B2D0B2,1)
в
select locate('he','hello');
locate('he','hello')
1
select locate('he','hello',2);
locate('he','hello',2)
0
select locate('lo','hello',2);
locate('lo','hello',2)
4
select locate('HE','hello');
locate('HE','hello')
1
select locate('HE','hello',2);
locate('HE','hello',2)
0
select locate('LO','hello',2);
locate('LO','hello',2)
4
select locate('HE','hello' collate utf8_bin);
locate('HE','hello' collate utf8_bin)
0
select locate('HE','hello' collate utf8_bin,2);
locate('HE','hello' collate utf8_bin,2)
0
select locate('LO','hello' collate utf8_bin,2);
locate('LO','hello' collate utf8_bin,2)
0
select locate(_utf8 0xD0B1, _utf8 0xD0B0D0B1D0B2);
locate(_utf8 0xD0B1, _utf8 0xD0B0D0B1D0B2)
2
select locate(_utf8 0xD091, _utf8 0xD0B0D0B1D0B2);
locate(_utf8 0xD091, _utf8 0xD0B0D0B1D0B2)
2
select locate(_utf8 0xD0B1, _utf8 0xD0B0D091D0B2);
locate(_utf8 0xD0B1, _utf8 0xD0B0D091D0B2)
2
select locate(_utf8 0xD091, _utf8 0xD0B0D0B1D0B2 collate utf8_bin);
locate(_utf8 0xD091, _utf8 0xD0B0D0B1D0B2 collate utf8_bin)
0
select locate(_utf8 0xD0B1, _utf8 0xD0B0D091D0B2 collate utf8_bin);
locate(_utf8 0xD0B1, _utf8 0xD0B0D091D0B2 collate utf8_bin)
0
select 'a' like 'a';
'a' like 'a'
1
select 'A' like 'a';
'A' like 'a'
1
select 'A' like 'a' collate utf8_bin;
'A' like 'a' collate utf8_bin
0
select _utf8 0xD0B0D0B1D0B2 like concat(_utf8'%',_utf8 0xD0B1,_utf8 '%');
_utf8 0xD0B0D0B1D0B2 like concat(_utf8'%',_utf8 0xD0B1,_utf8 '%')
1
#
# Tests with the utf8 character set
#
set names utf8;
select left(_utf8 0xD0B0D0B1D0B2,1);
select right(_utf8 0xD0B0D0B2D0B2,1);
select locate('he','hello');
select locate('he','hello',2);
select locate('lo','hello',2);
select locate('HE','hello');
select locate('HE','hello',2);
select locate('LO','hello',2);
select locate('HE','hello' collate utf8_bin);
select locate('HE','hello' collate utf8_bin,2);
select locate('LO','hello' collate utf8_bin,2);
select locate(_utf8 0xD0B1, _utf8 0xD0B0D0B1D0B2);
select locate(_utf8 0xD091, _utf8 0xD0B0D0B1D0B2);
select locate(_utf8 0xD0B1, _utf8 0xD0B0D091D0B2);
select locate(_utf8 0xD091, _utf8 0xD0B0D0B1D0B2 collate utf8_bin);
select locate(_utf8 0xD0B1, _utf8 0xD0B0D091D0B2 collate utf8_bin);
select 'a' like 'a';
select 'A' like 'a';
select 'A' like 'a' collate utf8_bin;
select _utf8 0xD0B0D0B1D0B2 like concat(_utf8'%',_utf8 0xD0B1,_utf8 '%');
#
# Fix this, it should return 1:
#
#select _utf8 0xD0B0D0B1D0B2 like concat(_utf8'%',_utf8 0xD091,_utf8 '%');
#
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment