~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/statement/alter_schema.cc

  • Committer: Stewart Smith
  • Date: 2011-01-14 05:11:45 UTC
  • mto: (2086.1.3 build)
  • mto: This revision was merged to the branch mainline in revision 2087.
  • Revision ID: stewart@flamingspork.com-20110114051145-xiputq4lvmtct377
storage engine docs. add bit about some temp table only engines.

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
 
36
36
bool statement::AlterSchema::execute()
37
37
{
38
 
  LEX_STRING *db= &getSession()->lex->name;
 
38
  LEX_STRING *db= &session->lex->name;
39
39
  message::schema::shared_ptr old_definition;
40
40
 
41
41
  if (not validateSchemaOptions())
42
42
    return true;
43
43
 
44
 
  identifier::Schema schema_identifier(string(db->str, db->length));
 
44
  SchemaIdentifier schema_identifier(string(db->str, db->length));
45
45
 
46
 
  if (not check_db_name(getSession(), schema_identifier))
 
46
  if (not check_db_name(session, schema_identifier))
47
47
  {
48
48
    my_error(ER_WRONG_DB_NAME, schema_identifier);
49
49
 
50
50
    return false;
51
51
  }
52
52
 
53
 
  identifier::Schema identifier(db->str);
 
53
  SchemaIdentifier identifier(db->str);
54
54
  if (not plugin::StorageEngine::getSchemaDefinition(identifier, old_definition))
55
55
  {
56
56
    my_error(ER_SCHEMA_DOES_NOT_EXIST, identifier); 
57
57
    return true;
58
58
  }
59
59
 
60
 
  if (getSession()->inTransaction())
 
60
  if (session->inTransaction())
61
61
  {
62
 
    my_error(ER_TRANSACTIONAL_DDL_NOT_SUPPORTED, MYF(0));
 
62
    my_message(ER_LOCK_OR_ACTIVE_TRANSACTION, 
 
63
               ER(ER_LOCK_OR_ACTIVE_TRANSACTION), 
 
64
               MYF(0));
63
65
    return true;
64
66
  }
65
67
  /*
83
85
  
84
86
  drizzled::message::update(schema_message);
85
87
 
86
 
  bool res= alter_db(getSession(), schema_message, old_definition);
 
88
  bool res= alter_db(session, schema_message);
87
89
 
88
90
  return not res;
89
91
}