MySQL 8.0.30
Source Code Documentation
procedure_impl.h
Go to the documentation of this file.
1/* Copyright (c) 2016, 2022, 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 DD__PROCEDURE_IMPL_INCLUDED
24#define DD__PROCEDURE_IMPL_INCLUDED
25
26#include <new>
27
28#include "my_inttypes.h"
30#include "sql/dd/impl/types/routine_impl.h" // dd::Routine_impl
32#include "sql/dd/object_id.h"
33#include "sql/dd/string_type.h"
34#include "sql/dd/types/procedure.h" // dd::Procedure
36#include "sql/dd/types/view.h"
37
38namespace dd {
39
40///////////////////////////////////////////////////////////////////////////
41
42class Open_dictionary_tables_ctx;
43class Parameter;
44class Weak_object;
45class Object_table;
46
47class Procedure_impl : public Routine_impl, public Procedure {
48 public:
49 Procedure_impl() = default;
50
51 ~Procedure_impl() override = default;
52
53 public:
55 const String_type &name) const override;
56
57 void debug_print(String_type &outb) const override;
58
59 // Fix "inherits ... via dominance" warnings
61 const Entity_object_impl *impl() const override {
63 }
64 Object_id id() const override { return Entity_object_impl::id(); }
65 bool is_persistent() const override {
67 }
68 const String_type &name() const override {
70 }
71 void set_name(const String_type &name) override {
73 }
74 const Object_table &object_table() const override {
76 }
77 Object_id schema_id() const override { return Routine_impl::schema_id(); }
80 }
81 enum_routine_type type() const override { return Routine_impl::type(); }
82 const String_type &definition() const override {
84 }
85 void set_definition(const String_type &definition) override {
87 }
88 const String_type &definition_utf8() const override {
90 }
93 }
94 const String_type &parameter_str() const override {
96 }
99 }
100 bool is_deterministic() const override {
102 }
103 void set_deterministic(bool deterministic) override {
104 Routine_impl::set_deterministic(deterministic);
105 }
108 }
111 }
114 }
117 }
118 ulonglong sql_mode() const override { return Routine_impl::sql_mode(); }
120 const String_type &definer_user() const override {
122 }
123 const String_type &definer_host() const override {
125 }
126 void set_definer(const String_type &username,
127 const String_type &hostname) override {
128 Routine_impl::set_definer(username, hostname);
129 }
132 }
135 }
138 }
141 }
144 }
147 }
148 ulonglong created(bool convert_time) const override {
149 return Routine_impl::created(convert_time);
150 }
153 }
154 ulonglong last_altered(bool convert_time) const override {
155 return Routine_impl::last_altered(convert_time);
156 }
159 }
160 const String_type &comment() const override {
161 return Routine_impl::comment();
162 }
163 void set_comment(const String_type &comment) override {
165 }
167 const Parameter_collection &parameters() const override {
169 }
170 bool update_name_key(Name_key *key) const override {
172 }
173
174 private:
175 Procedure_impl(const Procedure_impl &src);
176 Procedure_impl *clone() const override { return new Procedure_impl(*this); }
177
178 // N.B.: returning dd::Procedure from this function might confuse MSVC
179 // compiler thanks to diamond inheritance.
181 Procedure_impl *placeholder = new Procedure_impl();
182 placeholder->set_id(id());
183 placeholder->set_schema_id(schema_id());
184 placeholder->set_name(name());
185 return placeholder;
186 }
187};
188
189///////////////////////////////////////////////////////////////////////////
190
191} // namespace dd
192
193#endif // DD__PROCEDURE_IMPL_INCLUDED
Definition: collection.h:43
Definition: entity_object_impl.h:43
void set_name(const String_type &name) override
Definition: entity_object_impl.h:61
void set_id(Object_id id)
Definition: entity_object_impl.h:50
Object_id id() const override
The unique dictionary object id.
Definition: entity_object_impl.h:48
const String_type & name() const override
Definition: entity_object_impl.h:59
Entity_object_impl * impl() override
Definition: entity_object_impl.h:67
bool is_persistent() const override
Is dictionary object persistent in dictionary tables ?
Definition: entity_object_impl.h:56
This class represents all data dictionary table like mysql.tables, mysql.columns and more.
Definition: object_table.h:71
Definition: parameter.h:44
Definition: procedure_impl.h:47
void set_deterministic(bool deterministic) override
Definition: procedure_impl.h:103
const String_type & parameter_str() const override
Definition: procedure_impl.h:94
void set_created(ulonglong created) override
Definition: procedure_impl.h:151
void set_last_altered(ulonglong last_altered) override
Definition: procedure_impl.h:157
const Object_table & object_table() const override
Definition: procedure_impl.h:74
void set_sql_mode(ulonglong sm) override
Definition: procedure_impl.h:119
void set_sql_data_access(enum_sql_data_access sda) override
Definition: procedure_impl.h:109
~Procedure_impl() override=default
void set_definition(const String_type &definition) override
Definition: procedure_impl.h:85
void debug_print(String_type &outb) const override
Definition: procedure_impl.cc:57
void set_connection_collation_id(Object_id connection_collation_id) override
Definition: procedure_impl.h:139
const String_type & definition() const override
Definition: procedure_impl.h:82
ulonglong created(bool convert_time) const override
Definition: procedure_impl.h:148
Object_id schema_collation_id() const override
Definition: procedure_impl.h:142
void set_parameter_str(const String_type &parameter_str) override
Definition: procedure_impl.h:97
bool is_deterministic() const override
Definition: procedure_impl.h:100
const Parameter_collection & parameters() const override
Definition: procedure_impl.h:167
enum_sql_data_access sql_data_access() const override
Definition: procedure_impl.h:106
Object_id connection_collation_id() const override
Definition: procedure_impl.h:136
Object_id client_collation_id() const override
Definition: procedure_impl.h:130
void set_schema_id(Object_id schema_id) override
Definition: procedure_impl.h:78
void set_security_type(View::enum_security_type security_type) override
Definition: procedure_impl.h:115
Procedure_impl()=default
View::enum_security_type security_type() const override
Definition: procedure_impl.h:112
void set_schema_collation_id(Object_id schema_collation_id) override
Definition: procedure_impl.h:145
Parameter * add_parameter() override
Definition: procedure_impl.h:166
const String_type & definer_host() const override
Definition: procedure_impl.h:123
bool update_routine_name_key(Name_key *key, Object_id schema_id, const String_type &name) const override
Definition: procedure_impl.cc:42
bool update_name_key(Name_key *key) const override
Definition: procedure_impl.h:170
Procedure_impl * clone() const override
Allocate a new object graph and invoke the copy constructor for each object.
Definition: procedure_impl.h:176
const String_type & comment() const override
Definition: procedure_impl.h:160
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:180
void set_name(const String_type &name) override
Definition: procedure_impl.h:71
Entity_object_impl * impl() override
Definition: procedure_impl.h:60
ulonglong sql_mode() const override
Definition: procedure_impl.h:118
const String_type & name() const override
Definition: procedure_impl.h:68
const String_type & definer_user() const override
Definition: procedure_impl.h:120
const String_type & definition_utf8() const override
Definition: procedure_impl.h:88
bool is_persistent() const override
Is dictionary object persistent in dictionary tables ?
Definition: procedure_impl.h:65
void set_definition_utf8(const String_type &definition_utf8) override
Definition: procedure_impl.h:91
enum_routine_type type() const override
Definition: procedure_impl.h:81
const Entity_object_impl * impl() const override
Definition: procedure_impl.h:61
void set_comment(const String_type &comment) override
Definition: procedure_impl.h:163
void set_client_collation_id(Object_id client_collation_id) override
Definition: procedure_impl.h:133
ulonglong last_altered(bool convert_time) const override
Definition: procedure_impl.h:154
Object_id id() const override
The unique dictionary object id.
Definition: procedure_impl.h:64
void set_definer(const String_type &username, const String_type &hostname) override
Definition: procedure_impl.h:126
Object_id schema_id() const override
Definition: procedure_impl.h:77
Definition: procedure.h:36
Definition: routine_impl.h:51
void set_definer(const String_type &username, const String_type &hostname) override
Definition: routine_impl.h:173
bool is_deterministic() const override
Definition: routine_impl.h:127
Object_id schema_collation_id() const override
Definition: routine_impl.h:199
const Object_table & object_table() const override
Definition: routine_impl.cc:243
ulonglong created(bool convert_time) const override
Definition: routine_impl.h:211
void set_comment(const String_type &comment) override
Definition: routine_impl.h:236
void set_parameter_str(const String_type &parameter_str) override
Definition: routine_impl.h:119
void set_sql_mode(ulonglong sm) override
Definition: routine_impl.h:163
ulonglong sql_mode() const override
Definition: routine_impl.h:161
const String_type & definer_host() const override
Definition: routine_impl.h:171
enum_sql_data_access sql_data_access() const override
Definition: routine_impl.h:137
Object_id client_collation_id() const override
Definition: routine_impl.h:183
void set_security_type(View::enum_security_type security_type) override
Definition: routine_impl.h:153
View::enum_security_type security_type() const override
Definition: routine_impl.h:149
const String_type & definer_user() const override
Definition: routine_impl.h:169
const String_type & parameter_str() const override
Definition: routine_impl.h:117
ulonglong last_altered(bool convert_time) const override
Definition: routine_impl.h:221
void set_schema_collation_id(Object_id schema_collation_id) override
Definition: routine_impl.h:203
void set_deterministic(bool deterministic) override
Definition: routine_impl.h:129
void set_definition(const String_type &definition) override
Definition: routine_impl.h:101
Object_id schema_id() const override
Definition: routine_impl.h:81
void set_definition_utf8(const String_type &definition_utf8) override
Definition: routine_impl.h:109
Object_id connection_collation_id() const override
Definition: routine_impl.h:191
void set_client_collation_id(Object_id client_collation_id) override
Definition: routine_impl.h:187
const String_type & definition_utf8() const override
Definition: routine_impl.h:105
void set_sql_data_access(enum_sql_data_access sda) override
Definition: routine_impl.h:141
void set_created(ulonglong created) override
Definition: routine_impl.h:215
const Parameter_collection & parameters() const override
Definition: routine_impl.h:244
enum_routine_type type() const override
Definition: routine_impl.h:89
Parameter * add_parameter() override
Definition: routine_impl.cc:235
void set_schema_id(Object_id schema_id) override
Definition: routine_impl.h:83
const String_type & definition() const override
Definition: routine_impl.h:99
void set_connection_collation_id(Object_id connection_collation_id) override
Definition: routine_impl.h:195
void set_last_altered(ulonglong last_altered) override
Definition: routine_impl.h:226
const String_type & comment() const override
Definition: routine_impl.h:234
Definition: object_keys.h:434
enum_sql_data_access
Definition: routine.h:89
enum_routine_type
Definition: routine.h:87
virtual bool update_name_key(Name_key *key) const
Definition: routine.h:77
enum_security_type
Definition: view.h:57
Some integer typedefs for easier portability.
unsigned long long int ulonglong
Definition: my_inttypes.h:55
The version of the current data dictionary table definitions.
Definition: dictionary_client.h:42
unsigned long long Object_id
Definition: object_id.h:30
Char_string_template< String_type_allocator > String_type
Definition: string_type.h:50
required string key
Definition: replication_asynchronous_connection_failover.proto:59