~drizzle-trunk/drizzle/jenkins-Drizzle-Builder-187

« back to all changes in this revision

Viewing changes to drizzled/statement/create_index.cc

  • Committer: Stewart Smith
  • Date: 2012-07-11 14:06:00 UTC
  • mto: This revision was merged to the branch mainline in revision 2574.
  • Revision ID: stewart@flamingspork.com-20120711140600-oxrs1cjabjuqpd05
force a identifier::Schema to be constructed with a identifier::Catalog. This is close to the final 'big' part for CATALOG support. We also have to modify all around the server that creates identifier::Schema so it does so properly. Since a single Session cannot span schemas, we get off a wee bit easy :) The big limitation in this patch is that INFORMATION_SCHEMA and DATA_DICTIONARY only appear in the LOCAL catalog (and this really needs to be fixed before CATALOGs other than LOCAL are supported).

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
#include <drizzled/statement/alter_table.h>
27
27
#include <drizzled/plugin/storage_engine.h>
28
28
#include <drizzled/open_tables_state.h>
 
29
#include <drizzled/catalog/instance.h>
29
30
 
30
31
namespace drizzled
31
32
{
49
50
  /* Chicken/Egg... we need to search for the table, to know if the table exists, so we can build a full identifier from it */
50
51
  message::table::shared_ptr original_table_message;
51
52
  {
52
 
    identifier::Table identifier(first_table->getSchemaName(), first_table->getTableName());
 
53
    identifier::Table identifier(session().catalog().identifier(),
 
54
                                 first_table->getSchemaName(),
 
55
                                 first_table->getTableName());
53
56
    if (not (original_table_message= plugin::StorageEngine::getTableMessage(session(), identifier)))
54
57
    {
55
58
      my_error(ER_BAD_TABLE_ERROR, identifier);
76
79
  bool res;
77
80
  if (original_table_message->type() == message::Table::STANDARD )
78
81
  {
79
 
    identifier::Table identifier(first_table->getSchemaName(), first_table->getTableName());
 
82
    identifier::Table identifier(session().catalog().identifier(),
 
83
                                 first_table->getSchemaName(),
 
84
                                 first_table->getTableName());
80
85
    create_info().default_table_charset= plugin::StorageEngine::getSchemaCollation(identifier);
81
86
 
82
87
    res= alter_table(&session(), 
91
96
  }
92
97
  else
93
98
  {
94
 
    identifier::Table catch22(first_table->getSchemaName(), first_table->getTableName());
 
99
    identifier::Table catch22(session().catalog().identifier(),
 
100
                              first_table->getSchemaName(),
 
101
                              first_table->getTableName());
95
102
    Table *table= session().open_tables.find_temporary_table(catch22);
96
103
    assert(table);
97
104
    {
98
 
      identifier::Table identifier(first_table->getSchemaName(), first_table->getTableName(), table->getMutableShare()->getPath());
 
105
      identifier::Table identifier(session().catalog().identifier(),
 
106
                                   first_table->getSchemaName(),
 
107
                                   first_table->getTableName(),
 
108
                                   table->getMutableShare()->getPath());
99
109
      create_info().default_table_charset= plugin::StorageEngine::getSchemaCollation(identifier);
100
110
 
101
111
      res= alter_table(&session(),