CAST(expr AS CHAR(10)) is now working

This commit is contained in:
unknown 2003-08-21 14:15:25 +05:00
commit 34e882dd79
7 changed files with 192 additions and 25 deletions

View file

@ -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;
}