~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/schema_engine.cc

  • Committer: Brian Aker
  • Date: 2010-10-15 00:59:36 UTC
  • mfrom: (1849 staging)
  • mto: This revision was merged to the branch mainline in revision 1853.
  • Revision ID: brian@tangent.org-20101015005936-znhvkz8khs4fhlyv
Merge with trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
65
65
class StorageEngineGetSchemaDefinition: public unary_function<StorageEngine *, bool>
66
66
{
67
67
  const SchemaIdentifier &identifier;
68
 
  message::Schema &schema_proto;
 
68
  message::SchemaPtr &schema_proto;
69
69
 
70
70
public:
71
71
  StorageEngineGetSchemaDefinition(const SchemaIdentifier &identifier_arg,
72
 
                                   message::Schema &schema_proto_arg) :
 
72
                                   message::SchemaPtr &schema_proto_arg) :
73
73
    identifier(identifier_arg),
74
74
    schema_proto(schema_proto_arg) 
75
75
  {
84
84
/*
85
85
  Return value is "if parsed"
86
86
*/
87
 
bool StorageEngine::getSchemaDefinition(const drizzled::TableIdentifier &identifier, message::Schema &proto)
 
87
bool StorageEngine::getSchemaDefinition(const drizzled::TableIdentifier &identifier, message::SchemaPtr &proto)
88
88
{
89
89
  return StorageEngine::getSchemaDefinition(identifier, proto);
90
90
}
91
91
 
92
 
bool StorageEngine::getSchemaDefinition(const SchemaIdentifier &identifier, message::Schema &proto)
 
92
bool StorageEngine::getSchemaDefinition(const SchemaIdentifier &identifier, message::SchemaPtr &proto)
93
93
{
94
 
  proto.Clear();
95
 
 
96
94
  EngineVector::iterator iter=
97
95
    find_if(StorageEngine::getSchemaEngines().begin(), StorageEngine::getSchemaEngines().end(),
98
96
            StorageEngineGetSchemaDefinition(identifier, proto));
107
105
 
108
106
bool StorageEngine::doesSchemaExist(const SchemaIdentifier &identifier)
109
107
{
110
 
  message::Schema proto;
 
108
  message::SchemaPtr proto;
111
109
 
112
110
  return StorageEngine::getSchemaDefinition(identifier, proto);
113
111
}
115
113
 
116
114
const CHARSET_INFO *StorageEngine::getSchemaCollation(const SchemaIdentifier &identifier)
117
115
{
118
 
  message::Schema schmema_proto;
 
116
  message::SchemaPtr schmema_proto;
119
117
  bool found;
120
118
 
121
119
  found= StorageEngine::getSchemaDefinition(identifier, schmema_proto);
122
120
 
123
 
  if (found && schmema_proto.has_collation())
 
121
  if (found && schmema_proto->has_collation())
124
122
  {
125
 
    const string buffer= schmema_proto.collation();
 
123
    const string buffer= schmema_proto->collation();
126
124
    const CHARSET_INFO* cs= get_charset_by_name(buffer.c_str());
127
125
 
128
126
    if (not cs)