~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/storage_engine.cc

  • Committer: Brian Aker
  • Date: 2010-05-19 06:14:35 UTC
  • mfrom: (1502.5.12 drizzle_events)
  • Revision ID: brian@gaz-20100519061435-j4i4yn667f1ermvo
Merge of events

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
#include "drizzled/db.h"
54
54
 
55
55
#include <drizzled/table_proto.h>
 
56
#include <drizzled/plugin/event_observer.h>
56
57
 
57
58
static bool shutdown_has_begun= false; // Once we put in the container for the vector/etc for engines this will go away.
58
59
 
98
99
 
99
100
int StorageEngine::renameTable(Session &session, TableIdentifier &from, TableIdentifier &to)
100
101
{
 
102
  int error;
101
103
  setTransactionReadWrite(session);
102
104
 
103
 
  return doRenameTable(session, from, to);
 
105
  if (unlikely(plugin::EventObserver::beforeRenameTable(session, from, to)))
 
106
  {
 
107
    error= ER_EVENT_OBSERVER_PLUGIN;
 
108
  }
 
109
  else
 
110
  {
 
111
    error =  doRenameTable(session, from, to);
 
112
    if (unlikely(plugin::EventObserver::afterRenameTable(session, from, to, error)))
 
113
    {
 
114
      error= ER_EVENT_OBSERVER_PLUGIN;
 
115
    }
 
116
  }
 
117
  
 
118
  return error;
104
119
}
105
120
 
106
121
/**
464
479
  int error;
465
480
 
466
481
  engine.setTransactionReadWrite(session);
467
 
  error= engine.doDropTable(session, identifier);
 
482
  
 
483
  if (unlikely(plugin::EventObserver::beforeDropTable(session, identifier)))
 
484
  {
 
485
    error= ER_EVENT_OBSERVER_PLUGIN;
 
486
  }
 
487
  else
 
488
  {
 
489
    error= engine.doDropTable(session, identifier);
 
490
    if (unlikely(plugin::EventObserver::afterDropTable(session, identifier, error)))
 
491
    {
 
492
      error= ER_EVENT_OBSERVER_PLUGIN;
 
493
    }
 
494
  }
 
495
 
468
496
 
469
497
  return error;
470
498
}