~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/statement/create_schema.cc

  • Committer: patrick crews
  • Date: 2011-03-15 12:12:09 UTC
  • mfrom: (1099.4.216 drizzle)
  • Revision ID: gleebix@gmail.com-20110315121209-8g2tkf31w0rx9ter
Tags: 2011.03.12
Updated translations

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
  if (not validateSchemaOptions())
41
41
    return true;
42
42
 
43
 
  if (getSession()->inTransaction())
 
43
  if (session().inTransaction())
44
44
  {
45
45
    my_error(ER_TRANSACTIONAL_DDL_NOT_SUPPORTED, MYF(0));
46
46
    return true;
47
47
  }
48
48
 
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))
51
51
    return false;
52
52
 
53
 
  drizzled::message::schema::init(schema_message, getSession()->getLex()->name.str);
 
53
  drizzled::message::schema::init(schema_message, lex().name.str);
54
54
 
55
55
  bool res = false;
56
56
  std::string path;
57
57
  schema_identifier.getSQLPath(path);
58
58
 
59
 
  if (unlikely(plugin::EventObserver::beforeCreateDatabase(*getSession(), path)))
 
59
  if (unlikely(plugin::EventObserver::beforeCreateDatabase(session(), path)))
60
60
  {
61
61
    my_error(ER_EVENT_OBSERVER_PLUGIN, MYF(0), path.c_str());
62
62
  }
63
63
  else
64
64
  {
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)))
67
67
    {
68
68
      my_error(ER_EVENT_OBSERVER_PLUGIN, schema_identifier);
69
69
      res = false;
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(*session().user(), identifier))
83
83
    return false;
84
84
 
85
 
  if (not getSession()->getLex()->exists())
 
85
  if (not lex().exists())
86
86
  {
87
87
    if (plugin::StorageEngine::doesSchemaExist(identifier))
88
88
    {