~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/archive/ha_archive.cc

  • Committer: Brian Aker
  • Date: 2011-01-12 06:45:23 UTC
  • mto: (2073.1.4 catalogs)
  • mto: This revision was merged to the branch mainline in revision 2080.
  • Revision ID: brian@tangent.org-20110112064523-rqhptaqbph22qmj1
RemoveĀ customĀ error.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
16
16
 
17
17
 
18
 
#include <config.h>
 
18
#include "config.h"
19
19
 
20
 
#include <plugin/archive/archive_engine.h>
 
20
#include "plugin/archive/archive_engine.h"
21
21
#include <memory>
22
22
#include <boost/scoped_ptr.hpp>
23
23
 
131
131
}
132
132
 
133
133
 
134
 
int ArchiveEngine::doDropTable(Session&, const identifier::Table &identifier)
 
134
int ArchiveEngine::doDropTable(Session&, const TableIdentifier &identifier)
135
135
{
136
136
  string new_path(identifier.getPath());
137
137
 
148
148
}
149
149
 
150
150
int ArchiveEngine::doGetTableDefinition(Session&,
151
 
                                        const identifier::Table &identifier,
 
151
                                        const TableIdentifier &identifier,
152
152
                                        drizzled::message::Table &table_proto)
153
153
{
154
154
  struct stat stat_info;
413
413
  Init out lock.
414
414
  We open the file we will read from.
415
415
*/
416
 
int ha_archive::doOpen(const identifier::Table &identifier, int , uint32_t )
 
416
int ha_archive::doOpen(const TableIdentifier &identifier, int , uint32_t )
417
417
{
418
418
  int rc= 0;
419
419
  share= get_share(identifier.getPath().c_str(), &rc);
499
499
 
500
500
int ArchiveEngine::doCreateTable(Session &,
501
501
                                 Table& table_arg,
502
 
                                 const drizzled::identifier::Table &identifier,
 
502
                                 const drizzled::TableIdentifier &identifier,
503
503
                                 drizzled::message::Table& proto)
504
504
{
505
505
  int error= 0;
1084
1084
 
1085
1085
    if ((lock_type >= TL_WRITE_CONCURRENT_INSERT &&
1086
1086
         lock_type <= TL_WRITE)
1087
 
        && ! session->doing_tablespace_operation())
 
1087
        && !session_tablespace_op(session))
1088
1088
      lock_type = TL_WRITE_ALLOW_WRITE;
1089
1089
 
1090
1090
    /*
1212
1212
  int rc= 0;
1213
1213
  const char *old_proc_info;
1214
1214
 
1215
 
  old_proc_info= session->get_proc_info();
1216
 
  session->set_proc_info("Checking table");
 
1215
  old_proc_info= get_session_proc_info(session);
 
1216
  set_session_proc_info(session, "Checking table");
1217
1217
  /* Flush any waiting data */
1218
1218
  pthread_mutex_lock(&share->mutex());
1219
1219
  azflush(&(share->archive_write), Z_SYNC_FLUSH);
1234
1234
      break;
1235
1235
  }
1236
1236
 
1237
 
  session->set_proc_info(old_proc_info);
 
1237
  set_session_proc_info(session, old_proc_info);
1238
1238
 
1239
1239
  if ((rc && rc != HA_ERR_END_OF_FILE))
1240
1240
  {
1247
1247
  }
1248
1248
}
1249
1249
 
1250
 
int ArchiveEngine::doRenameTable(Session&, const identifier::Table &from, const identifier::Table &to)
 
1250
int ArchiveEngine::doRenameTable(Session&, const TableIdentifier &from, const TableIdentifier &to)
1251
1251
{
1252
1252
  int error= 0;
1253
1253
 
1265
1265
}
1266
1266
 
1267
1267
bool ArchiveEngine::doDoesTableExist(Session&,
1268
 
                                     const identifier::Table &identifier)
 
1268
                                     const TableIdentifier &identifier)
1269
1269
{
1270
1270
  string proto_path(identifier.getPath());
1271
1271
  proto_path.append(ARZ);
1279
1279
}
1280
1280
 
1281
1281
void ArchiveEngine::doGetTableIdentifiers(drizzled::CachedDirectory &directory,
1282
 
                                          const drizzled::identifier::Schema &schema_identifier,
1283
 
                                          drizzled::identifier::Table::vector &set_of_identifiers)
 
1282
                                          const drizzled::SchemaIdentifier &schema_identifier,
 
1283
                                          drizzled::TableIdentifier::vector &set_of_identifiers)
1284
1284
{
1285
1285
  drizzled::CachedDirectory::Entries entries= directory.getEntries();
1286
1286
 
1302
1302
      char uname[NAME_LEN + 1];
1303
1303
      uint32_t file_name_len;
1304
1304
 
1305
 
      file_name_len= identifier::Table::filename_to_tablename(filename->c_str(), uname, sizeof(uname));
 
1305
      file_name_len= TableIdentifier::filename_to_tablename(filename->c_str(), uname, sizeof(uname));
1306
1306
      // TODO: Remove need for memory copy here
1307
1307
      uname[file_name_len - sizeof(ARZ) + 1]= '\0'; // Subtract ending, place NULL 
1308
1308
 
1309
 
      set_of_identifiers.push_back(identifier::Table(schema_identifier, uname));
 
1309
      set_of_identifiers.push_back(TableIdentifier(schema_identifier, uname));
1310
1310
    }
1311
1311
  }
1312
1312
}