MySQL 8.4.0
Source Code Documentation
dd_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_TABLESPACE_INCLUDED
25#define DD_TABLESPACE_INCLUDED
26
27#include "sql/lock.h" // Tablespace_hash_set
28#include "sql/thr_malloc.h"
29
30struct MEM_ROOT;
31class THD;
33struct handlerton;
34
35namespace dd {
36
37/**
38 Fill Tablespace_hash_set with tablespace names used by the
39 given db_name.table_name.
40
41 @param thd - Thread invoking the function.
42 @param db_name - Database name.
43 @param table_name - Table name.
44 @param tablespace_set - (OUT) hash set where tablespace names
45 are filled.
46
47 @return true - On failure.
48 @return false - On success.
49*/
51 const char *table_name,
52 Tablespace_hash_set *tablespace_set);
53
54/**
55 Read tablespace name of a tablespace_id.
56
57 @param thd - Thread invoking this call.
58 @param obj - Table/Partition object whose
59 tablespace name is being read.
60 @param tablespace_name (OUT) - Tablespace name of table.
61 @param mem_root - Memroot where tablespace name
62 should be stored.
63
64 @return true - On failure.
65 @return false - On success.
66*/
67template <typename T>
68bool get_tablespace_name(THD *thd, const T *obj, const char **tablespace_name,
70
71} // namespace dd
72#endif // DD_TABLESPACE_INCLUDED
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
std::unordered_set, but with my_malloc, so that you can track the memory used using PSI memory keys.
Definition: map_helpers.h:177
Legacy struct for passing tablespace information to SEs.
Definition: handler.h:868
static MEM_ROOT mem_root
Definition: client_plugin.cc:114
The version of the current data dictionary table definitions.
Definition: dictionary_client.h:43
bool get_tablespace_name(THD *thd, const T *obj, String_type *name)
Read tablespace name of a tablespace_id from Table or similar object.
Definition: dd_tablespace.cc:153
bool fill_table_and_parts_tablespace_names(THD *thd, const char *db_name, const char *table_name, Tablespace_hash_set *tablespace_set)
Fill Tablespace_hash_set with tablespace names used by the given db_name.table_name.
Definition: dd_tablespace.cc:78
const char * table_name
Definition: rules_table_service.cc:56
const char * db_name
Definition: rules_table_service.cc:55
The MEM_ROOT is a simple arena, where allocations are carved out of larger blocks.
Definition: my_alloc.h:83
handlerton is a singleton structure - one instance per storage engine - to provide access to storage ...
Definition: handler.h:2733