~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/storage_engine.cc

  • Committer: Monty Taylor
  • Date: 2009-03-25 08:19:09 UTC
  • mto: (960.5.2 mordred)
  • mto: This revision was merged to the branch mainline in revision 964.
  • Revision ID: mordred@inaugust.com-20090325081909-pox7g3dz4ms24742
More hton renaming.

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
  check for dups and to find StorageEngine from legacy_db_type.
34
34
  Remove when legacy_db_type is finally gone
35
35
*/
36
 
st_plugin_int *hton2plugin[MAX_HA];
 
36
st_plugin_int *engine2plugin[MAX_HA];
37
37
 
38
 
static StorageEngine *installed_htons[128];
 
38
static StorageEngine *installed_engines[128];
39
39
 
40
40
static const LEX_STRING sys_table_aliases[]=
41
41
{
60
60
    return ha_default_handlerton(session);
61
61
  default:
62
62
    if (db_type > DB_TYPE_UNKNOWN && db_type < DB_TYPE_DEFAULT &&
63
 
        (plugin= ha_lock_engine(session, installed_htons[db_type])))
 
63
        (plugin= ha_lock_engine(session, installed_engines[db_type])))
64
64
      return plugin_data(plugin, StorageEngine*);
65
65
    /* fall through */
66
66
  case DB_TYPE_UNKNOWN:
152
152
{
153
153
  if (engine)
154
154
  {
155
 
    st_plugin_int **plugin= hton2plugin + engine->slot;
 
155
    st_plugin_int **plugin= engine2plugin + engine->slot;
156
156
 
157
157
    return my_plugin_lock(session, &plugin);
158
158
  }
214
214
  case SHOW_OPTION_DISABLED:
215
215
    break;
216
216
  case SHOW_OPTION_YES:
217
 
    if (installed_htons[engine->db_type] == engine)
218
 
      installed_htons[engine->db_type]= NULL;
 
217
    if (installed_engines[engine->db_type] == engine)
 
218
      installed_engines[engine->db_type]= NULL;
219
219
    break;
220
220
  };
221
221
 
257
257
      /* now check the db_type for conflict */
258
258
      if (engine->db_type <= DB_TYPE_UNKNOWN ||
259
259
          engine->db_type >= DB_TYPE_DEFAULT ||
260
 
          installed_htons[engine->db_type])
 
260
          installed_engines[engine->db_type])
261
261
      {
262
262
        int idx= (int) DB_TYPE_FIRST_DYNAMIC;
263
263
 
264
 
        while (idx < (int) DB_TYPE_DEFAULT && installed_htons[idx])
 
264
        while (idx < (int) DB_TYPE_DEFAULT && installed_engines[idx])
265
265
          idx++;
266
266
 
267
267
        if (idx == (int) DB_TYPE_DEFAULT)
275
275
                        plugin->plugin->name, idx);
276
276
        engine->db_type= (enum legacy_db_type) idx;
277
277
      }
278
 
      installed_htons[engine->db_type]= engine;
 
278
      installed_engines[engine->db_type]= engine;
279
279
      tmp= engine->savepoint_offset;
280
280
      engine->savepoint_offset= savepoint_alloc_size;
281
281
      savepoint_alloc_size+= tmp;
282
282
      engine->slot= total_ha++;
283
 
      hton2plugin[engine->slot]=plugin;
 
283
      engine2plugin[engine->slot]=plugin;
284
284
      if (engine->has_2pc())
285
285
        total_ha_2pc++;
286
286
      break;
315
315
 
316
316
const char *ha_resolve_storage_engine_name(const StorageEngine *db_type)
317
317
{
318
 
  return db_type == NULL ? "UNKNOWN" : hton2plugin[db_type->slot]->name.str;
 
318
  return db_type == NULL ? "UNKNOWN" : engine2plugin[db_type->slot]->name.str;
319
319
}
320
320
 
321
321
bool ha_check_storage_engine_flag(const StorageEngine *db_type, const engine_flag_bits flag)
331
331
 
332
332
LEX_STRING *ha_storage_engine_name(const StorageEngine *engine)
333
333
{
334
 
  return &hton2plugin[engine->slot]->name;
 
334
  return &engine2plugin[engine->slot]->name;
335
335
}