~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/statement/create_index.cc

merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
  /* Chicken/Egg... we need to search for the table, to know if the table exists, so we can build a full identifier from it */
37
37
  message::Table original_table_message;
38
38
  {
39
 
    TableIdentifier identifier(first_table->db, first_table->table_name);
 
39
    TableIdentifier identifier(first_table->getSchemaName(), first_table->getTableName());
40
40
    if (plugin::StorageEngine::getTableDefinition(*session, identifier, original_table_message) != EEXIST)
41
41
    {
42
42
      my_error(ER_BAD_TABLE_ERROR, MYF(0), identifier.getSQLPath().c_str());
62
62
  bool res;
63
63
  if (original_table_message.type() == message::Table::STANDARD )
64
64
  {
65
 
    TableIdentifier identifier(first_table->db, first_table->table_name);
 
65
    TableIdentifier identifier(first_table->getSchemaName(), first_table->getTableName());
66
66
    create_info.default_table_charset= plugin::StorageEngine::getSchemaCollation(identifier);
67
67
 
68
68
    res= alter_table(session, 
73
73
                     create_table_message, 
74
74
                     first_table,
75
75
                     &alter_info,
76
 
                     0, (order_st*) 0, 0);
 
76
                     0, (Order*) 0, 0);
77
77
  }
78
78
  else
79
79
  {
80
 
    Table *table= session->find_temporary_table(first_table);
 
80
    TableIdentifier catch22(first_table->getSchemaName(), first_table->getTableName());
 
81
    Table *table= session->find_temporary_table(catch22);
81
82
    assert(table);
82
83
    {
83
 
      TableIdentifier identifier(first_table->db, first_table->table_name, table->getMutableShare()->getPath());
 
84
      TableIdentifier identifier(first_table->getSchemaName(), first_table->getTableName(), table->getMutableShare()->getPath());
84
85
      create_info.default_table_charset= plugin::StorageEngine::getSchemaCollation(identifier);
85
86
 
86
87
      res= alter_table(session, 
91
92
                       create_table_message, 
92
93
                       first_table,
93
94
                       &alter_info,
94
 
                       0, (order_st*) 0, 0);
 
95
                       0, (Order*) 0, 0);
95
96
    }
96
97
  }
97
98