~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-07-01 02:01:37 UTC
  • mto: This revision was merged to the branch mainline in revision 1084.
  • Revision ID: osullivan.padraig@gmail.com-20090701020137-j6x95t1nuvq20kzk
Extracted the SCHEMATA table into the I_S plugin.

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
static vector<const ColumnInfo *> plugin_columns;
47
47
static vector<const ColumnInfo *> processlist_columns;
48
48
static vector<const ColumnInfo *> ref_constraint_columns;
 
49
static vector<const ColumnInfo *> schemata_columns;
49
50
static vector<const ColumnInfo *> tab_constraints_columns;
50
51
static vector<const ColumnInfo *> tables_columns;
51
52
static vector<const ColumnInfo *> tab_names_columns;
62
63
static InfoSchemaMethods *plugins_methods= NULL;
63
64
static InfoSchemaMethods *processlist_methods= NULL;
64
65
static InfoSchemaMethods *ref_constraint_methods= NULL;
 
66
static InfoSchemaMethods *schemata_methods= NULL;
65
67
static InfoSchemaMethods *tab_constraints_methods= NULL;
66
68
static InfoSchemaMethods *tables_methods= NULL;
67
69
static InfoSchemaMethods *tab_names_methods= NULL;
78
80
static InfoSchemaTable *plugins_table= NULL;
79
81
static InfoSchemaTable *processlist_table= NULL;
80
82
static InfoSchemaTable *ref_constraint_table= NULL;
 
83
static InfoSchemaTable *schemata_table= NULL;
81
84
static InfoSchemaTable *tab_constraints_table= NULL;
82
85
static InfoSchemaTable *tables_table= NULL;
83
86
static InfoSchemaTable *tab_names_table= NULL;
136
139
    return true;
137
140
  }
138
141
 
 
142
  if ((retval= createSchemataColumns(schemata_columns)) == true)
 
143
  {
 
144
    return true;
 
145
  }
 
146
 
139
147
  if ((retval= createTabConstraintsColumns(tab_constraints_columns)) == true)
140
148
  {
141
149
    return true;
168
176
  clearColumns(plugin_columns);
169
177
  clearColumns(processlist_columns);
170
178
  clearColumns(ref_constraint_columns);
 
179
  clearColumns(schemata_columns);
171
180
  clearColumns(tab_constraints_columns);
172
181
  clearColumns(tables_columns);
173
182
  clearColumns(tab_names_columns);
225
234
    return true;
226
235
  }
227
236
 
 
237
  if ((schemata_methods= new(std::nothrow) SchemataISMethods()) == NULL)
 
238
  {
 
239
    return true;
 
240
  }
 
241
 
228
242
  if ((tab_constraints_methods= new(std::nothrow) TabConstraintsISMethods()) == NULL)
229
243
  {
230
244
    return true;
257
271
  delete plugins_methods;
258
272
  delete processlist_methods;
259
273
  delete ref_constraint_methods;
 
274
  delete schemata_methods;
260
275
  delete tab_constraints_methods;
261
276
  delete tables_methods;
262
277
  delete tab_names_methods;
354
369
    return true;
355
370
  }
356
371
 
 
372
  schemata_table= new(std::nothrow) InfoSchemaTable("SCHEMATA",
 
373
                                                    schemata_columns,
 
374
                                                    1, -1, false, false, 0,
 
375
                                                    schemata_methods);
 
376
  if (schemata_table == NULL)
 
377
  {
 
378
    return true;
 
379
  }
 
380
 
357
381
  tab_constraints_table= new(std::nothrow) InfoSchemaTable("TABLE_CONSTRAINTS",
358
382
                                                           tab_constraints_columns,
359
383
                                                           3, 4, false, true,
400
424
  delete plugins_table;
401
425
  delete processlist_table;
402
426
  delete ref_constraint_table;
 
427
  delete schemata_table;
403
428
  delete tab_constraints_table;
404
429
  delete tables_table;
405
430
  delete tab_names_table;
439
464
  registry.add(plugins_table);
440
465
  registry.add(processlist_table);
441
466
  registry.add(ref_constraint_table);
 
467
  registry.add(schemata_table);
442
468
  registry.add(tab_constraints_table);
443
469
  registry.add(tables_table);
444
470
  registry.add(tab_names_table);
463
489
  registry.remove(plugins_table);
464
490
  registry.remove(processlist_table);
465
491
  registry.remove(ref_constraint_table);
 
492
  registry.remove(schemata_table);
466
493
  registry.remove(tab_constraints_table);
467
494
  registry.remove(tables_table);
468
495
  registry.remove(tab_names_table);