MySQL 8.0.39
Source Code Documentation
dd.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__DD_INCLUDED
25#define DD__DD_INCLUDED
26
27namespace dd {
28
29///////////////////////////////////////////////////////////////////////////
30
31// enum type to pass to init() function.
33 DD_INITIALIZE = 1,
40};
41
42/**
43 Initialize data dictionary upon server startup, server startup on old
44 data directory or install data dictionary for the first time.
45
46 @param dd_init - Option for initialization, population or deletion
47 of data dictionary.
48
49 @return false - On success
50 @return true - On error
51*/
52bool init(enum_dd_init_type dd_init);
53
54/**
55 Shuts down the data dictionary instance by deleting
56 the instance of dd::Dictionary_impl* upon server shutdown.
57
58 @return false - On success
59 @return true - If invoked when data dictionary instance
60 is not yet initialized.
61*/
62bool shutdown();
63
64/**
65 Get the data dictionary instance.
66
67 @returns 'Dictionary*' pointer to data dictionary instance.
68 Else returns NULL if data dictionary is not
69 initialized.
70*/
71class Dictionary *get_dictionary();
72
73/**
74 Create a instance of data dictionary object of type X.
75 E.g., X could be 'dd::Table', 'dd::View' and etc.
76
77 @returns Pointer to the newly allocated dictionary object.
78*/
79template <typename X>
81
82///////////////////////////////////////////////////////////////////////////
83
84} // namespace dd
85
86#endif // DD__DD_INCLUDED
The version of the current data dictionary table definitions.
Definition: dictionary_client.h:43
class Dictionary * get_dictionary()
Get the data dictionary instance.
Definition: dd.cc:76
enum_dd_init_type
Definition: dd.h:32
X * create_object()
Create a instance of data dictionary object of type X.
Definition: dd.cc:79
bool shutdown()
Shuts down the data dictionary instance by deleting the instance of dd::Dictionary_impl* upon server ...
Definition: dd.cc:71
bool init(enum_dd_init_type dd_init)
Initialize data dictionary upon server startup, server startup on old data directory or install data ...
Definition: dd.cc:58
#define X(b)
Definition: xcom_base.cc:9099