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