diff options
Diffstat (limited to 'sql/item_strfunc.h')
-rw-r--r-- | sql/item_strfunc.h | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h index 65aad3a3fff..a70c9b39255 100644 --- a/sql/item_strfunc.h +++ b/sql/item_strfunc.h @@ -220,35 +220,37 @@ public: }; -class Item_func_ltrim :public Item_str_func +class Item_func_trim :public Item_str_func { +protected: String tmp_value; + String remove; public: - Item_func_ltrim(Item *a,Item *b) :Item_str_func(a,b) {} + Item_func_trim(Item *a,Item *b) :Item_str_func(a,b) {} + Item_func_trim(Item *a) :Item_str_func(a) {} String *val_str(String *); - void fix_length_and_dec() { max_length= args[0]->max_length; } - const char *func_name() const { return "ltrim"; } + void fix_length_and_dec(); + const char *func_name() const { return "trim"; } }; -class Item_func_rtrim :public Item_str_func +class Item_func_ltrim :public Item_func_trim { - String tmp_value; public: - Item_func_rtrim(Item *a,Item *b) :Item_str_func(a,b) {} + Item_func_ltrim(Item *a,Item *b) :Item_func_trim(a,b) {} + Item_func_ltrim(Item *a) :Item_func_trim(a) {} String *val_str(String *); - void fix_length_and_dec() { max_length= args[0]->max_length; } - const char *func_name() const { return "rtrim"; } + const char *func_name() const { return "ltrim"; } }; -class Item_func_trim :public Item_str_func + +class Item_func_rtrim :public Item_func_trim { - String tmp_value; public: - Item_func_trim(Item *a,Item *b) :Item_str_func(a,b) {} + Item_func_rtrim(Item *a,Item *b) :Item_func_trim(a,b) {} + Item_func_rtrim(Item *a) :Item_func_trim(a) {} String *val_str(String *); - void fix_length_and_dec() { max_length= args[0]->max_length; } - const char *func_name() const { return "trim"; } + const char *func_name() const { return "rtrim"; } }; |