~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/log.cc

  • Committer: Monty Taylor
  • Date: 2008-10-06 04:45:56 UTC
  • mfrom: (438.1.13 drizzle)
  • Revision ID: monty@inaugust.com-20081006044556-5urk8k3yhnnl3o1p
Merged in from trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1327
1327
    0   ok
1328
1328
*/
1329
1329
 
1330
 
#ifdef HAVE_REPLICATION
1331
 
 
1332
1330
static bool copy_up_file_and_fill(IO_CACHE *index_file, my_off_t offset)
1333
1331
{
1334
1332
  int bytes_read;
1360
1358
  return(1);
1361
1359
}
1362
1360
 
1363
 
#endif /* HAVE_REPLICATION */
1364
 
 
1365
1361
/**
1366
1362
  Find the position in the log-index-file for the given log name.
1367
1363
 
1647
1643
    LOG_INFO_IO         Got IO error while reading file
1648
1644
*/
1649
1645
 
1650
 
#ifdef HAVE_REPLICATION
1651
1646
 
1652
1647
int DRIZZLE_BIN_LOG::purge_first_log(Relay_log_info* rli, bool included)
1653
1648
{
1984
1979
  pthread_mutex_unlock(&LOCK_index);
1985
1980
  return(error);
1986
1981
}
1987
 
#endif /* HAVE_REPLICATION */
1988
1982
 
1989
1983
 
1990
1984
/**
2672
2666
      (my_b_tell(&log_file) >= (my_off_t) max_size))
2673
2667
  {
2674
2668
    new_file_without_locking();
2675
 
#ifdef HAVE_REPLICATION
2676
2669
    if (expire_logs_days)
2677
2670
    {
2678
2671
      time_t purge_time= my_time(0) - expire_logs_days*24*60*60;
2679
2672
      if (purge_time >= 0)
2680
2673
        purge_logs_before_date(purge_time);
2681
2674
    }
2682
 
#endif
2683
2675
  }
2684
2676
  if (!(flags & RP_LOCK_LOG_IS_ALREADY_LOCKED))
2685
2677
    pthread_mutex_unlock(&LOCK_log);
3023
3015
{                                       // One can't set log_type here!
3024
3016
  if (log_state == LOG_OPENED)
3025
3017
  {
3026
 
#ifdef HAVE_REPLICATION
3027
3018
    if (log_type == LOG_BIN && !no_auto_events &&
3028
3019
        (exiting & LOG_CLOSE_STOP_EVENT))
3029
3020
    {
3032
3023
      bytes_written+= s.data_written;
3033
3024
      signal_update();
3034
3025
    }
3035
 
#endif /* HAVE_REPLICATION */
3036
3026
 
3037
3027
    /* don't pwrite in a file opened with O_APPEND - it doesn't work */
3038
3028
    if (log_file.type == WRITE_CACHE && log_type == LOG_BIN)
3138
3128
 
3139
3129
void sql_perror(const char *message)
3140
3130
{
3141
 
#ifdef HAVE_STRERROR
3142
3131
  sql_print_error("%s: %s",message, strerror(errno));
3143
 
#else
3144
 
  perror(message);
3145
 
#endif
3146
3132
}
3147
3133
 
3148
3134