summaryrefslogtreecommitdiff
path: root/sql/item_strfunc.h
diff options
context:
space:
mode:
authorbar@mysql.com <>2005-10-13 19:24:47 +0500
committerbar@mysql.com <>2005-10-13 19:24:47 +0500
commit7c81d7fc6928f47be54cdf58d0e6d0a3f3c39260 (patch)
tree7154826a1c55c5f624f5fe3e1e8c453474fa51c8 /sql/item_strfunc.h
parent304d4f580b0b085aaac008693689f82e6101c320 (diff)
downloadmariadb-git-7c81d7fc6928f47be54cdf58d0e6d0a3f3c39260.tar.gz
ctype_utf8.result, ctype_utf8.test:
New syntax: CHAR(x USING charset) Adding test case. sql_yacc.yy: New syntax: CHAR(x USING charset) Adding new parser rule. item_strfunc.h: New syntax: CHAR(x USING charset) Adding a new constructor.
Diffstat (limited to 'sql/item_strfunc.h')
-rw-r--r--sql/item_strfunc.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h
index ec470bb242b..5889821293d 100644
--- a/sql/item_strfunc.h
+++ b/sql/item_strfunc.h
@@ -480,12 +480,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(&my_charset_bin); }
+ 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(&my_charset_bin);
- maybe_null=0; max_length=arg_count;
+ maybe_null=0;
+ max_length=arg_count * collation.collation->mbmaxlen;
}
const char *func_name() const { return "char"; }
};