MySQL 8.3.0
Source Code Documentation
tables.h
Go to the documentation of this file.
1/* Copyright (c) 2014, 2023, 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
35struct CHARSET_INFO;
36
37namespace dd {
38
39class Item_name_key;
40class Object_key;
41class Open_dictionary_tables_ctx;
42class Se_private_id_key;
43
44namespace tables {
45
46///////////////////////////////////////////////////////////////////////////
47
49 public:
50 static const Tables &instance();
51
52 static const CHARSET_INFO *name_collation();
53
92 NUMBER_OF_FIELDS // Always keep this entry at the end of the enum
93 };
94
96 INDEX_PK_ID = static_cast<uint>(Common_index::PK_ID),
106 };
107
114 };
115
116 Tables();
117
118 Abstract_table *create_entity_object(const Raw_record &r) const override;
119
120 static bool update_object_key(Item_name_key *key, Object_id schema_id,
121 const String_type &table_name);
122
123 static bool update_aux_key(Se_private_id_key *key, const String_type &engine,
124 ulonglong se_private_id);
125
126 static Object_key *create_se_private_key(const String_type &engine,
127 Object_id se_private_id);
128
130
131 static Object_key *create_key_by_tablespace_id(Object_id tablespace_id);
132
133 /**
134 Create a key to find all views for a given definer.
135
136 @param definer Name of the definer.
137
138 @returns Pointer to Object_key.
139 */
140 static Object_key *create_key_by_definer(const String_type &definer);
141
143};
144
145///////////////////////////////////////////////////////////////////////////
146
147} // namespace tables
148} // namespace dd
149
150#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:48
Tables()
Definition: tables.cc:58
static bool update_aux_key(Se_private_id_key *key, const String_type &engine, ulonglong se_private_id)
Definition: tables.cc:230
static ulonglong read_se_private_id(const Raw_record &r)
Definition: tables.cc:280
static Object_key * create_se_private_key(const String_type &engine, Object_id se_private_id)
Definition: tables.cc:240
enum_fields
Definition: tables.h:54
@ FIELD_OPTIONS
Definition: tables.h:65
@ FIELD_SE_PRIVATE_ID
Definition: tables.h:67
@ FIELD_PARTITION_TYPE
Definition: tables.h:69
@ FIELD_VIEW_CONNECTION_COLLATION_ID
Definition: tables.h:87
@ FIELD_SE_PRIVATE_DATA
Definition: tables.h:66
@ FIELD_SUBPARTITION_EXPRESSION_UTF8
Definition: tables.h:75
@ FIELD_VIEW_DEFINER
Definition: tables.h:85
@ FIELD_HIDDEN
Definition: tables.h:64
@ FIELD_PARTITION_EXPRESSION
Definition: tables.h:70
@ FIELD_CREATED
Definition: tables.h:77
@ FIELD_ENGINE
Definition: tables.h:59
@ FIELD_COLLATION_ID
Definition: tables.h:62
@ FIELD_PARTITION_EXPRESSION_UTF8
Definition: tables.h:71
@ FIELD_TABLESPACE_ID
Definition: tables.h:68
@ FIELD_SECONDARY_ENGINE_ATTRIBUTE
Definition: tables.h:91
@ FIELD_ENGINE_ATTRIBUTE
Definition: tables.h:90
@ FIELD_VIEW_IS_UPDATABLE
Definition: tables.h:82
@ FIELD_LAST_CHECKED_FOR_UPGRADE_VERSION_ID
Definition: tables.h:89
@ FIELD_DEFAULT_PARTITIONING
Definition: tables.h:72
@ FIELD_VIEW_DEFINITION
Definition: tables.h:79
@ FIELD_SUBPARTITION_TYPE
Definition: tables.h:73
@ FIELD_SCHEMA_ID
Definition: tables.h:56
@ FIELD_COMMENT
Definition: tables.h:63
@ FIELD_VIEW_CHECK_OPTION
Definition: tables.h:81
@ FIELD_SUBPARTITION_EXPRESSION
Definition: tables.h:74
@ FIELD_ROW_FORMAT
Definition: tables.h:61
@ FIELD_VIEW_ALGORITHM
Definition: tables.h:83
@ FIELD_ID
Definition: tables.h:55
@ FIELD_TYPE
Definition: tables.h:58
@ NUMBER_OF_FIELDS
Definition: tables.h:92
@ FIELD_VIEW_COLUMN_NAMES
Definition: tables.h:88
@ FIELD_DEFAULT_SUBPARTITIONING
Definition: tables.h:76
@ FIELD_LAST_ALTERED
Definition: tables.h:78
@ FIELD_MYSQL_VERSION_ID
Definition: tables.h:60
@ FIELD_VIEW_CLIENT_COLLATION_ID
Definition: tables.h:86
@ FIELD_NAME
Definition: tables.h:57
@ FIELD_VIEW_SECURITY_TYPE
Definition: tables.h:84
@ FIELD_VIEW_DEFINITION_UTF8
Definition: tables.h:80
Abstract_table * create_entity_object(const Raw_record &r) const override
Definition: tables.cc:209
static Object_key * create_key_by_tablespace_id(Object_id tablespace_id)
Definition: tables.cc:257
enum_foreign_keys
Definition: tables.h:108
@ FK_TABLESPACE_ID
Definition: tables.h:111
@ FK_COLLATION_ID
Definition: tables.h:110
@ FK_VIEW_CONNECTION_COLLATION_ID
Definition: tables.h:113
@ FK_VIEW_CLIENT_COLLATION_ID
Definition: tables.h:112
@ FK_SCHEMA_ID
Definition: tables.h:109
static const CHARSET_INFO * name_collation()
Definition: tables.cc:52
static Object_key * create_key_by_schema_id(Object_id schema_id)
Definition: tables.cc:250
static bool update_object_key(Item_name_key *key, Object_id schema_id, const String_type &table_name)
Definition: tables.cc:221
static const Tables & instance()
Definition: tables.cc:45
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:264
enum_indexes
Definition: tables.h:95
@ INDEX_K_VIEW_CONNECTION_COLLATION_ID
Definition: tables.h:104
@ INDEX_K_TYPE
Definition: tables.h:102
@ INDEX_K_TYPE_VIEW_DEFINER
Definition: tables.h:105
@ INDEX_K_ENGINE
Definition: tables.h:99
@ INDEX_K_TABLESPACE_ID
Definition: tables.h:101
@ INDEX_UK_ENGINE_SE_PRIVATE_ID
Definition: tables.h:98
@ INDEX_UK_SCHEMA_ID_NAME
Definition: tables.h:97
@ INDEX_K_VIEW_CLIENT_COLLATION_ID
Definition: tables.h:103
@ INDEX_K_COLLATION_ID
Definition: tables.h:100
@ INDEX_PK_ID
Definition: tables.h:96
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:422