summaryrefslogtreecommitdiff
path: root/sql/item_strfunc.h
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mysql.com>2010-08-18 16:08:59 +0400
committerAlexander Barkov <bar@mysql.com>2010-08-18 16:08:59 +0400
commit9452dd112243d9a59355ba26537c4e8b695d7820 (patch)
tree905133fcd1d54bac1c07308652fd0e868af871a4 /sql/item_strfunc.h
parentd0d8bbed5e901e59044be6bcaa6d4020238a1eb4 (diff)
downloadmariadb-git-9452dd112243d9a59355ba26537c4e8b695d7820.tar.gz
Bug#45263 utf32_general_ci, bad effects around CREATE TABLE AS SELECT
Problem: Item_func_hex::val_str() returned data in ASCII format, which did not match collation.collation pointing to my_charset_utf32_general_ci. Fix: changing parent class of Item_func_hex to Item_str_ascii_func, as val_str() implementation is heavily ASCII-oriented. mysql-test/r/ctype_utf32.result mysql-test/t/ctype_utf32.test Adding test case sql/item_strfunc.cc sql/item_strfunc.h - Changing parent class to Item_str_ascii_func - Clean-up in Item_func_hex::fix_length_and_dec() Using fix_char_length() instead of setting max_length directly.
Diffstat (limited to 'sql/item_strfunc.h')
-rw-r--r--sql/item_strfunc.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h
index df794ecaaf4..4461373f7b3 100644
--- a/sql/item_strfunc.h
+++ b/sql/item_strfunc.h
@@ -622,18 +622,18 @@ public:
};
-class Item_func_hex :public Item_str_func
+class Item_func_hex :public Item_str_ascii_func
{
String tmp_value;
public:
- Item_func_hex(Item *a) :Item_str_func(a) {}
+ Item_func_hex(Item *a) :Item_str_ascii_func(a) {}
const char *func_name() const { return "hex"; }
- String *val_str(String *);
+ String *val_str_ascii(String *);
void fix_length_and_dec()
{
collation.set(default_charset());
decimals=0;
- max_length=args[0]->max_length*2*collation.collation->mbmaxlen;
+ fix_char_length(args[0]->max_length * 2);
}
};