~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/info_schema/info_schema.cc

  • Committer: Padraig O'Sullivan
  • Date: 2010-02-10 16:26:01 UTC
  • mto: This revision was merged to the branch mainline in revision 1294.
  • Revision ID: osullivan.padraig@gmail.com-20100210162601-itx2ndl397pc1wr6
Corrected an order of initialization in a few optimizer classes

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
 
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
 
3
 *
 
4
 *  Copyright (C) 2009 Sun Microsystems
 
5
 *
 
6
 *  This program is free software; you can redistribute it and/or modify
 
7
 *  it under the terms of the GNU General Public License as published by
 
8
 *  the Free Software Foundation; either version 2 of the License, or
 
9
 *  (at your option) any later version.
 
10
 *
 
11
 *  This program is distributed in the hope that it will be useful,
 
12
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
 *  GNU General Public License for more details.
 
15
 *
 
16
 *  You should have received a copy of the GNU General Public License
 
17
 *  along with this program; if not, write to the Free Software
 
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
19
 */
 
20
 
 
21
/**
 
22
 * @file 
 
23
 *   I_S plugin implementation.
 
24
 */
 
25
 
 
26
#include "config.h"
 
27
#include "drizzled/session.h"
 
28
#include "drizzled/show.h"
 
29
 
 
30
#include "helper_methods.h"
 
31
#include "character_set.h"
 
32
#include "collation.h"
 
33
#include "collation_char_set.h"
 
34
#include "columns.h"
 
35
#include "key_column_usage.h"
 
36
#include "modules.h"
 
37
#include "open_tables.h"
 
38
#include "plugins.h"
 
39
#include "processlist.h"
 
40
#include "referential_constraints.h"
 
41
#include "schemata.h"
 
42
#include "table_constraints.h"
 
43
#include "tables.h"
 
44
#include "table_names.h"
 
45
#include "statistics.h"
 
46
#include "status.h"
 
47
#include "variables.h"
 
48
 
 
49
#include <vector>
 
50
 
 
51
using namespace drizzled;
 
52
using namespace std;
 
53
 
 
54
/**
 
55
 * Initialize the I_S plugin.
 
56
 *
 
57
 * @param[in] registry the drizzled::plugin::Registry singleton
 
58
 * @return 0 on success; 1 on failure.
 
59
 */
 
60
static int infoSchemaInit(drizzled::plugin::Registry& registry)
 
61
{
 
62
  registry.add(CharacterSetIS::getTable());
 
63
  registry.add(CollationIS::getTable());
 
64
  registry.add(CollationCharSetIS::getTable());
 
65
  registry.add(ColumnsIS::getTable());
 
66
  registry.add(KeyColumnUsageIS::getTable());
 
67
  registry.add(GlobalStatusIS::getTable());
 
68
  registry.add(GlobalVariablesIS::getTable());
 
69
  registry.add(OpenTablesIS::getTable());
 
70
  registry.add(ModulesIS::getTable());
 
71
  registry.add(PluginsIS::getTable());
 
72
  registry.add(ProcessListIS::getTable());
 
73
  registry.add(ReferentialConstraintsIS::getTable());
 
74
  registry.add(SchemataIS::getTable());
 
75
  registry.add(SessionStatusIS::getTable());
 
76
  registry.add(SessionVariablesIS::getTable());
 
77
  registry.add(StatisticsIS::getTable());
 
78
  registry.add(StatusIS::getTable());
 
79
  registry.add(TableConstraintsIS::getTable());
 
80
  registry.add(TablesIS::getTable());
 
81
  registry.add(TableNamesIS::getTable());
 
82
  registry.add(VariablesIS::getTable());
 
83
 
 
84
  return 0;
 
85
}
 
86
 
 
87
/**
 
88
 * Clean up the I_S plugin.
 
89
 *
 
90
 * @param[in] registry the drizzled::plugin::Registry singleton
 
91
 * @return 0 on success; 1 on failure
 
92
 */
 
93
static int infoSchemaDone(drizzled::plugin::Registry& registry)
 
94
{
 
95
  registry.remove(CharacterSetIS::getTable());
 
96
  CharacterSetIS::cleanup();
 
97
 
 
98
  registry.remove(CollationIS::getTable());
 
99
  CollationIS::cleanup();
 
100
 
 
101
  registry.remove(CollationCharSetIS::getTable());
 
102
  CollationCharSetIS::cleanup();
 
103
 
 
104
  registry.remove(ColumnsIS::getTable());
 
105
  ColumnsIS::cleanup();
 
106
 
 
107
  registry.remove(KeyColumnUsageIS::getTable());
 
108
  KeyColumnUsageIS::cleanup();
 
109
 
 
110
  registry.remove(GlobalStatusIS::getTable());
 
111
  GlobalStatusIS::cleanup();
 
112
 
 
113
  registry.remove(GlobalVariablesIS::getTable());
 
114
  GlobalVariablesIS::cleanup();
 
115
 
 
116
  registry.remove(OpenTablesIS::getTable());
 
117
  OpenTablesIS::cleanup();
 
118
 
 
119
  registry.remove(ModulesIS::getTable());
 
120
  ModulesIS::cleanup();
 
121
 
 
122
  registry.remove(PluginsIS::getTable());
 
123
  PluginsIS::cleanup();
 
124
 
 
125
  registry.remove(ProcessListIS::getTable());
 
126
  ProcessListIS::cleanup();
 
127
 
 
128
  registry.remove(ReferentialConstraintsIS::getTable());
 
129
  ReferentialConstraintsIS::cleanup();
 
130
 
 
131
  registry.remove(SchemataIS::getTable());
 
132
  SchemataIS::cleanup();
 
133
 
 
134
  registry.remove(SessionStatusIS::getTable());
 
135
  SessionStatusIS::cleanup();
 
136
 
 
137
  registry.remove(SessionVariablesIS::getTable());
 
138
  SessionVariablesIS::cleanup();
 
139
 
 
140
  registry.remove(StatisticsIS::getTable());
 
141
  StatisticsIS::cleanup();
 
142
 
 
143
  registry.remove(StatusIS::getTable());
 
144
  StatusIS::cleanup();
 
145
 
 
146
  registry.remove(TableConstraintsIS::getTable());
 
147
  TableConstraintsIS::cleanup();
 
148
 
 
149
  registry.remove(TablesIS::getTable());
 
150
  TablesIS::cleanup();
 
151
 
 
152
  registry.remove(TableNamesIS::getTable());
 
153
  TableNamesIS::cleanup();
 
154
 
 
155
  registry.remove(VariablesIS::getTable());
 
156
  VariablesIS::cleanup();
 
157
 
 
158
  return 0;
 
159
}
 
160
 
 
161
DRIZZLE_DECLARE_PLUGIN
 
162
{
 
163
  DRIZZLE_VERSION_ID,
 
164
  "info_schema",
 
165
  "1.1",
 
166
  "Padraig O'Sullivan",
 
167
  "I_S plugin",
 
168
  PLUGIN_LICENSE_GPL,
 
169
  infoSchemaInit,
 
170
  infoSchemaDone,
 
171
  NULL,
 
172
  NULL,
 
173
  NULL
 
174
}
 
175
DRIZZLE_DECLARE_PLUGIN_END;