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