MySQL 8.0.40
Source Code Documentation
sdi_tablespace.h
Go to the documentation of this file.
1/* Copyright (c) 2015, 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__SDI_TABLESPACE_INCLUDED
25#define DD__SDI_TABLESPACE_INCLUDED
26
27#include "sql/dd/impl/sdi.h" // dd::Sdi_type
28#include "sql/dd/object_id.h"
29
30class THD;
31struct handlerton;
32
33namespace dd {
34class Partition;
35class Tablespace;
36namespace cache {
37class Dictionary_client;
38}
39namespace sdi_tablespace {
40
41/**
42 @defgroup sdi_tablespace Storage operations for SDIs in tablespaces.
43 @ingroup sdi
44
45 Called from functions in sdi.cc if the dd object resides in an SE
46 supporting SDI storage in tablespaces.
47
48 @note
49 There is no function for dropping the Tablespace
50 SDI. Dropping a tablespace implies that all SDIs in it are dropped
51 also.
52
53 @{
54*/
55
56/**
57 Looks up the relevant tablespaces for the table and stores the
58 table SDI in each.
59 */
60bool store_tbl_sdi(THD *thd, handlerton *hton, const Sdi_type &sdi,
61 const Table &table, const dd::Schema &schema);
62
63/**
64 Stores the tablespace SDI in the tablespace.
65 */
66bool store_tsp_sdi(handlerton *hton, const Sdi_type &sdi,
67 const Tablespace &tablespace);
68
69/**
70 Looks up the relevant tablespaces for the table and drops the
71 table SDI in each.
72
73 @note When the last table in a schema is dropped from a tablespace
74 the schema SDI should also be dropped. But leaving them is not a big
75 problem as the schema SDIs are small (they only contain the default
76 charset for the schema).
77 */
78bool drop_tbl_sdi(THD *thd, const handlerton &hton, const Table &table,
79 const Schema &schema [[maybe_unused]]);
80
81/**
82 Deletes all SDIs with SDI_TYPE_TABLE from the table tablespace. In case of
83 a partitioned table, SDIs are deleted from all partition tablespaces. SDIs
84 with SDI_TYPE_TABLESPACE are only deleted if their tablespace id does not
85 match the current tablespace id of the tablespace being deleted from.
86*/
87bool drop_all_sdi(THD *, const handlerton &, const Table &);
88
89/**
90 Deletes all SDIs with SDI_TYPE_TABLE from the partition tablespace, or
91 sub-partition tablespaces in case of a sub-partitioned table. SDIs
92 with SDI_TYPE_TABLESPACE are only deleted if their tablespace id does not
93 match the current tablespace id of the tablespace being deleted from.
94*/
95bool drop_all_sdi(THD *, const handlerton &, const Partition &);
96/** @} End of group sdi_tablespace */
97} // namespace sdi_tablespace
98} // namespace dd
99#endif // !DD__SDI_TABLESPACE_INCLUDED
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:34
Data structure that contains the information about shared tablespaces.
Definition: fsp0space.h:47
Definition: schema.h:63
bool store_tbl_sdi(THD *thd, handlerton *hton, const dd::Sdi_type &sdi, const dd::Table &table, const dd::Schema &schema)
Looks up the relevant tablespaces for the table and stores the table SDI in each.
Definition: sdi_tablespace.cc:135
bool store_tsp_sdi(handlerton *hton, const Sdi_type &sdi, const Tablespace &tblspc)
Stores the tablespace SDI in the tablespace.
Definition: sdi_tablespace.cc:159
bool drop_tbl_sdi(THD *thd, const handlerton &hton, const Table &table, const Schema &schema)
Looks up the relevant tablespaces for the table and drops the table SDI in each.
Definition: sdi_tablespace.cc:169
bool drop_all_sdi(THD *thd, const handlerton &hton, const Table &t)
Deletes all SDIs with SDI_TYPE_TABLE from the table tablespace.
Definition: sdi_tablespace.cc:251
borrowable::session_track::Schema< true > Schema
Definition: classic_protocol_session_track.h:277
The version of the current data dictionary table definitions.
Definition: dictionary_client.h:43
String_type Sdi_type
Definition: sdi.h:48
Exposes SDI-related functionality to the rest of the dictionary code.
handlerton is a singleton structure - one instance per storage engine - to provide access to storage ...
Definition: handler.h:2622