Commit 8def9a3e authored by bar@bar.mysql.r18.ru's avatar bar@bar.mysql.r18.ru

item_func.cc:

  Fix for coercibility of function
parent cb6a0a48
...@@ -122,10 +122,29 @@ Item_func::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) ...@@ -122,10 +122,29 @@ Item_func::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
Set return character set to first argument if we are returning a Set return character set to first argument if we are returning a
string. string.
*/ */
if (args == arg) if ((*arg)->binary())
set_charset(args[0]->charset()); {
else if ((*arg)->binary() || (charset() != (*arg)->charset()) ) set_charset(&my_charset_bin);
set_charset(&my_charset_bin); coercibility= COER_NOCOLL;
}
else if (coercibility== COER_NOCOLL)
{
coercibility= (*arg)->coercibility;
set_charset((*arg)->charset());
}
else if ((*arg)->coercibility > coercibility)
{
if (strcmp(charset()->csname,(*arg)->charset()->csname))
{
set_charset(&my_charset_bin);
coercibility= COER_NOCOLL;
}
else
{
coercibility= (*arg)->coercibility;
set_charset((*arg)->charset());
}
}
} }
with_sum_func= with_sum_func || (*arg)->with_sum_func; with_sum_func= with_sum_func || (*arg)->with_sum_func;
used_tables_cache|=(*arg)->used_tables(); used_tables_cache|=(*arg)->used_tables();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment