diff options
author | Alexander Nozdrin <alik@sun.com> | 2009-10-23 15:22:21 +0400 |
---|---|---|
committer | Alexander Nozdrin <alik@sun.com> | 2009-10-23 15:22:21 +0400 |
commit | 069d78c06714233dcdc6011fa3262a54df6a1ed4 (patch) | |
tree | 9a94748e3f29d58645ae7979faaf09464080033d /sql/item_create.cc | |
parent | 40c0ae812965d86406f8e44fc0c4af0914858d46 (diff) | |
parent | 2f5413ebc5a47ed45abe0d3c660cfbf673c666e2 (diff) | |
download | mariadb-git-069d78c06714233dcdc6011fa3262a54df6a1ed4.tar.gz |
Merge from mysql-next-mr.
Diffstat (limited to 'sql/item_create.cc')
-rw-r--r-- | sql/item_create.cc | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/sql/item_create.cc b/sql/item_create.cc index 5daad660d59..e2b2a4ede97 100644 --- a/sql/item_create.cc +++ b/sql/item_create.cc @@ -927,10 +927,10 @@ protected: }; -class Create_func_format : public Create_func_arg2 +class Create_func_format : public Create_native_func { public: - virtual Item *create(THD *thd, Item *arg1, Item *arg2); + virtual Item *create_native(THD *thd, LEX_STRING name, List<Item> *item_list); static Create_func_format s_singleton; @@ -3352,9 +3352,34 @@ Create_func_floor::create(THD *thd, Item *arg1) Create_func_format Create_func_format::s_singleton; Item* -Create_func_format::create(THD *thd, Item *arg1, Item *arg2) +Create_func_format::create_native(THD *thd, LEX_STRING name, + List<Item> *item_list) { - return new (thd->mem_root) Item_func_format(arg1, arg2); + Item *func= NULL; + int arg_count= item_list ? item_list->elements : 0; + + switch (arg_count) { + case 2: + { + Item *param_1= item_list->pop(); + Item *param_2= item_list->pop(); + func= new (thd->mem_root) Item_func_format(param_1, param_2); + break; + } + case 3: + { + Item *param_1= item_list->pop(); + Item *param_2= item_list->pop(); + Item *param_3= item_list->pop(); + func= new (thd->mem_root) Item_func_format(param_1, param_2, param_3); + break; + } + default: + my_error(ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT, MYF(0), name.str); + break; + } + + return func; } |