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