diff options
author | unknown <bar@bar.mysql.r18.ru> | 2003-05-28 17:57:58 +0500 |
---|---|---|
committer | unknown <bar@bar.mysql.r18.ru> | 2003-05-28 17:57:58 +0500 |
commit | 5f9d3e4276913351a9a8485654657d23b8aa7b6d (patch) | |
tree | d90c589c4aa4758f8cd2ece67315b1f98e924f3e /sql/item_create.cc | |
parent | 9166602342853af34ee7f38ae638692e4fcdd46e (diff) | |
download | mariadb-git-5f9d3e4276913351a9a8485654657d23b8aa7b6d.tar.gz |
CAST(expr AS char) now supports character set with conversion:
SELECT CAST(_latin1'string' AS CHAR CHARACTER SET latin2)
Diffstat (limited to 'sql/item_create.cc')
-rw-r--r-- | sql/item_create.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sql/item_create.cc b/sql/item_create.cc index 39e1c2dec22..723610c0df4 100644 --- a/sql/item_create.cc +++ b/sql/item_create.cc @@ -457,13 +457,16 @@ Item *create_load_file(Item* a) } -Item *create_func_cast(Item *a, Item_cast cast_type) +Item *create_func_cast(Item *a, Item_cast cast_type, CHARSET_INFO *cs) { Item *res; LINT_INIT(res); switch (cast_type) { case ITEM_CAST_BINARY: res= new Item_func_binary(a); break; - case ITEM_CAST_CHAR: res= new Item_char_typecast(a); break; + case ITEM_CAST_CHAR: + res= (cs == NULL) ? new Item_char_typecast(a) : + new Item_func_conv_charset(a,cs); + break; case ITEM_CAST_SIGNED_INT: res= new Item_func_signed(a); break; case ITEM_CAST_UNSIGNED_INT: res= new Item_func_unsigned(a); break; case ITEM_CAST_DATE: res= new Item_date_typecast(a); break; |