MySQL 9.2.0
Source Code Documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
mysql_library.h
Go to the documentation of this file.
1/* Copyright (c) 2024, Oracle and/or its affiliates.
2
3This program is free software; you can redistribute it and/or modify
4it under the terms of the GNU General Public License, version 2.0,
5as published by the Free Software Foundation.
6
7This program is designed to work with certain software (including
8but not limited to OpenSSL) that is licensed under separate terms,
9as designated in a particular file or component or in included license
10documentation. The authors of MySQL hereby grant you an additional
11permission to link the program and your derivative works with the
12separately licensed software that they have either included with
13the program or referenced in the documentation.
14
15This program is distributed in the hope that it will be useful,
16but WITHOUT ANY WARRANTY; without even the implied warranty of
17MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18GNU General Public License, version 2.0, for more details.
19
20You should have received a copy of the GNU General Public License
21along with this program; if not, write to the Free Software
22Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#ifndef MYSQL_LIBRARY_H
25#define MYSQL_LIBRARY_H
26
30
32
33/**
34 Services for reading the properties of the Libraries that are imported
35 by the routines.
36
37 How to use:
38 my_h_library library_handle;
39 library->init(nullptr, schema, name, version, &library_handle);
40 mysql_cstring_with_length body;
41 library->get_body(library_handle, &body);
42 // ... use the body throughout the caller.
43 library->deinit(library_handle);
44*/
46
47/**
48 Checks if library exists.
49
50 @param [in] thd (optional) Thread where the check will be
51 made. current_thd will be used if nullptr.
52 @param [in] schema_name Schema where the library is stored.
53 @param [in] library_name Name of the library.
54 @param [in] version Version of the library.
55 @param [out] result True if library exists, false otherwise.
56
57 @return Status of the performed operation:
58 @retval false success.
59 @retval true failure.
60 */
62 (MYSQL_THD thd, mysql_cstring_with_length schema_name,
63 mysql_cstring_with_length library_name,
65
66/**
67 Construct a new library object. Locks the library object with a shared
68 reentrant read-lock.
69
70 @note If the library handle provided points to non-nullptr, an error is
71 reported.
72 @note call deinit(library_handle) to release the lock.
73
74 @param [in] thd (optional) Thread where the handle will be
75 allocated. current_thd will be used if nullptr.
76 @param [in] schema_name Schema where the library is stored.
77 @param [in] library_name Name of the library.
78 @param [in] version Version of the library.
79 @param [out] library_handle A handle to the library object.
80 Must be set to nullptr when calling the function.
81
82 @return Status of the performed operation:
83 @retval false success.
84 @retval true failure.
85 */
87 mysql_cstring_with_length library_name,
89 my_h_library *library_handle));
90
91/**
92 Get library's body.
93
94 @param [in] library_handle Handle to library.
95 @param [out] body Library's body.
96
97 @note: The returned Library's body is valid only while the library_handle
98 is valid.
99
100 @returns Status of get operation:
101 @retval false Success.
102 @retval true Failure.
103*/
104DECLARE_BOOL_METHOD(get_body, (my_h_library library_handle,
106
107/**
108 Get library's language.
109
110 @param [in] library_handle Handle to library.
111 @param [out] language Library's language.
112
113 @note: The returned Library's language is valid only while the library_handle
114 is valid.
115
116 @returns Status of get operation:
117 @retval false Success.
118 @retval true Failure.
119*/
120DECLARE_BOOL_METHOD(get_language, (my_h_library library_handle,
122
123/**
124 Clean up the resources related to a library. Release the shared read lock.
125
126 @param [in] library_handle A handle to the library.
127
128 @note: library_handle will no longer be valid at the end of this function.
129
130 @return Status of the performed operation:
131 @retval false success.
132 @retval true failure.
133 */
135
137
138#endif /* MYSQL_LIBRARY_H */
static mysql_service_status_t deinit()
Component deinitialization.
Definition: audit_api_message_emit.cc:580
static mysql_service_status_t init()
Component initialization.
Definition: audit_api_message_emit.cc:571
#define MYSQL_THD
Definition: backup_page_tracker.h:38
struct my_h_library_imp * my_h_library
Definition: mysql_library.h:31
String related data structures.
static int exists(node_address *name, node_list const *nodes, u_int with_uid)
Definition: node_list.cc:106
required uint64 version
Definition: replication_group_member_actions.proto:41
#define END_SERVICE_DEFINITION(name)
A macro to end the last Service definition started with the BEGIN_SERVICE_DEFINITION macro.
Definition: service.h:91
#define BEGIN_SERVICE_DEFINITION(name)
Declares a new Service.
Definition: service.h:86
#define DEFINE_SERVICE_HANDLE(name)
Defines an object type that is meant for carrying handles to the implementation-specific objects used...
Definition: service.h:129
#define DECLARE_BOOL_METHOD(name, args)
Declares a method that returns bool as a part of the Service definition.
Definition: service.h:112
String with length information.
Definition: mysql_string_defs.h:33
Definition: result.h:30