~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/statement/drop_schema.cc

  • Committer: Brian Aker
  • Date: 2011-02-16 02:39:43 UTC
  • mfrom: (2171.1.3 drizzle-staging)
  • Revision ID: brian@tangent.org-20110216023943-z4lxkjvknnrrncr2
Merge of all fixes related to errors, schemas, etc.

Show diffs side-by-side

added added

removed removed

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