~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/transaction_log/transaction_log.cc

  • Committer: lbieber
  • Date: 2010-10-05 22:23:12 UTC
  • mfrom: (1813.1.4 build)
  • Revision ID: lbieber@orisndriz08-20101005222312-weuq0ardk3gcryau
Merge Travis - 621861 - convert structs to classes
Merge Billy - 621331 - Replace use of stringstream with boost::lexical_cast
Merge Travis - 621861 = To change C structs to C++ classes in Drizzle
Merge Andrew - fix bug 653300 - Syntax error on inport of a SQL file produced by drizzledump

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
 
 *  Copyright (C) 2008-2009 Sun Microsystems, Inc.
5
 
 *  Copyright (C) 2010 Jay Pipes <jaypipes@gmail.com>
 
4
 *  Copyright (C) 2008-2009 Sun Microsystems
 
5
 *  Copyright (c) 2010 Jay Pipes <jaypipes@gmail.com>
6
6
 *
7
7
 *  Authors:
8
8
 *
211
211
  {
212
212
    char errmsg[STRERROR_MAX];
213
213
    strerror_r(errno, errmsg, sizeof(errmsg));
214
 
    errmsg_printf(error::ERROR, 
 
214
    errmsg_printf(ERRMSG_LVL_ERROR, 
215
215
                  _("Failed to write full size of log entry.  Tried to write %" PRId64
216
216
                    " bytes at offset %" PRId64 ", but only wrote %" PRId32 " bytes.  Error: %s\n"), 
217
217
                  static_cast<int64_t>(data_length),
218
218
                  static_cast<int64_t>(cur_offset),
219
 
                  static_cast<int32_t>(written), 
 
219
                  static_cast<int64_t>(written), 
220
220
                  errmsg);
221
221
    state= CRASHED;
222
222
    /* 
230
230
 
231
231
  if (unlikely(error_code != 0))
232
232
  {
233
 
    sql_perror(_("Failed to sync log file."));
 
233
    char errmsg[STRERROR_MAX];
 
234
    strerror_r(errno, errmsg, sizeof(errmsg));
 
235
    errmsg_printf(ERRMSG_LVL_ERROR, 
 
236
                  _("Failed to sync log file. Got error: %s\n"), 
 
237
                  errmsg);
234
238
  }
235
 
 
236
239
  return cur_offset;
237
240
}
238
241
 
282
285
    result= ftruncate(log_file, log_offset);
283
286
  }
284
287
  while (result == -1 && errno == EINTR);
 
288
  drizzled::TransactionServices::singleton().resetTransactionId();
285
289
}
286
290
 
287
291
bool TransactionLog::findLogFilenameContainingTransactionId(const ReplicationServices::GlobalTransactionId&,