~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_repl.cc

  • Committer: Monty Taylor
  • Date: 2008-08-10 06:11:44 UTC
  • mto: (312.1.3 translations)
  • mto: This revision was merged to the branch mainline in revision 295.
  • Revision ID: monty@inaugust.com-20080810061144-llnyqeju5zckd6pw
Oy. Replaced max and min macros with std::max and std::min so that we get
strong typing. And, then, cast things in the right direction...

Show diffs side-by-side

added added

removed removed

Lines of Context:
1186
1186
  if (lex_mi->heartbeat_opt != LEX_MASTER_INFO::LEX_MI_UNCHANGED)
1187
1187
    mi->heartbeat_period = lex_mi->heartbeat_period;
1188
1188
  else
1189
 
    mi->heartbeat_period= (float) min(SLAVE_MAX_HEARTBEAT_PERIOD,
 
1189
    mi->heartbeat_period= (float) min((double)SLAVE_MAX_HEARTBEAT_PERIOD,
1190
1190
                                      (slave_net_timeout/2.0));
1191
1191
  mi->received_heartbeats= 0LL; // counter lives until master is CHANGEd
1192
1192
  if (lex_mi->ssl != LEX_MASTER_INFO::LEX_MI_UNCHANGED)
1252
1252
       of replication is not 100% clear, so we guard against problems using
1253
1253
       max().
1254
1254
      */
1255
 
     mi->master_log_pos = max(BIN_LOG_HEADER_SIZE,
1256
 
                              mi->rli.group_master_log_pos);
 
1255
     mi->master_log_pos = ((BIN_LOG_HEADER_SIZE > mi->rli.group_master_log_pos)
 
1256
                           ? BIN_LOG_HEADER_SIZE
 
1257
                           : mi->rli.group_master_log_pos);
1257
1258
     strmake(mi->master_log_name, mi->rli.group_master_log_name,
1258
1259
             sizeof(mi->master_log_name)-1);
1259
1260
  }
1393
1394
    LEX_MASTER_INFO *lex_mi= &thd->lex->mi;
1394
1395
    SELECT_LEX_UNIT *unit= &thd->lex->unit;
1395
1396
    ha_rows event_count, limit_start, limit_end;
1396
 
    my_off_t pos = max(BIN_LOG_HEADER_SIZE, lex_mi->pos); // user-friendly
 
1397
    my_off_t pos = max((uint64_t)BIN_LOG_HEADER_SIZE, lex_mi->pos); // user-friendly
1397
1398
    char search_file_name[FN_REFLEN], *name;
1398
1399
    const char *log_file_name = lex_mi->log_file_name;
1399
1400
    pthread_mutex_t *log_lock = mysql_bin_log.get_log_lock();