~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/show.cc

  • Committer: Monty Taylor
  • Date: 2009-04-10 18:17:59 UTC
  • mto: (992.1.1 mordred)
  • mto: This revision was merged to the branch mainline in revision 990.
  • Revision ID: mordred@inaugust.com-20090410181759-wr58on1xxc9lwzut
Made plugin registration go through Plugin_registry.

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
#include <drizzled/lock.h>
42
42
#include <drizzled/item/return_date_time.h>
43
43
#include <drizzled/item/empty_string.h>
 
44
#include "drizzled/plugin_registry.h"
44
45
 
45
46
#include <string>
46
47
#include <iostream>
67
68
 
68
69
static vector<ST_SCHEMA_TABLE *> all_schema_tables;
69
70
 
70
 
static void add_infoschema_table(ST_SCHEMA_TABLE *table)
 
71
Table *create_schema_table(Session *session, TableList *table_list);
 
72
int make_old_format(Session *session, ST_SCHEMA_TABLE *schema_table);
 
73
 
 
74
void add_infoschema_table(ST_SCHEMA_TABLE *schema_table)
71
75
{
72
 
  all_schema_tables.push_back(table);
 
76
  if (schema_table->create_table == NULL)
 
77
    schema_table->create_table= create_schema_table;
 
78
  if (schema_table->old_format == NULL)
 
79
    schema_table->old_format= make_old_format;
 
80
  if (schema_table->idx_field1 == 0)
 
81
    schema_table->idx_field1= -1;
 
82
  if (schema_table->idx_field2)
 
83
   schema_table->idx_field2= -1;
 
84
 
 
85
  all_schema_tables.push_back(schema_table);
73
86
}
74
87
 
75
88
static void remove_infoschema_table(ST_SCHEMA_TABLE *table)
4500
4513
      return 1;
4501
4514
    }
4502
4515
 
4503
 
    if (schema_table->create_table == NULL)
4504
 
      schema_table->create_table= create_schema_table;
4505
 
    if (schema_table->old_format == NULL)
4506
 
      schema_table->old_format= make_old_format;
4507
 
    if (schema_table->idx_field1 == 0)
4508
 
      schema_table->idx_field1= -1;
4509
 
    if (schema_table->idx_field2)
4510
 
      schema_table->idx_field2= -1;
4511
 
 
4512
4516
    /*- Make sure the plugin name is not set inside the init() function. */
4513
4517
    schema_table->table_name= plugin->name.str;
4514
4518
  }
4515
4519
 
4516
 
  add_infoschema_table(schema_table);
 
4520
  Plugin_registry &registry= Plugin_registry::get_plugin_registry();
 
4521
  registry.registerPlugin(schema_table);
4517
4522
  plugin->data= schema_table;
4518
4523
 
4519
4524
  return 0;