MySQL  8.0.18
Source Code Documentation
udf_registration_imp.h
Go to the documentation of this file.
1 /* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
2 
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License, version 2.0,
5 as published by the Free Software Foundation.
6 
7 This program is also distributed with certain software (including
8 but not limited to OpenSSL) that is licensed under separate terms,
9 as designated in a particular file or component or in included license
10 documentation. The authors of MySQL hereby grant you an additional
11 permission to link the program and your derivative works with the
12 separately licensed software that they have included with MySQL.
13 
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License, version 2.0, for more details.
18 
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22 
23 #if !defined(UDF_REGISTRATION_IMP_H)
24 #define UDF_REGISTRATION_IMP_H
25 
28 
29 struct udf_func;
30 
31 /**
32  A helper class for the implementation of the
33  udf_registration and udf_aggregate functions
34 
35  Needed because we register these service implementations
36  as part of the mysql_server component.
37 */
39  public: /* service implementations */
40  /** udf_registration::udf_register */
42  (const char *name, Item_result return_type,
43  Udf_func_any func, Udf_func_init init_func,
44  Udf_func_deinit deinit_func));
45 
46  /** udf_registration::udf_unregister
47  and udf_registration_aggregate::udf_register
48  */
50  (const char *name, int *was_present));
51 
52  /** udf_registration_aggregate::udf_register */
54  (const char *func_name,
55  enum Item_result return_type, Udf_func_any func,
56  Udf_func_init init_func,
57  Udf_func_deinit deinit_func, Udf_func_add add_func,
58  Udf_func_clear clear_func));
59 
60  private:
61  static bool udf_register_inner(udf_func *func);
62  static udf_func *alloc_udf(const char *func_name,
63  enum Item_result return_type, Udf_func_any func,
64  Udf_func_init init_func,
65  Udf_func_deinit deinit_func);
66 };
67 
68 #endif
Definition: sql_udf.h:42
void(* Udf_func_clear)(UDF_INIT *, unsigned char *, unsigned char *)
Definition: udf_registration_types.h:76
Item_result
Type of the user defined function return slot and arguments
Definition: udf_registration_types.h:38
void(* Udf_func_add)(UDF_INIT *, UDF_ARGS *, unsigned char *, unsigned char *)
Definition: udf_registration_types.h:77
const string name("\ame\)
#define DEFINE_BOOL_METHOD(name, args)
void(* Udf_func_any)(void)
Definition: udf_registration_types.h:81
static mysql_service_status_t udf_register_aggregate(const char *func_name, enum Item_result return_type, Udf_func_any func, Udf_func_init init_func, Udf_func_deinit deinit_func, Udf_func_add add_func, Udf_func_clear clear_func) noexcept
udf_registration_aggregate::udf_register
Definition: sql_udf.cc:835
static udf_func * alloc_udf(const char *func_name, enum Item_result return_type, Udf_func_any func, Udf_func_init init_func, Udf_func_deinit deinit_func)
Definition: sql_udf.cc:795
static mysql_service_status_t udf_register(const char *name, Item_result return_type, Udf_func_any func, Udf_func_init init_func, Udf_func_deinit deinit_func) noexcept
udf_registration::udf_register
Definition: sql_udf.cc:819
bool(* Udf_func_init)(UDF_INIT *, UDF_ARGS *, char *)
Definition: udf_registration_types.h:80
static bool udf_register_inner(udf_func *func)
Definition: sql_udf.cc:779
static mysql_service_status_t udf_unregister(const char *name, int *was_present) noexcept
udf_registration::udf_unregister and udf_registration_aggregate::udf_register
Definition: sql_udf.cc:851
void(* Udf_func_deinit)(UDF_INIT *)
Definition: udf_registration_types.h:79
A helper class for the implementation of the udf_registration and udf_aggregate functions.
Definition: udf_registration_imp.h:38
Specifies macros to define Service Implementations.