~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/replication/replication.cc

  • Committer: Eric Herman
  • Date: 2008-12-06 19:42:46 UTC
  • mto: (656.1.6 devel)
  • mto: This revision was merged to the branch mainline in revision 665.
  • Revision ID: eric@mysql.com-20081206194246-5cdexuu81i366eek
removed trailing whitespace with simple script:

for file in $(find . -name "*.c") $(find . -name "*.cc") $(find . -name "*.h"); do ruby -pe 'gsub(/\s+$/, $/)' < $file > $file.out; mv $file.out $file; done;

Show diffs side-by-side

added added

removed removed

Lines of Context:
315
315
 
316
316
  @return        heartbeat period an uint64_t of nanoseconds
317
317
                 or zero if heartbeat was not demanded by slave
318
 
*/ 
 
318
*/
319
319
static uint64_t get_heartbeat_period(Session * session)
320
320
{
321
321
  bool null_value;
322
322
  LEX_STRING name=  { C_STRING_WITH_LEN("master_heartbeat_period")};
323
 
  user_var_entry *entry= 
 
323
  user_var_entry *entry=
324
324
    (user_var_entry*) hash_search(&session->user_vars, (unsigned char*) name.str,
325
325
                                  name.length);
326
326
  return entry? entry->val_int(&null_value) : 0;
334
334
  @param event_coordinates  binlog file name and position of the last
335
335
                            real event master sent from binlog
336
336
 
337
 
  @note 
 
337
  @note
338
338
    Among three essential pieces of heartbeat data Log_event::when
339
339
    is computed locally.
340
340
    The  error to send is serious and should force terminating
394
394
  bool binlog_can_be_corrupted= false;
395
395
 
396
396
  memset(&log, 0, sizeof(log));
397
 
  /* 
 
397
  /*
398
398
     heartbeat_period from @master_heartbeat_period user variable
399
399
  */
400
400
  uint64_t heartbeat_period= get_heartbeat_period(session);
503
503
  packet->set("\0", 1, &my_charset_bin);
504
504
  /*
505
505
    Adding MAX_LOG_EVENT_HEADER_LEN, since a binlog event can become
506
 
    this larger than the corresponding packet (query) sent 
 
506
    this larger than the corresponding packet (query) sent
507
507
    from client to master.
508
508
  */
509
509
  session->variables.max_allowed_packet+= MAX_LOG_EVENT_HEADER;
685
685
            goto end;
686
686
          }
687
687
 
688
 
          do 
 
688
          do
689
689
          {
690
690
            if (coord)
691
691
            {
710
710
            }
711
711
          } while (ret != 0 && coord != NULL && !session->killed);
712
712
          pthread_mutex_unlock(log_lock);
713
 
        }    
 
713
        }
714
714
        break;
715
 
            
 
715
 
716
716
        default:
717
717
          pthread_mutex_unlock(log_lock);
718
718
          fatal_error = 1;
1393
1393
  if (protocol->send_fields(&field_list,
1394
1394
                            Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
1395
1395
    return(true);
1396
 
  
 
1396
 
1397
1397
  pthread_mutex_lock(drizzle_bin_log.get_log_lock());
1398
1398
  drizzle_bin_log.lock_index();
1399
1399
  index_file= drizzle_bin_log.get_index_file();
1400
 
  
 
1400
 
1401
1401
  drizzle_bin_log.raw_get_current_log(&cur); // dont take mutex
1402
1402
  pthread_mutex_unlock(drizzle_bin_log.get_log_lock()); // lockdep, OK
1403
 
  
 
1403
 
1404
1404
  cur_dir_len= dirname_length(cur.log_file_name);
1405
1405
 
1406
1406
  reinit_io_cache(index_file, READ_CACHE, (my_off_t) 0, 0, 0);
1447
1447
   before a chunk of data is being read into the cache's buffer
1448
1448
   The fuction instantianates and writes into the binlog
1449
1449
   replication events along LOAD DATA processing.
1450
 
   
 
1450
 
1451
1451
   @param file  pointer to io-cache
1452
1452
   @return 0
1453
1453
*/
1464
1464
  if (lf_info->last_pos_in_file != HA_POS_ERROR &&
1465
1465
      lf_info->last_pos_in_file >= my_b_get_pos_in_file(file))
1466
1466
    return(0);
1467
 
  
 
1467
 
1468
1468
  for (block_len= my_b_get_bytes_in_buffer(file); block_len > 0;
1469
1469
       buffer += cmin(block_len, max_event_size),
1470
1470
       block_len -= cmin(block_len, max_event_size))