MySQL 9.1.0
Source Code Documentation
procedure_impl.h
Go to the documentation of this file.
1/* Copyright (c) 2016, 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__PROCEDURE_IMPL_INCLUDED
25#define DD__PROCEDURE_IMPL_INCLUDED
26
27#include <new>
28
29#include "my_inttypes.h"
31#include "sql/dd/impl/types/routine_impl.h" // dd::Routine_impl
33#include "sql/dd/object_id.h"
34#include "sql/dd/string_type.h"
35#include "sql/dd/types/procedure.h" // dd::Procedure
37#include "sql/dd/types/view.h"
38
39namespace dd {
40
41///////////////////////////////////////////////////////////////////////////
42
43class Open_dictionary_tables_ctx;
44class Parameter;
45class Weak_object;
46class Object_table;
47
48class Procedure_impl : public Routine_impl, public Procedure {
49 public:
50 Procedure_impl() = default;
51
52 ~Procedure_impl() override = default;
53
54 public:
56 const String_type &name) const override;
57
58 void debug_print(String_type &outb) const override;
59
60 // Fix "inherits ... via dominance" warnings
62 const Entity_object_impl *impl() const override {
64 }
65 Object_id id() const override { return Entity_object_impl::id(); }
66 bool is_persistent() const override {
68 }
69 const String_type &name() const override {
71 }
72 void set_name(const String_type &name) override {
74 }
75 const Object_table &object_table() const override {
77 }
78 Object_id schema_id() const override { return Routine_impl::schema_id(); }
81 }
82 enum_routine_type type() const override { return Routine_impl::type(); }
83 const String_type &definition() const override {
85 }
86 void set_definition(const String_type &definition) override {
88 }
89 const String_type &definition_utf8() const override {
91 }
94 }
95 const String_type &parameter_str() const override {
97 }
100 }
101 bool is_deterministic() const override {
103 }
104 void set_deterministic(bool deterministic) override {
105 Routine_impl::set_deterministic(deterministic);
106 }
109 }
112 }
113 const String_type &external_language() const override {
115 }
116 void set_external_language(const String_type &el) override {
118 }
121 }
124 }
125 ulonglong sql_mode() const override { return Routine_impl::sql_mode(); }
127 const String_type &definer_user() const override {
129 }
130 const String_type &definer_host() const override {
132 }
133 void set_definer(const String_type &username,
134 const String_type &hostname) override {
135 Routine_impl::set_definer(username, hostname);
136 }
139 }
142 }
145 }
148 }
151 }
154 }
155 ulonglong created(bool convert_time) const override {
156 return Routine_impl::created(convert_time);
157 }
160 }
161 ulonglong last_altered(bool convert_time) const override {
162 return Routine_impl::last_altered(convert_time);
163 }
166 }
167 const String_type &comment() const override {
168 return Routine_impl::comment();
169 }
170 void set_comment(const String_type &comment) override {
172 }
174 const Parameter_collection &parameters() const override {
176 }
177 bool update_name_key(Name_key *key) const override {
179 }
180
181 private:
182 Procedure_impl(const Procedure_impl &src);
183 Procedure_impl *clone() const override { return new Procedure_impl(*this); }
184
185 // N.B.: returning dd::Procedure from this function might confuse MSVC
186 // compiler thanks to diamond inheritance.
188 Procedure_impl *placeholder = new Procedure_impl();
189 placeholder->set_id(id());
190 placeholder->set_schema_id(schema_id());
191 placeholder->set_name(name());
192 return placeholder;
193 }
194};
195
196///////////////////////////////////////////////////////////////////////////
197
198} // namespace dd
199
200#endif // DD__PROCEDURE_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
void set_id(Object_id id)
Definition: entity_object_impl.h:51
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
This class represents all data dictionary table like mysql.tables, mysql.columns and more.
Definition: object_table.h:72
Definition: parameter.h:45
Definition: procedure_impl.h:48
void set_deterministic(bool deterministic) override
Definition: procedure_impl.h:104
const String_type & parameter_str() const override
Definition: procedure_impl.h:95
void set_created(ulonglong created) override
Definition: procedure_impl.h:158
void set_last_altered(ulonglong last_altered) override
Definition: procedure_impl.h:164
const Object_table & object_table() const override
Definition: procedure_impl.h:75
void set_sql_mode(ulonglong sm) override
Definition: procedure_impl.h:126
void set_sql_data_access(enum_sql_data_access sda) override
Definition: procedure_impl.h:110
~Procedure_impl() override=default
void set_definition(const String_type &definition) override
Definition: procedure_impl.h:86
void debug_print(String_type &outb) const override
Definition: procedure_impl.cc:58
void set_connection_collation_id(Object_id connection_collation_id) override
Definition: procedure_impl.h:146
const String_type & definition() const override
Definition: procedure_impl.h:83
ulonglong created(bool convert_time) const override
Definition: procedure_impl.h:155
Object_id schema_collation_id() const override
Definition: procedure_impl.h:149
void set_parameter_str(const String_type &parameter_str) override
Definition: procedure_impl.h:98
bool is_deterministic() const override
Definition: procedure_impl.h:101
const Parameter_collection & parameters() const override
Definition: procedure_impl.h:174
enum_sql_data_access sql_data_access() const override
Definition: procedure_impl.h:107
Object_id connection_collation_id() const override
Definition: procedure_impl.h:143
Object_id client_collation_id() const override
Definition: procedure_impl.h:137
void set_schema_id(Object_id schema_id) override
Definition: procedure_impl.h:79
void set_security_type(View::enum_security_type security_type) override
Definition: procedure_impl.h:122
Procedure_impl()=default
View::enum_security_type security_type() const override
Definition: procedure_impl.h:119
void set_schema_collation_id(Object_id schema_collation_id) override
Definition: procedure_impl.h:152
Parameter * add_parameter() override
Definition: procedure_impl.h:173
const String_type & definer_host() const override
Definition: procedure_impl.h:130
bool update_routine_name_key(Name_key *key, Object_id schema_id, const String_type &name) const override
Definition: procedure_impl.cc:43
bool update_name_key(Name_key *key) const override
Definition: procedure_impl.h:177
Procedure_impl * clone() const override
Allocate a new object graph and invoke the copy constructor for each object.
Definition: procedure_impl.h:183
const String_type & comment() const override
Definition: procedure_impl.h:167
Procedure_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: procedure_impl.h:187
void set_name(const String_type &name) override
Definition: procedure_impl.h:72
Entity_object_impl * impl() override
Definition: procedure_impl.h:61
void set_external_language(const String_type &el) override
Definition: procedure_impl.h:116
ulonglong sql_mode() const override
Definition: procedure_impl.h:125
const String_type & name() const override
Definition: procedure_impl.h:69
const String_type & definer_user() const override
Definition: procedure_impl.h:127
const String_type & definition_utf8() const override
Definition: procedure_impl.h:89
bool is_persistent() const override
Is dictionary object persistent in dictionary tables ?
Definition: procedure_impl.h:66
const String_type & external_language() const override
Definition: procedure_impl.h:113
void set_definition_utf8(const String_type &definition_utf8) override
Definition: procedure_impl.h:92
enum_routine_type type() const override
Definition: procedure_impl.h:82
const Entity_object_impl * impl() const override
Definition: procedure_impl.h:62
void set_comment(const String_type &comment) override
Definition: procedure_impl.h:170
void set_client_collation_id(Object_id client_collation_id) override
Definition: procedure_impl.h:140
ulonglong last_altered(bool convert_time) const override
Definition: procedure_impl.h:161
Object_id id() const override
The unique dictionary object id.
Definition: procedure_impl.h:65
void set_definer(const String_type &username, const String_type &hostname) override
Definition: procedure_impl.h:133
Object_id schema_id() const override
Definition: procedure_impl.h:78
Definition: procedure.h:37
Definition: routine_impl.h:52
void set_definer(const String_type &username, const String_type &hostname) override
Definition: routine_impl.h:186
bool is_deterministic() const override
Definition: routine_impl.h:128
Object_id schema_collation_id() const override
Definition: routine_impl.h:212
const Object_table & object_table() const override
Definition: routine_impl.cc:249
ulonglong created(bool convert_time) const override
Definition: routine_impl.h:224
void set_external_language(const String_type &el) override
Definition: routine_impl.h:154
void set_comment(const String_type &comment) override
Definition: routine_impl.h:249
void set_parameter_str(const String_type &parameter_str) override
Definition: routine_impl.h:120
void set_sql_mode(ulonglong sm) override
Definition: routine_impl.h:176
ulonglong sql_mode() const override
Definition: routine_impl.h:174
const String_type & definer_host() const override
Definition: routine_impl.h:184
enum_sql_data_access sql_data_access() const override
Definition: routine_impl.h:138
Object_id client_collation_id() const override
Definition: routine_impl.h:196
void set_security_type(View::enum_security_type security_type) override
Definition: routine_impl.h:166
View::enum_security_type security_type() const override
Definition: routine_impl.h:162
const String_type & definer_user() const override
Definition: routine_impl.h:182
const String_type & parameter_str() const override
Definition: routine_impl.h:118
ulonglong last_altered(bool convert_time) const override
Definition: routine_impl.h:234
void set_schema_collation_id(Object_id schema_collation_id) override
Definition: routine_impl.h:216
void set_deterministic(bool deterministic) override
Definition: routine_impl.h:130
void set_definition(const String_type &definition) override
Definition: routine_impl.h:102
Object_id schema_id() const override
Definition: routine_impl.h:82
void set_definition_utf8(const String_type &definition_utf8) override
Definition: routine_impl.h:110
Object_id connection_collation_id() const override
Definition: routine_impl.h:204
void set_client_collation_id(Object_id client_collation_id) override
Definition: routine_impl.h:200
const String_type & definition_utf8() const override
Definition: routine_impl.h:106
const String_type & external_language() const override
Definition: routine_impl.h:150
void set_sql_data_access(enum_sql_data_access sda) override
Definition: routine_impl.h:142
void set_created(ulonglong created) override
Definition: routine_impl.h:228
const Parameter_collection & parameters() const override
Definition: routine_impl.h:257
enum_routine_type type() const override
Definition: routine_impl.h:90
Parameter * add_parameter() override
Definition: routine_impl.cc:241
void set_schema_id(Object_id schema_id) override
Definition: routine_impl.h:84
const String_type & definition() const override
Definition: routine_impl.h:100
void set_connection_collation_id(Object_id connection_collation_id) override
Definition: routine_impl.h:208
void set_last_altered(ulonglong last_altered) override
Definition: routine_impl.h:239
const String_type & comment() const override
Definition: routine_impl.h:247
Definition: object_keys.h:434
enum_sql_data_access
Definition: routine.h:90
enum_routine_type
Definition: routine.h:88
virtual bool update_name_key(Name_key *key) const
Definition: routine.h:78
enum_security_type
Definition: view.h:62
Some integer typedefs for easier portability.
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
required string key
Definition: replication_asynchronous_connection_failover.proto:60