2091
2093
case ITEM_CAST_BINARY:
2092
2094
res= new (session->mem_root) Item_func_binary(a);
2097
case ITEM_CAST_TIME:
2098
res= new (session->mem_root) function::cast::Time(a);
2094
2101
case ITEM_CAST_DATE:
2095
2102
res= new (session->mem_root) Item_date_typecast(a);
2097
2105
case ITEM_CAST_DATETIME:
2098
2106
res= new (session->mem_root) Item_datetime_typecast(a);
2100
2109
case ITEM_CAST_DECIMAL:
2102
len= c_len ? atoi(c_len) : 0;
2103
dec= c_dec ? atoi(c_dec) : 0;
2104
my_decimal_trim(&len, &dec);
2107
my_error(ER_M_BIGGER_THAN_D, MYF(0), "");
2110
if (len > DECIMAL_MAX_PRECISION)
2112
my_error(ER_TOO_BIG_PRECISION, MYF(0), len, a->name,
2113
DECIMAL_MAX_PRECISION);
2116
if (dec > DECIMAL_MAX_SCALE)
2118
my_error(ER_TOO_BIG_SCALE, MYF(0), dec, a->name,
2122
res= new (session->mem_root) Item_decimal_typecast(a, len, dec);
2111
len= c_len ? atoi(c_len) : 0;
2112
dec= c_dec ? atoi(c_dec) : 0;
2113
my_decimal_trim(&len, &dec);
2116
my_error(ER_M_BIGGER_THAN_D, MYF(0), "");
2119
if (len > DECIMAL_MAX_PRECISION)
2121
my_error(ER_TOO_BIG_PRECISION, MYF(0), len, a->name,
2122
DECIMAL_MAX_PRECISION);
2125
if (dec > DECIMAL_MAX_SCALE)
2127
my_error(ER_TOO_BIG_SCALE, MYF(0), dec, a->name,
2131
res= new (session->mem_root) Item_decimal_typecast(a, len, dec);
2125
2134
case ITEM_CAST_CHAR:
2127
len= c_len ? atoi(c_len) : -1;
2128
res= create_func_char_cast(session, a, len, cs);
2136
len= c_len ? atoi(c_len) : -1;
2137
res= create_func_char_cast(session, a, len, cs);