MySQL 9.2.0
Source Code Documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
library_impl.h
Go to the documentation of this file.
1/* Copyright (c) 2024, 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 designed to work 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 either included with
13 the program or referenced in the documentation.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License, version 2.0, for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#ifndef DD__LIBRARY_IMPL_INCLUDED
25#define DD__LIBRARY_IMPL_INCLUDED
26
27#include "routine_impl.h"
28#include "sql/dd/impl/types/routine_impl.h" // dd::Routine_impl
29#include "sql/dd/object_id.h"
30#include "sql/dd/string_type.h"
31#include "sql/dd/types/library.h" // dd::Library
32#include "sql/dd/types/view.h" // View::enum_security_type
33
34namespace dd {
35
36///////////////////////////////////////////////////////////////////////////
37
38class Open_dictionary_tables_ctx;
39class Parameter;
40class Weak_object;
41class Object_table;
42
43class Library_impl : public Routine_impl, public Library {
44 public:
46
47 public:
49 const String_type &name) const override;
50
51 void debug_print(String_type &outb) const override;
52
53 // Fix "inherits ... via dominance" warnings of MSVC
54 // Note: The other compilers support `using` instead. MSVC does not.
56 [[nodiscard]] const Entity_object_impl *impl() const override {
58 }
59 [[nodiscard]] Object_id id() const override {
61 }
62 [[nodiscard]] bool is_persistent() const override {
64 }
65 [[nodiscard]] const String_type &name() const override {
67 }
68 void set_name(const String_type &name) override {
70 }
71 const Properties &options() const override { return Routine_impl::options(); }
72 Properties &options() override { return Routine_impl::options(); }
73 bool update_name_key(Name_key *key) const override {
75 }
76 Object_id schema_id() const override { return Routine_impl::schema_id(); }
79 }
80 enum_routine_type type() const override { return Routine_impl::type(); }
81 const String_type &definition() const override {
83 }
84 void set_definition(const String_type &definition) override {
86 }
87 const String_type &definition_utf8() const override {
89 }
92 }
93 const String_type &parameter_str() const override {
95 }
98 }
99 bool is_deterministic() const override {
101 }
104 }
105 const String_type &external_language() const override {
107 }
108 void set_external_language(const String_type &el) override {
110 }
113 }
114 ulonglong sql_mode() const override { return Routine_impl::sql_mode(); }
116 const String_type &definer_user() const override {
118 }
119 const String_type &definer_host() const override {
121 }
122 void set_definer(const String_type &username,
123 const String_type &hostname) override {
124 Routine_impl::set_definer(username, hostname);
125 }
128 }
131 }
134 }
135 ulonglong created(bool convert_time) const override {
136 return Routine_impl::created(convert_time);
137 }
140 }
141 ulonglong last_altered(bool convert_time) const override {
142 return Routine_impl::last_altered(convert_time);
143 }
146 }
147 const String_type &comment() const override {
148 return Routine_impl::comment();
149 }
150 const Parameter_collection &parameters() const override {
152 }
153 bool set_options(const Properties &options) override {
155 }
156 bool set_options(const String_type &options_raw) override {
157 return Routine_impl::set_options(options_raw);
158 }
159
160 // Disabled functions that do not make sense for a library.
161
162 /////////////////////////////////////////////////////////////////////////
163 // is_deterministic.
164 /////////////////////////////////////////////////////////////////////////
165
166 void set_deterministic(bool deterministic [[maybe_unused]]) override {
167 // Setting this attribute is not allowed for the Library.
168 assert(false);
169 }
170
171 /////////////////////////////////////////////////////////////////////////
172 // sql data access.
173 /////////////////////////////////////////////////////////////////////////
174
175 void set_sql_data_access(enum_sql_data_access sda [[maybe_unused]]) override {
176 // Setting this attribute is not allowed for the Library.
177 assert(false);
178 }
179
180 /////////////////////////////////////////////////////////////////////////
181 // security_type.
182 /////////////////////////////////////////////////////////////////////////
183
185 [[maybe_unused]]) override {
186 // Setting this attribute is not allowed for the Library.
187 assert(false);
188 }
189
190 /////////////////////////////////////////////////////////////////////////
191 // collation.
192 /////////////////////////////////////////////////////////////////////////
193
195 [[maybe_unused]]) override {
196 // Setting this attribute is not allowed for the Library.
197 assert(false);
198 }
199
201 [[maybe_unused]]) override {
202 // Setting this attribute is not allowed for the Library.
203 assert(false);
204 }
205
207 [[maybe_unused]]) override {
208 // Setting this attribute is not allowed for the Library.
209 assert(false);
210 }
211
212 /////////////////////////////////////////////////////////////////////////
213 // comment.
214 /////////////////////////////////////////////////////////////////////////
215
216 void set_comment(const String_type &) override { assert(false); }
217
218 /////////////////////////////////////////////////////////////////////////
219 // Parameter collection.
220 /////////////////////////////////////////////////////////////////////////
221
223 assert(false);
224 return nullptr;
225 }
226
227 private:
228 Library_impl(const Library_impl &src);
229 [[nodiscard]] Library_impl *clone() const override;
230
231 // N.B.: returning dd::Library from this function might confuse MSVC
232 // compiler thanks to diamond inheritance.
233 [[nodiscard]] Library_impl *clone_dropped_object_placeholder() const override;
234};
235
236///////////////////////////////////////////////////////////////////////////
237
238} // namespace dd
239
240#endif // DD__LIBRARY_IMPL_INCLUDED
Definition: collection.h:44
Definition: entity_object_impl.h:44
void set_name(const String_type &name) override
Definition: entity_object_impl.h:62
Object_id id() const override
The unique dictionary object id.
Definition: entity_object_impl.h:49
const String_type & name() const override
Definition: entity_object_impl.h:60
Entity_object_impl * impl() override
Definition: entity_object_impl.h:68
bool is_persistent() const override
Is dictionary object persistent in dictionary tables ?
Definition: entity_object_impl.h:57
Definition: library_impl.h:43
const String_type & comment() const override
Definition: library_impl.h:147
void set_security_type(View::enum_security_type security_type) override
Definition: library_impl.h:184
View::enum_security_type security_type() const override
Definition: library_impl.h:111
bool update_routine_name_key(Name_key *key, Object_id schema_id, const String_type &name) const override
Definition: library_impl.cc:48
bool is_deterministic() const override
Definition: library_impl.h:99
void set_definer(const String_type &username, const String_type &hostname) override
Definition: library_impl.h:122
const String_type & definer_host() const override
Definition: library_impl.h:119
const String_type & definition() const override
Definition: library_impl.h:81
void set_sql_data_access(enum_sql_data_access sda) override
Definition: library_impl.h:175
bool set_options(const Properties &options) override
Definition: library_impl.h:153
void set_client_collation_id(Object_id client_collation_id) override
Definition: library_impl.h:194
ulonglong last_altered(bool convert_time) const override
Definition: library_impl.h:141
Object_id client_collation_id() const override
Definition: library_impl.h:126
const String_type & external_language() const override
Definition: library_impl.h:105
void set_definition_utf8(const String_type &definition_utf8) override
Definition: library_impl.h:90
void set_deterministic(bool deterministic) override
Definition: library_impl.h:166
enum_sql_data_access sql_data_access() const override
Definition: library_impl.h:102
Object_id connection_collation_id() const override
Definition: library_impl.h:129
const Parameter_collection & parameters() const override
Definition: library_impl.h:150
void set_name(const String_type &name) override
Definition: library_impl.h:68
const Properties & options() const override
Definition: library_impl.h:71
Object_id schema_id() const override
Definition: library_impl.h:76
bool update_name_key(Name_key *key) const override
Definition: library_impl.h:73
void set_schema_collation_id(Object_id schema_collation_id) override
Definition: library_impl.h:206
Object_id schema_collation_id() const override
Definition: library_impl.h:132
bool is_persistent() const override
Is dictionary object persistent in dictionary tables ?
Definition: library_impl.h:62
void set_parameter_str(const String_type &parameter_str) override
Definition: library_impl.h:96
void set_connection_collation_id(Object_id connection_collation_id) override
Definition: library_impl.h:200
ulonglong created(bool convert_time) const override
Definition: library_impl.h:135
enum_routine_type type() const override
Definition: library_impl.h:80
void set_sql_mode(ulonglong sm) override
Definition: library_impl.h:115
Library_impl * clone_dropped_object_placeholder() const override
Allocate a new object which can serve as a placeholder for the original object in the Dictionary_clie...
Definition: library_impl.cc:89
void set_comment(const String_type &) override
Definition: library_impl.h:216
Entity_object_impl * impl() override
Definition: library_impl.h:55
const String_type & parameter_str() const override
Definition: library_impl.h:93
Properties & options() override
Definition: library_impl.h:72
void set_external_language(const String_type &el) override
Definition: library_impl.h:108
void set_created(ulonglong created) override
Definition: library_impl.h:138
const String_type & name() const override
Definition: library_impl.h:65
bool set_options(const String_type &options_raw) override
Definition: library_impl.h:156
const String_type & definition_utf8() const override
Definition: library_impl.h:87
Object_id id() const override
The unique dictionary object id.
Definition: library_impl.h:59
void set_last_altered(ulonglong last_altered) override
Definition: library_impl.h:144
Parameter * add_parameter() override
Definition: library_impl.h:222
Library_impl()
Definition: library_impl.cc:37
void debug_print(String_type &outb) const override
Definition: library_impl.cc:63
void set_definition(const String_type &definition) override
Definition: library_impl.h:84
Library_impl * clone() const override
Allocate a new object graph and invoke the copy constructor for each object.
Definition: library_impl.cc:83
const Entity_object_impl * impl() const override
Definition: library_impl.h:56
const String_type & definer_user() const override
Definition: library_impl.h:116
void set_schema_id(Object_id schema_id) override
Definition: library_impl.h:77
ulonglong sql_mode() const override
Definition: library_impl.h:114
Definition: library.h:37
bool update_name_key(Name_key *key) const override
Definition: library.h:41
Definition: parameter.h:45
The Properties class defines an interface for storing key=value pairs, where both key and value may b...
Definition: properties.h:74
Definition: routine_impl.h:53
void set_definer(const String_type &username, const String_type &hostname) override
Definition: routine_impl.h:187
bool is_deterministic() const override
Definition: routine_impl.h:129
Object_id schema_collation_id() const override
Definition: routine_impl.h:213
ulonglong created(bool convert_time) const override
Definition: routine_impl.h:225
void set_external_language(const String_type &el) override
Definition: routine_impl.h:155
void set_parameter_str(const String_type &parameter_str) override
Definition: routine_impl.h:121
void set_sql_mode(ulonglong sm) override
Definition: routine_impl.h:177
ulonglong sql_mode() const override
Definition: routine_impl.h:175
const String_type & definer_host() const override
Definition: routine_impl.h:185
enum_sql_data_access sql_data_access() const override
Definition: routine_impl.h:139
Object_id client_collation_id() const override
Definition: routine_impl.h:197
bool set_options(const Properties &options) override
Definition: routine_impl.h:270
View::enum_security_type security_type() const override
Definition: routine_impl.h:163
const String_type & definer_user() const override
Definition: routine_impl.h:183
const String_type & parameter_str() const override
Definition: routine_impl.h:119
ulonglong last_altered(bool convert_time) const override
Definition: routine_impl.h:235
void set_definition(const String_type &definition) override
Definition: routine_impl.h:103
Object_id schema_id() const override
Definition: routine_impl.h:83
void set_definition_utf8(const String_type &definition_utf8) override
Definition: routine_impl.h:111
Object_id connection_collation_id() const override
Definition: routine_impl.h:205
const String_type & definition_utf8() const override
Definition: routine_impl.h:107
const String_type & external_language() const override
Definition: routine_impl.h:151
void set_created(ulonglong created) override
Definition: routine_impl.h:229
const Parameter_collection & parameters() const override
Definition: routine_impl.h:258
enum_routine_type type() const override
Definition: routine_impl.h:91
void set_schema_id(Object_id schema_id) override
Definition: routine_impl.h:85
const String_type & definition() const override
Definition: routine_impl.h:101
void set_last_altered(ulonglong last_altered) override
Definition: routine_impl.h:240
const String_type & comment() const override
Definition: routine_impl.h:248
const Properties & options() const override
Definition: routine_impl.h:266
Definition: object_keys.h:434
enum_sql_data_access
Definition: routine.h:90
enum_routine_type
Definition: routine.h:88
enum_security_type
Definition: view.h:62
unsigned long long int ulonglong
Definition: my_inttypes.h:56
The version of the current data dictionary table definitions.
Definition: dictionary_client.h:43
unsigned long long Object_id
Definition: object_id.h:31
Char_string_template< String_type_allocator > String_type
Definition: string_type.h:51
Definition: options.cc:57
required string key
Definition: replication_asynchronous_connection_failover.proto:60