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

« back to all changes in this revision

Viewing changes to drizzled/statement/drop_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
 
37
38
  /* Chicken/Egg... we need to search for the table, to know if the table exists, so we can build a full identifier from it */
38
39
  message::table::shared_ptr original_table_message;
39
40
  {
40
 
    identifier::Table identifier(first_table->getSchemaName(), first_table->getTableName());
 
41
    identifier::Table identifier(session().catalog().identifier(),
 
42
                                 first_table->getSchemaName(),
 
43
                                 first_table->getTableName());
41
44
    if (not (original_table_message= plugin::StorageEngine::getTableMessage(session(), identifier)))
42
45
    {
43
46
      my_error(ER_BAD_TABLE_ERROR, identifier);
68
71
  bool res;
69
72
  if (original_table_message->type() == message::Table::STANDARD )
70
73
  {
71
 
    identifier::Table identifier(first_table->getSchemaName(), first_table->getTableName());
 
74
    identifier::Table identifier(session().catalog().identifier(),
 
75
                                 first_table->getSchemaName(),
 
76
                                 first_table->getTableName());
72
77
 
73
78
    create_info.default_table_charset= plugin::StorageEngine::getSchemaCollation(identifier);
74
79
 
84
89
  }
85
90
  else
86
91
  {
87
 
    identifier::Table catch22(first_table->getSchemaName(), first_table->getTableName());
 
92
    identifier::Table catch22(session().catalog().identifier(),
 
93
                              first_table->getSchemaName(),
 
94
                              first_table->getTableName());
88
95
    Table *table= session().open_tables.find_temporary_table(catch22);
89
96
    assert(table);
90
97
    {
91
 
      identifier::Table identifier(first_table->getSchemaName(), first_table->getTableName(), table->getShare()->getPath());
 
98
      identifier::Table identifier(session().catalog().identifier(),
 
99
                                   first_table->getSchemaName(),
 
100
                                   first_table->getTableName(),
 
101
                                   table->getShare()->getPath());
92
102
      create_info.default_table_charset= plugin::StorageEngine::getSchemaCollation(identifier);
93
103
 
94
104
      res= alter_table(&session(),