~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/statement/create_schema.cc

  • Committer: Lee Bieber
  • Date: 2011-02-11 20:30:05 UTC
  • mfrom: (2157.1.3 build)
  • Revision ID: kalebral@gmail.com-20110211203005-757o1y2yf78dxzqr
Merge Stewart - 716848: drizzleimport displays wrong program_name
Merge Stewart - update README file
Merge Andrew and Joe - Exposes the InnoDB SYS_REPLICATION_LOG to data_dictionary so that it is fast and fixes many issues we have been having

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/create_schema.h>
26
 
#include <drizzled/schema.h>
 
25
#include <drizzled/db.h>
27
26
#include <drizzled/plugin/event_observer.h>
28
27
#include <drizzled/message.h>
29
 
#include <drizzled/plugin/storage_engine.h>
30
28
 
31
29
#include <string>
32
30
 
46
44
    return true;
47
45
  }
48
46
 
49
 
  identifier::Schema schema_identifier(string(getSession()->getLex()->name.str, getSession()->getLex()->name.length));
 
47
  identifier::Schema schema_identifier(string(getSession()->lex->name.str, getSession()->lex->name.length));
50
48
  if (not check(schema_identifier))
51
49
    return false;
52
50
 
53
 
  drizzled::message::schema::init(schema_message, getSession()->getLex()->name.str);
 
51
  drizzled::message::schema::init(schema_message, getSession()->lex->name.str);
54
52
 
55
53
  bool res = false;
56
54
  std::string path;
62
60
  }
63
61
  else
64
62
  {
65
 
    res= schema::create(*getSession(), schema_message, getSession()->getLex()->exists());
 
63
    res= create_db(getSession(), schema_message, getSession()->getLex()->exists());
66
64
    if (unlikely(plugin::EventObserver::afterCreateDatabase(*getSession(), path, res)))
67
65
    {
68
66
      my_error(ER_EVENT_OBSERVER_PLUGIN, schema_identifier);
79
77
  if (not identifier.isValid())
80
78
    return false;
81
79
 
82
 
  if (not plugin::Authorization::isAuthorized(*getSession()->user(), identifier))
 
80
  if (not plugin::Authorization::isAuthorized(getSession()->user(), identifier))
83
81
    return false;
84
82
 
85
83
  if (not getSession()->getLex()->exists())