diff options
Diffstat (limited to 'sql/item_strfunc.h')
-rw-r--r-- | sql/item_strfunc.h | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h index 2adccd212b3..3b171b5d50f 100644 --- a/sql/item_strfunc.h +++ b/sql/item_strfunc.h @@ -37,6 +37,7 @@ public: enum Item_result result_type () const { return STRING_RESULT; } void left_right_max_length(); String *check_well_formed_result(String *str); + bool fix_fields(THD *thd, Item **ref); }; class Item_func_md5 :public Item_str_func @@ -360,11 +361,9 @@ public: class Item_func_encode :public Item_str_func { - protected: - SQL_CRYPT sql_crypt; public: - Item_func_encode(Item *a, char *seed): - Item_str_func(a),sql_crypt(seed) {} + Item_func_encode(Item *a, Item *seed): + Item_str_func(a, seed) {} String *val_str(String *); void fix_length_and_dec(); const char *func_name() const { return "encode"; } @@ -374,7 +373,7 @@ public: class Item_func_decode :public Item_func_encode { public: - Item_func_decode(Item *a, char *seed): Item_func_encode(a,seed) {} + Item_func_decode(Item *a, Item *seed): Item_func_encode(a, seed) {} String *val_str(String *); const char *func_name() const { return "decode"; } }; @@ -507,15 +506,9 @@ class Item_func_format :public Item_str_func { String tmp_str; public: - Item_func_format(Item *org,int dec); + Item_func_format(Item *org, Item *dec); String *val_str(String *); - void fix_length_and_dec() - { - collation.set(default_charset()); - uint char_length= args[0]->max_length/args[0]->collation.collation->mbmaxlen; - max_length= ((char_length + (char_length-args[0]->decimals)/3) * - collation.collation->mbmaxlen); - } + void fix_length_and_dec(); const char *func_name() const { return "format"; } void print(String *); }; @@ -530,9 +523,8 @@ public: { collation.set(cs); } String *val_str(String *); void fix_length_and_dec() - { - maybe_null=0; - max_length=arg_count * collation.collation->mbmaxlen; + { + max_length= arg_count * collation.collation->mbmaxlen; } const char *func_name() const { return "char"; } }; |