~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 <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>
 
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"
30
31
 
31
32
#include <drizzled/pthread_globals.h>
32
33
 
33
34
#include <drizzled/execute.h>
34
35
 
35
 
#include <drizzled/internal/my_sys.h>
36
 
#include <drizzled/cached_directory.h>
 
36
#include "drizzled/internal/my_sys.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
 
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
 
    schema_message= iter->second;
 
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.
340
341
 
341
342
void Schema::doGetTableIdentifiers(drizzled::CachedDirectory&,
342
343
                                   const drizzled::identifier::Schema&,
343
 
                                   drizzled::identifier::table::vector&)
 
344
                                   drizzled::identifier::Table::vector&)
344
345
{
345
346
}