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

Better error message

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