~ubuntu-branches/ubuntu/raring/mysql-5.5/raring-proposed

« back to all changes in this revision

Viewing changes to sql/sql_repl.cc

  • Committer: Package Import Robot
  • Author(s): Clint Byrum
  • Date: 2012-02-14 23:59:22 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20120214235922-cux5uek1e5l0hje9
Tags: 5.5.20-0ubuntu1
* New upstream release.
* d/mysql-server-5.5.mysql.upstart: Fix stop on to make sure mysql is
  fully stopped before shutdown commences. (LP: #688541) Also simplify
  start on as it is redundant.
* d/control: Depend on upstart version which has apparmor profile load
  script to prevent failure on upgrade from lucid to precise.
  (LP: #907465)
* d/apparmor-profile: need to allow /run since that is the true path
  of /var/run files. (LP: #917542)
* d/control: mysql-server-5.5 has files in it that used to be owned
  by libmysqlclient-dev, so it must break/replace it. (LP: #912487)
* d/rules, d/control: 5.5.20 Fixes segfault on tests with gcc 4.6,
  change compiler back to system default.
* d/rules: Turn off embedded libedit/readline.(Closes: #659566)

Show diffs side-by-side

added added

removed removed

Lines of Context:
352
352
    *errmsg = "memory allocation failed reading log event";
353
353
    break;
354
354
  case LOG_READ_TRUNC:
355
 
    *errmsg = "binlog truncated in the middle of event";
 
355
    *errmsg = "binlog truncated in the middle of event; consider out of disk space on master";
356
356
    break;
357
357
  default:
358
358
    *errmsg = "unknown error reading log event on the master";
447
447
  String* packet = &thd->packet;
448
448
  int error;
449
449
  const char *errmsg = "Unknown error";
 
450
  const char *fmt= "%s; the last event was read from '%s' at %s, the last byte read was read from '%s' at %s.";
 
451
  char llbuff1[22], llbuff2[22];
 
452
  char error_text[MAX_SLAVE_ERRMSG]; // to be send to slave via my_message()
450
453
  NET* net = &thd->net;
451
454
  mysql_mutex_t *log_lock;
452
455
  mysql_cond_t *log_cond;
677
680
    if (reset_transmit_packet(thd, flags, &ev_offset, &errmsg))
678
681
      goto err;
679
682
 
680
 
    my_off_t prev_pos= pos;
681
 
    while (!(error = Log_event::read_log_event(&log, packet, log_lock)))
 
683
    while (!(error= Log_event::read_log_event(&log, packet, log_lock)))
682
684
    {
683
 
      prev_pos= my_b_tell(&log);
684
685
#ifndef DBUG_OFF
685
686
      if (max_binlog_dump_events && !left_events--)
686
687
      {
719
720
      else if (event_type == STOP_EVENT)
720
721
        binlog_can_be_corrupted= FALSE;
721
722
 
 
723
      /*
 
724
        Introduced this code to make the gcc 4.6.1 compiler happy. When
 
725
        warnings are converted to errors, the compiler complains about
 
726
        the fact that binlog_can_be_corrupted is defined but never used.
 
727
 
 
728
        We need to check if this is a dead code or if someone removed any
 
729
        code by mistake.
 
730
 
 
731
        /Alfranio
 
732
      */
 
733
      if (binlog_can_be_corrupted)
 
734
      {
 
735
        /*
 
736
           Don't try to print out warning messages because this generates
 
737
           erroneous messages in the error log and causes performance
 
738
           problems.
 
739
 
 
740
           /Alfranio
 
741
        */
 
742
      }
 
743
      
722
744
      pos = my_b_tell(&log);
723
745
      if (RUN_HOOK(binlog_transmit, before_send_event,
724
746
                   (thd, flags, packet, log_file_name, pos)))
767
789
    }
768
790
 
769
791
    /*
770
 
      here we were reading binlog that was not closed properly (as a result
771
 
      of a crash ?). treat any corruption as EOF
772
 
    */
773
 
    if (binlog_can_be_corrupted &&
774
 
        error != LOG_READ_MEM && error != LOG_READ_EOF)
775
 
    {
776
 
      my_b_seek(&log, prev_pos);
777
 
      error=LOG_READ_EOF;
778
 
    }
779
 
 
780
 
    /*
781
792
      TODO: now that we are logging the offset, check to make sure
782
793
      the recorded offset and the actual match.
783
794
      Guilhem 2003-06: this is not true if this master is a slave
1021
1032
 
1022
1033
err:
1023
1034
  thd_proc_info(thd, "Waiting to finalize termination");
 
1035
  if (my_errno == ER_MASTER_FATAL_ERROR_READING_BINLOG && my_b_inited(&log))
 
1036
  {
 
1037
    /* 
 
1038
       detailing the fatal error message with coordinates 
 
1039
       of the last position read.
 
1040
    */
 
1041
    my_snprintf(error_text, sizeof(error_text), fmt, errmsg,
 
1042
                coord->file_name, (llstr(coord->pos, llbuff1), llbuff1),
 
1043
                log_file_name, (llstr(my_b_tell(&log), llbuff2), llbuff2));
 
1044
  }
 
1045
  else
 
1046
    strcpy(error_text, errmsg);
1024
1047
  end_io_cache(&log);
1025
1048
  RUN_HOOK(binlog_transmit, transmit_stop, (thd, flags));
1026
1049
  /*
1037
1060
    mysql_file_close(file, MYF(MY_WME));
1038
1061
  thd->variables.max_allowed_packet= old_max_allowed_packet;
1039
1062
 
1040
 
  my_message(my_errno, errmsg, MYF(0));
 
1063
  my_message(my_errno, error_text, MYF(0));
1041
1064
  DBUG_VOID_RETURN;
1042
1065
}
1043
1066
 
1666
1689
  thd_proc_info(thd, 0);
1667
1690
  if (ret == FALSE)
1668
1691
    my_ok(thd);
1669
 
  delete_dynamic(&lex_mi->repl_ignore_server_ids); //freeing of parser-time alloc
1670
1692
  DBUG_RETURN(ret);
1671
1693
}
1672
1694