~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/statement/drop_schema.cc

updating

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
 
37
37
bool statement::DropSchema::execute()
38
38
{
39
 
  if (getSession()->inTransaction())
 
39
  if (session().inTransaction())
40
40
  {
41
41
    my_error(ER_TRANSACTIONAL_DDL_NOT_SUPPORTED, MYF(0));
42
42
    return true;
44
44
 
45
45
  identifier::Schema schema_identifier(std::string(lex().name.str, lex().name.length));
46
46
 
47
 
  if (not schema::check(*getSession(), schema_identifier))
 
47
  if (not schema::check(session(), schema_identifier))
48
48
  {
49
49
    my_error(ER_WRONG_DB_NAME, schema_identifier);
50
50
 
51
51
    return false;
52
52
  }
53
53
 
54
 
  if (getSession()->inTransaction())
 
54
  if (session().inTransaction())
55
55
  {
56
56
    my_message(ER_LOCK_OR_ACTIVE_TRANSACTION, 
57
57
        ER(ER_LOCK_OR_ACTIVE_TRANSACTION), 
62
62
  bool res = true;
63
63
  std::string path;
64
64
  schema_identifier.getSQLPath(path);
65
 
  if (unlikely(plugin::EventObserver::beforeDropDatabase(*getSession(), path))) 
 
65
  if (unlikely(plugin::EventObserver::beforeDropDatabase(session(), path))) 
66
66
  {
67
67
    my_error(ER_EVENT_OBSERVER_PLUGIN, schema_identifier);
68
68
  }
69
69
  else
70
70
  {
71
 
    res= schema::drop(*getSession(), schema_identifier, drop_if_exists);
72
 
    if (unlikely(plugin::EventObserver::afterDropDatabase(*getSession(), path, res)))
 
71
    res= schema::drop(session(), schema_identifier, drop_if_exists);
 
72
    if (unlikely(plugin::EventObserver::afterDropDatabase(session(), path, res)))
73
73
    {
74
74
      my_error(ER_EVENT_OBSERVER_PLUGIN, MYF(0), path.c_str());
75
75
      res = false;