summaryrefslogtreecommitdiff
path: root/sql/item_strfunc.cc
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mysql.com>2010-07-09 09:39:41 +0400
committerAlexander Barkov <bar@mysql.com>2010-07-09 09:39:41 +0400
commit63777287b8e07abefc74eae6b1fbf95255abd847 (patch)
treedeb9210a4406979a0ed87262242f37e2fe01f4a9 /sql/item_strfunc.cc
parentdbf76b0deb58ef188585b85f93a0add4d8fcc9d8 (diff)
downloadmariadb-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.cc7
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);