~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/statement/alter_schema.cc

  • Committer: lbieber
  • Date: 2010-10-06 02:01:43 UTC
  • mfrom: (1814.1.1 build)
  • Revision ID: lbieber@orisndriz08-20101006020143-gho0wsmd346m02f9
Merge Brian - fix bug 654905 - DATA_DICTIONARY.TABLE.TYPE not returning BASE or VIEW (it reports the port type).

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
#include <drizzled/statement/alter_schema.h>
25
25
#include <drizzled/plugin/storage_engine.h>
26
26
#include <drizzled/db.h>
 
27
#include <drizzled/message.h>
27
28
 
28
29
#include <string>
29
30
 
48
49
    return false;
49
50
  }
50
51
 
51
 
  schema_message.set_name(db->str);
52
 
  schema_message.mutable_engine()->set_name("filesystem"); // For the moment we have only one.
53
 
  SchemaIdentifier identifier(schema_message.name());
54
 
 
 
52
  SchemaIdentifier identifier(db->str);
55
53
  if (not plugin::StorageEngine::getSchemaDefinition(identifier, old_definition))
56
54
  {
57
55
    my_error(ER_SCHEMA_DOES_NOT_EXIST, MYF(0), db->str);
65
63
               MYF(0));
66
64
    return true;
67
65
  }
68
 
 
 
66
  /*
 
67
    @todo right now the logic for alter schema is just sitting here, at some point this should be packaged up in a class/etc.
 
68
  */
 
69
 
 
70
  // We set the name from the old version to keep case preference
 
71
  schema_message.set_name(old_definition.name());
 
72
  schema_message.set_version(old_definition.version());
 
73
  schema_message.set_uuid(old_definition.uuid());
 
74
  schema_message.mutable_engine()->set_name(old_definition.engine().name());
 
75
 
 
76
  // We need to make sure we don't destroy any collation that might have
 
77
  // been changed.
69
78
  if (not schema_message.has_collation())
70
79
  {
71
 
    schema_message.set_collation(schema_message.collation());
 
80
    schema_message.set_collation(old_definition.collation());
72
81
  }
 
82
  
 
83
  drizzled::message::update(schema_message);
73
84
 
74
85
  bool res= mysql_alter_db(session, schema_message);
75
86