~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/storage_engine.cc

  • Committer: Brian Aker
  • Date: 2009-04-07 20:09:30 UTC
  • mfrom: (971.1.17 mordred)
  • Revision ID: brian@gaz-20090407200930-27jkul7lkwkjs2to
Merge from Monty

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
 
33
33
using namespace std;
34
34
 
 
35
map<string, StorageEngine *> all_engines;
 
36
 
35
37
st_plugin_int *engine2plugin[MAX_HA];
36
38
 
37
39
static const LEX_STRING sys_table_aliases[]=
41
43
  {NULL, 0}
42
44
};
43
45
 
44
 
StorageEngine::StorageEngine(const std::string &name_arg,
 
46
StorageEngine::StorageEngine(const std::string name_arg,
45
47
                             const std::bitset<HTON_BIT_SIZE> &flags_arg,
46
48
                             size_t savepoint_offset_arg,
47
49
                             bool support_2pc)
57
59
    slot= total_ha++;
58
60
    if (two_phase_commit)
59
61
        total_ha_2pc++;
60
 
  } 
 
62
  }
61
63
}
62
64
 
63
65
 
184
186
{
185
187
  StorageEngine *engine= static_cast<StorageEngine *>(plugin->data);
186
188
 
 
189
  all_engines.erase(engine->getName());
 
190
 
187
191
  if (engine && plugin->plugin->deinit)
188
192
    (void)plugin->plugin->deinit(engine);
189
193
 
223
227
 
224
228
  plugin->data= engine;
225
229
  plugin->isInited= true;
 
230
  all_engines[engine->getName()]= engine;
226
231
 
227
232
  return 0;
228
233
}
229
234
 
230
 
const char *ha_resolve_storage_engine_name(const StorageEngine *db_type)
 
235
const string ha_resolve_storage_engine_name(const StorageEngine *engine)
231
236
{
232
 
  return db_type == NULL ? "UNKNOWN" : engine2plugin[db_type->slot]->name.str;
 
237
  return engine == NULL ? string("UNKNOWN") : engine->getName();
233
238
}
234
239
 
235
 
LEX_STRING *ha_storage_engine_name(const StorageEngine *engine)
236
 
{
237
 
  return &engine2plugin[engine->slot]->name;
238
 
}