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

CAST(expr AS char) now supports character set with conversion:

SELECT CAST(_latin1'string' AS CHAR CHARACTER SET latin2)
This commit is contained in:
unknown
2003-05-28 17:57:58 +05:00
parent 9166602342
commit 5f9d3e4276
5 changed files with 41 additions and 14 deletions

View File

@ -28,6 +28,19 @@ cast("2001-1-1" as DATE) cast("2001-1-1" as DATETIME)
select cast("1:2:3" as TIME);
cast("1:2:3" as TIME)
01:02:03
select cast(_latin1'test' as char character set latin2);
cast(_latin1'test' as char character set latin2)
test
select cast(_koi8r'<27><><EFBFBD><EFBFBD>' as char character set cp1251);
cast(_koi8r'<27><><EFBFBD><EFBFBD>' as char character set cp1251)
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
create table t1 select cast(_koi8r'<27><><EFBFBD><EFBFBD>' as char character set cp1251) as t;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`t` char(4) character set cp1251 NOT NULL default ''
) TYPE=MyISAM CHARSET=latin1
drop table t1;
select cast("2001-1-1" as date) = "2001-01-01";
cast("2001-1-1" as date) = "2001-01-01"
0