35
using namespace drizzled;
35
36
using namespace std;
38
39
* Vectors of columns for various I_S tables.
40
static vector<const ColumnInfo *> char_set_columns;
41
static vector<const ColumnInfo *> collation_columns;
42
static vector<const ColumnInfo *> coll_char_columns;
43
static vector<const ColumnInfo *> col_columns;
44
static vector<const ColumnInfo *> key_col_usage_columns;
45
static vector<const ColumnInfo *> open_tab_columns;
46
static vector<const ColumnInfo *> plugin_columns;
47
static vector<const ColumnInfo *> processlist_columns;
48
static vector<const ColumnInfo *> ref_constraint_columns;
49
static vector<const ColumnInfo *> schemata_columns;
50
static vector<const ColumnInfo *> stats_columns;
51
static vector<const ColumnInfo *> status_columns;
52
static vector<const ColumnInfo *> tab_constraints_columns;
53
static vector<const ColumnInfo *> tables_columns;
54
static vector<const ColumnInfo *> tab_names_columns;
41
static vector<const plugin::ColumnInfo *> char_set_columns;
42
static vector<const plugin::ColumnInfo *> collation_columns;
43
static vector<const plugin::ColumnInfo *> coll_char_columns;
44
static vector<const plugin::ColumnInfo *> col_columns;
45
static vector<const plugin::ColumnInfo *> key_col_usage_columns;
46
static vector<const plugin::ColumnInfo *> open_tab_columns;
47
static vector<const plugin::ColumnInfo *> plugin_columns;
48
static vector<const plugin::ColumnInfo *> processlist_columns;
49
static vector<const plugin::ColumnInfo *> ref_constraint_columns;
50
static vector<const plugin::ColumnInfo *> schemata_columns;
51
static vector<const plugin::ColumnInfo *> stats_columns;
52
static vector<const plugin::ColumnInfo *> status_columns;
53
static vector<const plugin::ColumnInfo *> tab_constraints_columns;
54
static vector<const plugin::ColumnInfo *> tables_columns;
55
static vector<const plugin::ColumnInfo *> tab_names_columns;
57
58
* Methods for various I_S tables.
59
static InfoSchemaMethods *char_set_methods= NULL;
60
static InfoSchemaMethods *collation_methods= NULL;
61
static InfoSchemaMethods *coll_char_methods= NULL;
62
static InfoSchemaMethods *columns_methods= NULL;
63
static InfoSchemaMethods *key_col_usage_methods= NULL;
64
static InfoSchemaMethods *open_tab_methods= NULL;
65
static InfoSchemaMethods *plugins_methods= NULL;
66
static InfoSchemaMethods *processlist_methods= NULL;
67
static InfoSchemaMethods *ref_constraint_methods= NULL;
68
static InfoSchemaMethods *schemata_methods= NULL;
69
static InfoSchemaMethods *stats_methods= NULL;
70
static InfoSchemaMethods *status_methods= NULL;
71
static InfoSchemaMethods *tab_constraints_methods= NULL;
72
static InfoSchemaMethods *tables_methods= NULL;
73
static InfoSchemaMethods *tab_names_methods= NULL;
74
static InfoSchemaMethods *variables_methods= NULL;
60
static plugin::InfoSchemaMethods *char_set_methods= NULL;
61
static plugin::InfoSchemaMethods *collation_methods= NULL;
62
static plugin::InfoSchemaMethods *coll_char_methods= NULL;
63
static plugin::InfoSchemaMethods *columns_methods= NULL;
64
static plugin::InfoSchemaMethods *key_col_usage_methods= NULL;
65
static plugin::InfoSchemaMethods *open_tab_methods= NULL;
66
static plugin::InfoSchemaMethods *plugins_methods= NULL;
67
static plugin::InfoSchemaMethods *processlist_methods= NULL;
68
static plugin::InfoSchemaMethods *ref_constraint_methods= NULL;
69
static plugin::InfoSchemaMethods *schemata_methods= NULL;
70
static plugin::InfoSchemaMethods *stats_methods= NULL;
71
static plugin::InfoSchemaMethods *status_methods= NULL;
72
static plugin::InfoSchemaMethods *tab_constraints_methods= NULL;
73
static plugin::InfoSchemaMethods *tables_methods= NULL;
74
static plugin::InfoSchemaMethods *tab_names_methods= NULL;
75
static plugin::InfoSchemaMethods *variables_methods= NULL;
79
static InfoSchemaTable *char_set_table= NULL;
80
static InfoSchemaTable *collation_table= NULL;
81
static InfoSchemaTable *coll_char_set_table= NULL;
82
static InfoSchemaTable *columns_table= NULL;
83
static InfoSchemaTable *key_col_usage_table= NULL;
84
static InfoSchemaTable *global_stat_table= NULL;
85
static InfoSchemaTable *global_var_table= NULL;
86
static InfoSchemaTable *open_tab_table= NULL;
87
static InfoSchemaTable *plugins_table= NULL;
88
static InfoSchemaTable *processlist_table= NULL;
89
static InfoSchemaTable *ref_constraint_table= NULL;
90
static InfoSchemaTable *schemata_table= NULL;
91
static InfoSchemaTable *sess_stat_table= NULL;
92
static InfoSchemaTable *sess_var_table= NULL;
93
static InfoSchemaTable *stats_table= NULL;
94
static InfoSchemaTable *status_table= NULL;
95
static InfoSchemaTable *tab_constraints_table= NULL;
96
static InfoSchemaTable *tables_table= NULL;
97
static InfoSchemaTable *tab_names_table= NULL;
98
static InfoSchemaTable *var_table= NULL;
80
static plugin::InfoSchema *char_set_table= NULL;
81
static plugin::InfoSchema *collation_table= NULL;
82
static plugin::InfoSchema *coll_char_set_table= NULL;
83
static plugin::InfoSchema *columns_table= NULL;
84
static plugin::InfoSchema *key_col_usage_table= NULL;
85
static plugin::InfoSchema *global_stat_table= NULL;
86
static plugin::InfoSchema *global_var_table= NULL;
87
static plugin::InfoSchema *open_tab_table= NULL;
88
static plugin::InfoSchema *plugins_table= NULL;
89
static plugin::InfoSchema *processlist_table= NULL;
90
static plugin::InfoSchema *ref_constraint_table= NULL;
91
static plugin::InfoSchema *schemata_table= NULL;
92
static plugin::InfoSchema *sess_stat_table= NULL;
93
static plugin::InfoSchema *sess_var_table= NULL;
94
static plugin::InfoSchema *stats_table= NULL;
95
static plugin::InfoSchema *status_table= NULL;
96
static plugin::InfoSchema *tab_constraints_table= NULL;
97
static plugin::InfoSchema *tables_table= NULL;
98
static plugin::InfoSchema *tab_names_table= NULL;
99
static plugin::InfoSchema *var_table= NULL;
101
102
* Populate the vectors of columns for each I_S table.
214
215
static bool initTableMethods()
216
if ((char_set_methods= new(std::nothrow) CharSetISMethods()) == NULL)
221
if ((collation_methods= new(std::nothrow) CollationISMethods()) == NULL)
226
if ((coll_char_methods= new(std::nothrow) CollCharISMethods()) == NULL)
231
if ((columns_methods= new(std::nothrow) ColumnsISMethods()) == NULL)
236
if ((key_col_usage_methods= new(std::nothrow) KeyColUsageISMethods()) == NULL)
241
if ((open_tab_methods= new(std::nothrow) OpenTablesISMethods()) == NULL)
246
if ((plugins_methods= new(std::nothrow) PluginsISMethods()) == NULL)
251
if ((processlist_methods= new(std::nothrow) ProcessListISMethods()) == NULL)
256
if ((ref_constraint_methods= new(std::nothrow) RefConstraintsISMethods()) == NULL)
261
if ((schemata_methods= new(std::nothrow) SchemataISMethods()) == NULL)
266
if ((stats_methods= new(std::nothrow) StatsISMethods()) == NULL)
271
if ((status_methods= new(std::nothrow) StatusISMethods()) == NULL)
276
if ((tab_constraints_methods= new(std::nothrow) TabConstraintsISMethods()) == NULL)
281
if ((tables_methods= new(std::nothrow) TablesISMethods()) == NULL)
286
if ((tab_names_methods= new(std::nothrow) TabNamesISMethods()) == NULL)
291
if ((variables_methods= new(std::nothrow) VariablesISMethods()) == NULL)
217
if ((char_set_methods= new(nothrow) CharSetISMethods()) == NULL)
222
if ((collation_methods= new(nothrow) CollationISMethods()) == NULL)
227
if ((coll_char_methods= new(nothrow) CollCharISMethods()) == NULL)
232
if ((columns_methods= new(nothrow) ColumnsISMethods()) == NULL)
237
if ((key_col_usage_methods= new(nothrow) KeyColUsageISMethods()) == NULL)
242
if ((open_tab_methods= new(nothrow) OpenTablesISMethods()) == NULL)
247
if ((plugins_methods= new(nothrow) PluginsISMethods()) == NULL)
252
if ((processlist_methods= new(nothrow) ProcessListISMethods()) == NULL)
257
if ((ref_constraint_methods= new(nothrow) RefConstraintsISMethods()) == NULL)
262
if ((schemata_methods= new(nothrow) SchemataISMethods()) == NULL)
267
if ((stats_methods= new(nothrow) StatsISMethods()) == NULL)
272
if ((status_methods= new(nothrow) StatusISMethods()) == NULL)
277
if ((tab_constraints_methods= new(nothrow) TabConstraintsISMethods()) == NULL)
282
if ((tables_methods= new(nothrow) TablesISMethods()) == NULL)
287
if ((tab_names_methods= new(nothrow) TabNamesISMethods()) == NULL)
292
if ((variables_methods= new(nothrow) VariablesISMethods()) == NULL)
571
registry.add(char_set_table);
572
registry.add(collation_table);
573
registry.add(coll_char_set_table);
574
registry.add(columns_table);
575
registry.add(key_col_usage_table);
576
registry.add(global_stat_table);
577
registry.add(global_var_table);
578
registry.add(open_tab_table);
579
registry.add(plugins_table);
580
registry.add(processlist_table);
581
registry.add(ref_constraint_table);
582
registry.add(schemata_table);
583
registry.add(sess_stat_table);
584
registry.add(sess_var_table);
585
registry.add(stats_table);
586
registry.add(status_table);
587
registry.add(tab_constraints_table);
588
registry.add(tables_table);
589
registry.add(tab_names_table);
590
registry.add(var_table);
572
registry.info_schema.add(char_set_table);
573
registry.info_schema.add(collation_table);
574
registry.info_schema.add(coll_char_set_table);
575
registry.info_schema.add(columns_table);
576
registry.info_schema.add(key_col_usage_table);
577
registry.info_schema.add(global_stat_table);
578
registry.info_schema.add(global_var_table);
579
registry.info_schema.add(open_tab_table);
580
registry.info_schema.add(plugins_table);
581
registry.info_schema.add(processlist_table);
582
registry.info_schema.add(ref_constraint_table);
583
registry.info_schema.add(schemata_table);
584
registry.info_schema.add(sess_stat_table);
585
registry.info_schema.add(sess_var_table);
586
registry.info_schema.add(stats_table);
587
registry.info_schema.add(status_table);
588
registry.info_schema.add(tab_constraints_table);
589
registry.info_schema.add(tables_table);
590
registry.info_schema.add(tab_names_table);
591
registry.info_schema.add(var_table);
601
602
static int infoSchemaDone(drizzled::plugin::Registry& registry)
603
registry.remove(char_set_table);
604
registry.remove(collation_table);
605
registry.remove(coll_char_set_table);
606
registry.remove(columns_table);
607
registry.remove(key_col_usage_table);
608
registry.remove(global_stat_table);
609
registry.remove(global_var_table);
610
registry.remove(open_tab_table);
611
registry.remove(plugins_table);
612
registry.remove(processlist_table);
613
registry.remove(ref_constraint_table);
614
registry.remove(schemata_table);
615
registry.remove(sess_stat_table);
616
registry.remove(sess_var_table);
617
registry.remove(stats_table);
618
registry.remove(status_table);
619
registry.remove(tab_constraints_table);
620
registry.remove(tables_table);
621
registry.remove(tab_names_table);
622
registry.remove(var_table);
604
registry.info_schema.remove(char_set_table);
605
registry.info_schema.remove(collation_table);
606
registry.info_schema.remove(coll_char_set_table);
607
registry.info_schema.remove(columns_table);
608
registry.info_schema.remove(key_col_usage_table);
609
registry.info_schema.remove(global_stat_table);
610
registry.info_schema.remove(global_var_table);
611
registry.info_schema.remove(open_tab_table);
612
registry.info_schema.remove(plugins_table);
613
registry.info_schema.remove(processlist_table);
614
registry.info_schema.remove(ref_constraint_table);
615
registry.info_schema.remove(schemata_table);
616
registry.info_schema.remove(sess_stat_table);
617
registry.info_schema.remove(sess_var_table);
618
registry.info_schema.remove(stats_table);
619
registry.info_schema.remove(status_table);
620
registry.info_schema.remove(tab_constraints_table);
621
registry.info_schema.remove(tables_table);
622
registry.info_schema.remove(tab_names_table);
623
registry.info_schema.remove(var_table);
624
625
cleanupTableMethods();
625
626
cleanupTableColumns();