~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/storage_engine.cc

Merged remove-dead-find_field_in_table_sef into remove-dead-Item-save_in_field_no_warnings.

Show diffs side-by-side

added added

removed removed

Lines of Context:
74
74
 
75
75
plugin::StorageEngine::StorageEngine(const string name_arg,
76
76
                                     const bitset<HTON_BIT_SIZE> &flags_arg,
77
 
                                     size_t savepoint_offset_arg,
78
77
                                     bool support_2pc)
79
78
    : Plugin(name_arg, "StorageEngine"),
80
79
      two_phase_commit(support_2pc),
81
80
      enabled(true),
82
81
      flags(flags_arg),
83
 
      savepoint_offset(savepoint_alloc_size),
84
 
      orig_savepoint_offset(savepoint_offset_arg),
85
82
      slot(0)
86
83
{
87
84
  if (enabled)
88
85
  {
89
 
    savepoint_alloc_size+= orig_savepoint_offset;
90
86
    slot= total_ha++;
91
87
    if (two_phase_commit)
92
88
        total_ha_2pc++;
97
93
 
98
94
plugin::StorageEngine::~StorageEngine()
99
95
{
100
 
  savepoint_alloc_size-= orig_savepoint_offset;
101
96
  pthread_mutex_destroy(&proto_cache_mutex);
102
97
}
103
98
 
166
161
 
167
162
  for (const char **ext= bas_ext(); *ext ; ext++)
168
163
  {
169
 
    fn_format(buff, table_path.c_str(), "", *ext,
 
164
    internal::fn_format(buff, table_path.c_str(), "", *ext,
170
165
              MY_UNPACK_FILENAME|MY_APPEND_EXT);
171
 
    if (my_delete_with_symlink(buff, MYF(0)))
 
166
    if (internal::my_delete_with_symlink(buff, MYF(0)))
172
167
    {
173
168
      if ((error= errno) != ENOENT)
174
169
        break;
776
771
int plugin::StorageEngine::createTable(Session& session,
777
772
                                       TableIdentifier &identifier,
778
773
                                       bool update_create_info,
779
 
                                       drizzled::message::Table& table_proto, bool proto_used)
 
774
                                       message::Table& table_proto, bool proto_used)
780
775
{
781
776
  int error= 1;
782
777
  Table table;
1308
1303
 
1309
1304
  path.append(DEFAULT_DEFINITION_FILE_EXT);
1310
1305
 
1311
 
  return my_delete(path.c_str(), MYF(0));
 
1306
  return internal::my_delete(path.c_str(), MYF(0));
1312
1307
}
1313
1308
 
1314
1309
int plugin::StorageEngine::renameDefinitionFromPath(TableIdentifier &dest, TableIdentifier &src)
1319
1314
  src_path.append(DEFAULT_DEFINITION_FILE_EXT);
1320
1315
  dest_path.append(DEFAULT_DEFINITION_FILE_EXT);
1321
1316
 
1322
 
  return my_rename(src_path.c_str(), dest_path.c_str(), MYF(MY_WME));
 
1317
  return internal::my_rename(src_path.c_str(), dest_path.c_str(), MYF(MY_WME));
1323
1318
}
1324
1319
 
1325
1320
int plugin::StorageEngine::writeDefinitionFromPath(TableIdentifier &identifier, message::Table &table_proto)
1328
1323
 
1329
1324
  file_name.append(DEFAULT_DEFINITION_FILE_EXT);
1330
1325
 
1331
 
  int fd= open(file_name.c_str(), O_RDWR|O_CREAT|O_TRUNC, my_umask);
 
1326
  int fd= open(file_name.c_str(), O_RDWR|O_CREAT|O_TRUNC, internal::my_umask);
1332
1327
 
1333
1328
  if (fd == -1)
1334
1329
    return errno;