~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/statement/alter_schema.cc

  • Committer: Brian Aker
  • Date: 2011-02-16 02:39:43 UTC
  • mfrom: (2171.1.3 drizzle-staging)
  • Revision ID: brian@tangent.org-20110216023943-z4lxkjvknnrrncr2
Merge of all fixes related to errors, schemas, etc.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
#include <drizzled/session.h>
24
24
#include <drizzled/statement/alter_schema.h>
25
25
#include <drizzled/plugin/storage_engine.h>
26
 
#include <drizzled/db.h>
 
26
#include <drizzled/schema.h>
27
27
#include <drizzled/message.h>
28
28
 
29
29
#include <string>
43
43
 
44
44
  identifier::Schema schema_identifier(string(db->str, db->length));
45
45
 
46
 
  if (not check_db_name(getSession(), schema_identifier))
 
46
  if (not schema::check(*getSession(), schema_identifier))
47
47
  {
48
48
    my_error(ER_WRONG_DB_NAME, schema_identifier);
49
49
 
51
51
  }
52
52
 
53
53
  identifier::Schema identifier(db->str);
54
 
  if (not plugin::StorageEngine::getSchemaDefinition(identifier, old_definition))
 
54
  if (not (old_definition= plugin::StorageEngine::getSchemaDefinition(identifier)))
55
55
  {
56
56
    my_error(ER_SCHEMA_DOES_NOT_EXIST, identifier); 
57
57
    return true;
83
83
  
84
84
  drizzled::message::update(schema_message);
85
85
 
86
 
  bool res= alter_db(getSession(), schema_message, old_definition);
 
86
  bool res= schema::alter(*getSession(), schema_message, *old_definition);
87
87
 
88
88
  return not res;
89
89
}