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