MySQL 8.4.2
Source Code Documentation
tablespace_file_impl.h
Go to the documentation of this file.
1/* Copyright (c) 2014, 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__TABLESPACE_FILES_IMPL_INCLUDED
25#define DD__TABLESPACE_FILES_IMPL_INCLUDED
26
27#include <sys/types.h>
28#include <memory> // std::unique_ptr
29#include <new>
30
33#include "sql/dd/impl/types/weak_object_impl.h" // dd::Weak_object_impl
34#include "sql/dd/sdi_fwd.h"
35#include "sql/dd/string_type.h"
36#include "sql/dd/types/tablespace_file.h" // dd::Tablespace_file
37
38namespace dd {
39
40///////////////////////////////////////////////////////////////////////////
41
42class Object_key;
43class Object_table;
44class Open_dictionary_tables_ctx;
45class Sdi_rcontext;
46class Sdi_wcontext;
47class Tablespace;
48class Tablespace_impl;
49class Weak_object;
50
51///////////////////////////////////////////////////////////////////////////
52
54 public:
56
58
60 Tablespace_impl *parent);
61
62 ~Tablespace_file_impl() override = default;
63
64 public:
65 const Object_table &object_table() const override;
66
67 bool store(Open_dictionary_tables_ctx *otx) override;
68
69 bool validate() const override;
70
71 bool store_attributes(Raw_record *r) override;
72
73 bool restore_attributes(const Raw_record &r) override;
74
75 void serialize(Sdi_wcontext *wctx, Sdi_writer *w) const override;
76
77 bool deserialize(Sdi_rcontext *rctx, const RJ_Value &val) override;
78
79 void debug_print(String_type &outb) const override;
80
83 }
84
85 public:
87
88 /////////////////////////////////////////////////////////////////////////
89 // ordinal_position.
90 /////////////////////////////////////////////////////////////////////////
91
92 uint ordinal_position() const override { return m_ordinal_position; }
93
94 /////////////////////////////////////////////////////////////////////////
95 // filename.
96 /////////////////////////////////////////////////////////////////////////
97
98 const String_type &filename() const override { return m_filename; }
99
100 void set_filename(const String_type &filename) override {
102 }
103
104 /////////////////////////////////////////////////////////////////////////
105 // se_private_data.
106 /////////////////////////////////////////////////////////////////////////
107
108 const Properties &se_private_data() const override {
109 return m_se_private_data;
110 }
111
113
114 bool set_se_private_data(const String_type &se_private_data_raw) override {
115 return m_se_private_data.insert_values(se_private_data_raw);
116 }
117
118 /////////////////////////////////////////////////////////////////////////
119 // tablespace.
120 /////////////////////////////////////////////////////////////////////////
121
122 const Tablespace &tablespace() const override;
123
124 Tablespace &tablespace() override;
125
126 public:
128 return new (std::nothrow) Tablespace_file_impl(ts);
129 }
130
132 Tablespace_impl *ts) {
133 return new (std::nothrow) Tablespace_file_impl(other, ts);
134 }
135
136 public:
137 Object_key *create_primary_key() const override;
138 bool has_new_primary_key() const override;
139
140 private:
141 // Fields
143
146
147 // References to other objects
149};
150
151///////////////////////////////////////////////////////////////////////////
152
153} // namespace dd
154
155#endif // DD__TABLESPACE_FILES_IMPL_INCLUDED
Data structure that contains the information about shared tablespaces.
Definition: fsp0space.h:47
Definition: object_key.h:38
This class represents all data dictionary table like mysql.tables, mysql.columns and more.
Definition: object_table.h:72
Auxiliary class for opening dictionary tables.
Definition: transaction_impl.h:76
The Properties_impl class implements the Properties interface.
Definition: properties_impl.h:77
bool insert_values(const Properties &properties) override
Insert key/value pairs from a different property object.
Definition: properties_impl.cc:104
The Properties class defines an interface for storing key=value pairs, where both key and value may b...
Definition: properties.h:74
Definition: raw_record.h:46
Opaque context which keeps reusable resoureces needed during deserialization.
Definition: sdi.cc:231
Opaque context which keeps reusable resources needed during serialization.
Definition: sdi.cc:129
Definition: tablespace_file_impl.h:53
static Tablespace_file_impl * clone(const Tablespace_file_impl &other, Tablespace_impl *ts)
Definition: tablespace_file_impl.h:131
bool store(Open_dictionary_tables_ctx *otx) override
Store the DD object into DD table.
Definition: tablespace_file_impl.cc:97
void debug_print(String_type &outb) const override
Definition: tablespace_file_impl.cc:171
Tablespace_impl * m_tablespace
Definition: tablespace_file_impl.h:148
bool deserialize(Sdi_rcontext *rctx, const RJ_Value &val) override
Re-establishes the state of *this by reading sdi information from the rapidjson DOM subobject provide...
Definition: tablespace_file_impl.cc:162
void set_ordinal_position(uint ordinal_position)
Definition: tablespace_file_impl.h:81
~Tablespace_file_impl() override=default
const String_type & filename() const override
Definition: tablespace_file_impl.h:98
uint ordinal_position() const override
Definition: tablespace_file_impl.h:92
bool restore_attributes(const Raw_record &r) override
Definition: tablespace_file_impl.cc:124
void serialize(Sdi_wcontext *wctx, Sdi_writer *w) const override
Converts *this into json.
Definition: tablespace_file_impl.cc:152
uint m_ordinal_position
Definition: tablespace_file_impl.h:142
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: tablespace_file_impl.cc:189
static void register_tables(Open_dictionary_tables_ctx *otx)
Definition: tablespace_file_impl.cc:211
static Tablespace_file_impl * restore_item(Tablespace_impl *ts)
Definition: tablespace_file_impl.h:127
String_type m_filename
Definition: tablespace_file_impl.h:144
Properties & se_private_data() override
Definition: tablespace_file_impl.h:112
Object_key * create_primary_key() const override
Definition: tablespace_file_impl.cc:184
Properties_impl m_se_private_data
Definition: tablespace_file_impl.h:145
const Tablespace & tablespace() const override
Definition: tablespace_file_impl.cc:72
bool set_se_private_data(const String_type &se_private_data_raw) override
Definition: tablespace_file_impl.h:114
const Properties & se_private_data() const override
Definition: tablespace_file_impl.h:108
bool store_attributes(Raw_record *r) override
Definition: tablespace_file_impl.cc:139
Tablespace_file_impl()
Definition: tablespace_file_impl.cc:64
void set_filename(const String_type &filename) override
Definition: tablespace_file_impl.h:100
const Object_table & object_table() const override
Definition: tablespace_file_impl.cc:205
bool validate() const override
Definition: tablespace_file_impl.cc:112
Definition: tablespace_file.h:45
Definition: tablespace_impl.h:57
Definition: tablespace.h:56
Definition: weak_object_impl.h:48
The version of the current data dictionary table definitions.
Definition: dictionary_client.h:43
RJ_Writer Sdi_writer
Alias for the rapidjson Writer type to use in serialization.
Definition: sdi_fwd.h:64
rapidjson::GenericValue< RJ_Encoding, RJ_Allocator > RJ_Value
Definition: sdi_fwd.h:49
Char_string_template< String_type_allocator > String_type
Definition: string_type.h:51
const mysql_service_registry_t * r
Definition: pfs_example_plugin_employee.cc:86
This header provides Rapidjson Type Aliases.