MySQL 8.0.37
Source Code Documentation
tables.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_TABLES__TABLES_INCLUDED
25#define DD_TABLES__TABLES_INCLUDED
26
27#include <string>
28
29#include "my_inttypes.h"
32#include "sql/dd/object_id.h" // dd::Object_id
33#include "sql/dd/string_type.h"
35
36namespace dd {
37
38class Item_name_key;
39class Object_key;
40class Open_dictionary_tables_ctx;
41class Se_private_id_key;
42
43namespace tables {
44
45///////////////////////////////////////////////////////////////////////////
46
48 public:
49 static const Tables &instance();
50
51 static const CHARSET_INFO *name_collation();
52
91 NUMBER_OF_FIELDS // Always keep this entry at the end of the enum
92 };
93
105 };
106
113 };
114
115 Tables();
116
117 Abstract_table *create_entity_object(const Raw_record &r) const override;
118
119 static bool update_object_key(Item_name_key *key, Object_id schema_id,
120 const String_type &table_name);
121
122 static bool update_aux_key(Se_private_id_key *key, const String_type &engine,
123 ulonglong se_private_id);
124
125 static Object_key *create_se_private_key(const String_type &engine,
126 Object_id se_private_id);
127
129
130 static Object_key *create_key_by_tablespace_id(Object_id tablespace_id);
131
132 /**
133 Create a key to find all views for a given definer.
134
135 @param definer Name of the definer.
136
137 @returns Pointer to Object_key.
138 */
139 static Object_key *create_key_by_definer(const String_type &definer);
140
142};
143
144///////////////////////////////////////////////////////////////////////////
145
146} // namespace tables
147} // namespace dd
148
149#endif // DD_TABLES__TABLES_INCLUDED
Abstract base class for tables and views.
Definition: abstract_table.h:69
Definition: entity_object_table_impl.h:46
Definition: object_keys.h:166
Definition: object_key.h:38
Definition: raw_record.h:46
Definition: object_keys.h:219
Definition: tables.h:47
Tables()
Definition: tables.cc:57
static bool update_aux_key(Se_private_id_key *key, const String_type &engine, ulonglong se_private_id)
Definition: tables.cc:229
static ulonglong read_se_private_id(const Raw_record &r)
Definition: tables.cc:279
static Object_key * create_se_private_key(const String_type &engine, Object_id se_private_id)
Definition: tables.cc:239
enum_fields
Definition: tables.h:53
@ FIELD_OPTIONS
Definition: tables.h:64
@ FIELD_SE_PRIVATE_ID
Definition: tables.h:66
@ FIELD_PARTITION_TYPE
Definition: tables.h:68
@ FIELD_VIEW_CONNECTION_COLLATION_ID
Definition: tables.h:86
@ FIELD_SE_PRIVATE_DATA
Definition: tables.h:65
@ FIELD_SUBPARTITION_EXPRESSION_UTF8
Definition: tables.h:74
@ FIELD_VIEW_DEFINER
Definition: tables.h:84
@ FIELD_HIDDEN
Definition: tables.h:63
@ FIELD_PARTITION_EXPRESSION
Definition: tables.h:69
@ FIELD_CREATED
Definition: tables.h:76
@ FIELD_ENGINE
Definition: tables.h:58
@ FIELD_COLLATION_ID
Definition: tables.h:61
@ FIELD_PARTITION_EXPRESSION_UTF8
Definition: tables.h:70
@ FIELD_TABLESPACE_ID
Definition: tables.h:67
@ FIELD_SECONDARY_ENGINE_ATTRIBUTE
Definition: tables.h:90
@ FIELD_ENGINE_ATTRIBUTE
Definition: tables.h:89
@ FIELD_VIEW_IS_UPDATABLE
Definition: tables.h:81
@ FIELD_LAST_CHECKED_FOR_UPGRADE_VERSION_ID
Definition: tables.h:88
@ FIELD_DEFAULT_PARTITIONING
Definition: tables.h:71
@ FIELD_VIEW_DEFINITION
Definition: tables.h:78
@ FIELD_SUBPARTITION_TYPE
Definition: tables.h:72
@ FIELD_SCHEMA_ID
Definition: tables.h:55
@ FIELD_COMMENT
Definition: tables.h:62
@ FIELD_VIEW_CHECK_OPTION
Definition: tables.h:80
@ FIELD_SUBPARTITION_EXPRESSION
Definition: tables.h:73
@ FIELD_ROW_FORMAT
Definition: tables.h:60
@ FIELD_VIEW_ALGORITHM
Definition: tables.h:82
@ FIELD_ID
Definition: tables.h:54
@ FIELD_TYPE
Definition: tables.h:57
@ NUMBER_OF_FIELDS
Definition: tables.h:91
@ FIELD_VIEW_COLUMN_NAMES
Definition: tables.h:87
@ FIELD_DEFAULT_SUBPARTITIONING
Definition: tables.h:75
@ FIELD_LAST_ALTERED
Definition: tables.h:77
@ FIELD_MYSQL_VERSION_ID
Definition: tables.h:59
@ FIELD_VIEW_CLIENT_COLLATION_ID
Definition: tables.h:85
@ FIELD_NAME
Definition: tables.h:56
@ FIELD_VIEW_SECURITY_TYPE
Definition: tables.h:83
@ FIELD_VIEW_DEFINITION_UTF8
Definition: tables.h:79
Abstract_table * create_entity_object(const Raw_record &r) const override
Definition: tables.cc:208
static Object_key * create_key_by_tablespace_id(Object_id tablespace_id)
Definition: tables.cc:256
enum_foreign_keys
Definition: tables.h:107
@ FK_TABLESPACE_ID
Definition: tables.h:110
@ FK_COLLATION_ID
Definition: tables.h:109
@ FK_VIEW_CONNECTION_COLLATION_ID
Definition: tables.h:112
@ FK_VIEW_CLIENT_COLLATION_ID
Definition: tables.h:111
@ FK_SCHEMA_ID
Definition: tables.h:108
static const CHARSET_INFO * name_collation()
Definition: tables.cc:51
static Object_key * create_key_by_schema_id(Object_id schema_id)
Definition: tables.cc:249
static bool update_object_key(Item_name_key *key, Object_id schema_id, const String_type &table_name)
Definition: tables.cc:220
static const Tables & instance()
Definition: tables.cc:44
static Object_key * create_key_by_definer(const String_type &definer)
Create a key to find all views for a given definer.
Definition: tables.cc:263
enum_indexes
Definition: tables.h:94
@ INDEX_K_VIEW_CONNECTION_COLLATION_ID
Definition: tables.h:103
@ INDEX_K_TYPE
Definition: tables.h:101
@ INDEX_K_TYPE_VIEW_DEFINER
Definition: tables.h:104
@ INDEX_K_ENGINE
Definition: tables.h:98
@ INDEX_K_TABLESPACE_ID
Definition: tables.h:100
@ INDEX_UK_ENGINE_SE_PRIVATE_ID
Definition: tables.h:97
@ INDEX_UK_SCHEMA_ID_NAME
Definition: tables.h:96
@ INDEX_K_VIEW_CLIENT_COLLATION_ID
Definition: tables.h:102
@ INDEX_K_COLLATION_ID
Definition: tables.h:99
@ INDEX_PK_ID
Definition: tables.h:95
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 char * table_name
Definition: rules_table_service.cc:56
const mysql_service_registry_t * r
Definition: pfs_example_plugin_employee.cc:86
required string key
Definition: replication_asynchronous_connection_failover.proto:60
Definition: m_ctype.h:385
unsigned int uint
Definition: uca9-dump.cc:75