~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/statement/drop_schema.cc

  • Committer: Monty Taylor
  • Date: 2010-09-26 21:24:15 UTC
  • mto: (1796.1.2 build)
  • mto: This revision was merged to the branch mainline in revision 1797.
  • Revision ID: mordred@inaugust.com-20100926212415-5fn3p3q75pgiei7r
Moved protocol doc into the docs.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
 
 *  Copyright (C) 2009 Sun Microsystems, Inc.
 
4
 *  Copyright (C) 2009 Sun Microsystems
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
41
41
  SchemaIdentifier schema_identifier(string(session->lex->name.str, session->lex->name.length));
42
42
  if (not check_db_name(session, schema_identifier))
43
43
  {
44
 
    std::string path;
45
 
    schema_identifier.getSQLPath(path);
46
 
 
47
 
    my_error(ER_WRONG_DB_NAME, MYF(0), path.c_str());
 
44
    my_error(ER_WRONG_DB_NAME, MYF(0), schema_identifier.getSQLPath().c_str());
48
45
    return false;
49
46
  }
50
47
  if (session->inTransaction())
56
53
  }
57
54
  
58
55
  bool res = true;
59
 
  std::string path;
60
 
  schema_identifier.getSQLPath(path);
61
 
  if (unlikely(plugin::EventObserver::beforeDropDatabase(*session, path))) 
 
56
  if (unlikely(plugin::EventObserver::beforeDropDatabase(*session, schema_identifier.getSQLPath()))) 
62
57
  {
63
 
    my_error(ER_EVENT_OBSERVER_PLUGIN, MYF(0), path.c_str());
 
58
    my_error(ER_EVENT_OBSERVER_PLUGIN, MYF(0), schema_identifier.getSQLPath().c_str());
64
59
  }
65
60
  else
66
61
  {
67
62
    res= mysql_rm_db(session, schema_identifier, drop_if_exists);
68
 
    if (unlikely(plugin::EventObserver::afterDropDatabase(*session, path, res)))
 
63
    if (unlikely(plugin::EventObserver::afterDropDatabase(*session, schema_identifier.getSQLPath(), res)))
69
64
    {
70
 
      my_error(ER_EVENT_OBSERVER_PLUGIN, MYF(0), path.c_str());
 
65
      my_error(ER_EVENT_OBSERVER_PLUGIN, MYF(0), schema_identifier.getSQLPath().c_str());
71
66
      res = false;
72
67
    }
73
68