~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_table.cc

  • Committer: Brian Aker
  • Date: 2009-11-18 03:04:25 UTC
  • mto: This revision was merged to the branch mainline in revision 1222.
  • Revision ID: brian@gaz-20091118030425-ezceti6llrwg464p
Updated fix for create table like.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2462
2462
 
2463
2463
    if (src_table->schema_table)
2464
2464
    {
 
2465
      /* 
 
2466
        If engine was not specified and we are reading from the I_S, then we need to 
 
2467
        toss an error. This should go away later on when we straighten out the 
 
2468
        I_S engine.
 
2469
      */
 
2470
      if (! (create_info->used_fields & HA_CREATE_USED_ENGINE))
 
2471
      {
 
2472
        pthread_mutex_unlock(&LOCK_open);
 
2473
        my_error(ER_ILLEGAL_HA_CREATE_OPTION, MYF(0),
 
2474
                 "INFORMATION_ENGINE",
 
2475
                 "TEMPORARY");
 
2476
        goto err;
 
2477
      }
 
2478
 
2465
2479
      if (create_like_schema_frm(session, src_table, create_info, &src_proto))
2466
2480
      {
2467
2481
        pthread_mutex_unlock(&LOCK_open);
2488
2502
      protoengine->set_name(create_table_proto.engine().name());
2489
2503
    }
2490
2504
 
2491
 
    string dst_proto_path(dst_path);
2492
 
    string file_ext = ".dfe";
2493
 
 
2494
 
    dst_proto_path.append(file_ext);
2495
 
 
2496
2505
    if (protoerr == EEXIST)
2497
2506
    {
2498
2507
      plugin::StorageEngine* engine= plugin::StorageEngine::findByName(*session,
2499
2508
                                                                       new_proto.engine().name());
2500
2509
 
2501
2510
      if (engine->check_flag(HTON_BIT_HAS_DATA_DICTIONARY) == false)
 
2511
      {
 
2512
        string dst_proto_path(dst_path);
 
2513
        dst_proto_path.append(".dfe");
 
2514
 
2502
2515
        protoerr= drizzle_write_proto_file(dst_proto_path.c_str(), &new_proto);
 
2516
      }
2503
2517
      else
 
2518
      {
2504
2519
        protoerr= 0;
 
2520
      }
2505
2521
    }
2506
2522
 
2507
2523
    if (protoerr)