MySQL 8.4.2
Source Code Documentation
table_partitions.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__TABLE_PARTITIONS_INCLUDED
25#define DD_TABLES__TABLE_PARTITIONS_INCLUDED
26
27#include "my_inttypes.h"
28#include "sql/dd/impl/types/object_table_impl.h" // dd::Object_table_impl
29#include "sql/dd/object_id.h" // dd::Object_id
30#include "sql/dd/string_type.h"
31
32class THD;
33
34struct CHARSET_INFO;
35
36namespace dd {
37class Object_key;
38class Raw_record;
39
40namespace tables {
41
42///////////////////////////////////////////////////////////////////////////
43
45 public:
46 static const Table_partitions &instance();
47
48 static const CHARSET_INFO *name_collation();
49
63 NUMBER_OF_FIELDS // Always keep this entry at the end of the enum
64 };
65
67 INDEX_PK_ID = static_cast<uint>(Common_index::PK_ID),
74 };
75
80 };
81
83
85
87 Object_id table_id, Object_id parent_partition_id);
88
89 static ulonglong read_table_id(const Raw_record &r);
90
91 static Object_key *create_se_private_key(const String_type &engine,
92 Object_id se_private_id);
93
94 static bool get_partition_table_id(THD *thd, const String_type &engine,
95 ulonglong se_private_id, Object_id *oid);
96};
97
98///////////////////////////////////////////////////////////////////////////
99
100} // namespace tables
101} // namespace dd
102
103#endif // DD_TABLES__TABLE_PARTITIONS_INCLUDED
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
Definition: object_key.h:38
Definition: object_table_impl.h:36
Definition: raw_record.h:46
Definition: table_partitions.h:44
static const Table_partitions & instance()
Definition: table_partitions.cc:45
static const CHARSET_INFO * name_collation()
Definition: table_partitions.cc:52
enum_foreign_keys
Definition: table_partitions.h:76
@ FK_PARENT_PARTITION_ID
Definition: table_partitions.h:79
@ FK_TABLE_ID
Definition: table_partitions.h:77
@ FK_TABLESPACE_ID
Definition: table_partitions.h:78
enum_fields
Definition: table_partitions.h:50
@ FIELD_OPTIONS
Definition: table_partitions.h:59
@ FIELD_TABLESPACE_ID
Definition: table_partitions.h:62
@ FIELD_NUMBER
Definition: table_partitions.h:54
@ NUMBER_OF_FIELDS
Definition: table_partitions.h:63
@ FIELD_NAME
Definition: table_partitions.h:55
@ FIELD_TABLE_ID
Definition: table_partitions.h:52
@ FIELD_SE_PRIVATE_ID
Definition: table_partitions.h:61
@ FIELD_PARENT_PARTITION_ID
Definition: table_partitions.h:53
@ FIELD_ENGINE
Definition: table_partitions.h:57
@ FIELD_COMMENT
Definition: table_partitions.h:58
@ FIELD_SE_PRIVATE_DATA
Definition: table_partitions.h:60
@ FIELD_ID
Definition: table_partitions.h:51
@ FIELD_DESCRIPTION_UTF8
Definition: table_partitions.h:56
static Object_key * create_key_by_table_id(Object_id table_id)
Definition: table_partitions.cc:116
enum_indexes
Definition: table_partitions.h:66
@ INDEX_UK_ENGINE_SE_PRIVATE_ID
Definition: table_partitions.h:70
@ INDEX_PK_ID
Definition: table_partitions.h:67
@ INDEX_UK_TABLE_ID_PARENT_PARTITION_ID_NUMBER
Definition: table_partitions.h:69
@ INDEX_UK_TABLE_ID_NAME
Definition: table_partitions.h:68
@ INDEX_K_TABLESPACE_ID
Definition: table_partitions.h:72
@ INDEX_K_ENGINE
Definition: table_partitions.h:71
@ INDEX_K_PARENT_PARTITION_ID
Definition: table_partitions.h:73
static ulonglong read_table_id(const Raw_record &r)
Definition: table_partitions.cc:133
static Object_key * create_se_private_key(const String_type &engine, Object_id se_private_id)
Definition: table_partitions.cc:141
static bool get_partition_table_id(THD *thd, const String_type &engine, ulonglong se_private_id, Object_id *oid)
Definition: table_partitions.cc:151
Table_partitions()
Definition: table_partitions.cc:58
static Object_key * create_key_by_parent_partition_id(Object_id table_id, Object_id parent_partition_id)
Definition: table_partitions.cc:123
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 mysql_service_registry_t * r
Definition: pfs_example_plugin_employee.cc:86
Definition: m_ctype.h:423