summaryrefslogtreecommitdiff
path: root/sql/item_strfunc.cc
diff options
context:
space:
mode:
authorunknown <bar@bar.mysql.r18.ru>2003-04-01 10:26:36 +0500
committerunknown <bar@bar.mysql.r18.ru>2003-04-01 10:26:36 +0500
commitc7db0a813cdf91855b885c6d9bf85e12716d8e00 (patch)
tree50f2041eb98ae8a0817ed32284c6f623a685eefa /sql/item_strfunc.cc
parent1fa8f0224b0e5c6137f9784555aa716b32a3e88d (diff)
downloadmariadb-git-c7db0a813cdf91855b885c6d9bf85e12716d8e00.tar.gz
Better error message
Diffstat (limited to 'sql/item_strfunc.cc')
-rw-r--r--sql/item_strfunc.cc12
1 files changed, 3 insertions, 9 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);