Merge from 5.1.

This commit is contained in:
unknown 2012-08-24 12:32:46 +02:00
commit 96703a63da
42 changed files with 1143 additions and 449 deletions

View file

@ -769,15 +769,31 @@ void Item::set_name(const char *str, uint length, CHARSET_INFO *cs)
if (!my_charset_same(cs, system_charset_info))
{
size_t res_length;
name= sql_strmake_with_convert(str, name_length= length, cs,
name= sql_strmake_with_convert(str, length, cs,
MAX_ALIAS_NAME, system_charset_info,
&res_length);
name_length= res_length;
}
else
name= sql_strmake(str, (name_length= min(length,MAX_ALIAS_NAME)));
}
void Item::set_name_no_truncate(const char *str, uint length, CHARSET_INFO *cs)
{
if (!my_charset_same(cs, system_charset_info))
{
size_t res_length;
name= sql_strmake_with_convert(str, length, cs,
UINT_MAX, system_charset_info,
&res_length);
name_length= res_length;
}
else
name= sql_strmake(str, (name_length= length));
}
/**
@details
This function is called when: