~ubuntu-branches/ubuntu/saucy/drizzle/saucy-proposed

« back to all changes in this revision

Viewing changes to drizzled/statement/rename_table.cc

  • Committer: Package Import Robot
  • Author(s): Clint Byrum
  • Date: 2012-06-19 10:46:49 UTC
  • mfrom: (1.1.6)
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20120619104649-e2l0ggd4oz3um0f4
Tags: upstream-7.1.36-stable
ImportĀ upstreamĀ versionĀ 7.1.36-stable

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
#include <drizzled/pthread_globals.h>
27
27
#include <drizzled/plugin/storage_engine.h>
28
28
#include <drizzled/transaction_services.h>
 
29
#include <drizzled/sql_lex.h>
 
30
#include <drizzled/table/cache.h>
29
31
 
30
 
namespace drizzled
31
 
{
 
32
namespace drizzled {
32
33
 
33
34
bool statement::RenameTable::execute()
34
35
{
81
82
    return true;
82
83
 
83
84
  {
84
 
    boost::mutex::scoped_lock scopedLock(table::Cache::singleton().mutex()); /* Rename table lock for exclusive access */
 
85
    boost::mutex::scoped_lock scopedLock(table::Cache::mutex()); /* Rename table lock for exclusive access */
85
86
 
86
87
    if (not session().lock_table_names_exclusively(table_list))
87
88
    {
116
117
  /* Lets hope this doesn't fail as the result will be messy */
117
118
  if (not error)
118
119
  {
119
 
    TransactionServices &transaction_services= TransactionServices::singleton();
120
 
    transaction_services.rawStatement(session(),
121
 
                                      *session().getQueryString(),
122
 
                                      *session().schema());        
 
120
    TransactionServices::rawStatement(session(), *session().getQueryString(), *session().schema());        
123
121
    session().my_ok();
124
122
  }
125
123