~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/statement/create_schema.cc

  • Committer: Brian Aker
  • Date: 2011-02-22 06:12:02 UTC
  • mfrom: (2190.1.6 drizzle-build)
  • Revision ID: brian@tangent.org-20110222061202-k03czxykqy4x9hjs
List update, header fixes, multiple symbols, and David deletes some code.

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