MySQL 9.0.0
Source Code Documentation
table_stat_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__TABLE_STAT_IMPL_INCLUDED
25#define DD__TABLE_STAT_IMPL_INCLUDED
26
27#include <memory>
28#include <new>
29#include <string>
30
31#include "my_inttypes.h"
33#include "sql/dd/impl/types/entity_object_impl.h" // dd::Entity_object_impl
34#include "sql/dd/object_id.h"
35#include "sql/dd/string_type.h"
37#include "sql/dd/types/table_stat.h" // dd::Table_stat
38
39namespace dd {
40
41///////////////////////////////////////////////////////////////////////////
42
43class Charset;
44class Object_key;
45class Object_table;
46class Open_dictionary_tables_ctx;
47class Raw_table;
48class Transaction;
49class Weak_object;
50class Object_table;
51
52///////////////////////////////////////////////////////////////////////////
53
55 public:
57 : m_table_rows(0),
62 m_data_free(0),
64 m_checksum(0),
66 m_check_time(0),
67 m_cached_time(0) {}
68
69 public:
70 void debug_print(String_type &outb) const override;
71
72 const Object_table &object_table() const override;
73
74 bool validate() const override;
75
76 bool restore_attributes(const Raw_record &r) override;
77 bool store_attributes(Raw_record *r) override;
78
79 public:
81
82 /////////////////////////////////////////////////////////////////////////
83 // schema name.
84 /////////////////////////////////////////////////////////////////////////
85
86 const String_type &schema_name() const override { return m_schema_name; }
87
88 void set_schema_name(const String_type &schema_name) override {
90 }
91
92 /////////////////////////////////////////////////////////////////////////
93 // table name.
94 /////////////////////////////////////////////////////////////////////////
95
96 const String_type &table_name() const override { return m_table_name; }
97
98 void set_table_name(const String_type &table_name) override {
100 }
101
102 /////////////////////////////////////////////////////////////////////////
103 // table_rows.
104 /////////////////////////////////////////////////////////////////////////
105
106 ulonglong table_rows() const override { return m_table_rows; }
107
110 }
111
112 /////////////////////////////////////////////////////////////////////////
113 // avg_row_length.
114 /////////////////////////////////////////////////////////////////////////
115
116 ulonglong avg_row_length() const override { return m_avg_row_length; }
117
120 }
121
122 /////////////////////////////////////////////////////////////////////////
123 // data_length.
124 /////////////////////////////////////////////////////////////////////////
125
126 ulonglong data_length() const override { return m_data_length; }
127
130 }
131
132 /////////////////////////////////////////////////////////////////////////
133 // max_data_length.
134 /////////////////////////////////////////////////////////////////////////
135
136 ulonglong max_data_length() const override { return m_max_data_length; }
137
140 }
141
142 /////////////////////////////////////////////////////////////////////////
143 // index_length.
144 /////////////////////////////////////////////////////////////////////////
145
146 ulonglong index_length() const override { return m_index_length; }
147
150 }
151
152 /////////////////////////////////////////////////////////////////////////
153 // data_free.
154 /////////////////////////////////////////////////////////////////////////
155
156 ulonglong data_free() const override { return m_data_free; }
157
159
160 /////////////////////////////////////////////////////////////////////////
161 // auto_increment.
162 /////////////////////////////////////////////////////////////////////////
163
164 ulonglong auto_increment() const override { return m_auto_increment; }
165
168 }
169
170 /////////////////////////////////////////////////////////////////////////
171 // checksum.
172 /////////////////////////////////////////////////////////////////////////
173
174 ulonglong checksum() const override { return m_checksum; }
175
177
178 /////////////////////////////////////////////////////////////////////////
179 // update_time.
180 /////////////////////////////////////////////////////////////////////////
181
182 ulonglong update_time() const override { return m_update_time; }
183
186 }
187
188 /////////////////////////////////////////////////////////////////////////
189 // check_time.
190 /////////////////////////////////////////////////////////////////////////
191
192 ulonglong check_time() const override { return m_check_time; }
193
196 }
197
198 /////////////////////////////////////////////////////////////////////////
199 // cached_time.
200 /////////////////////////////////////////////////////////////////////////
201
202 ulonglong cached_time() const override { return m_cached_time; }
203
206 }
207
208 public:
209 Object_key *create_primary_key() const override;
210 bool has_new_primary_key() const override;
211
212 // Fix "inherits ... via dominance" warnings
214 const Entity_object_impl *impl() const override {
216 }
217 Object_id id() const override { return Entity_object_impl::id(); }
218 bool is_persistent() const override {
220 }
221 const String_type &name() const override {
223 }
224 void set_name(const String_type &name) override {
226 }
227
228 private:
229 // Fields
232
244};
245
246///////////////////////////////////////////////////////////////////////////
247
248} // namespace dd
249
250#endif // DD__TABLE_STAT_IMPL_INCLUDED
Definition: entity_object_impl.h:44
void set_name(const String_type &name) override
Definition: entity_object_impl.h:62
Object_id id() const override
The unique dictionary object id.
Definition: entity_object_impl.h:49
const String_type & name() const override
Definition: entity_object_impl.h:60
Entity_object_impl * impl() override
Definition: entity_object_impl.h:68
bool is_persistent() const override
Is dictionary object persistent in dictionary tables ?
Definition: entity_object_impl.h:57
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
Definition: raw_record.h:46
Definition: table_stat_impl.h:54
ulonglong data_length() const override
Definition: table_stat_impl.h:126
String_type m_schema_name
Definition: table_stat_impl.h:230
void set_table_rows(ulonglong table_rows) override
Definition: table_stat_impl.h:108
ulonglong m_check_time
Definition: table_stat_impl.h:242
ulonglong check_time() const override
Definition: table_stat_impl.h:192
ulonglong m_data_free
Definition: table_stat_impl.h:238
ulonglong m_cached_time
Definition: table_stat_impl.h:243
ulonglong m_auto_increment
Definition: table_stat_impl.h:239
const Object_table & object_table() const override
Definition: table_stat_impl.cc:155
ulonglong data_free() const override
Definition: table_stat_impl.h:156
const String_type & name() const override
Definition: table_stat_impl.h:221
ulonglong table_rows() const override
Definition: table_stat_impl.h:106
void set_check_time(ulonglong check_time) override
Definition: table_stat_impl.h:194
const String_type & table_name() const override
Definition: table_stat_impl.h:96
void debug_print(String_type &outb) const override
Definition: table_stat_impl.cc:102
void set_table_name(const String_type &table_name) override
Definition: table_stat_impl.h:98
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: table_stat_impl.cc:131
ulonglong m_index_length
Definition: table_stat_impl.h:237
ulonglong index_length() const override
Definition: table_stat_impl.h:146
void set_data_length(ulonglong data_length) override
Definition: table_stat_impl.h:128
ulonglong m_table_rows
Definition: table_stat_impl.h:233
void set_schema_name(const String_type &schema_name) override
Definition: table_stat_impl.h:88
Object_id id() const override
The unique dictionary object id.
Definition: table_stat_impl.h:217
Table_stat_impl()
Definition: table_stat_impl.h:56
void set_name(const String_type &name) override
Definition: table_stat_impl.h:224
void set_checksum(ulonglong checksum) override
Definition: table_stat_impl.h:176
ulonglong m_max_data_length
Definition: table_stat_impl.h:236
ulonglong update_time() const override
Definition: table_stat_impl.h:182
bool validate() const override
Definition: table_stat_impl.cc:48
ulonglong avg_row_length() const override
Definition: table_stat_impl.h:116
ulonglong checksum() const override
Definition: table_stat_impl.h:174
Entity_object_impl * impl() override
Definition: table_stat_impl.h:213
ulonglong m_update_time
Definition: table_stat_impl.h:241
const Entity_object_impl * impl() const override
Definition: table_stat_impl.h:214
void set_update_time(ulonglong update_time) override
Definition: table_stat_impl.h:184
ulonglong m_data_length
Definition: table_stat_impl.h:235
ulonglong max_data_length() const override
Definition: table_stat_impl.h:136
void set_avg_row_length(ulonglong avg_row_length) override
Definition: table_stat_impl.h:118
const String_type & schema_name() const override
Definition: table_stat_impl.h:86
Object_key * create_primary_key() const override
Definition: table_stat_impl.cc:125
static void register_tables(Open_dictionary_tables_ctx *otx)
Definition: table_stat_impl.cc:161
void set_cached_time(ulonglong cached_time) override
Definition: table_stat_impl.h:204
String_type m_table_name
Definition: table_stat_impl.h:231
ulonglong auto_increment() const override
Definition: table_stat_impl.h:164
void set_data_free(ulonglong data_free) override
Definition: table_stat_impl.h:158
void set_auto_increment(ulonglong auto_increment) override
Definition: table_stat_impl.h:166
bool store_attributes(Raw_record *r) override
Definition: table_stat_impl.cc:81
void set_max_data_length(ulonglong max_data_length) override
Definition: table_stat_impl.h:138
ulonglong cached_time() const override
Definition: table_stat_impl.h:202
ulonglong m_avg_row_length
Definition: table_stat_impl.h:234
void set_index_length(ulonglong index_length) override
Definition: table_stat_impl.h:148
bool restore_attributes(const Raw_record &r) override
Definition: table_stat_impl.cc:60
bool is_persistent() const override
Is dictionary object persistent in dictionary tables ?
Definition: table_stat_impl.h:218
ulonglong m_checksum
Definition: table_stat_impl.h:240
Definition: table_stat.h:43
Some integer typedefs for easier portability.
unsigned long long int ulonglong
Definition: my_inttypes.h:56
The version of the current data dictionary table definitions.
Definition: dictionary_client.h:43
unsigned long long Object_id
Definition: object_id.h:31
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