MySQL 8.1.0
Source Code Documentation
parameter_type_element_impl.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_TYPE_ELEMENT_IMPL_INCLUDED
24#define DD__PARAMETER_TYPE_ELEMENT_IMPL_INCLUDED
25
26#include <sys/types.h>
27#include <new>
28
29#include "sql/dd/impl/types/weak_object_impl.h" // dd::Weak_object_impl
30#include "sql/dd/string_type.h"
31#include "sql/dd/types/parameter_type_element.h" // dd::Parameter_type_element
32
33namespace dd {
34
35///////////////////////////////////////////////////////////////////////////
36
37class Object_key;
38class Object_table;
39class Open_dictionary_tables_ctx;
40class Parameter;
41class Parameter_impl;
42class Raw_record;
43class Weak_object;
44
45///////////////////////////////////////////////////////////////////////////
46
49 public:
51
54
56 Parameter_impl *parent);
57
58 ~Parameter_type_element_impl() override = default;
59
60 public:
62
63 const Object_table &object_table() const override;
64
65 bool validate() const override;
66
67 bool store_attributes(Raw_record *r) override;
68
69 bool restore_attributes(const Raw_record &r) override;
70
73 }
74
75 virtual uint ordinal_position() const { return index(); }
76
77 public:
79 return new (std::nothrow) Parameter_type_element_impl(parameter);
80 }
81
84 return new (std::nothrow) Parameter_type_element_impl(other, parameter);
85 }
86
87 public:
88 /////////////////////////////////////////////////////////////////////////
89 // Name.
90 /////////////////////////////////////////////////////////////////////////
91
92 const String_type &name() const override { return m_name; }
93
94 void set_name(const String_type &name) override { m_name = name; }
95
96 /////////////////////////////////////////////////////////////////////////
97 // Parameter
98 /////////////////////////////////////////////////////////////////////////
99
100 const Parameter &parameter() const override;
101
102 /////////////////////////////////////////////////////////////////////////
103 // index.
104 /////////////////////////////////////////////////////////////////////////
105
106 uint index() const override { return m_index; }
107
108 public:
109 void debug_print(String_type &outb) const override;
110
111 protected:
112 Object_key *create_primary_key() const override;
113 bool has_new_primary_key() const override;
114
115 protected:
116 // Fields
119
120 // References to other objects
122};
123
124///////////////////////////////////////////////////////////////////////////
125
126} // namespace dd
127
128#endif // DD__PARAMETER_TYPE_ELEMENT_IMPL_INCLUDED
Definition: object_key.h:37
This class represents all data dictionary table like mysql.tables, mysql.columns and more.
Definition: object_table.h:71
Auxiliary class for opening dictionary tables.
Definition: transaction_impl.h:75
Definition: parameter_impl.h:54
Definition: parameter_type_element_impl.h:48
~Parameter_type_element_impl() override=default
const Object_table & object_table() const override
Definition: parameter_type_element_impl.cc:144
uint index() const override
Definition: parameter_type_element_impl.h:106
Parameter_impl * m_parameter
Definition: parameter_type_element_impl.h:121
void debug_print(String_type &outb) const override
Definition: parameter_type_element_impl.cc:109
void set_name(const String_type &name) override
Definition: parameter_type_element_impl.h:94
bool has_new_primary_key() const override
Indicates that object is guaranteed to have primary key value which doesn't exist in database (e....
Definition: parameter_type_element_impl.cc:129
const Parameter & parameter() const override
Definition: parameter_type_element_impl.cc:57
bool store_attributes(Raw_record *r) override
Definition: parameter_type_element_impl.cc:99
Object_key * create_primary_key() const override
Definition: parameter_type_element_impl.cc:123
uint m_index
Definition: parameter_type_element_impl.h:118
const String_type & name() const override
Definition: parameter_type_element_impl.h:92
String_type m_name
Definition: parameter_type_element_impl.h:117
virtual uint ordinal_position() const
Definition: parameter_type_element_impl.h:75
Parameter_type_element_impl(Parameter_impl *parameter)
Definition: parameter_type_element_impl.h:52
void set_ordinal_position(uint ordinal_position)
Definition: parameter_type_element_impl.h:71
static Parameter_type_element_impl * clone(const Parameter_type_element_impl &other, Parameter_impl *parameter)
Definition: parameter_type_element_impl.h:82
static Parameter_type_element_impl * restore_item(Parameter_impl *parameter)
Definition: parameter_type_element_impl.h:78
static void register_tables(Open_dictionary_tables_ctx *otx)
Definition: parameter_type_element_impl.cc:150
bool validate() const override
Definition: parameter_type_element_impl.cc:63
bool restore_attributes(const Raw_record &r) override
Definition: parameter_type_element_impl.cc:85
Parameter_type_element_impl()
Definition: parameter_type_element_impl.h:50
Definition: parameter_type_element.h:42
Definition: parameter.h:44
Definition: raw_record.h:45
Definition: weak_object_impl.h:47
The version of the current data dictionary table definitions.
Definition: dictionary_client.h:42
Char_string_template< String_type_allocator > String_type
Definition: string_type.h:50
const mysql_service_registry_t * r
Definition: pfs_example_plugin_employee.cc:85