diff options
author | Alexander Barkov <bar@mysql.com> | 2010-07-09 09:39:41 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mysql.com> | 2010-07-09 09:39:41 +0400 |
commit | 63777287b8e07abefc74eae6b1fbf95255abd847 (patch) | |
tree | deb9210a4406979a0ed87262242f37e2fe01f4a9 /sql/item_strfunc.cc | |
parent | dbf76b0deb58ef188585b85f93a0add4d8fcc9d8 (diff) | |
download | mariadb-git-63777287b8e07abefc74eae6b1fbf95255abd847.tar.gz |
Bug#54668 User variable assignments get wrong type
Problem: Item_str_ascii_func::val_str() did not set
charset of the returned value properly.
mysql-test/include/ctype_numconv.inc
mysql-test/r/ctype_binary.result
mysql-test/r/ctype_cp1251.result
mysql-test/r/ctype_latin1.result
mysql-test/r/ctype_ucs.result
- Adding tests
sql/item_strfunc.cc
- Adding initialization of charset
Diffstat (limited to 'sql/item_strfunc.cc')
-rw-r--r-- | sql/item_strfunc.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 2a9eef2298d..851d0e07a7e 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -72,7 +72,12 @@ String *Item_str_ascii_func::val_str(String *str) DBUG_ASSERT(fixed == 1); if (!(collation.collation->state & MY_CS_NONASCII)) - return val_str_ascii(str); + { + String *res= val_str_ascii(str); + if (res) + res->set_charset(collation.collation); + return res; + } DBUG_ASSERT(str != &ascii_buf); |