40
40
if (not validateSchemaOptions())
43
if (getSession()->inTransaction())
43
if (session().inTransaction())
45
45
my_error(ER_TRANSACTIONAL_DDL_NOT_SUPPORTED, MYF(0));
49
identifier::Schema schema_identifier(string(getSession()->getLex()->name.str, getSession()->getLex()->name.length));
49
identifier::Schema schema_identifier(string(lex().name.str, lex().name.length));
50
50
if (not check(schema_identifier))
53
drizzled::message::schema::init(schema_message, getSession()->getLex()->name.str);
53
drizzled::message::schema::init(schema_message, lex().name.str);
57
57
schema_identifier.getSQLPath(path);
59
if (unlikely(plugin::EventObserver::beforeCreateDatabase(*getSession(), path)))
59
if (unlikely(plugin::EventObserver::beforeCreateDatabase(session(), path)))
61
61
my_error(ER_EVENT_OBSERVER_PLUGIN, MYF(0), path.c_str());
65
res= schema::create(*getSession(), schema_message, getSession()->getLex()->exists());
66
if (unlikely(plugin::EventObserver::afterCreateDatabase(*getSession(), path, res)))
65
res= schema::create(session(), schema_message, lex().exists());
66
if (unlikely(plugin::EventObserver::afterCreateDatabase(session(), path, res)))
68
68
my_error(ER_EVENT_OBSERVER_PLUGIN, schema_identifier);
79
79
if (not identifier.isValid())
82
if (not plugin::Authorization::isAuthorized(*getSession()->user(), identifier))
82
if (not plugin::Authorization::isAuthorized(*session().user(), identifier))
85
if (not getSession()->getLex()->exists())
85
if (not lex().exists())
87
87
if (plugin::StorageEngine::doesSchemaExist(identifier))