~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/schema_engine/schema.cc

  • Committer: pcrews
  • Date: 2011-05-24 17:36:24 UTC
  • mfrom: (1099.4.232 drizzle)
  • Revision ID: pcrews@lucid32-20110524173624-mwr1bvq6fa1r01ao
Updated translations + 2011.05.18 tarball tag

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/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"
 
23
#include <drizzled/error.h>
 
24
#include <plugin/schema_engine/schema.h>
 
25
#include <drizzled/schema.h>
 
26
#include <drizzled/sql_table.h>
 
27
#include <drizzled/charset.h>
 
28
#include <drizzled/cursor.h>
 
29
#include <drizzled/data_home.h>
31
30
 
32
31
#include <drizzled/pthread_globals.h>
33
32
 
34
33
#include <drizzled/execute.h>
35
34
 
36
 
#include "drizzled/internal/my_sys.h"
 
35
#include <drizzled/internal/my_sys.h>
 
36
#include <drizzled/cached_directory.h>
37
37
 
38
38
#include <fcntl.h>
39
39
#include <sys/stat.h>
102
102
{
103
103
}
104
104
 
105
 
void Schema::doGetSchemaIdentifiers(identifier::Schema::vector &set_of_names)
 
105
void Schema::doGetSchemaIdentifiers(identifier::schema::vector &set_of_names)
106
106
{
107
107
  mutex.lock_shared();
108
108
  {
110
110
         iter != schema_cache.end();
111
111
         iter++)
112
112
    {
113
 
      set_of_names.push_back(identifier::Schema((*iter).second->name()));
 
113
      set_of_names.push_back(identifier::Schema(iter->second->name()));
114
114
    }
115
115
  }
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
 
    schema_message= (*iter).second;
 
126
    drizzled::message::schema::shared_ptr schema_message;
 
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.
341
340
 
342
341
void Schema::doGetTableIdentifiers(drizzled::CachedDirectory&,
343
342
                                   const drizzled::identifier::Schema&,
344
 
                                   drizzled::identifier::Table::vector&)
 
343
                                   drizzled::identifier::table::vector&)
345
344
{
346
345
}