MySQL  8.0.27
Source Code Documentation
rpl_async_conn_failover_add_source_udf.h
Go to the documentation of this file.
1 /* Copyright (c) 2020, 2021, Oracle and/or its affiliates.
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 #ifndef RPL_ASYNC_CONN_FAILOVER_ADD_SOURCE_UDF_H
24 #define RPL_ASYNC_CONN_FAILOVER_ADD_SOURCE_UDF_H
25 
26 #include "sql/udf_service_impl.h"
27 #include "sql/udf_service_util.h"
28 
30  private:
32  static constexpr const char *m_udf_name =
33  "asynchronous_connection_failover_add_source";
34  bool m_initialized{false};
35 
36  public:
39 
40  /**
41  Initialize variables, acquires the mysql_service_mysql_udf_metadata from the
42  registry service and register the Asynchronous Connection Failover's UDFs.
43  If there is an error registering any UDF, all installed UDFs are
44  unregistered.
45 
46  @retval true if there was an error
47  @retval false if all UDFs were registered
48  */
49  bool init() override;
50 
51  /**
52  Release the udf_metadata service.
53 
54  @retval false Success
55  @retval true Failure. service could not be released
56  */
57  bool deinit();
58 
59  /**
60  Add source network configuration details
61 
62  @param[in] init_id UDF_INIT structure
63  @param[in] args UDF_ARGS structure containing argument details
64  @param[out] result error message
65  @param[out] length error message length
66  @param[out] is_null if result is null
67  @param[in,out] error error code
68 
69  @return error message
70  */
71  static char *add_source(UDF_INIT *init_id, UDF_ARGS *args, char *result,
72  unsigned long *length, unsigned char *is_null,
73  unsigned char *error);
74 
75  /**
76  Initialize and verifies UDF's arguments. Also sets argument and result
77  charset.
78 
79  @param[in] init_id UDF_INIT structure
80  @param[in] args UDF_ARGS structure containing argument details
81  @param[out] message error message
82 
83  @return True if error, false otherwise.
84  */
85  static bool add_source_init(UDF_INIT *init_id, UDF_ARGS *args, char *message);
86 
87  /**
88  Deinitialize variables initalized during init function.
89 
90  @param[in] init_id UDF_INIT structure
91  */
92  static void add_source_deinit(UDF_INIT *init_id);
93 };
94 #endif /* RPL_ASYNC_CONN_FAILOVER_ADD_SOURCE_UDF_H */
Definition: rpl_async_conn_failover_add_source_udf.h:29
Udf_charset_service m_charset_service
Definition: rpl_async_conn_failover_add_source_udf.h:31
bool deinit()
Release the udf_metadata service.
Definition: rpl_async_conn_failover_add_source_udf.cc:48
static char * add_source(UDF_INIT *init_id, UDF_ARGS *args, char *result, unsigned long *length, unsigned char *is_null, unsigned char *error)
Add source network configuration details.
Definition: rpl_async_conn_failover_add_source_udf.cc:58
static constexpr const char * m_udf_name
Definition: rpl_async_conn_failover_add_source_udf.h:32
bool init() override
Initialize variables, acquires the mysql_service_mysql_udf_metadata from the registry service and reg...
Definition: rpl_async_conn_failover_add_source_udf.cc:36
bool m_initialized
Definition: rpl_async_conn_failover_add_source_udf.h:34
static bool add_source_init(UDF_INIT *init_id, UDF_ARGS *args, char *message)
Initialize and verifies UDF's arguments.
Definition: rpl_async_conn_failover_add_source_udf.cc:103
~Rpl_async_conn_failover_add_source() override=default
static void add_source_deinit(UDF_INIT *init_id)
Deinitialize variables initalized during init function.
Definition: rpl_async_conn_failover_add_source_udf.cc:190
Definition: udf_service_util.h:36
Definition: udf_service_impl.h:60
bool length(const dd::Spatial_reference_system *srs, const Geometry *g1, double *length, bool *null) noexcept
Computes the length of linestrings and multilinestrings.
Definition: length.cc:75
Definition: udf_registration_types.h:47
Information about the result of a user defined function.
Definition: udf_registration_types.h:65
Definition: result.h:29