MySQL 8.4.0
Source Code Documentation
parameter.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__PARAMETER_INCLUDED
25#define DD__PARAMETER_INCLUDED
26
27#include "my_inttypes.h"
28#include "sql/dd/types/column.h" // dd::Column::enum_column_types
29#include "sql/dd/types/entity_object.h" // dd::Entity_object
30
31namespace dd {
32
33///////////////////////////////////////////////////////////////////////////
34
35class Routine;
36class Parameter_impl;
37class Parameter_type_element;
38
39namespace tables {
40class Parameters;
41}
42
43///////////////////////////////////////////////////////////////////////////
44
45class Parameter : virtual public Entity_object {
46 public:
51
52 public:
53 ~Parameter() override = default;
54
55 public:
57
58 public:
59 /////////////////////////////////////////////////////////////////////////
60 // Is name null?
61 /////////////////////////////////////////////////////////////////////////
62
63 virtual void set_name_null(bool is_null) = 0;
64 virtual bool is_name_null() const = 0;
65
66 /////////////////////////////////////////////////////////////////////////
67 // Routine.
68 /////////////////////////////////////////////////////////////////////////
69
70 virtual const Routine &routine() const = 0;
71
72 virtual Routine &routine() = 0;
73
74 /////////////////////////////////////////////////////////////////////////
75 // ordinal_position.
76 /////////////////////////////////////////////////////////////////////////
77
78 virtual uint ordinal_position() const = 0;
79
80 /////////////////////////////////////////////////////////////////////////
81 // mode
82 /////////////////////////////////////////////////////////////////////////
83
84 virtual enum_parameter_mode mode() const = 0;
86 virtual void set_parameter_mode_null(bool is_null) = 0;
87 virtual bool is_parameter_mode_null() const = 0;
88
89 /////////////////////////////////////////////////////////////////////////
90 // data type.
91 /////////////////////////////////////////////////////////////////////////
92
93 virtual enum_column_types data_type() const = 0;
95
96 /////////////////////////////////////////////////////////////////////////
97 // display type
98 /////////////////////////////////////////////////////////////////////////
99
100 virtual const String_type &data_type_utf8() const = 0;
102
103 /////////////////////////////////////////////////////////////////////////
104 // is_zerofill.
105 /////////////////////////////////////////////////////////////////////////
106
107 virtual bool is_zerofill() const = 0;
108 virtual void set_zerofill(bool zerofill) = 0;
109
110 /////////////////////////////////////////////////////////////////////////
111 // is_unsigned.
112 /////////////////////////////////////////////////////////////////////////
113
114 virtual bool is_unsigned() const = 0;
115 virtual void set_unsigned(bool unsigned_flag) = 0;
116
117 /////////////////////////////////////////////////////////////////////////
118 // char_length.
119 /////////////////////////////////////////////////////////////////////////
120
121 virtual size_t char_length() const = 0;
122 virtual void set_char_length(size_t char_length) = 0;
123
124 /////////////////////////////////////////////////////////////////////////
125 // numeric_precision.
126 /////////////////////////////////////////////////////////////////////////
127
128 virtual uint numeric_precision() const = 0;
130
131 /////////////////////////////////////////////////////////////////////////
132 // numeric_scale.
133 /////////////////////////////////////////////////////////////////////////
134
135 virtual uint numeric_scale() const = 0;
136 virtual void set_numeric_scale(uint numeric_scale) = 0;
137 virtual void set_numeric_scale_null(bool is_null) = 0;
138 virtual bool is_numeric_scale_null() const = 0;
139
140 /////////////////////////////////////////////////////////////////////////
141 // datetime_precision.
142 /////////////////////////////////////////////////////////////////////////
143
144 virtual uint datetime_precision() const = 0;
146
147 /////////////////////////////////////////////////////////////////////////
148 // collation.
149 /////////////////////////////////////////////////////////////////////////
150
151 virtual Object_id collation_id() const = 0;
153
154 /////////////////////////////////////////////////////////////////////////
155 // Options.
156 /////////////////////////////////////////////////////////////////////////
157
158 virtual const Properties &options() const = 0;
159
160 virtual Properties &options() = 0;
161 virtual bool set_options(const String_type &options_raw) = 0;
162
163 /////////////////////////////////////////////////////////////////////////
164 // Elements.
165 /////////////////////////////////////////////////////////////////////////
166
168
169 virtual const Parameter_type_element_collection &elements() const = 0;
170
171 virtual size_t elements_count() const = 0;
172};
173
174///////////////////////////////////////////////////////////////////////////
175
176} // namespace dd
177
178#endif // DD__PARAMETER_INCLUDED
Definition: collection.h:44
Base class for dictionary objects which has single column integer primary key.
Definition: entity_object.h:48
Definition: parameter_impl.h:55
Definition: parameter_type_element.h:43
Definition: parameter.h:45
virtual Parameter_type_element * add_element()=0
virtual uint numeric_precision() const =0
virtual const Properties & options() const =0
virtual bool is_unsigned() const =0
virtual bool is_parameter_mode_null() const =0
virtual bool is_zerofill() const =0
virtual const String_type & data_type_utf8() const =0
virtual Routine & routine()=0
virtual bool set_options(const String_type &options_raw)=0
virtual void set_unsigned(bool unsigned_flag)=0
virtual const Parameter_type_element_collection & elements() const =0
tables::Parameters DD_table
Definition: parameter.h:50
virtual void set_zerofill(bool zerofill)=0
virtual const Routine & routine() const =0
virtual void set_parameter_mode_null(bool is_null)=0
virtual void set_numeric_scale_null(bool is_null)=0
virtual uint datetime_precision() const =0
virtual bool is_numeric_scale_null() const =0
virtual void set_collation_id(Object_id collation_id)=0
virtual void set_mode(enum_parameter_mode mode)=0
virtual Object_id collation_id() const =0
enum_parameter_mode
Definition: parameter.h:56
@ PM_INOUT
Definition: parameter.h:56
@ PM_OUT
Definition: parameter.h:56
@ PM_IN
Definition: parameter.h:56
virtual size_t elements_count() const =0
virtual void set_data_type_utf8(const String_type &data_type_utf8)=0
virtual enum_parameter_mode mode() const =0
virtual bool is_name_null() const =0
virtual Properties & options()=0
Collection< Parameter_type_element * > Parameter_type_element_collection
Definition: parameter.h:48
~Parameter() override=default
virtual uint ordinal_position() const =0
virtual void set_numeric_scale(uint numeric_scale)=0
virtual uint numeric_scale() const =0
virtual void set_datetime_precision(uint datetime_precision)=0
Parameter_impl Impl
Definition: parameter.h:49
virtual enum_column_types data_type() const =0
virtual void set_char_length(size_t char_length)=0
virtual void set_numeric_precision(uint numeric_precision)=0
virtual size_t char_length() const =0
virtual void set_data_type(enum_column_types type)=0
virtual void set_name_null(bool is_null)=0
The Properties class defines an interface for storing key=value pairs, where both key and value may b...
Definition: properties.h:74
Abstract base class for functions and procedures.
Definition: routine.h:61
Definition: parameters.h:40
Some integer typedefs for easier portability.
constexpr value_type zerofill
Definition: classic_protocol_constants.h:274
The version of the current data dictionary table definitions.
Definition: dictionary_client.h:43
unsigned long long Object_id
Definition: object_id.h:31
enum_column_types
Definition: column.h:53
Char_string_template< String_type_allocator > String_type
Definition: string_type.h:51
required string type
Definition: replication_group_member_actions.proto:34