~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/info_schema/info_schema.cc

  • Committer: Brian Aker
  • Date: 2010-02-19 23:07:45 UTC
  • mto: (1273.13.97 build)
  • mto: This revision was merged to the branch mainline in revision 1309.
  • Revision ID: brian@gaz-20100219230745-cmurfbxj845it9z7
This remove the original info_schema system for the server. More still to
cut, but we are on our way.

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 "key_column_usage.h"
32
 
#include "referential_constraints.h"
33
 
#include "table_constraints.h"
34
 
#include "statistics.h"
35
 
 
36
 
#include <vector>
37
 
 
38
 
using namespace drizzled;
39
 
using namespace std;
40
 
 
41
 
/**
42
 
 * Initialize the I_S plugin.
43
 
 *
44
 
 * @param[in] registry the drizzled::plugin::Registry singleton
45
 
 * @return 0 on success; 1 on failure.
46
 
 */
47
 
static int infoSchemaInit(drizzled::plugin::Registry& registry)
48
 
{
49
 
  registry.add(ReferentialConstraintsIS::getTable());
50
 
  registry.add(TableConstraintsIS::getTable());
51
 
  registry.add(KeyColumnUsageIS::getTable());
52
 
  registry.add(StatisticsIS::getTable());
53
 
#if 0
54
 
#endif
55
 
 
56
 
  return 0;
57
 
}
58
 
 
59
 
/**
60
 
 * Clean up the I_S plugin.
61
 
 *
62
 
 * @param[in] registry the drizzled::plugin::Registry singleton
63
 
 * @return 0 on success; 1 on failure
64
 
 */
65
 
static int infoSchemaDone(drizzled::plugin::Registry& registry)
66
 
{
67
 
  registry.remove(KeyColumnUsageIS::getTable());
68
 
  KeyColumnUsageIS::cleanup();
69
 
 
70
 
  registry.remove(ReferentialConstraintsIS::getTable());
71
 
  ReferentialConstraintsIS::cleanup();
72
 
 
73
 
  registry.remove(StatisticsIS::getTable());
74
 
  StatisticsIS::cleanup();
75
 
 
76
 
  registry.remove(TableConstraintsIS::getTable());
77
 
  TableConstraintsIS::cleanup();
78
 
 
79
 
  return 0;
80
 
}
81
 
 
82
 
DRIZZLE_DECLARE_PLUGIN
83
 
{
84
 
  DRIZZLE_VERSION_ID,
85
 
  "info_schema",
86
 
  "1.1",
87
 
  "Padraig O'Sullivan",
88
 
  "I_S plugin",
89
 
  PLUGIN_LICENSE_GPL,
90
 
  infoSchemaInit,
91
 
  infoSchemaDone,
92
 
  NULL,
93
 
  NULL
94
 
}
95
 
DRIZZLE_DECLARE_PLUGIN_END;