summaryrefslogtreecommitdiff
path: root/sql/item_strfunc.cc
diff options
context:
space:
mode:
authorunknown <bar@mysql.com>2005-11-21 17:26:31 +0400
committerunknown <bar@mysql.com>2005-11-21 17:26:31 +0400
commit72d19611d198164e1fcd2e16b270a11824d860bf (patch)
tree05c91bc3d02c0f22aab0913b8e7228667bb5ff38 /sql/item_strfunc.cc
parent83bbd30c480d97f57203b999cff4517f5e04bf13 (diff)
downloadmariadb-git-72d19611d198164e1fcd2e16b270a11824d860bf.tar.gz
Bug#10446 Illegal mix of collations:
item_strfunc.h, item_strfunc.cc, item.cc: Try to convert a const item into destination character set. If conversion happens without data loss, then cache the converted value and return it during val_str(). Otherwise, if conversion loses data, return Illeral mix of collations error, as it happened previously. ctype_recoding.result, ctype_recoding.test: Fixing tests accordingly. sql/item.cc: Bug#10446 Illegal mix of collations Try to convert a const item into destination character set. If conversion happens without data loss, then cache the converted value and return it during val_str(). Otherwise, if conversion loses data, return Illeral mix of collations error, as it happened previously. sql/item_strfunc.cc: Return cached value when it's possible. mysql-test/t/ctype_recoding.test: Fixing tests accordingly. mysql-test/r/ctype_recoding.result: Fixing tests accordingly.
Diffstat (limited to 'sql/item_strfunc.cc')
-rw-r--r--sql/item_strfunc.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index 6ca6ce62c54..60cb3348590 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -2252,6 +2252,8 @@ String *Item_func_conv::val_str(String *str)
String *Item_func_conv_charset::val_str(String *str)
{
DBUG_ASSERT(fixed == 1);
+ if (use_cached_value)
+ return null_value ? 0 : &str_value;
String *arg= args[0]->val_str(str);
uint dummy_errors;
if (!arg)