diff options
-rw-r--r-- | sql/item_strfunc.cc | 12 | ||||
-rw-r--r-- | sql/share/charsets/Index.xml | 3 |
2 files changed, 5 insertions, 10 deletions
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 3b2e4072b18..5b2706e3eef 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -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); diff --git a/sql/share/charsets/Index.xml b/sql/share/charsets/Index.xml index 974c2968e55..edb74fd2a9e 100644 --- a/sql/share/charsets/Index.xml +++ b/sql/share/charsets/Index.xml @@ -1,6 +1,6 @@ <?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"> |