~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_table.cc

Merged in latest plugin-slot-reorg.

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();
539
538
    if (drop_temporary ||
540
539
        ((table_type == NULL
541
 
          && (plugins.storage_engine.getTableProto(path, NULL) != EEXIST))))
 
540
          && (plugin::StorageEngine::getTableProto(path, NULL) != EEXIST))))
542
541
    {
543
542
      // Table was not found on disk and table can't be created from engine
544
543
      if (if_exists)
1745
1744
  pthread_mutex_lock(&LOCK_open); /* CREATE TABLE (some confussion on naming, double check) */
1746
1745
  if (!internal_tmp_table && !(create_info->options & HA_LEX_CREATE_TMP_TABLE))
1747
1746
  {
1748
 
    plugin::Registry &plugins= plugin::Registry::singleton();
1749
 
    if (plugins.storage_engine.getTableProto(path, NULL)==EEXIST)
 
1747
    if (plugin::StorageEngine::getTableProto(path, NULL)==EEXIST)
1750
1748
    {
1751
1749
      if (create_info->options & HA_LEX_CREATE_IF_NOT_EXISTS)
1752
1750
      {
1796
1794
    table_path_length= build_table_filename(table_path, sizeof(table_path),
1797
1795
                                            db, table_name, false);
1798
1796
 
1799
 
    plugin::Registry &plugins= plugin::Registry::singleton();
1800
 
    int retcode= plugins.storage_engine.getTableProto(table_path, NULL);
 
1797
    int retcode= plugin::StorageEngine::getTableProto(table_path, NULL);
1801
1798
    switch (retcode)
1802
1799
    {
1803
1800
      case ENOENT:
2463
2460
  uint32_t not_used;
2464
2461
  message::Table src_proto;
2465
2462
 
2466
 
  plugin::Registry &plugins= plugin::Registry::singleton();
2467
2463
 
2468
2464
  /*
2469
2465
    By opening source table we guarantee that it exists and no concurrent
2497
2493
      goto table_exists;
2498
2494
    dst_path_length= build_table_filename(dst_path, sizeof(dst_path),
2499
2495
                                          db, table_name, false);
2500
 
    if (plugins.storage_engine.getTableProto(dst_path, NULL) == EEXIST)
 
2496
    if (plugin::StorageEngine::getTableProto(dst_path, NULL) == EEXIST)
2501
2497
      goto table_exists;
2502
2498
  }
2503
2499
 
2530
2526
    }
2531
2527
    else
2532
2528
    {
2533
 
      protoerr= plugins.storage_engine.getTableProto(src_path, &src_proto);
 
2529
      protoerr= plugin::StorageEngine::getTableProto(src_path, &src_proto);
2534
2530
    }
2535
2531
 
2536
2532
    string dst_proto_path(dst_path);
2540
2536
 
2541
2537
    if (protoerr == EEXIST)
2542
2538
    {
2543
 
      plugin::StorageEngine* engine= ha_resolve_by_name(session,
 
2539
      plugin::StorageEngine* engine= plugin::StorageEngine::findByName(session,
2544
2540
                                                src_proto.engine().name());
2545
2541
 
2546
2542
      if (engine->check_flag(HTON_BIT_HAS_DATA_DICTIONARY) == false)
2853
2849
    push_warning_printf(session, DRIZZLE_ERROR::WARN_LEVEL_NOTE,
2854
2850
                       ER_WARN_USING_OTHER_HANDLER,
2855
2851
                       ER(ER_WARN_USING_OTHER_HANDLER),
2856
 
                       ha_resolve_storage_engine_name(*new_engine).c_str(),
 
2852
                       plugin::StorageEngine::resolveName(*new_engine).c_str(),
2857
2853
                       table_name);
2858
2854
  }
2859
2855
  if (create_info->options & HA_LEX_CREATE_TMP_TABLE &&
2862
2858
    if (create_info->used_fields & HA_CREATE_USED_ENGINE)
2863
2859
    {
2864
2860
      my_error(ER_ILLEGAL_HA_CREATE_OPTION, MYF(0),
2865
 
               ha_resolve_storage_engine_name(*new_engine).c_str(),
 
2861
               plugin::StorageEngine::resolveName(*new_engine).c_str(),
2866
2862
               "TEMPORARY");
2867
2863
      *new_engine= 0;
2868
2864
      return true;
2873
2869
     && (*new_engine)->check_flag(HTON_BIT_TEMPORARY_ONLY))
2874
2870
  {
2875
2871
    my_error(ER_ILLEGAL_HA_CREATE_OPTION, MYF(0),
2876
 
             ha_resolve_storage_engine_name(*new_engine).c_str(),
 
2872
             plugin::StorageEngine::resolveName(*new_engine).c_str(),
2877
2873
             "non-TEMPORARY");
2878
2874
    *new_engine= 0;
2879
2875
    return true;