diff options
author | unknown <monty@mashka.mysql.fi> | 2002-11-25 17:33:51 +0200 |
---|---|---|
committer | unknown <monty@mashka.mysql.fi> | 2002-11-25 17:33:51 +0200 |
commit | 1b9becc35824401f22b4e7c2b2f9b3dab5348fe9 (patch) | |
tree | 5b47ce28ff625bae821d7bbc89fc86a74bc810a1 /sql/item_timefunc.h | |
parent | 0985653c1f820badb4ab642fe8e9f1287fd20656 (diff) | |
download | mariadb-git-1b9becc35824401f22b4e7c2b2f9b3dab5348fe9.tar.gz |
Fixed CAST( xxx as CHAR)
sql/item.h:
Made some virtual functions non virtual (as they are not used virtually)
sql/item_strfunc.cc:
Optimizations.
sql/item_strfunc.h:
Fixed BINARY handling
sql/sql_string.h:
Indentation cleanups
Diffstat (limited to 'sql/item_timefunc.h')
-rw-r--r-- | sql/item_timefunc.h | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h index 7765769c1d3..f9b987324f0 100644 --- a/sql/item_timefunc.h +++ b/sql/item_timefunc.h @@ -534,8 +534,17 @@ public: Item_typecast(Item *a) :Item_str_func(a) {} const char *func_name() const { return "char"; } String *val_str(String *a) - { a=args[0]->val_str(a); null_value=args[0]->null_value; return a; } - void fix_length_and_dec() { max_length=args[0]->max_length; } + { + String *tmp=args[0]->val_str(a); + null_value=args[0]->null_value; + tmp->set_charset(charset()); + return tmp; + } + void fix_length_and_dec() + { + set_charset(thd_charset()); + max_length=args[0]->max_length; + } void print(String *str); }; @@ -544,7 +553,11 @@ class Item_char_typecast :public Item_typecast { public: Item_char_typecast(Item *a) :Item_typecast(a) {} - void fix_length_and_dec() { binary=0; max_length=args[0]->max_length; } + void fix_length_and_dec() + { + set_charset(thd_charset()); + max_length=args[0]->max_length; + } }; |