~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/schema_engine/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:
21
21
#include "config.h"
22
22
 
23
23
#include "plugin/schema_engine/schema.h"
24
 
#include "drizzled/db.h"
 
24
#include "drizzled/schema.h"
25
25
#include "drizzled/sql_table.h"
26
26
#include "drizzled/global_charset_info.h"
27
27
#include "drizzled/charset.h"
116
116
  mutex.unlock_shared();
117
117
}
118
118
 
119
 
bool Schema::doGetSchemaDefinition(const identifier::Schema &schema_identifier, message::schema::shared_ptr &schema_message)
 
119
drizzled::message::schema::shared_ptr Schema::doGetSchemaDefinition(const identifier::Schema &schema_identifier)
120
120
{
121
121
  mutex.lock_shared();
122
122
  SchemaCache::iterator iter= schema_cache.find(schema_identifier.getPath());
123
123
 
124
124
  if (iter != schema_cache.end())
125
125
  {
 
126
    drizzled::message::schema::shared_ptr schema_message;
126
127
    schema_message= (*iter).second;
127
128
    mutex.unlock_shared();
128
129
 
129
 
    return true;
 
130
    return schema_message;
130
131
  }
131
132
  mutex.unlock_shared();
132
133
 
133
 
  return false;
 
134
  return drizzled::message::schema::shared_ptr();
134
135
}
135
136
 
136
137
 
168
169
 
169
170
bool Schema::doDropSchema(const identifier::Schema &schema_identifier)
170
171
{
171
 
  message::schema::shared_ptr schema_message;
172
 
 
173
172
  string schema_file(schema_identifier.getPath());
174
173
  schema_file.append(1, FN_LIBCHAR);
175
174
  schema_file.append(MY_DB_OPT_FILE);
176
175
 
177
 
  if (not doGetSchemaDefinition(schema_identifier, schema_message))
 
176
  if (not doGetSchemaDefinition(schema_identifier))
178
177
    return false;
179
178
 
180
179
  // No db.opt file, no love from us.