~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: 2009-11-17 18:13:13 UTC
  • mto: This revision was merged to the branch mainline in revision 1223.
  • Revision ID: osullivan.padraig@gmail.com-20091117181313-26qxxqrfcfqs2zum
Moved the referential constraints I_S table into its own implementation and
header files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
#include "open_tables.h"
39
39
#include "plugins.h"
40
40
#include "processlist.h"
 
41
#include "referential_constraints.h"
41
42
 
42
43
#include <vector>
43
44
 
47
48
/*
48
49
 * Vectors of columns for various I_S tables.
49
50
 */
50
 
static vector<const plugin::ColumnInfo *> ref_constraint_columns;
51
51
static vector<const plugin::ColumnInfo *> schemata_columns;
52
52
static vector<const plugin::ColumnInfo *> stats_columns;
53
53
static vector<const plugin::ColumnInfo *> status_columns;
58
58
/*
59
59
 * Methods for various I_S tables.
60
60
 */
61
 
static plugin::InfoSchemaMethods *ref_constraint_methods= NULL;
62
61
static plugin::InfoSchemaMethods *schemata_methods= NULL;
63
62
static plugin::InfoSchemaMethods *stats_methods= NULL;
64
63
static plugin::InfoSchemaMethods *status_methods= NULL;
72
71
 */
73
72
static plugin::InfoSchemaTable *global_stat_table= NULL;
74
73
static plugin::InfoSchemaTable *global_var_table= NULL;
75
 
static plugin::InfoSchemaTable *ref_constraint_table= NULL;
76
74
static plugin::InfoSchemaTable *schemata_table= NULL;
77
75
static plugin::InfoSchemaTable *sess_stat_table= NULL;
78
76
static plugin::InfoSchemaTable *sess_var_table= NULL;
92
90
{
93
91
  bool retval= false;
94
92
 
95
 
  if ((retval= createRefConstraintColumns(ref_constraint_columns)) == true)
96
 
  {
97
 
    return true;
98
 
  }
99
 
 
100
93
  if ((retval= createSchemataColumns(schemata_columns)) == true)
101
94
  {
102
95
    return true;
135
128
 */
136
129
static void cleanupTableColumns()
137
130
{
138
 
  clearColumns(ref_constraint_columns);
139
131
  clearColumns(schemata_columns);
140
132
  clearColumns(stats_columns);
141
133
  clearColumns(status_columns);
151
143
 */
152
144
static bool initTableMethods()
153
145
{
154
 
  if ((ref_constraint_methods= new(nothrow) RefConstraintsISMethods()) == NULL)
155
 
  {
156
 
    return true;
157
 
  }
158
 
 
159
146
  if ((schemata_methods= new(nothrow) SchemataISMethods()) == NULL)
160
147
  {
161
148
    return true;
199
186
 */
200
187
static void cleanupTableMethods()
201
188
{
202
 
  delete ref_constraint_methods;
203
189
  delete schemata_methods;
204
190
  delete stats_methods;
205
191
  delete status_methods;
235
221
    return true;
236
222
  }
237
223
 
238
 
  ref_constraint_table= new(nothrow) plugin::InfoSchemaTable("REFERENTIAL_CONSTRAINTS",
239
 
                                                             ref_constraint_columns,
240
 
                                                             1, 9, false, true,
241
 
                                                             OPEN_TABLE_ONLY,
242
 
                                                             ref_constraint_methods);
243
 
  if (ref_constraint_table == NULL)
244
 
  {
245
 
    return true;
246
 
  }
247
 
 
248
224
  schemata_table= new(nothrow) plugin::InfoSchemaTable("SCHEMATA",
249
225
                                                       schemata_columns,
250
226
                                                       1, -1, false, false, 0,
339
315
{
340
316
  delete global_stat_table;
341
317
  delete global_var_table;
342
 
  delete ref_constraint_table;
343
318
  delete schemata_table;
344
319
  delete sess_stat_table;
345
320
  delete sess_var_table;
389
364
  registry.add(ModulesIS::getTable());
390
365
  registry.add(PluginsIS::getTable());
391
366
  registry.add(ProcessListIS::getTable());
 
367
  registry.add(ReferentialConstraintsIS::getTable());
392
368
 
393
 
  registry.add(ref_constraint_table);
394
369
  registry.add(schemata_table);
395
370
  registry.add(sess_stat_table);
396
371
  registry.add(sess_var_table);
442
417
  registry.remove(ProcessListIS::getTable());
443
418
  ProcessListIS::cleanup();
444
419
 
445
 
  registry.remove(ref_constraint_table);
 
420
  registry.remove(ReferentialConstraintsIS::getTable());
 
421
  ReferentialConstraintsIS::cleanup();
 
422
 
446
423
  registry.remove(schemata_table);
447
424
  registry.remove(sess_stat_table);
448
425
  registry.remove(sess_var_table);