~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/statement/create_index.cc

  • Committer: Brian Aker
  • Date: 2010-10-29 01:13:40 UTC
  • mto: (1890.1.1 build)
  • mto: This revision was merged to the branch mainline in revision 1891.
  • Revision ID: brian@tangent.org-20101029011340-y9ixm180v9daypqr
Remove warnings for c++

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());
59
59
    return true;
60
60
  }
61
61
 
62
 
  create_info.row_type= ROW_TYPE_NOT_USED;
63
 
 
64
62
  bool res;
65
63
  if (original_table_message.type() == message::Table::STANDARD )
66
64
  {
67
 
    TableIdentifier identifier(first_table->db, first_table->table_name);
 
65
    TableIdentifier identifier(first_table->getSchemaName(), first_table->getTableName());
68
66
    create_info.default_table_charset= plugin::StorageEngine::getSchemaCollation(identifier);
69
67
 
70
68
    res= alter_table(session, 
71
69
                     identifier,
72
70
                     identifier,
73
71
                     &create_info, 
 
72
                     original_table_message,
74
73
                     create_table_message, 
75
74
                     first_table,
76
75
                     &alter_info,
78
77
  }
79
78
  else
80
79
  {
81
 
    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);
82
82
    assert(table);
83
83
    {
84
 
      TableIdentifier identifier(first_table->db, first_table->table_name, table->s->path.str);
 
84
      TableIdentifier identifier(first_table->getSchemaName(), first_table->getTableName(), table->getMutableShare()->getPath());
85
85
      create_info.default_table_charset= plugin::StorageEngine::getSchemaCollation(identifier);
86
86
 
87
87
      res= alter_table(session, 
88
88
                       identifier,
89
89
                       identifier,
90
90
                       &create_info, 
 
91
                       original_table_message,
91
92
                       create_table_message, 
92
93
                       first_table,
93
94
                       &alter_info,
94
95
                       0, (order_st*) 0, 0);
95
96
    }
96
97
  }
 
98
 
97
99
  return res;
98
100
}
99
101