-
Notifications
You must be signed in to change notification settings - Fork 4k
/
Copy pathtablespaces.h
102 lines (81 loc) · 3.25 KB
/
tablespaces.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/* Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
#ifndef DD_TABLES__TABLESPACES_INCLUDED
#define DD_TABLES__TABLESPACES_INCLUDED
#include "my_global.h"
#include "dd/impl/types/dictionary_object_table_impl.h" // dd::Dictionary_obj...
#include "dd/impl/types/tablespace_impl.h" // dd::Tablespace_impl
namespace dd {
namespace tables {
///////////////////////////////////////////////////////////////////////////
class Tablespaces : public Dictionary_object_table_impl
{
public:
static const Tablespaces &instance();
static const std::string &table_name()
{
static std::string s_table_name("tablespaces");
return s_table_name;
}
public:
enum enum_fields
{
FIELD_ID,
FIELD_NAME,
FIELD_OPTIONS,
FIELD_SE_PRIVATE_DATA,
FIELD_COMMENT,
FIELD_ENGINE
};
public:
Tablespaces()
{
m_target_def.table_name(table_name());
m_target_def.dd_version(1);
m_target_def.add_field(FIELD_ID,
"FIELD_ID",
"id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT");
m_target_def.add_field(FIELD_NAME,
"FIELD_NAME",
"name VARCHAR(255) NOT NULL COLLATE utf8_bin");
m_target_def.add_field(FIELD_OPTIONS,
"FIELD_OPTIONS",
"options MEDIUMTEXT");
m_target_def.add_field(FIELD_SE_PRIVATE_DATA,
"FIELD_SE_PRIVATE_DATA",
"se_private_data MEDIUMTEXT");
m_target_def.add_field(FIELD_COMMENT,
"FIELD_COMMENT",
"comment VARCHAR(2048) NOT NULL");
m_target_def.add_field(FIELD_ENGINE,
"FIELD_ENGINE",
"engine VARCHAR(64) NOT NULL");
m_target_def.add_index("PRIMARY KEY(id)");
m_target_def.add_index("UNIQUE KEY(name)");
m_target_def.add_option("ENGINE=INNODB");
m_target_def.add_option("DEFAULT CHARSET=utf8");
m_target_def.add_option("COLLATE=utf8_bin");
m_target_def.add_option("ROW_FORMAT=DYNAMIC");
m_target_def.add_option("STATS_PERSISTENT=0");
}
virtual const std::string &name() const
{ return Tablespaces::table_name(); }
virtual Dictionary_object *create_dictionary_object(const Raw_record &) const
{ return new (std::nothrow) Tablespace_impl(); }
public:
static bool update_object_key(Global_name_key *key,
const std::string &tablespace_name);
};
///////////////////////////////////////////////////////////////////////////
}
}
#endif // DD_TABLES__TABLESPACES_INCLUDED