~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/statement/alter_schema.cc

  • Committer: Mark Atwood
  • Date: 2011-10-19 00:10:47 UTC
  • mfrom: (2440.2.13 rf)
  • Revision ID: me@mark.atwood.name-20111019001047-atj0u8gedphon1tb
mergeĀ lp:~olafvdspek/drizzle/refactor5

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
 
32
32
using namespace std;
33
33
 
34
 
namespace drizzled
35
 
{
 
34
namespace drizzled {
36
35
 
37
36
bool statement::AlterSchema::execute()
38
37
{
39
 
  lex_string_t *db= &lex().name;
40
 
  message::schema::shared_ptr old_definition;
41
 
 
42
38
  if (not validateSchemaOptions())
43
39
    return true;
44
40
 
45
 
  identifier::Schema schema_identifier(string(db->data(), db->size()));
 
41
  identifier::Schema schema_identifier(lex().name);
46
42
 
47
43
  if (not schema::check(session(), schema_identifier))
48
44
  {
49
45
    my_error(ER_WRONG_DB_NAME, schema_identifier);
50
 
 
51
46
    return false;
52
47
  }
53
48
 
54
 
  identifier::Schema identifier(db->data());
55
 
  if (not (old_definition= plugin::StorageEngine::getSchemaDefinition(identifier)))
 
49
  identifier::Schema identifier(lex().name);
 
50
  message::schema::shared_ptr old_definition= plugin::StorageEngine::getSchemaDefinition(identifier);
 
51
  if (not old_definition)
56
52
  {
57
53
    my_error(ER_SCHEMA_DOES_NOT_EXIST, identifier); 
58
54
    return true;
88
84
}
89
85
 
90
86
} /* namespace drizzled */
91