~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/storage_engine.cc

  • Committer: Monty Taylor
  • Date: 2010-02-05 08:11:15 UTC
  • mfrom: (1283 build)
  • mto: (1273.13.43 fix_is)
  • mto: This revision was merged to the branch mainline in revision 1300.
  • Revision ID: mordred@inaugust.com-20100205081115-dr82nvrwv4lvw7sd
Merged trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
75
75
 
76
76
plugin::StorageEngine::StorageEngine(const string name_arg,
77
77
                                     const bitset<HTON_BIT_SIZE> &flags_arg,
78
 
                                     size_t savepoint_offset_arg,
79
78
                                     bool support_2pc)
80
79
    : Plugin(name_arg, "StorageEngine"),
81
80
      two_phase_commit(support_2pc),
82
81
      enabled(true),
83
82
      flags(flags_arg),
84
 
      savepoint_offset(savepoint_alloc_size),
85
 
      orig_savepoint_offset(savepoint_offset_arg),
86
83
      slot(0)
87
84
{
88
85
  if (enabled)
89
86
  {
90
 
    savepoint_alloc_size+= orig_savepoint_offset;
91
87
    slot= total_ha++;
92
88
    if (two_phase_commit)
93
89
        total_ha_2pc++;
98
94
 
99
95
plugin::StorageEngine::~StorageEngine()
100
96
{
101
 
  savepoint_alloc_size-= orig_savepoint_offset;
102
97
  pthread_mutex_destroy(&proto_cache_mutex);
103
98
}
104
99
 
167
162
 
168
163
  for (const char **ext= bas_ext(); *ext ; ext++)
169
164
  {
170
 
    fn_format(buff, table_path.c_str(), "", *ext,
 
165
    internal::fn_format(buff, table_path.c_str(), "", *ext,
171
166
              MY_UNPACK_FILENAME|MY_APPEND_EXT);
172
 
    if (my_delete_with_symlink(buff, MYF(0)))
 
167
    if (internal::my_delete_with_symlink(buff, MYF(0)))
173
168
    {
174
169
      if ((error= errno) != ENOENT)
175
170
        break;
777
772
int plugin::StorageEngine::createTable(Session& session,
778
773
                                       TableIdentifier &identifier,
779
774
                                       bool update_create_info,
780
 
                                       drizzled::message::Table& table_proto, bool proto_used)
 
775
                                       message::Table& table_proto, bool proto_used)
781
776
{
782
777
  int error= 1;
783
778
  Table table;
1352
1347
 
1353
1348
  path.append(DEFAULT_DEFINITION_FILE_EXT);
1354
1349
 
1355
 
  return my_delete(path.c_str(), MYF(0));
 
1350
  return internal::my_delete(path.c_str(), MYF(0));
1356
1351
}
1357
1352
 
1358
1353
int plugin::StorageEngine::renameDefinitionFromPath(TableIdentifier &dest, TableIdentifier &src)
1363
1358
  src_path.append(DEFAULT_DEFINITION_FILE_EXT);
1364
1359
  dest_path.append(DEFAULT_DEFINITION_FILE_EXT);
1365
1360
 
1366
 
  return my_rename(src_path.c_str(), dest_path.c_str(), MYF(MY_WME));
 
1361
  return internal::my_rename(src_path.c_str(), dest_path.c_str(), MYF(MY_WME));
1367
1362
}
1368
1363
 
1369
1364
int plugin::StorageEngine::writeDefinitionFromPath(TableIdentifier &identifier, message::Table &table_proto)
1372
1367
 
1373
1368
  file_name.append(DEFAULT_DEFINITION_FILE_EXT);
1374
1369
 
1375
 
  int fd= open(file_name.c_str(), O_RDWR|O_CREAT|O_TRUNC, my_umask);
 
1370
  int fd= open(file_name.c_str(), O_RDWR|O_CREAT|O_TRUNC, internal::my_umask);
1376
1371
 
1377
1372
  if (fd == -1)
1378
1373
    return errno;