~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/statement/drop_schema.cc

  • Committer: Lee Bieber
  • Date: 2011-01-24 17:20:08 UTC
  • mfrom: (2107.2.1 trunk-bug-703913)
  • mto: This revision was merged to the branch mainline in revision 2109.
  • Revision ID: kalebral@gmail.com-20110124172008-y5maihyoyu7gn18p
Merge Andrew - fix bug 703913: some support-files should be dropped

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>
22
 
 
 
21
#include "config.h"
23
22
#include <drizzled/show.h>
24
23
#include <drizzled/session.h>
25
24
#include <drizzled/statement/drop_schema.h>
 
25
#include <drizzled/db.h>
26
26
#include <drizzled/plugin/event_observer.h>
27
27
 
28
 
#include <drizzled/schema.h>
29
 
 
30
28
#include <string>
31
29
 
32
30
using namespace std;
42
40
    return true;
43
41
  }
44
42
 
45
 
  identifier::Schema schema_identifier(std::string(getSession()->getLex()->name.str, getSession()->getLex()->name.length));
 
43
  identifier::Schema schema_identifier(std::string(getSession()->lex->name.str, getSession()->lex->name.length));
46
44
 
47
 
  if (not schema::check(*getSession(), schema_identifier))
 
45
  if (not check_db_name(getSession(), schema_identifier))
48
46
  {
49
47
    my_error(ER_WRONG_DB_NAME, schema_identifier);
50
48
 
68
66
  }
69
67
  else
70
68
  {
71
 
    res= schema::drop(*getSession(), schema_identifier, drop_if_exists);
 
69
    res= rm_db(getSession(), schema_identifier, drop_if_exists);
72
70
    if (unlikely(plugin::EventObserver::afterDropDatabase(*getSession(), path, res)))
73
71
    {
74
72
      my_error(ER_EVENT_OBSERVER_PLUGIN, MYF(0), path.c_str());