~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/statement/rename_table.cc

  • Committer: Brian Aker
  • Date: 2010-10-23 22:28:30 UTC
  • mto: This revision was merged to the branch mainline in revision 1875.
  • Revision ID: brian@tangent.org-20101023222830-em4idhbau96l37zt
Encapsulate schema_name it table_list.

Show diffs side-by-side

added added

removed removed

Lines of Context:
154
154
  plugin::StorageEngine *engine= NULL;
155
155
  message::Table table_proto;
156
156
 
157
 
  TableIdentifier old_identifier(ren_table->db, old_alias, message::Table::STANDARD);
 
157
  TableIdentifier old_identifier(ren_table->getSchemaName(), old_alias, message::Table::STANDARD);
158
158
 
159
159
  if (plugin::StorageEngine::getTableDefinition(*session, old_identifier, table_proto) != EEXIST)
160
160
  {
161
 
    my_error(ER_NO_SUCH_TABLE, MYF(0), ren_table->db, old_alias);
 
161
    my_error(ER_NO_SUCH_TABLE, MYF(0), ren_table->getSchemaName(), old_alias);
162
162
    return true;
163
163
  }
164
164
 
186
186
  for (ren_table= table_list; ren_table; ren_table= new_table->next_local)
187
187
  {
188
188
    new_table= ren_table->next_local;
189
 
    if (rename(ren_table, new_table->db, new_table->table_name, skip_error))
 
189
    if (rename(ren_table, new_table->getSchemaName(), new_table->table_name, skip_error))
190
190
      return ren_table;
191
191
  }
192
192
  return 0;