~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/statement/rename_table.cc

  • Committer: Lee Bieber
  • Date: 2011-02-19 18:28:30 UTC
  • mfrom: (1994.4.78 drizzle)
  • mto: This revision was merged to the branch mainline in revision 2185.
  • Revision ID: kalebral@gmail.com-20110219182830-kb8m3ali4yjmcg0s
Merge Marisa - adds logo references to the include file

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
19
 */
20
20
 
21
 
#include "config.h"
 
21
#include <config.h>
22
22
#include <drizzled/show.h>
23
23
#include <drizzled/lock.h>
24
24
#include <drizzled/session.h>
25
25
#include <drizzled/statement/rename_table.h>
26
 
#include "drizzled/sql_table.h"
27
 
#include "drizzled/pthread_globals.h"
28
 
#include "drizzled/plugin/storage_engine.h"
 
26
#include <drizzled/sql_table.h>
 
27
#include <drizzled/pthread_globals.h>
 
28
#include <drizzled/plugin/storage_engine.h>
29
29
 
30
30
namespace drizzled
31
31
{
153
153
  }
154
154
 
155
155
  plugin::StorageEngine *engine= NULL;
156
 
  message::table::shared_ptr table_proto;
 
156
  message::table::shared_ptr table_message;
157
157
 
158
158
  identifier::Table old_identifier(ren_table->getSchemaName(), old_alias, message::Table::STANDARD);
159
159
 
160
 
  if (plugin::StorageEngine::getTableDefinition(*getSession(), old_identifier, table_proto) != EEXIST)
 
160
  if (not (table_message= plugin::StorageEngine::getTableMessage(*getSession(), old_identifier)))
161
161
  {
162
162
    my_error(ER_TABLE_UNKNOWN, old_identifier);
163
163
    return true;
164
164
  }
165
165
 
166
 
  engine= plugin::StorageEngine::findByName(*getSession(), table_proto->engine().name());
 
166
  engine= plugin::StorageEngine::findByName(*getSession(), table_message->engine().name());
167
167
 
168
168
  identifier::Table new_identifier(new_db, new_alias, message::Table::STANDARD);
169
169
  if (plugin::StorageEngine::doesTableExist(*getSession(), new_identifier))
170
170
  {
171
 
    my_error(ER_TABLE_EXISTS_ERROR, MYF(0), new_alias);
 
171
    my_error(ER_TABLE_EXISTS_ERROR, new_identifier);
172
172
    return 1; // This can't be skipped
173
173
  }
174
174