summaryrefslogtreecommitdiff
path: root/sql/item_create.cc
diff options
context:
space:
mode:
authorunknown <bar@bar.mysql.r18.ru>2003-08-21 14:15:25 +0500
committerunknown <bar@bar.mysql.r18.ru>2003-08-21 14:15:25 +0500
commit34e882dd79663c428199a76ba8fcfe6d704592af (patch)
treec97e84f2eab14aa455ae3c07b91e184b75d6cd28 /sql/item_create.cc
parent8359a2c7298f4c936ca2a0bde083d87d35538e1d (diff)
downloadmariadb-git-34e882dd79663c428199a76ba8fcfe6d704592af.tar.gz
CAST(expr AS CHAR(10)) is now working
Diffstat (limited to 'sql/item_create.cc')
-rw-r--r--sql/item_create.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/sql/item_create.cc b/sql/item_create.cc
index e18d1cfa189..e3e3c021a1e 100644
--- a/sql/item_create.cc
+++ b/sql/item_create.cc
@@ -470,21 +470,21 @@ Item *create_load_file(Item* a)
}
-Item *create_func_cast(Item *a, Cast_target cast_type, CHARSET_INFO *cs)
+Item *create_func_cast(Item *a, Cast_target cast_type, int len, 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= (cs == NULL) ? (Item*) new Item_char_typecast(a) :
- (Item*) 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;
case ITEM_CAST_TIME: res= new Item_time_typecast(a); break;
case ITEM_CAST_DATETIME: res= new Item_datetime_typecast(a); break;
+ case ITEM_CAST_CHAR:
+ res= new Item_char_typecast(a, len, cs ? cs :
+ current_thd->variables.collation_connection);
+ break;
}
return res;
}