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