1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Merge of mysql-5.1-bugteam into mysql-trunk-merge.

This commit is contained in:
Davi Arnaut
2010-07-02 16:38:04 -03:00
60 changed files with 260 additions and 365 deletions

View File

@ -5131,8 +5131,6 @@ create_func_cast(THD *thd, Item *a, Cast_target cast_type,
CHARSET_INFO *cs)
{
Item *UNINIT_VAR(res);
ulong len;
uint dec;
switch (cast_type) {
case ITEM_CAST_BINARY:
@ -5155,11 +5153,10 @@ create_func_cast(THD *thd, Item *a, Cast_target cast_type,
break;
case ITEM_CAST_DECIMAL:
{
if (c_len == NULL)
{
len= 0;
}
else
ulong len= 0;
uint dec= 0;
if (c_len)
{
ulong decoded_size;
errno= 0;
@ -5173,11 +5170,7 @@ create_func_cast(THD *thd, Item *a, Cast_target cast_type,
len= decoded_size;
}
if (c_dec == NULL)
{
dec= 0;
}
else
if (c_dec)
{
ulong decoded_size;
errno= 0;
@ -5213,12 +5206,9 @@ create_func_cast(THD *thd, Item *a, Cast_target cast_type,
}
case ITEM_CAST_CHAR:
{
int len= -1;
CHARSET_INFO *real_cs= (cs ? cs : thd->variables.collation_connection);
if (c_len == NULL)
{
len= LL(-1);
}
else
if (c_len)
{
ulong decoded_size;
errno= 0;
@ -5228,7 +5218,7 @@ create_func_cast(THD *thd, Item *a, Cast_target cast_type,
my_error(ER_TOO_BIG_DISPLAYWIDTH, MYF(0), "cast as char", MAX_FIELD_BLOBLENGTH);
return NULL;
}
len= decoded_size;
len= (int) decoded_size;
}
res= new (thd->mem_root) Item_char_typecast(a, len, real_cs);
break;