1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

ctype_utf8.result, ctype_utf8.test:

New syntax: CHAR(x USING charset)
  Adding test case.
sql_yacc.yy:
  New syntax: CHAR(x USING charset)
  Adding new parser rule.
item_strfunc.h:
  New syntax: CHAR(x USING charset)
  Adding a new constructor.


sql/item_strfunc.h:
  New syntax: CHAR(x USING charset)
  Adding a new constructor.
sql/sql_yacc.yy:
  New syntax: CHAR(x USING charset)
  Adding new parser rule.
mysql-test/t/ctype_utf8.test:
  New syntax: CHAR(x USING charset)
  Adding test case.
mysql-test/r/ctype_utf8.result:
  New syntax: CHAR(x USING charset)
  Adding test case.
This commit is contained in:
unknown
2005-10-13 19:24:47 +05:00
parent 8d9c66a53c
commit 221039515b
4 changed files with 71 additions and 46 deletions

View File

@ -1064,46 +1064,56 @@ xxx
yyy
DROP TABLE t1;
set names utf8;
select hex(char(1));
hex(char(1))
select hex(char(1 using utf8));
hex(char(1 using utf8))
01
select char(0xd1,0x8f);
char(0xd1,0x8f)
select char(0xd1,0x8f using utf8);
char(0xd1,0x8f using utf8)
я
select char(0xd18f);
char(0xd18f)
select char(0xd18f using utf8);
char(0xd18f using utf8)
я
select char(53647);
char(53647)
select char(53647 using utf8);
char(53647 using utf8)
я
select char(0xff,0x8f);
char(0xff,0x8f)
select char(0xff,0x8f using utf8);
char(0xff,0x8f using utf8)
<EFBFBD><EFBFBD>
Warnings:
Warning 1300 Invalid utf8 character string: 'FF8F'
set sql_mode=traditional;
select char(0xff,0x8f);
char(0xff,0x8f)
<EFBFBD><EFBFBD>
select convert(char(0xff,0x8f) using utf8);
convert(char(0xff,0x8f) using utf8)
<EFBFBD><EFBFBD>
select char(195);
char(195)
<EFBFBD>
select convert(char(195) using utf8);
convert(char(195) using utf8)
<EFBFBD>
select char(196);
char(196)
<EFBFBD>
select convert(char(196) using utf8);
convert(char(196) using utf8)
<EFBFBD>
select char(0xff,0x8f using utf8);
char(0xff,0x8f using utf8)
NULL
Warnings:
Error 1300 Invalid utf8 character string: 'FF8F'
select char(195 using utf8);
char(195 using utf8)
NULL
Warnings:
Error 1300 Invalid utf8 character string: 'C3'
select char(196 using utf8);
char(196 using utf8)
NULL
Warnings:
Error 1300 Invalid utf8 character string: 'C4'
select char(2557 using utf8);
char(2557 using utf8)
NULL
Warnings:
Error 1300 Invalid utf8 character string: 'FD'
select hex(convert(char(2557 using latin1) using utf8));
hex(convert(char(2557 using latin1) using utf8))
09C3BD
select hex(char(195));
hex(char(195))
C3
select hex(char(196));
hex(char(196))
C4
select hex(char(2557));
hex(char(2557))
09FD
select hex(convert(char(2557) using utf8));
hex(convert(char(2557) using utf8))
09FD
set names utf8;
create table t1 (a char(1)) default character set utf8;
create table t2 (a char(1)) default character set utf8;

View File

@ -871,22 +871,32 @@ DROP TABLE t1;
#
set names utf8;
# correct value
select hex(char(1));
select char(0xd1,0x8f);
select char(0xd18f);
select char(53647);
select hex(char(1 using utf8));
select char(0xd1,0x8f using utf8);
select char(0xd18f using utf8);
select char(53647 using utf8);
# incorrect value: return with warning
select char(0xff,0x8f);
select char(0xff,0x8f using utf8);
# incorrect value in strict mode: return NULL with "Error" level warning
set sql_mode=traditional;
select char(0xff,0x8f);
select convert(char(0xff,0x8f) using utf8);
select char(195);
select convert(char(195) using utf8);
select char(196);
select convert(char(196) using utf8);
select char(0xff,0x8f using utf8);
select char(195 using utf8);
select char(196 using utf8);
select char(2557 using utf8);
#
# Check convert + char + using
#
select hex(convert(char(2557 using latin1) using utf8));
#
# char() without USING returns "binary" by default, any argument is ok
#
select hex(char(195));
select hex(char(196));
select hex(char(2557));
select hex(convert(char(2557) using utf8));
#
# Bug#12891: UNION doesn't return DISTINCT result for multi-byte characters