diff options
Diffstat (limited to 'sql/item_create.h')
-rw-r--r-- | sql/item_create.h | 53 |
1 files changed, 41 insertions, 12 deletions
diff --git a/sql/item_create.h b/sql/item_create.h index 894e9777b8d..3fadaecb090 100644 --- a/sql/item_create.h +++ b/sql/item_create.h @@ -145,16 +145,6 @@ protected: /** - Find the native function builder associated with a given function name. - @param thd The current thread - @param name The native function name - @return The native function builder associated with the name, or NULL -*/ -extern Create_func *find_native_function_builder(THD *thd, - const LEX_CSTRING *name); - - -/** Find the function builder for qualified functions. @param thd The current thread @return A function builder for qualified functions @@ -215,9 +205,48 @@ struct Native_func_registry Create_func *builder; }; + +class Native_functions_hash: public HASH +{ +public: + Native_functions_hash() + { + bzero(this, sizeof(*this)); + } + ~Native_functions_hash() + { + /* + No automatic free. + The the upper level code should call cleanup() explicitly. + */ + DBUG_ASSERT(!records); + } + bool init(size_t count); + bool init(const Native_func_registry array[], size_t count) + { + return init(count) || append(array); + } + bool append(const Native_func_registry array[]); + bool remove(const Native_func_registry array[]); + void cleanup(); + /** + Find the native function builder associated with a given function name. + @param thd The current thread + @param name The native function name + @return The native function builder associated with the name, or NULL + */ + Create_func *find(THD *thd, const LEX_CSTRING &name) const; +}; + +extern Native_functions_hash native_functions_hash; +extern Native_functions_hash native_functions_hash_oracle_overrides; + +extern const Native_func_registry func_array[]; +extern const size_t func_array_length; + int item_create_init(); -int item_create_append(Native_func_registry array[]); -int item_create_remove(Native_func_registry array[]); +int item_create_append(const Native_func_registry array[]); +int item_create_remove(const Native_func_registry array[]); void item_create_cleanup(); Item *create_func_dyncol_create(THD *thd, List<DYNCALL_CREATE_DEF> &list); |