~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/statement/rename_table.cc

  • Committer: Monty Taylor
  • Date: 2010-03-11 18:27:20 UTC
  • mfrom: (1333 staging)
  • mto: This revision was merged to the branch mainline in revision 1348.
  • Revision ID: mordred@inaugust.com-20100311182720-hd1h87y6cb1b1mp0
Merged trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
110
110
  /* Lets hope this doesn't fail as the result will be messy */
111
111
  if (! error)
112
112
  {
113
 
    write_bin_log(session, session->query, session->query_length);
 
113
    write_bin_log(session, session->query.c_str());
114
114
    session->my_ok();
115
115
  }
116
116
 
154
154
  plugin::StorageEngine *engine= NULL;
155
155
  message::Table table_proto;
156
156
 
157
 
  TableIdentifier old_identifier(ren_table->db, old_alias, NO_TMP_TABLE);
 
157
  TableIdentifier old_identifier(ren_table->db, old_alias, STANDARD_TABLE);
158
158
 
159
159
  if (plugin::StorageEngine::getTableDefinition(*session, old_identifier, &table_proto) != EEXIST)
160
160
  {
164
164
 
165
165
  engine= plugin::StorageEngine::findByName(*session, table_proto.engine().name());
166
166
 
167
 
  TableIdentifier new_identifier(new_db, new_alias, NO_TMP_TABLE);
168
 
  if (plugin::StorageEngine::getTableDefinition(*session, new_identifier) != ENOENT)
 
167
  TableIdentifier new_identifier(new_db, new_alias, STANDARD_TABLE);
 
168
  if (plugin::StorageEngine::doesTableExist(*session, new_identifier))
169
169
  {
170
170
    my_error(ER_TABLE_EXISTS_ERROR, MYF(0), new_alias);
171
171
    return 1; // This can't be skipped