summaryrefslogtreecommitdiff
path: root/sql/item_strfunc.h
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2016-01-26 17:52:24 +0400
committerAlexander Barkov <bar@mariadb.org>2016-01-26 17:52:24 +0400
commit77c75a46cfe9ffa914c73fe129dec743b80ed57b (patch)
tree0d41f8dcaea54c93ccfe037b5b1f5f8b9baefb5e /sql/item_strfunc.h
parent71b39066d4320e74e5ad73f4f5a6d436e32f14f3 (diff)
downloadmariadb-git-77c75a46cfe9ffa914c73fe129dec743b80ed57b.tar.gz
A clean-up patch for Item_func_conv_charset (needed for MDEV-9181)
Removing the "conv_charset" member and using collation.collation instead, as they duplicated each other.
Diffstat (limited to 'sql/item_strfunc.h')
-rw-r--r--sql/item_strfunc.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h
index 1a9f855dec5..65c286819d3 100644
--- a/sql/item_strfunc.h
+++ b/sql/item_strfunc.h
@@ -959,20 +959,22 @@ class Item_func_conv_charset :public Item_str_func
String tmp_value;
public:
bool safe;
- CHARSET_INFO *conv_charset; // keep it public
Item_func_conv_charset(THD *thd, Item *a, CHARSET_INFO *cs):
Item_str_func(thd, a)
- { conv_charset= cs; use_cached_value= 0; safe= 0; }
+ {
+ collation.set(cs, DERIVATION_IMPLICIT);
+ use_cached_value= 0; safe= 0;
+ }
Item_func_conv_charset(THD *thd, Item *a, CHARSET_INFO *cs, bool cache_if_const):
Item_str_func(thd, a)
{
- conv_charset= cs;
+ collation.set(cs, DERIVATION_IMPLICIT);
if (cache_if_const && args[0]->const_item() && !args[0]->is_expensive())
{
uint errors= 0;
String tmp, *str= args[0]->val_str(&tmp);
if (!str || str_value.copy(str->ptr(), str->length(),
- str->charset(), conv_charset, &errors))
+ str->charset(), cs, &errors))
null_value= 1;
use_cached_value= 1;
str_value.mark_as_const();