~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/statement/rename_table.cc

  • Committer: Eric Day
  • Date: 2009-10-31 21:53:33 UTC
  • mfrom: (1200 staging)
  • mto: This revision was merged to the branch mainline in revision 1202.
  • Revision ID: eday@oddments.org-20091031215333-j94bjoanwmi68p6f
Merged trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
#include <drizzled/session.h>
25
25
#include <drizzled/statement/rename_table.h>
26
26
 
27
 
using namespace drizzled;
 
27
namespace drizzled
 
28
{
28
29
 
29
30
bool statement::RenameTable::execute()
30
31
{
156
157
  length= build_table_filename(path, sizeof(path),
157
158
                               ren_table->db, old_alias, false);
158
159
 
159
 
  if (plugin::StorageEngine::getTableProto(path, &table_proto) != EEXIST)
 
160
  if (plugin::StorageEngine::getTableDefinition(*session, path, ren_table->db, old_alias, false, &table_proto) != EEXIST)
160
161
  {
161
162
    my_error(ER_NO_SUCH_TABLE, MYF(0), ren_table->db, old_alias);
162
163
    return true;
163
164
  }
164
165
 
165
 
  engine= plugin::StorageEngine::findByName(session, table_proto.engine().name());
 
166
  engine= plugin::StorageEngine::findByName(*session, table_proto.engine().name());
166
167
 
167
168
  length= build_table_filename(path, sizeof(path),
168
169
                               new_db, new_alias, false);
169
170
 
170
 
  if (plugin::StorageEngine::getTableProto(path, NULL) != ENOENT)
 
171
  if (plugin::StorageEngine::getTableDefinition(*session, path, new_db, new_alias, false) != ENOENT)
171
172
  {
172
173
    my_error(ER_TABLE_EXISTS_ERROR, MYF(0), new_alias);
173
174
    return 1; // This can't be skipped
194
195
      return ren_table;
195
196
  }
196
197
  return 0;
197
 
}
 
198
 
199
 
 
200
} /* namespace drizzled */