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