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

Better error message

parent dd2ef4fe
...@@ -2167,16 +2167,10 @@ void Item_func_set_collation::fix_length_and_dec() ...@@ -2167,16 +2167,10 @@ void Item_func_set_collation::fix_length_and_dec()
else else
set_collation= get_charset_by_name(colname,MYF(0)); set_collation= get_charset_by_name(colname,MYF(0));
if (!set_collation) if (!set_collation || !my_charset_same(args[0]->charset(),set_collation))
{
my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), str->c_ptr());
return;
}
if (!my_charset_same(args[0]->charset(),set_collation))
{ {
my_error(ER_COLLATION_CHARSET_MISMATCH, MYF(0), my_error(ER_COLLATION_CHARSET_MISMATCH, MYF(0),
set_collation->name,args[0]->charset()->csname); colname,args[0]->charset()->csname);
return; return;
} }
set_charset(set_collation, COER_EXPLICIT); set_charset(set_collation, COER_EXPLICIT);
......
<?xml version='1.0' encoding="utf-8"?> <?xml version='1.0' encoding="utf-8"?>
<charsets max-id="82"> <charsets max-id="83">
<description> <description>
This file lists all of the available character sets. This file lists all of the available character sets.
...@@ -377,6 +377,7 @@ To make maintaining easier please: ...@@ -377,6 +377,7 @@ To make maintaining easier please:
<description>UTF-8 Unicode</description> <description>UTF-8 Unicode</description>
<alias>utf-8</alias> <alias>utf-8</alias>
<collation name="utf8" id="33" flag="primary"/> <collation name="utf8" id="33" flag="primary"/>
<collation name="utf8_bin" id="83" flag="binary"/>
</charset> </charset>
<charset name="ucs2"> <charset name="ucs2">
......
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