diff options
author | unknown <bar@gw.udmsearch.izhnet.ru> | 2002-03-20 20:52:23 +0400 |
---|---|---|
committer | unknown <bar@gw.udmsearch.izhnet.ru> | 2002-03-20 20:52:23 +0400 |
commit | 9f09ae660bcd27b4c19d85b4515b8566722c9eec (patch) | |
tree | e474b12ae053af5fe18330997fadb42b0c18303f | |
parent | bbde41e9f79b7461da9795bd9ccb9fb314ff5ada (diff) | |
download | mariadb-git-9f09ae660bcd27b4c19d85b4515b8566722c9eec.tar.gz |
Added new method to set string's charset
sql/item_cmpfunc.cc:
Fix for IN, when String->charset is empty
-rw-r--r-- | sql/item_cmpfunc.cc | 3 | ||||
-rw-r--r-- | sql/sql_string.h | 1 |
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;} |