diff options
author | unknown <bar@mysql.com> | 2005-10-21 14:41:56 +0500 |
---|---|---|
committer | unknown <bar@mysql.com> | 2005-10-21 14:41:56 +0500 |
commit | c9978d8bcbf609d5e495df77f7306cdb5abaf7a1 (patch) | |
tree | 283d5930afab08637d4b0260622f6e7b3cea7db6 /sql/item_strfunc.h | |
parent | 571d9cdd0b820b89960c6c9eac5f70772115c514 (diff) | |
download | mariadb-git-c9978d8bcbf609d5e495df77f7306cdb5abaf7a1.tar.gz |
Bug#13233
select distinct char(column) fails with utf8
ctype_utf8.result, ctype_utf8.test:
Adding test case
sql_yacc.yy:
Adding new syntax.
item_strfunc.h:
Fixing wrong max_length calculation.
Also, adding CHAR(x USING charset),
for easier migrating from 4.1 to 5.0,
according to Monty's suggestion.
sql/item_strfunc.h:
Bug#13233
select distinct char(column) fails with utf8
Also, adding CHAR(x USING charset),
for easier migrating from 4.1 to 5.0.
sql/sql_yacc.yy:
Adding new syntax.
mysql-test/t/ctype_utf8.test:
Adding test case
mysql-test/r/ctype_utf8.result:
Adding test case
Diffstat (limited to 'sql/item_strfunc.h')
-rw-r--r-- | sql/item_strfunc.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h index b01d75b8e02..5525c046b95 100644 --- a/sql/item_strfunc.h +++ b/sql/item_strfunc.h @@ -444,12 +444,15 @@ public: class Item_func_char :public Item_str_func { public: - Item_func_char(List<Item> &list) :Item_str_func(list) {} + Item_func_char(List<Item> &list) :Item_str_func(list) + { collation.set(default_charset()); } + Item_func_char(List<Item> &list, CHARSET_INFO *cs) :Item_str_func(list) + { collation.set(cs); } String *val_str(String *); void fix_length_and_dec() { - collation.set(default_charset()); - maybe_null=0; max_length=arg_count; + maybe_null=0; + max_length=arg_count * collation.collation->mbmaxlen; } const char *func_name() const { return "char"; } }; |