summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/item_cmpfunc.cc3
-rw-r--r--sql/sql_string.h1
2 files changed, 4 insertions, 0 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index d4ab03003ce..f1af89cfefc 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -890,6 +890,9 @@ void in_string::set(uint pos,Item *item)
String *res=item->val_str(str);
if (res && res != str)
*str= *res;
+ // BAR TODO: I'm not sure this is absolutely correct
+ if (!str->charset())
+ str->set_charset(default_charset_info);
}
byte *in_string::get_value(Item *item)
diff --git a/sql/sql_string.h b/sql/sql_string.h
index 811e49a0d02..9bf13b93628 100644
--- a/sql/sql_string.h
+++ b/sql/sql_string.h
@@ -74,6 +74,7 @@ public:
{ sql_element_free(ptr_arg); }
~String() { free(); }
+ inline void set_charset(CHARSET_INFO *charset) { str_charset=charset; }
inline CHARSET_INFO *charset() const { return str_charset; }
inline uint32 length() const { return str_length;}
inline uint32 alloced_length() const { return Alloced_length;}