~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/schema_engine/schema.cc

  • Committer: Monty Taylor
  • Date: 2011-02-13 17:26:39 UTC
  • mfrom: (2157.2.2 give-in-to-pkg-config)
  • mto: This revision was merged to the branch mainline in revision 2166.
  • Revision ID: mordred@inaugust.com-20110213172639-nhy7i72sfhoq13ms
Merged in pkg-config fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
19
 */
20
20
 
21
 
#include <config.h>
 
21
#include "config.h"
22
22
 
23
 
#include <plugin/schema_engine/schema.h>
24
 
#include <drizzled/schema.h>
25
 
#include <drizzled/sql_table.h>
26
 
#include <drizzled/global_charset_info.h>
27
 
#include <drizzled/charset.h>
28
 
#include <drizzled/charset_info.h>
29
 
#include <drizzled/cursor.h>
30
 
#include <drizzled/data_home.h>
 
23
#include "plugin/schema_engine/schema.h"
 
24
#include "drizzled/db.h"
 
25
#include "drizzled/sql_table.h"
 
26
#include "drizzled/global_charset_info.h"
 
27
#include "drizzled/charset.h"
 
28
#include "drizzled/charset_info.h"
 
29
#include "drizzled/cursor.h"
 
30
#include "drizzled/data_home.h"
31
31
 
32
32
#include <drizzled/pthread_globals.h>
33
33
 
34
34
#include <drizzled/execute.h>
35
35
 
36
 
#include <drizzled/internal/my_sys.h>
 
36
#include "drizzled/internal/my_sys.h"
37
37
 
38
38
#include <fcntl.h>
39
39
#include <sys/stat.h>
116
116
  mutex.unlock_shared();
117
117
}
118
118
 
119
 
drizzled::message::schema::shared_ptr Schema::doGetSchemaDefinition(const identifier::Schema &schema_identifier)
 
119
bool Schema::doGetSchemaDefinition(const identifier::Schema &schema_identifier, message::schema::shared_ptr &schema_message)
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;
127
126
    schema_message= (*iter).second;
128
127
    mutex.unlock_shared();
129
128
 
130
 
    return schema_message;
 
129
    return true;
131
130
  }
132
131
  mutex.unlock_shared();
133
132
 
134
 
  return drizzled::message::schema::shared_ptr();
 
133
  return false;
135
134
}
136
135
 
137
136
 
169
168
 
170
169
bool Schema::doDropSchema(const identifier::Schema &schema_identifier)
171
170
{
 
171
  message::schema::shared_ptr schema_message;
 
172
 
172
173
  string schema_file(schema_identifier.getPath());
173
174
  schema_file.append(1, FN_LIBCHAR);
174
175
  schema_file.append(MY_DB_OPT_FILE);
175
176
 
176
 
  if (not doGetSchemaDefinition(schema_identifier))
 
177
  if (not doGetSchemaDefinition(schema_identifier, schema_message))
177
178
    return false;
178
179
 
179
180
  // No db.opt file, no love from us.