~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/info_schema/info_schema.cc

Added code necessary for building plugins dynamically.
Merged in changes from lifeless to allow autoreconf to work.
Touching plugin.ini files now triggers a rebuid - so config/autorun.sh is no
longer required to be run after touching those.
Removed the duplicate plugin names - also removed the issue that getting them
different would silently fail weirdly later.

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
static vector<const plugin::ColumnInfo *> col_columns;
45
45
static vector<const plugin::ColumnInfo *> key_col_usage_columns;
46
46
static vector<const plugin::ColumnInfo *> open_tab_columns;
47
 
static vector<const plugin::ColumnInfo *> plugin_columns;
 
47
static vector<const plugin::ColumnInfo *> modules_columns;
 
48
static vector<const plugin::ColumnInfo *> plugins_columns;
48
49
static vector<const plugin::ColumnInfo *> processlist_columns;
49
50
static vector<const plugin::ColumnInfo *> ref_constraint_columns;
50
51
static vector<const plugin::ColumnInfo *> schemata_columns;
63
64
static plugin::InfoSchemaMethods *columns_methods= NULL;
64
65
static plugin::InfoSchemaMethods *key_col_usage_methods= NULL;
65
66
static plugin::InfoSchemaMethods *open_tab_methods= NULL;
 
67
static plugin::InfoSchemaMethods *modules_methods= NULL;
66
68
static plugin::InfoSchemaMethods *plugins_methods= NULL;
67
69
static plugin::InfoSchemaMethods *processlist_methods= NULL;
68
70
static plugin::InfoSchemaMethods *ref_constraint_methods= NULL;
85
87
static plugin::InfoSchemaTable *global_stat_table= NULL;
86
88
static plugin::InfoSchemaTable *global_var_table= NULL;
87
89
static plugin::InfoSchemaTable *open_tab_table= NULL;
 
90
static plugin::InfoSchemaTable *modules_table= NULL;
88
91
static plugin::InfoSchemaTable *plugins_table= NULL;
89
92
static plugin::InfoSchemaTable *processlist_table= NULL;
90
93
static plugin::InfoSchemaTable *ref_constraint_table= NULL;
137
140
    return true;
138
141
  }
139
142
 
140
 
  if ((retval= createPluginsColumns(plugin_columns)) == true)
 
143
  if ((retval= createModulesColumns(modules_columns)) == true)
 
144
  {
 
145
    return true;
 
146
  }
 
147
 
 
148
  if ((retval= createPluginsColumns(plugins_columns)) == true)
141
149
  {
142
150
    return true;
143
151
  }
196
204
  clearColumns(col_columns);
197
205
  clearColumns(key_col_usage_columns);
198
206
  clearColumns(open_tab_columns);
199
 
  clearColumns(plugin_columns);
 
207
  clearColumns(modules_columns);
 
208
  clearColumns(plugins_columns);
200
209
  clearColumns(processlist_columns);
201
210
  clearColumns(ref_constraint_columns);
202
211
  clearColumns(schemata_columns);
244
253
    return true;
245
254
  }
246
255
 
 
256
  if ((modules_methods= new(nothrow) ModulesISMethods()) == NULL)
 
257
  {
 
258
    return true;
 
259
  }
 
260
 
247
261
  if ((plugins_methods= new(nothrow) PluginsISMethods()) == NULL)
248
262
  {
249
263
    return true;
308
322
  delete columns_methods;
309
323
  delete key_col_usage_methods;
310
324
  delete open_tab_methods;
 
325
  delete modules_methods;
311
326
  delete plugins_methods;
312
327
  delete processlist_methods;
313
328
  delete ref_constraint_methods;
402
417
    return true;
403
418
  }
404
419
 
 
420
  modules_table= new(nothrow) plugin::InfoSchemaTable("MODULES",
 
421
                                                      modules_columns,
 
422
                                                      -1, -1, false, false, 0,
 
423
                                                      modules_methods);
 
424
  if (modules_table == NULL)
 
425
  {
 
426
    return true;
 
427
  }
 
428
 
405
429
  plugins_table= new(nothrow) plugin::InfoSchemaTable("PLUGINS",
406
 
                                                   plugin_columns,
407
 
                                                   -1, -1, false, false, 0,
408
 
                                                   plugins_methods);
 
430
                                                      plugins_columns,
 
431
                                                      -1, -1, false, false, 0,
 
432
                                                      plugins_methods);
409
433
  if (plugins_table == NULL)
410
434
  {
411
435
    return true;
577
601
  registry.add(global_stat_table);
578
602
  registry.add(global_var_table);
579
603
  registry.add(open_tab_table);
 
604
  registry.add(modules_table);
580
605
  registry.add(plugins_table);
581
606
  registry.add(processlist_table);
582
607
  registry.add(ref_constraint_table);
609
634
  registry.remove(global_stat_table);
610
635
  registry.remove(global_var_table);
611
636
  registry.remove(open_tab_table);
 
637
  registry.remove(modules_table);
612
638
  registry.remove(plugins_table);
613
639
  registry.remove(processlist_table);
614
640
  registry.remove(ref_constraint_table);
629
655
  return 0;
630
656
}
631
657
 
632
 
drizzle_declare_plugin(info_schema)
 
658
drizzle_declare_plugin
633
659
{
634
660
  "info_schema",
635
661
  "0.1",