~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_table.cc

Split StorageEngine into slot. This completes the plugin-slot-reorg. Woot.
Next step - getting slot registration to inject a plugin reference into a
registry so that we can make I_S.PLUGINS stop being broken.

Show diffs side-by-side

added added

removed removed

Lines of Context:
535
535
      /* remove .frm file and engine files */
536
536
      path_length= build_table_filename(path, sizeof(path), db, table->table_name, table->internal_tmp_table);
537
537
    }
 
538
    plugin::Registry &plugins= plugin::Registry::singleton();
538
539
    if (drop_temporary ||
539
540
        ((table_type == NULL
540
 
          && (plugin::StorageEngine::getTableProto(path, NULL) != EEXIST))))
 
541
          && (plugins.storage_engine.getTableProto(path, NULL) != EEXIST))))
541
542
    {
542
543
      // Table was not found on disk and table can't be created from engine
543
544
      if (if_exists)
1744
1745
  pthread_mutex_lock(&LOCK_open); /* CREATE TABLE (some confussion on naming, double check) */
1745
1746
  if (!internal_tmp_table && !(create_info->options & HA_LEX_CREATE_TMP_TABLE))
1746
1747
  {
1747
 
    if (plugin::StorageEngine::getTableProto(path, NULL)==EEXIST)
 
1748
    plugin::Registry &plugins= plugin::Registry::singleton();
 
1749
    if (plugins.storage_engine.getTableProto(path, NULL)==EEXIST)
1748
1750
    {
1749
1751
      if (create_info->options & HA_LEX_CREATE_IF_NOT_EXISTS)
1750
1752
      {
1794
1796
    table_path_length= build_table_filename(table_path, sizeof(table_path),
1795
1797
                                            db, table_name, false);
1796
1798
 
1797
 
    int retcode= plugin::StorageEngine::getTableProto(table_path, NULL);
 
1799
    plugin::Registry &plugins= plugin::Registry::singleton();
 
1800
    int retcode= plugins.storage_engine.getTableProto(table_path, NULL);
1798
1801
    switch (retcode)
1799
1802
    {
1800
1803
      case ENOENT:
2466
2469
  uint32_t not_used;
2467
2470
  message::Table src_proto;
2468
2471
 
 
2472
  plugin::Registry &plugins= plugin::Registry::singleton();
 
2473
 
2469
2474
  /*
2470
2475
    By opening source table we guarantee that it exists and no concurrent
2471
2476
    DDL operation will mess with it. Later we also take an exclusive
2498
2503
      goto table_exists;
2499
2504
    dst_path_length= build_table_filename(dst_path, sizeof(dst_path),
2500
2505
                                          db, table_name, false);
2501
 
    if (plugin::StorageEngine::getTableProto(dst_path, NULL)==EEXIST)
 
2506
    if (plugins.storage_engine.getTableProto(dst_path, NULL) == EEXIST)
2502
2507
      goto table_exists;
2503
2508
  }
2504
2509
 
2531
2536
    }
2532
2537
    else
2533
2538
    {
2534
 
      protoerr= plugin::StorageEngine::getTableProto(src_path, &src_proto);
 
2539
      protoerr= plugins.storage_engine.getTableProto(src_path, &src_proto);
2535
2540
    }
2536
2541
 
2537
2542
    string dst_proto_path(dst_path);