~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/show.cc

  • Committer: Brian Aker
  • Date: 2009-04-01 01:25:04 UTC
  • mfrom: (968.2.27 mordred)
  • Revision ID: brian@tangent.org-20090401012504-mq9sxcmph5jc1fh6
Merge Monty

Show diffs side-by-side

added added

removed removed

Lines of Context:
4487
4487
{
4488
4488
  ST_SCHEMA_TABLE *schema_table;
4489
4489
 
4490
 
  if ((schema_table= new ST_SCHEMA_TABLE) == NULL)
4491
 
    return(1);
4492
 
  memset(schema_table, 0, sizeof(ST_SCHEMA_TABLE));
4493
 
 
4494
 
  /* Historical Requirement */
4495
 
  plugin->data= schema_table; // shortcut for the future
4496
4490
  if (plugin->plugin->init)
4497
4491
  {
4498
 
    schema_table->create_table= create_schema_table;
4499
 
    schema_table->old_format= make_old_format;
4500
 
    schema_table->idx_field1= -1,
4501
 
    schema_table->idx_field2= -1;
4502
 
 
4503
 
    /* Make the name available to the init() function. */
4504
 
    schema_table->table_name= plugin->name.str;
4505
 
 
4506
 
    if (plugin->plugin->init(schema_table))
 
4492
    if (plugin->plugin->init(&schema_table))
4507
4493
    {
4508
4494
      errmsg_printf(ERRMSG_LVL_ERROR,
4509
4495
                    _("Plugin '%s' init function returned error."),
4510
4496
                    plugin->name.str);
4511
 
      goto err;
 
4497
      return 1;
4512
4498
    }
4513
4499
 
4514
 
    /* Make sure the plugin name is not set inside the init() function. */
 
4500
    if (schema_table->create_table == NULL)
 
4501
      schema_table->create_table= create_schema_table;
 
4502
    if (schema_table->old_format == NULL)
 
4503
      schema_table->old_format= make_old_format;
 
4504
    if (schema_table->idx_field1 == 0)
 
4505
      schema_table->idx_field1= -1;
 
4506
    if (schema_table->idx_field2)
 
4507
      schema_table->idx_field2= -1;
 
4508
 
 
4509
    /*- Make sure the plugin name is not set inside the init() function. */
4515
4510
    schema_table->table_name= plugin->name.str;
4516
4511
  }
4517
4512
 
 
4513
  plugin->data= schema_table;
 
4514
 
4518
4515
  return 0;
4519
 
err:
4520
 
  delete schema_table;
4521
 
 
4522
 
  return 1;
4523
4516
}
4524
4517
 
4525
4518
int finalize_schema_table(st_plugin_int *plugin)
4527
4520
  ST_SCHEMA_TABLE *schema_table= (ST_SCHEMA_TABLE *)plugin->data;
4528
4521
 
4529
4522
  if (schema_table && plugin->plugin->deinit)
4530
 
    delete schema_table;
 
4523
    plugin->plugin->deinit(schema_table);
4531
4524
 
4532
4525
  return(0);
4533
4526
}