diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2019-03-22 11:15:21 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2019-03-22 11:15:21 +0200 |
commit | 031fa8f1d260cd9fae67a307d901bd4432bdf1cb (patch) | |
tree | 36c96ba92e2f345dd26cc8ebe521dde1906ad384 /sql/item_strfunc.h | |
parent | 1caec9c8982a73f3db78fabc570934b837658109 (diff) | |
parent | 8be02be08bf6a7227e2ab6a5443b63f3a155e2a9 (diff) | |
download | mariadb-git-031fa8f1d260cd9fae67a307d901bd4432bdf1cb.tar.gz |
Merge 10.1 into 10.2
Diffstat (limited to 'sql/item_strfunc.h')
-rw-r--r-- | sql/item_strfunc.h | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h index b3baae99c15..9a78a7f34f5 100644 --- a/sql/item_strfunc.h +++ b/sql/item_strfunc.h @@ -3,7 +3,7 @@ /* Copyright (c) 2000, 2011, Oracle and/or its affiliates. - Copyright (c) 2009, 2015, MariaDB + Copyright (c) 2009, 2019, MariaDB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -932,28 +932,35 @@ public: }; -class Item_func_rpad :public Item_str_func +class Item_func_pad: public Item_str_func { - String tmp_value, rpad_str; +protected: + String tmp_value, pad_str; public: - Item_func_rpad(THD *thd, Item *arg1, Item *arg2, Item *arg3): + Item_func_pad(THD *thd, Item *arg1, Item *arg2, Item *arg3): Item_str_func(thd, arg1, arg2, arg3) {} - String *val_str(String *); bool fix_length_and_dec(); +}; + + +class Item_func_rpad :public Item_func_pad +{ +public: + Item_func_rpad(THD *thd, Item *arg1, Item *arg2, Item *arg3): + Item_func_pad(thd, arg1, arg2, arg3) {} + String *val_str(String *); const char *func_name() const { return "rpad"; } Item *get_copy(THD *thd, MEM_ROOT *mem_root) { return get_item_copy<Item_func_rpad>(thd, mem_root, this); } }; -class Item_func_lpad :public Item_str_func +class Item_func_lpad :public Item_func_pad { - String tmp_value, lpad_str; public: Item_func_lpad(THD *thd, Item *arg1, Item *arg2, Item *arg3): - Item_str_func(thd, arg1, arg2, arg3) {} + Item_func_pad(thd, arg1, arg2, arg3) {} String *val_str(String *); - bool fix_length_and_dec(); const char *func_name() const { return "lpad"; } Item *get_copy(THD *thd, MEM_ROOT *mem_root) { return get_item_copy<Item_func_lpad>(thd, mem_root, this); } |