00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #pragma once
00023
00024 #include <drizzled/item/func.h>
00025 #include <drizzled/plugin/function.h>
00026
00027 namespace drizzled {
00028
00040 class Create_func
00041 {
00042 public:
00064 virtual Item *create(Session*, str_ref name, List<Item> *item_list) = 0;
00065
00066 protected:
00067 virtual ~Create_func() {}
00068 };
00069
00076 class Create_qfunc : public Create_func
00077 {
00078 public:
00087 virtual Item *create(Session*, str_ref name, List<Item> *item_list);
00088
00098 virtual Item* create(Session*, str_ref db, str_ref name, bool use_explicit_name, List<Item>*) = 0;
00099 };
00100
00101
00107 extern Create_func* find_native_function_builder(str_ref name);
00108
00109
00115 extern Create_qfunc* find_qualified_function_builder(Session*);
00116
00117
00122 class Create_udf_func : public Create_func
00123 {
00124 public:
00125 virtual Item *create(Session*, str_ref name, List<Item> *item_list);
00126
00134 Item *create(Session*, const plugin::Function *fct, List<Item> *item_list);
00135
00137 static Create_udf_func s_singleton;
00138
00139 protected:
00141 Create_udf_func() {}
00142 };
00143
00144 Item*
00145 create_func_char_cast(Session*, Item *a, int len, const charset_info_st * const cs);
00146
00156 Item *
00157 create_func_cast(Session*, Item *a, Cast_target cast_type, const char *len, const char *dec, const charset_info_st*);
00158
00159 void item_create_init();
00160 void item_create_cleanup();
00161
00162 }
00163