~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_table.cc

  • Committer: Brian Aker
  • Date: 2009-11-30 19:13:19 UTC
  • mfrom: (1225.1.39 figure)
  • Revision ID: brian@gaz-20091130191319-zyt51fidacic3brf
Merge Padraig

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
#include <drizzled/plugin/client.h>
37
37
#include <drizzled/table_identifier.h>
38
38
 
39
 
#include "drizzled/statement/alter_table.h" /* for drizzled::create_like_schema_frm, which will die soon */
 
39
#include "drizzled/statement/alter_table.h"
 
40
#include "drizzled/plugin/info_schema_table.h"
40
41
 
41
42
#include <algorithm>
42
43
 
2312
2313
  {
2313
2314
    int protoerr= EEXIST;
2314
2315
 
2315
 
    if (src_table->schema_table)
 
2316
    /*
 
2317
     * If an engine was not specified and we are reading from an I_S table, then we need to toss an
 
2318
     * error. This should go away soon.
 
2319
     * @todo make this go away!
 
2320
     */
 
2321
    if (! is_engine_set)
2316
2322
    {
2317
 
      /*
2318
 
        If engine was not specified and we are reading from the I_S, then we need to
2319
 
        toss an error. This should go away later on when we straighten out the
2320
 
        I_S engine.
2321
 
      */
2322
 
      if (! is_engine_set)
 
2323
      string tab_name(src_path);
 
2324
      string i_s_prefix("./information_schema/");
 
2325
      if (tab_name.compare(0, i_s_prefix.length(), i_s_prefix) == 0)
2323
2326
      {
2324
2327
        pthread_mutex_unlock(&LOCK_open);
2325
 
        my_error(ER_ILLEGAL_HA_CREATE_OPTION, MYF(0),
 
2328
        my_error(ER_ILLEGAL_HA_CREATE_OPTION,
 
2329
                 MYF(0),
2326
2330
                 "INFORMATION_ENGINE",
2327
2331
                 "TEMPORARY");
2328
2332
        goto err;
2329
2333
      }
 
2334
    }
2330
2335
 
2331
 
      if (create_like_schema_frm(session, src_table, &src_proto))
2332
 
      {
2333
 
        pthread_mutex_unlock(&LOCK_open);
2334
 
        goto err;
2335
 
      }
2336
 
    }
2337
 
    else
2338
 
    {
2339
 
      protoerr= plugin::StorageEngine::getTableDefinition(*session,
2340
 
                                                          src_path,
2341
 
                                                          db,
2342
 
                                                          table_name,
2343
 
                                                          false,
2344
 
                                                          &src_proto);
2345
 
    }
 
2336
    protoerr= plugin::StorageEngine::getTableDefinition(*session,
 
2337
                                                        src_path,
 
2338
                                                        db,
 
2339
                                                        table_name,
 
2340
                                                        false,
 
2341
                                                        &src_proto);
2346
2342
 
2347
2343
    message::Table new_proto(src_proto);
2348
2344