~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/statement/rename_table.cc

  • Committer: Olaf van der Spek
  • Date: 2011-03-10 10:44:18 UTC
  • mto: This revision was merged to the branch mainline in revision 2233.
  • Revision ID: olafvdspek@gmail.com-20110310104418-9nye3afuge7hnf5g
Statement::session()

Show diffs side-by-side

added added

removed removed

Lines of Context:
117
117
  if (not error)
118
118
  {
119
119
    TransactionServices &transaction_services= TransactionServices::singleton();
120
 
    transaction_services.rawStatement(*getSession(),
 
120
    transaction_services.rawStatement(session(),
121
121
                                      *session().getQueryString(),
122
122
                                      *session().schema());        
123
123
    session().my_ok();
160
160
 
161
161
  identifier::Table old_identifier(ren_table->getSchemaName(), old_alias, message::Table::STANDARD);
162
162
 
163
 
  if (not (table_message= plugin::StorageEngine::getTableMessage(*getSession(), old_identifier)))
 
163
  if (not (table_message= plugin::StorageEngine::getTableMessage(session(), old_identifier)))
164
164
  {
165
165
    my_error(ER_TABLE_UNKNOWN, old_identifier);
166
166
    return true;
167
167
  }
168
168
 
169
 
  engine= plugin::StorageEngine::findByName(*getSession(), table_message->engine().name());
 
169
  engine= plugin::StorageEngine::findByName(session(), table_message->engine().name());
170
170
 
171
171
  identifier::Table new_identifier(new_db, new_alias, message::Table::STANDARD);
172
 
  if (plugin::StorageEngine::doesTableExist(*getSession(), new_identifier))
 
172
  if (plugin::StorageEngine::doesTableExist(session(), new_identifier))
173
173
  {
174
174
    my_error(ER_TABLE_EXISTS_ERROR, new_identifier);
175
175
    return 1; // This can't be skipped
176
176
  }
177
177
 
178
 
  rc= rename_table(*getSession(), engine, old_identifier, new_identifier);
 
178
  rc= rename_table(session(), engine, old_identifier, new_identifier);
179
179
  if (rc && ! skip_error)
180
180
    return true;
181
181