An error occurred fetching the project authors.
  1. 19 Jun, 2008 1 commit
    • Andrei Elkin's avatar
      Bug#36443 Server crashes when executing insert when insert trigger on table · e66ba2a7
      Andrei Elkin authored
                              
            The crash appeared to be a result of allocating an instance of Discrete_interval 
            automatically that that was referred in out-of-declaration scope.
                              
            Fixed with correcting backing up and restoring scheme of
            auto_inc_intervals_forced, introduced by bug#33029, by means of shallow copying;
            added simulation code that forces executing those fixes of the former bug that
            targeted at master-and-slave having incompatible bug#33029-prone versions.
      
      mysql-test/suite/bugs/r/rpl_bug33029.result:
        new results file
      mysql-test/suite/bugs/t/rpl_bug33029.test:
        test merely checks no crash happens on slave.
      sql/slave.cc:
        forcing to execute special logics implemented for bug#33029 if
        simulate_bug33029 the debug option is set.
      sql/sql_class.cc:
        swaps of backed and the actual auto_inc_intervals_forced basing on shallow coping.
      sql/structs.h:
        Removing the deep _copy() and methods associated with it;
        adding methods to Discrete_intervals_list:
            
        private `=', copy constructor to prevent using;
        private set_members();
        public  copy_shallow(), swap(), get_{head, tail, current}();
                empty_no_free() through set_members().
      e66ba2a7
  2. 28 Mar, 2008 1 commit
    • unknown's avatar
      Bug#26243 mysql command line crash after control-c · a9089cf4
      unknown authored
      - Backported the 5.1 DBUG to 5.0.
      - Avoid memory cleanup race on Windows client for CTRL-C
      
      
      client/mysql.cc:
        Bug#26243 mysql command line crash after control-c
        - On Windows, the sigint handler shouldn't call mysql_end
        because the main thread will do so automatically.
        - Remove unnecessary signal call from the sigint handler.
        - Call my_end with proper value.
      dbug/dbug.c:
        Bug#26243 mysql command line crash after control-c
        - Backported the 5.1 DBUG library. The old version uses a non-thread 
        safe global variable 'static struct state *stack'.
      dbug/factorial.c:
        Bug#26243 mysql command line crash after control-c
        - Backported the 5.1 DBUG library. The old version uses a non-thread 
        safe global variable 'static struct state *stack'.
      dbug/user.r:
        Bug#26243 mysql command line crash after control-c
        - Backported the 5.1 DBUG library. The old version uses a non-thread 
        safe global variable 'static struct state *stack'.
      include/my_dbug.h:
        Bug#26243 mysql command line crash after control-c
        - Backported the 5.1 DBUG library. The old version uses a non-thread 
        safe global variable 'static struct state *stack'.
      libmysql/libmysql.c:
        Bug#26243 mysql command line crash after control-c
        - Update for new DBUG library.
      myisam/mi_open.c:
        Bug#26243 mysql command line crash after control-c
        - Update for new DBUG library.
      sql/ha_federated.cc:
        Bug#26243 mysql command line crash after control-c
        - Update for new DBUG library.
      sql/ha_innodb.cc:
        Bug#26243 mysql command line crash after control-c
        - Update for new DBUG library.
      sql/ha_myisammrg.cc:
        Bug#26243 mysql command line crash after control-c
        - Update for new DBUG library.
      sql/item_cmpfunc.cc:
        Bug#26243 mysql command line crash after control-c
        - Update for new DBUG library.
      sql/mysqld.cc:
        Bug#26243 mysql command line crash after control-c
        - Update for new DBUG library.
      sql/net_serv.cc:
        Bug#26243 mysql command line crash after control-c
        - Update for new DBUG library.
      sql/opt_range.cc:
        Bug#26243 mysql command line crash after control-c
        - Update for new DBUG library.
      sql/set_var.cc:
        Bug#26243 mysql command line crash after control-c
        - Update for new DBUG library.
      sql/slave.cc:
        Bug#26243 mysql command line crash after control-c
        - Update for new DBUG library.
      sql/sql_cache.cc:
        Bug#26243 mysql command line crash after control-c
        - Update for new DBUG library.
      sql/sql_select.cc:
        Bug#26243 mysql command line crash after control-c
        - Update for new DBUG library.
      tests/mysql_client_test.c:
        Bug#26243 mysql command line crash after control-c
        - Update for new DBUG library.
      a9089cf4
  3. 14 Mar, 2008 1 commit
    • unknown's avatar
      BUG#33029 5.0 to 5.1 replication fails on dup key when inserting · f21ee5d0
      unknown authored
      using a trig in SP
      
      For all 5.0 and up to 5.1.12 exclusive, when a stored routine or
      trigger caused an INSERT into an AUTO_INCREMENT column, the
      generated AUTO_INCREMENT value should not be written into the
      binary log, which means if a statement does not generate
      AUTO_INCREMENT value itself, there will be no Intvar event (SET
      INSERT_ID) associated with it even if one of the stored routine
      or trigger caused generation of such a value. And meanwhile, when
      executing a stored routine or trigger, it would ignore the
      INSERT_ID value even if there is a INSERT_ID value available set
      by a SET INSERT_ID statement.
      
      Starting from MySQL 5.1.12, the generated AUTO_INCREMENT value is
      written into the binary log, and the value will be used if
      available when executing the stored routine or trigger.
      
      Prior fix of this bug in MySQL 5.0 and prior MySQL 5.1.12
      (referenced as the buggy versions in the text below), when a
      statement that generates AUTO_INCREMENT value by the top
      statement was executed in the body of a SP, all statements in the
      SP after this statement would be treated as if they had generated
      AUTO_INCREMENT by the top statement.  When a statement that did
      not generate AUTO_INCREMENT value by the top statement but by a
      function/trigger called by it, an erroneous Intvar event would be
      associated with the statement, this erroneous INSERT_ID value
      wouldn't cause problem when replicating between masters and
      slaves of 5.0.x or prior 5.1.12, because the erroneous INSERT_ID
      value was not used when executing functions/triggers. But when
      replicating from buggy versions to 5.1.12 or newer, which will
      use the INSERT_ID value in functions/triggers, the erroneous
      value will be used, which would cause duplicate entry error and
      cause the slave to stop.
      
      The patch for 5.1 fixed it to ignore the SET INSERT_ID value when
      executing functions/triggers if it is replicating from a master
      of buggy versions, another patch for 5.0 fixed it not to generate
      the erroneous Intvar event.
      
      
      mysql-test/include/show_binlog_events.inc:
        add $binlog_start parameter to show binlog events from a given position
      sql/slave.cc:
        Add function to check for bug#33029
      sql/slave.h:
        Add function to check for bug#33029
      sql/sql_class.cc:
        if master has bug#33029, reset auto_inc_intervals_forced for sub statements
        
        add a new function Discrete_intervals_list::append that takes a Discrete_interval as argument
      sql/sql_class.h:
        Add member to save and restore auto_inc_intervals_forced
      sql/structs.h:
        add copy constructor and assignment operator for Discrete_intervals_list
        
        add a new function Discrete_intervals_list::append that takes a Discrete_interval as argument
      mysql-test/std_data/bug33029-slave-relay-bin.000001:
        relay logs from a buggy 5.0 master for test case of BUG#33029
      mysql-test/suite/binlog/r/binlog_auto_increment_bug33029.result:
        Test if the slave can process relay logs from a buggy master of BUG#33029
      mysql-test/suite/binlog/t/binlog_auto_increment_bug33029-master.opt:
        Test if the slave can process relay logs from a buggy master of BUG#33029
      mysql-test/suite/binlog/t/binlog_auto_increment_bug33029.test:
        Test if the slave can process relay logs from a buggy master of BUG#33029
      f21ee5d0
  4. 11 Mar, 2008 1 commit
    • unknown's avatar
      BUG#31024: STOP SLAVE does not stop attempted connect()s · 1836625f
      unknown authored
      Problem: if the IO slave thread is attempting to connect,
      STOP SLAVE waits for the attempt to finish. 
      It may take a long time.
      Fix: don't wait, stop the slave immediately.
      
      
      sql/slave.cc:
        Send a SIGALRM signal to the slave thread when stopping it (using
        pthread_kill()). This breaks current socket(), connect(), poll() etc.
        calls, and makes the subsequent thd->awake() call effective.
        
        Also, move the definition of KICK_SLAVE to slave.cc.
      sql/sql_repl.h:
        Removed KICK_SLAVE and inlined it in slave.cc because:
         - it was only called once, so better to make it local to where it is used
         - it needed to include a preprocessor conditional in the middle
      1836625f
  5. 06 Mar, 2008 1 commit
    • unknown's avatar
      Bug#26622 MASTER_POS_WAIT does not work as documented · 04c5af18
      unknown authored
      MASTER_POS_WAIT return values are different than expected when the server is not a slave. 
      It returns -1 instead of NULL.
      
      Fixed with correcting  st_relay_log_info::wait_for_pos() to return the proper
      value in the case of rli info is not inited.
      
      
      mysql-test/r/rpl_master_pos_wait.result:
        results changed
      mysql-test/t/rpl_master_pos_wait.test:
        the new test to check that select master_pos_wait() to a server does 
        not have master info returns NULL as specified.
      sql/slave.cc:
        changing the return value to correspond the specification.
      04c5af18
  6. 27 Feb, 2008 1 commit
    • unknown's avatar
      BUG#13861 - START SLAVE UNTIL may stop 1 evnt too late if · 83bcd5df
      unknown authored
                  log-slave-updates and circul repl
      
      After merge fixes.
      
      
      mysql-test/suite/rpl/t/rpl_dual_pos_advance-slave.opt:
        Rename: mysql-test/t/rpl_dual_pos_advance-slave.opt -> mysql-test/suite/rpl/t/rpl_dual_pos_advance-slave.opt
      mysql-test/include/wait_for_slave_sql_to_stop.inc:
        Do not change connection if it was requested by caller (needed for
        circular replication tests).
      mysql-test/suite/rpl/t/rpl_dual_pos_advance.test:
        Let include/wait_for_slave_sql_to_stop.inc know that we do not want to
        change connection to slave.
      sql/rpl_rli.cc:
        After merge fix.
      sql/rpl_rli.h:
        After merge fix.
      sql/slave.cc:
        After merge fix.
      83bcd5df
  7. 22 Feb, 2008 1 commit
    • unknown's avatar
      BUG#13861 - START SLAVE UNTIL may stop 1 evnt too late if · fea2a5d8
      unknown authored
                  log-slave-updates and circul repl
      
      Slave SQL thread may execute one extra event when there are events
      skipped by slave I/O thread (e.g. originated by the same server).
      Whereas it was requested not to do so by the UNTIL condition.
      
      This happens because we compare with the end position of previously
      executed event. This is fine when there are no skipped by slave I/O
      thread events, as end position of previous event equals to start
      position of to be executed event. Otherwise this position equals to
      start position of skipped event.
      
      This is fixed by:
      - reading the event to be executed before checking if the until condition
        is satisfied.
      - comparing the start position of the event to be executed. Since we do
        not have the start position available, we compute it by subtracting
        event length from end position (which is available).
      - if there are no events on the event queue at the slave sql starting
        time, that meet until condition, we stop immediately, as in this
        case we do not want to wait for next event.
      
      
      mysql-test/r/rpl_dual_pos_advance.result:
        A test case for BUG#13861.
      mysql-test/t/rpl_dual_pos_advance.test:
        A test case for BUG#13861.
      sql/log_event.cc:
        Store length of event. This is needed for further calculation of
        the beginning of event.
      sql/slave.cc:
        Slave SQL thread may execute one extra event when there are events
        skipped by slave I/O thread (e.g. originated by the same server).
        Whereas it was requested not to do so by the UNTIL condition.
        
        This happens because we compare with the end position of previously
        executed event. This is fine when there are no skipped by slave I/O
        thread events, as end position of previous event equals to start
        position of to be executed event. Otherwise this position equals to
        start position of skipped event.
        
        This is fixed by:
        - reading the event to be executed before checking if the until condition
          is satisfied.
        - comparing the start position of the event to be executed. Since we do
          not have the start position available, we compute it by subtracting
          event length from end position (which is available).
        - if there are no events on the event queue at the slave sql starting
          time, that meet until condition, we stop immediately, as in this
          case we do not want to wait for next event.
      sql/slave.h:
        Added master_log_pos parametr to is_until_satisfied().
      mysql-test/t/rpl_dual_pos_advance-slave.opt:
        New BitKeeper file ``mysql-test/t/rpl_dual_pos_advance-slave.opt''
      fea2a5d8
  8. 20 Feb, 2008 1 commit
    • unknown's avatar
      Bug #31316 Report server id clashes in SHOW SLAVE STATUS · e19c8e2e
      unknown authored
          "Server_IO_State" field
      
      Critical error messages from get_master_version_and_clock() were written
      only to the slave errorlog while Show slave status did not display any
      incident happened.
      
      Although the artifact was reported for a particular --replicate-same-server-id
      related issue the fix refines all critical error reporting with 
      deploying rli->report().
      
      The test for the bug covers only --replicate-same-server-id error reporting.
      
      
      mysql-test/suite/rpl/r/rpl_server_id1.result:
        new results reflecting changes
      mysql-test/suite/rpl/t/rpl_server_id1.test:
        Preserving the idea of the test unnecessary queries and the sleep are
        eliminated.
        In the end the slave must stop with the error displayable via $$$.
      sql/slave.cc:
        improving get_master_version_and_clock() code to report a critical incident
        via rli->report() that takes care of bothe the error log and
        the slave's status info placeholders.
        
        A critical error that force the IO slave thread to terminate is handled
        immediately (goto err).
      e19c8e2e
  9. 19 Feb, 2008 1 commit
  10. 13 Feb, 2008 1 commit
    • unknown's avatar
      Bug #33931 assertion at write_ignored_events_info_to_relay_log if init_slave_thread() fails · ded528ca
      unknown authored
      and
      bug#33932  assertion at handle_slave_sql if init_slave_thread() fails
      
      the asserts were caused by 
        bug33931: having thd deleted at time of executing err: code plus
                  a missed initialization;
        bug33932: initialization of slave_is_running member was missed;
      
      fixed with relocating mi members initialization and removing delete thd
      It is safe to do as deletion happens later explicitly in the caller of
      init_slave_thread().
      
      Todo: at merging the test is better to be moved into suite/bugs for 5.x (when x>0).
      
      
      sql/slave.cc:
        adding the bugs simulating code;
        relocating some assignments to satisfy the asserts;
      mysql-test/r/rpl_bug33931.result:
        the new result file
      mysql-test/t/rpl_bug33931-slave.opt:
        option to spark the simulation code
      mysql-test/t/rpl_bug33931.test:
        tests check that slave does not crash as before.
        Slave threads must be in NO running state in the end.
      ded528ca
  11. 11 Feb, 2008 2 commits
    • unknown's avatar
      Disabling declaration of debug variable for non-debug builds. · c9d0934a
      unknown authored
      (originally from Mats)
      
      
      sql/slave.cc:
        Disabling declaration in non-debug builds.
      c9d0934a
    • unknown's avatar
      Patch to eliminate some valgrind warnings in debug printout code. · 6f6fabb7
      unknown authored
      (originally from Mats)
      
      
      sql/rpl_rli.cc:
        Adding variable to mark an instance of Relay_log_info as fake.
      sql/rpl_rli.h:
        Adding variable to mark an instance of Relay_log_info as fake.
      sql/slave.cc:
        Not printing debug information if we are working with a fake
        instance of Relay_log_info. This because the result of calling
        update is nonsense, and trying to print it generates valgrind
        warnings.
      sql/sql_binlog.cc:
        Marking newly created instance of Relay_log_info as a fake instance.
      6f6fabb7
  12. 07 Feb, 2008 1 commit
  13. 06 Feb, 2008 1 commit
    • unknown's avatar
      Patch to eliminate some valgrind warnings in debug printout code. · be5a46a6
      unknown authored
      sql/rpl_rli.cc:
        Adding variable to mark an instance of Relay_log_info as fake.
      sql/rpl_rli.h:
        Adding variable to mark an instance of Relay_log_info as fake.
      sql/slave.cc:
        Not printing debug information if we are working with a fake
        instance of Relay_log_info. This because the result of calling
        update is nonsense, and trying to print it generates valgrind
        warnings.
      sql/sql_binlog.cc:
        Marking newly created instance of Relay_log_info as a fake instance.
      be5a46a6
  14. 05 Feb, 2008 1 commit
    • unknown's avatar
      Bug #34305 show slave status handling segfaults when slave io is about · 3b6a71a4
      unknown authored
          to leave
      
      The artifact was caused by
      a flaw in concurrent accessing the slave's io thd by
      the io itself and a handling show slave status thread.
      Namely, show_master_info did not acquire mi->run_lock mutex that is
      specified for mi->io_thd member.
      
      Fixed with deploying the mutex locking and unlocking. The mutex is kept
      short time and without interleaving with mi->data_lock mutex.
      
      Todo: to report and fix an issue with 
          sys_var_slave_skip_counter::{methods} 
      seem to acquire incorrectly
           active_mi->rli.run_lock
      instead of the specified
           active_mi->rli.data_lock
      
      A test case is difficult to compose, so rpl_packet should continue serving
      as the indicator.
      
      
      sql/slave.cc:
        implementing a TODO left at 4.1 time:
        mending access to mi->io_thd with the specified mutex;
      sql/slave.h:
        adding a member name to the list of that run_lock guards.
      3b6a71a4
  15. 30 Jan, 2008 1 commit
    • unknown's avatar
      Post-merge changes. · 101c30cc
      unknown authored
      BitKeeper/deleted/.del-show_binlog_events2.inc:
        Delete: mysql-test/include/show_binlog_events2.inc
      client/mysqlbinlog.cc:
        char -> uchar for raw memory.
      sql/item_cmpfunc.cc:
        Adding cast to remove warning when converting negative integer
        to unsigned type.
      sql/log_event.cc:
        char -> uchar for raw memory.
      sql/log_event.h:
        char -> uchar for raw memory.
      sql/rpl_utility.cc:
        Adding cast to remove warning when converting negative integer
        to unsigned type.
      sql/slave.cc:
        char -> uchar for raw memory.
      sql/sql_repl.cc:
        char -> uchar for raw memory.
      sql-common/client.c:
        char -> uchar for raw memory.
      101c30cc
  16. 20 Dec, 2007 1 commit
    • unknown's avatar
      BUG#12691 (Exec_master_log_pos corrupted with SQL_SLAVE_SKIP_COUNTER): · 150590a0
      unknown authored
      Complementary patch since LOAD DATA INFILE was not covered in
      the previous patch.
      
      This patch adds a check so that the slave skip counter is not
      decreased to zero if seeing a BEGIN_LOAD_QUERY_EVENT,
      APPEND_BLOCK_EVENT, or CREATE_FILE_EVENT since these cannot
      end a group. The group is terminated by an EXECUTE_LOAD_QUERY_
      EVENT or DELETE_FILE_EVENT.
      
      
      mysql-test/r/rpl_slave_skip.result:
        Result change.
      mysql-test/t/rpl_slave_skip.test:
        Adding tests to test that the first event of a LOAD DATA INFILE
        can be skipped safely for both transactional and non-transactional
        tables. Also include a case that will generate a DELETE_FILE event
        last in the group, and this should be properly skipped as well.
      sql/slave.cc:
        Not decrementing slave skip counter to zero when seeing a
        BEGIN_LOAD_QUERY_EVENT, APPEND_BLOCK_EVENT, or CREATE_FILE_EVENT
        since these cannot end a group.
      150590a0
  17. 14 Dec, 2007 1 commit
    • unknown's avatar
      BUG#32407: Impossible to do point-in-time recovery from older binlog · 8d37a30e
      unknown authored
      Problem: it is unsafe to read base64-printed events without first
      reading the Format_description_log_event (FD).  Currently, mysqlbinlog
      cannot print the FD.
      
      As a side effect, another bug has also been fixed: When mysqlbinlog
      --start-position=X was specified, no ROLLBACK was printed. I changed
      this, so that ROLLBACK is always printed.
      
      This patch does several things:
      
       - Format_description_log_event (FD) now print themselves in base64
         format.
      
       - mysqlbinlog is now able to print FD events.  It has three modes:
          --base64-output=auto    Print row events in base64 output, and print
                                  FD event.  The FD event is printed even if
                                  it is outside the range specified with
                                  --start-position, because it would not be
                                  safe to read row events otherwise. This is
                                  the default.
      
          --base64-output=always  Like --base64-output=auto, but also print
                                  base64 output for query events.  This is
                                  like the old --base64-output flag, which
                                  is also a shorthand for
                                  --base64-output=always
      
          --base64-output=never   Never print base64 output, generate error if
                                  row events occur in binlog.  This is
                                  useful to suppress the FD event in binlogs
                                  known not to contain row events (e.g.,
                                  because BINLOG statement is unsafe,
                                  requires root privileges, is not SQL, etc)
      
       - the BINLOG statement now handles FD events correctly, by setting
         the thread's rli's relay log's description_event_for_exec to the
         loaded event.
      
         In fact, executing a BINLOG statement is almost the same as reading
         an event from a relay log.  Before my patch, the code for this was
         separated (exec_relay_log_event in slave.cc executes events from
         the relay log, mysql_client_binlog_statement in sql_binlog.cc
         executes BINLOG statements).  I needed to augment
         mysql_client_binlog_statement to do parts of what
         exec_relay_log_event does.  Hence, I did a small refactoring and
         moved parts of exec_relay_log_event to a new function, which I
         named apply_event_and_update_pos.  apply_event_and_update_pos is
         called both from exec_relay_log_event and from
         mysql_client_binlog_statement.
      
       - When a non-FD event is executed in a BINLOG statement, without
         previously executing a FD event in a BINLOG statement, it generates
         an error, because that's unsafe.  I took a new error code for that:
         ER_NO_FORMAT_DESCRIPTION_EVENT_BEFORE_BINLOG_STATEMENTS.
      
         In order to get a decent error message containing the name of the
         event, I added the class method char*
         Log_event::get_type_str(Log_event_type type), which returns a
         string name for the given Log_event_type.  This is just like the
         existing char* Log_event::get_type_str(), except it is a class
         method that takes the log event type as parameter.
      
         I also added PRE_GA_*_ROWS_LOG_EVENT to Log_event::get_type_str(),
         so that names of old rows event are properly printed.
      
       - When reading an event, I added a check that the event type is known
         by the current Format_description_log_event. Without this, it may
         crash on bad input (and I was struck by this several times).
      
       - I patched the following test cases, which all contain BINLOG
         statements for row events which must be preceded by BINLOG
         statements for FD events:
          - rpl_bug31076
      
      While I was here, I fixed some small things in log_event.cc:
      
       - replaced hard-coded 4 by EVENT_TYPE_OFFSET in 3 places
      
       - replaced return by DBUG_VOID_RETURN in one place
      
       - The name of the logfile can be '-' to indicate stdin.  Before my
         patch, the code just checked if the first character is '-'; now it
         does a full strcmp().  Probably, all arguments that begin with a -
         are already handled somewhere else as flags, but I still think it
         is better that the code reflects what it is supposed to do, with as
         little dependencies as possible on other parts of the code.  If we
         one day implement that all command line arguments after -- are
         files (as most unix tools do), then we need this.
      
      I also fixed the following in slave.cc:
      
       - next_event() was declared twice, and queue_event was not static but
         should be static (not used outside the file).
      
      
      client/client_priv.h:
        Declared the new option for base64 output.
      client/mysqlbinlog.cc:
         - Change from using the two-state command line option
          "default/--base64-output" to the three-state
          "--base64-output=[never|auto|always]"
         - Print the FD event even if it is outside the --start-position range.
         - Stop if a row event is about to be printed without a preceding FD
           event.
         - Minor fixes:
            * changed 4 to EVENT_TYPE_OFFSET in some places
            * Added comments
            * before, "mysqlbinlog -xyz" read from stdin; now it does not
              (only "mysqlbinlog -" reads stdin).
      mysql-test/r/mysqlbinlog2.result:
        Updated result file: mysqlbinlog now prints ROLLBACK always.
      mysql-test/suite/binlog/t/disabled.def:
        The test must be disabled since it reveals another bug: see BUG#33247.
      mysql-test/suite/rpl/r/rpl_bug31076.result:
        Updated result file
      mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result:
        Updated result file
      mysql-test/suite/rpl/t/rpl_bug31076.test:
        Had to add explicit Format_description_log_event before other BINLOG
        statements
      mysql-test/t/mysqlbinlog2.test:
        we must suppress base64 output in result file because it contains a
        timestamp
      sql/log_event.cc:
         - Made FD events able to print themselves
         - Added check that the current FD event knows about the event type, when
           an event is about to be read. (Hint to reviewers: I had to re-indent
           a big block because of this; use diff -b)
            * To get a decent error message, I also added a class method
              const char* Log_event::get_type_str(Log_event_type)
              which converts number to event type string without having a
              Log_event object.
            * Made Log_event::get_type_str aware of PRE_GA_*_ROWS_LOG_EVENT.
         - Minor fixes:
            * Changed return to DBUG_VOID_RETURN
      sql/log_event.h:
         - Declared enum to describe the three base64_output modes
         - Use the enum instead of a flag
         - Declare the new class method get_type_str (see log_event.cc)
      sql/share/errmsg.txt:
        Added error msg.
      sql/slave.cc:
         - Factored out part of exec_relay_log_event to the new function
           apply_event_and_update_pos, because that code is needed when executing
           BINLOG statements. (this is be functionally equivalent to the
           previous code, except: (1) skipping events is now optional, controlled
           by a parameter to the new function (2) the return value of
           exec_relay_log_event has changed; see next item).
         - Changed returned error value to always be 1. Before, it would return
           the error value from apply_log_event, which was unnecessary. This
           change is safe because the exact return value of exec_relay_log_event
           is never examined; it is only tested to be ==0 or !=0.
         - Added comments describing exec_relay_log_event and
           apply_event_and_update_pos.
         - Minor fixes:
            * Removed duplicate declaration of next_event, made queue_event
              static.
            * Added doxygen code to include this file.
      sql/slave.h:
        Declared the new apply_event_and_update_pos
      sql/sql_binlog.cc:
         - Made mysql_binlog_statement set the current FD event when the given
           event is an FD event. This entails using the new function
           apply_event_and_update_pos from slave.cc instead of just calling the
           ev->apply method.
         - Made mysql_binlog_statement fail if the first BINLOG statement is not
           an FD event.
      mysql-test/suite/binlog/r/binlog_base64_flag.result:
        New test file needs new result file
      mysql-test/suite/binlog/t/binlog_base64_flag.test:
        Added test case to verify that:
         - my patch fixes the bug
         - the new --base64-output flag works as expected
         - base64 events not preceded by an FD event give an error
         - an event of a type not known by the current FD event fails cleanly.
      mysql-test/suite/binlog/std_data/binlog-bug32407.000001:
        BitKeeper file /home/sven/bk/b32407-5.1-new-rpl-mysqlbinlog_base64/mysql-test/suite/binlog/std_data/binlog-bug32407.000001
      8d37a30e
  18. 12 Dec, 2007 1 commit
    • unknown's avatar
      Bug#12713 "Error in a stored function called from a SELECT doesn't · 2a0d2fef
      unknown authored
      cause ROLLBACK of statement", part 1. Review fixes.
      
      Do not send OK/EOF packets to the client until we reached the end of 
      the current statement.
      This is a consolidation, to keep the functionality that is shared by all 
      SQL statements in one place in the server.
      Currently this functionality includes:
      - close_thread_tables()
      - log_slow_statement().
      
      After this patch and the subsequent patch for Bug#12713, it shall also include:
      - ha_autocommit_or_rollback()
      - net_end_statement()
      - query_cache_end_of_result().
      
      In future it may also include:
      - mysql_reset_thd_for_next_command().
      
      
      include/mysql_com.h:
        Rename now unused members of NET: no_send_ok, no_send_error, report_error.
        These were server-specific variables related to the client/server
        protocol. They have been made obsolete by this patch.
        
        Previously the same members of NET were used to store the error message
        both on the client and on the server. 
        The error message was stored in net.last_error (client: mysql->net.last_error,
        server: thd->net.last_error).
        The error code was stored in net.last_errno (client: mysql->net.last_errno,
        server: thd->net.last_errno).
        The server error code and message are now stored elsewhere 
        (in the Diagnostics_area), thus NET members are no longer used by the
        server.
        Rename last_error to client_last_error, last_errno to client_last_errno
        to avoid potential bugs introduced by merges.
      include/mysql_h.ic:
        Update the ABI file to reflect a rename. 
        Renames do not break the binary compatibility.
      libmysql/libmysql.c:
        Rename last_error to client_last_error, last_errno to client_last_errno.
        This is necessary to ensure no unnoticed bugs introduced by merged
        changesets.
        
        Remove net.report_error, net.no_send_ok, net.no_send_error.
      libmysql/manager.c:
        Rename net.last_errno to net.client_last_errno.
      libmysqld/lib_sql.cc:
        Rename net.last_errno to net.client_last_errno.
        
        Update the embedded implementation of the client-server protocol to
        reflect the refactoring of protocol.cc.
      libmysqld/libmysqld.c:
        Rename net.last_errno to net.client_last_errno.
      mysql-test/r/events.result:
        Update to reflect the change in mysql_rm_db(). Now we drop stored
        routines and events for a given database name only if there
        is a directory for this database name. ha_drop_database() and
        query_cache_invalidate() are called likewise. 
        Previously we would attempt to drop routines/events even if database
        directory was not found (it worked, since routines and events are stored
        in tables). This fixes Bug 29958 "Weird message on DROP DATABASE if mysql.proc
        does not exist".
        The change was done because the previous code used to call send_ok()
        twice, which led to an assertion failure when asserts against it were
        added by this patch.
      mysql-test/r/grant.result:
        Fix the patch for Bug 16470, now FLUSH PRIVILEGES produces an error 
        if mysql.procs_priv is missing.
        This fixes the assert that send_ok() must not called after send_error()
        (the original patch for Bug 16470 was prone to this).
      mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result:
        Produce a more detailed error message.
      mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result:
        Produce a more detailed error message.
      mysql-test/t/grant.test:
        Update the test, now FLUSH PRIVILEGES returns an error if mysql.procs_priv
        is missing.
      server-tools/instance-manager/mysql_connection.cc:
        Rename net.last_errno to net.client_last_errno.
      sql/ha_ndbcluster_binlog.cc:
        Add asserts. 
        
        Use getters to access statement status information.
        
        Add a comment why run_query() is broken. Reset the diagnostics area
        in the end of run_query() to fulfill the invariant that the diagnostics_area
        is never assigned twice per statement (see the comment in the code
        when this can happen). We still do not clear thd->is_fatal_error and
        thd->is_slave_error, which may lead to bugs, I consider the whole affair
        as something to be dealt with separately.
      sql/ha_partition.cc:
        fatal_error() doesn't set an error by itself. Perhaps we should
        remove this method altogether and instead add a flag to my_error 
        to set thd->is_fatal_error property.
        
        Meanwhile, this change is a part of inspection made to the entire source
        code with the goal to ensure that fatal_error()
        is always accompanied by my_error().
      sql/item_func.cc:
        There is no net.last_error anymore. Remove the obsolete assignment.
      sql/log_event.cc:
        Use getters to access statement error status information.
      sql/log_event_old.cc:
        Use getters to access statement error status information.
      sql/mysqld.cc:
        Previously, if a continue handler for an error was found, my_message_sql() 
        would not set an error in THD. Since the current statement
        must be aborted in any case, find_handler() had a hack to assign 
        thd->net.report_error to 1.
        
        Remove this hack. Set an error in my_message_sql() even if the continue
        handler is found. The error will be cleared anyway when the handler
        is executed. This is one action among many in this patch to ensure the 
        invariant that whenever thd->is_error() is TRUE, we have a message in 
        thd->main_da.message().
      sql/net_serv.cc:
        Use a full-blown my_error() in net_serv.cc to report an error,
        instead of just setting net->last_errno. This ensures the invariant that
        whenever thd->is_error() returns TRUE, we have a message in 
        thd->main_da.message().
        
        Remove initialization of removed NET members.
      sql/opt_range.cc:
        Use my_error() instead of just raising thd->net.report_error. 
        This ensures the invariant that whenever thd->is_error() returns TRUE, 
        there is a message in thd->main_da.message().
      sql/opt_sum.cc:
        Move invocation of fatal_error() right next to the place where
        we set the error message. That makes it easier to track that whenever
        fatal_error() is called, there is a message in THD.
      sql/protocol.cc:
        Rename send_ok() and send_eof() to net_send_ok() and net_send_eof() 
        respectively. These functions write directly to the network and are not 
        for use anywhere outside the client/server protocol code. 
        
        Remove the code that was responsible for cases when either there is 
        no error code, or no error message, or both.
        Instead the calling code ensures that they are always present. Asserts
        are added to enforce the invariant.
        
        Instead of a direct access to thd->server_status and thd->total_warn_count
        use function parameters, since these from now on don't always come directly
        from THD.
        
        Introduce net_end_statement(), the single-entry-point replacement API for 
        send_ok(), send_eof() and net_send_error().
        
        Implement Protocol::end_partial_result_set to use in select_send::abort()
        when there is a continue handler.
      sql/protocol.h:
        Update declarations.
      sql/repl_failsafe.cc:
        Use getters to access statement status information in THD.
        Rename net.last_error to net.client_last_error.
      sql/rpl_record.cc:
        Set an error message in prepare_record() if there is no default
        value for the field -- later we do print this message to the client.
      sql/rpl_rli.cc:
        Use getters to access statement status information in THD.
      sql/slave.cc:
        In create_table_from_dump() (a common function that is used in 
        LOAD MASTER TABLE SQL statement and COM_LOAD_MASTER_DATA), instead of hacks
        with no_send_ok, clear the diagnostics area when mysql_rm_table() succeeded.
        
        Update has_temporary_error() to work correctly when no error is set.
        This is the case when Incident_log_event is executed: it always returns
        an error but does not set an error message.
        
        Use getters to access error status information.
      sql/sp_head.cc:
        Instead of hacks with no_send_error, work through the diagnostics area 
        interface to suppress sending of OK/ERROR packets to the client.
        
        Move query_cache_end_of_result before log_slow_statement(), similarly
        to how it's done in dispatch_command().
      sql/sp_rcontext.cc:
        Remove hacks with assignment of thd->net.report_error, they are not
        necessary any more (see the changes in mysqld.cc).
      sql/sql_acl.cc:
        Use getters to access error status information in THD.
      sql/sql_base.cc:
        Access thd->main_da.sql_errno() only if there is an error. This fixes
        a bug when auto-discovery, that was effectively disabled under pre-locking.
      sql/sql_binlog.cc:
        Remove hacks with no_send_ok/no_send_error, they are not necessary 
        anymore: the caller is responsible for network communication.
      sql/sql_cache.cc:
        Disable sending of OK/ERROR/EOF packet in the end of dispatch_command
        if the response has been served from the query cache. This raises the 
        question whether we should store EOF packet in the query cache at all,
        or generate it anew for each statement (we should generate it anew), but
        this is to be addressed separately.
      sql/sql_class.cc:
        Implement class Diagnostics_area. Please see comments in sql_class.h
        for details.
        
        Fix a subtle coding mistake in select_send::send_data: when on slave, 
        an error in Item::send() was ignored.
        The problem became visible due to asserts that the diagnostics area is
        never double assigned.
        
        Remove initialization of removed NET members.
        
        In select_send::abort() do not call select_send::send_eof(). This is
        not inheritance-safe. Even if a stored procedure continue handler is
        found, the current statement is aborted, not succeeded.
        Instead introduce a Protocol API to send the required response, 
        Protocol::end_partial_result_set().
        
        This simplifies implementation of select_send::send_eof(). No need
        to add more asserts that there is no error, there is an assert inside
        Diagnostics_area::set_ok_status() already.
        
        Leave no trace of no_send_* in the code.
      sql/sql_class.h:
        Declare class Diagnostics_area. 
        
        Remove the hack with no_send_ok from
        Substatement_state.
        
        Provide inline implementations of send_ok/send_eof.
        
        Add commetns.
      sql/sql_connect.cc:
        Remove hacks with no_send_error. 
        
        Since now an error in THD is always set if net->error, it's not necessary
        to check both net->error and thd->is_error() in the do_command loop.
        
        Use thd->main_da.message() instead of net->last_errno.
        
        Remove the hack with is_slave_error in sys_init_connect. Since now we do not
        reset the diagnostics area in net_send_error (it's reset at the beginning
        of the next statement), we can access it safely even after 
        execute_init_command.
      sql/sql_db.cc:
        Update the code to satisfy the invariant that the diagnostics area is never
        assigned twice.
        Incidentally, this fixes Bug 29958 "Weird message on DROP DATABASE if 
        mysql.proc does not exist".
      sql/sql_delete.cc:
        Change multi-delete to abort in abort(), as per select_send protocol.
        Fixes the merge error with the test for Bug 29136
      sql/sql_derived.cc:
        Use getters to access error information.
      sql/sql_insert.cc:
        Use getters to access error information.
      sql-common/client.c:
        Rename last_error to client_last_error, last_errno to client_last_errno.
      sql/sql_parse.cc:
        Remove hacks with no_send_error. Deploy net_end_statement().
        
        The story of COM_SHUTDOWN is interesting. Long story short, the server 
        would become on its death's door, and only no_send_ok/no_send_error assigned
        by send_ok()/net_send_error() would hide its babbling from the client.
        
        First of all, COM_QUIT does not require a response. So, the comment saying
        "Let's send a response to possible COM_QUIT" is not only groundless 
        (even mysqladmin shutdown/mysql_shutdown() doesn't send COM_QUIT after 
        COM_SHUTDOWN), it's plainly incorrect.
        
        Secondly, besides this additional 'OK' packet to respond to a hypothetical
        COM_QUIT, there was the following code in dispatch_command():
        
        if (thd->killed)
          thd->send_kill_message();
        if (thd->is_error()
          net_send_error(thd);
        
        This worked out really funny for the thread through which COM_SHUTDOWN
        was delivered: we would get COM_SHUTDOWN, say okay, say okay again, 
        kill everybody, get the kill signal ourselves, and then attempt to say 
        "Server shutdown in progress" to the client that is very likely long gone.
        
        This all became visible when asserts were added that the Diagnostics_area
        is not assigned twice.
        
        Move query_cache_end_of_result() to the end of dispatch_command(), since
        net_send_eof() has been moved there. This is safe, query_cache_end_of_result()
        is a no-op if there is no started query in the cache.
        
        Consistently use select_send interface to call abort() or send_eof()
        depending on the operation result.
        
        Remove thd->fatal_error() from reset_master(), it was a no-op. 
        in hacks with no_send_error woudl save us
        from complete breakage of the client/server protocol.
        
        Consistently use select_send::abort() whenever there is an error, 
        and select_send::send_eof() in case of success.
        The issue became visible due to added asserts.
      sql/sql_partition.cc:
        Always set an error in THD whenever there is a call to fatal_error().
      sql/sql_prepare.cc:
        Deploy class Diagnostics_area.
        Remove the unnecessary juggling with the protocol in 
        Select_fetch_protocol_binary::send_eof(). EOF packet format is 
        protocol-independent.
      sql/sql_select.cc:
        Call fatal_error() directly in opt_sum_query.
        Call my_error() whenever we call thd->fatal_error().
      sql/sql_servers.cc:
        Use getters to access error information in THD.
      sql/sql_show.cc:
        Use getters to access error information in THD.
        
        Add comments.
        
        Call my_error() whenever we call fatal_error().
      sql/sql_table.cc:
        Replace hacks with no_send_ok with the interface of the diagnostics area.
        
        Clear the error if ENOENT error in ha_delete_table().
      sql/sql_update.cc:
        Introduce multi_update::abort(), which is the proper way to abort a
        multi-update. This fixes the merge conflict between this patch and
        the patch for Bug 29136.
      sql/table.cc:
        Use a getter to access error information in THD.
      sql/tztime.cc:
        Use a getter to access error information in THD.
      2a0d2fef
  19. 22 Nov, 2007 1 commit
    • unknown's avatar
      Fix for bug #29976: Excessive Slave I/O errors in replication tests · 67522fcb
      unknown authored
      Problem:
      
      The "Slave I/O thread couldn't register on master" error sporadically
      occurred in replication tests because the slave I/O thread got
      killed by STOP SLAVE before or while registering on master.
      
      Fixed by checking the state of the I/O thread, and issueing
      the error only if it was not explicitely killed by a user.
      
      
      sql/slave.cc:
        When the slave I/O thread fails to register on master, issue an error
        message only if it is not explicitely killed by a user with STOP SLAVE.
      67522fcb
  20. 15 Nov, 2007 1 commit
    • unknown's avatar
      Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE · c8450b27
      unknown authored
                  corrupts a MERGE table
      Bug 26867 - LOCK TABLES + REPAIR + merge table result in
                  memory/cpu hogging
      Bug 26377 - Deadlock with MERGE and FLUSH TABLE
      Bug 25038 - Waiting TRUNCATE
      Bug 25700 - merge base tables get corrupted by
                  optimize/analyze/repair table
      Bug 30275 - Merge tables: flush tables or unlock tables
                  causes server to crash
      Bug 19627 - temporary merge table locking
      Bug 27660 - Falcon: merge table possible
      Bug 30273 - merge tables: Can't lock file (errno: 155)
      
      The problems were:
      
      Bug 26379 - Combination of FLUSH TABLE and REPAIR TABLE
                      corrupts a MERGE table
      
        1. A thread trying to lock a MERGE table performs busy waiting while
           REPAIR TABLE or a similar table administration task is ongoing on
           one or more of its MyISAM tables.
        
        2. A thread trying to lock a MERGE table performs busy waiting until all
           threads that did REPAIR TABLE or similar table administration tasks
           on one or more of its MyISAM tables in LOCK TABLES segments do UNLOCK
           TABLES. The difference against problem #1 is that the busy waiting
           takes place *after* the administration task. It is terminated by
           UNLOCK TABLES only.
        
        3. Two FLUSH TABLES within a LOCK TABLES segment can invalidate the
           lock. This does *not* require a MERGE table. The first FLUSH TABLES
           can be replaced by any statement that requires other threads to
           reopen the table. In 5.0 and 5.1 a single FLUSH TABLES can provoke
           the problem.
      
      Bug 26867 - LOCK TABLES + REPAIR + merge table result in
                  memory/cpu hogging
      
        Trying DML on a MERGE table, which has a child locked and
        repaired by another thread, made an infinite loop in the server.
      
      Bug 26377 - Deadlock with MERGE and FLUSH TABLE
      
        Locking a MERGE table and its children in parent-child order
        and flushing the child deadlocked the server.
      
      Bug 25038 - Waiting TRUNCATE
      
        Truncating a MERGE child, while the MERGE table was in use,
        let the truncate fail instead of waiting for the table to
        become free.
      
      Bug 25700 - merge base tables get corrupted by
                  optimize/analyze/repair table
      
        Repairing a child of an open MERGE table corrupted the child.
        It was necessary to FLUSH the child first.
      
      Bug 30275 - Merge tables: flush tables or unlock tables
                  causes server to crash
      
        Flushing and optimizing locked MERGE children crashed the server.
      
      Bug 19627 - temporary merge table locking
      
        Use of a temporary MERGE table with non-temporary children
        could corrupt the children.
      
        Temporary tables are never locked. So we do now prohibit
        non-temporary chidlren of a temporary MERGE table.
      
      Bug 27660 - Falcon: merge table possible
      
        It was possible to create a MERGE table with non-MyISAM children.
      
      Bug 30273 - merge tables: Can't lock file (errno: 155)
      
        This was a Windows-only bug. Table administration statements
        sometimes failed with "Can't lock file (errno: 155)".
      
      These bugs are fixed by a new implementation of MERGE table open.
      
      When opening a MERGE table in open_tables() we do now add the
      child tables to the list of tables to be opened by open_tables()
      (the "query_list"). The children are not opened in the handler at
      this stage.
      
      After opening the parent, open_tables() opens each child from the
      now extended query_list. When the last child is opened, we remove
      the children from the query_list again and attach the children to
      the parent. This behaves similar to the old open. However it does
      not open the MyISAM tables directly, but grabs them from the already
      open children.
      
      When closing a MERGE table in close_thread_table() we detach the
      children only. Closing of the children is done implicitly because
      they are in thd->open_tables.
      
      For more detail see the comment at the top of ha_myisammrg.cc.
      
      Changed from open_ltable() to open_and_lock_tables() in all places
      that can be relevant for MERGE tables. The latter can handle tables
      added to the list on the fly. When open_ltable() was used in a loop
      over a list of tables, the list must be temporarily terminated
      after every table for open_and_lock_tables().
      table_list->required_type is set to FRMTYPE_TABLE to avoid open of
      special tables. Handling of derived tables is suppressed.
      These details are handled by the new function
      open_n_lock_single_table(), which has nearly the same signature as
      open_ltable() and can replace it in most cases.
      
      In reopen_tables() some of the tables open by a thread can be
      closed and reopened. When a MERGE child is affected, the parent
      must be closed and reopened too. Closing of the parent is forced
      before the first child is closed. Reopen happens in the order of
      thd->open_tables. MERGE parents do not attach their children
      automatically at open. This is done after all tables are reopened.
      So all children are open when attaching them.
      
      Special lock handling like mysql_lock_abort() or mysql_lock_remove()
      needs to be suppressed for MERGE children or forwarded to the parent.
      This depends on the situation. In loops over all open tables one
      suppresses child lock handling. When a single table is touched,
      forwarding is done.
      
      Behavioral changes:
      ===================
      
      This patch changes the behavior of temporary MERGE tables.
      Temporary MERGE must have temporary children.
      The old behavior was wrong. A temporary table is not locked. Hence
      even non-temporary children were not locked. See
      Bug 19627 - temporary merge table locking.
      
      You cannot change the union list of a non-temporary MERGE table
      when LOCK TABLES is in effect. The following does *not* work:
      CREATE TABLE m1 ... ENGINE=MRG_MYISAM ...;
      LOCK TABLES t1 WRITE, t2 WRITE, m1 WRITE;
      ALTER TABLE m1 ... UNION=(t1,t2) ...;
      However, you can do this with a temporary MERGE table.
      
      You cannot create a MERGE table with CREATE ... SELECT, neither
      as a temporary MERGE table, nor as a non-temporary MERGE table.
      CREATE TABLE m1 ... ENGINE=MRG_MYISAM ... SELECT ...;
      Gives error message: table is not BASE TABLE.
      
      
      include/my_base.h:
        Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
                    corrupts a MERGE table
        Added HA_EXTRA_ATTACH_CHILDREN and HA_EXTRA_DETACH_CHILDREN.
      include/myisammrg.h:
        Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
                    corrupts a MERGE table
        Added element 'children_attached' to MYRG_INFO.
        Added declarations for myrg_parent_open(),
        myrg_attach_children() and myrg_detach_children()
        for the new MERGE table open approach.
      mysql-test/extra/binlog_tests/blackhole.test:
        Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
                    corrupts a MERGE table
        Preliminarily added new error message with a comment.
      mysql-test/r/create.result:
        Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
                    corrupts a MERGE table
        Fixed test result.
      mysql-test/r/delayed.result:
        Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
                    corrupts a MERGE table
        Moved test result from here to merge.result.
      mysql-test/r/merge.result:
        Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
                    corrupts a MERGE table
        Fixed/added test result.
      mysql-test/r/myisam.result:
        Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
                    corrupts a MERGE table
        Moved test result for bug 8306 from here to merge.result.
      mysql-test/suite/binlog/r/binlog_stm_blackhole.result:
        Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
                    corrupts a MERGE table
        Fixed test result.
      mysql-test/t/create.test:
        Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
                    corrupts a MERGE table
        Fixed error number.
      mysql-test/t/delayed.test:
        Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
                    corrupts a MERGE table
        Moved test from here to merge.test.
      mysql-test/t/merge.test:
        Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
                    corrupts a MERGE table
        Fixed test for new temporary MERGE table behavior.
        Exchanged error numbers by symbolic codes.
        Added tests. Included are tests for bugs
        8306 (moved from myisam.test), 26379, 19627, 25038, 25700, 26377,
        26867, 27660, 30275, and 30273.
        Fixed changes resulting from disabled CREATE...SELECT.
        Integrated tests moved from delayed.test and myisam.test to here.
      mysql-test/t/myisam.test:
        Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
                    corrupts a MERGE table
        Moved test for bug 8306 from here to merge.test.
      mysys/thr_lock.c:
        Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
                    corrupts a MERGE table
        Added code to let the owner of a high priority lock (TL_WRITE_ONLY)
        to bypass its own lock.
      sql/ha_ndbcluster_binlog.cc:
        Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
                    corrupts a MERGE table
        Added 'thd' argument to init_tmp_table_share().
      sql/handler.cc:
        Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
                    corrupts a MERGE table
        Added 'thd' argument to init_tmp_table_share().
      sql/mysql_priv.h:
        Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
                    corrupts a MERGE table
        Removed declaration of check_merge_table_access(). It is now static
        in sql_parse.cc.
        Added declaration for fix_merge_after_open().
        Renamed open_and_lock_tables() to open_and_lock_tables_derived()
        with additional parameter 'derived'.
        Added inline functions simple_open_n_lock_tables() and
        open_and_lock_tables(), which call open_and_lock_tables_derived()
        and add the argument for 'derived'.
        Added new function open_n_lock_single_table(), which can be used
        as an replacement for open_ltable() in most situations. Internally
        it calls simple_open_n_lock_tables() so hat it is appropriate for
        MERGE tables.
        Added 'thd' argument to init_tmp_table_share().
      sql/slave.cc:
        ug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
                    corrupts a MERGE table
        Added comment.
      sql/sql_base.cc:
        Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
                    corrupts a MERGE table
        
        Defined new functions add_merge_table_list(),
        attach_merge_children(), detach_merge_children(), and
        fix_merge_after_open() for the new MERGE table open approach.
        
        Added calls of the new functions to
        close_handle_and_leave_table_as_lock(), close_thread_tables(),
        close_thread_table(), unlink_open_table(), reopen_name_locked_table(),
        reopen_table(), drop_locked_tables(), close_temporary_table(),
        and open_tables() respectively.
        
        Prevented special lock handling of merge children (like
        mysql_lock_remove, mysql_lock_merge or mysql_lock_abort)
        at many places. Some of these calls are forwarded to the
        parent table instead.
        
        Added code to set thd->some_tables_deleted for every thread that has
        a table open that we are flushing.
        Added code for MERGE tables to unlink_open_table().
        Added MERGE children to the list of unusable tables in open_table().
        Added MERGE table handling to reopen_table().
        Added lock handling and closing of a parent before the children
        in close_data_files_and_morph_locks().
        Added code for re-attaching children in reopen_tables().
        Added MYSQL_LOCK_NOTIFY_IF_NEED_REOPEN to the locking flags and
        error reporting after mysql_lock_tables() in reopen_tables().
        Added lock handling and closing of a parent before the children
        in close_old_data_files().
        Added lock handling and detaching in drop_locked_tables().
        Added code for removing the children list from the statement list
        to prepare for a repetition in open_tables().
        Added new function open_n_lock_single_table(), which can be used
        as an replacement for open_ltable() in most situations. Internally
        it calls simple_open_n_lock_tables() so hat it is appropriate for
        MERGE tables.
        Disabled use of open_ltable() for MERGE tables.
        Removed function simple_open_n_lock_tables(). It is now inline
        declared in mysql_priv.h.
        Renamed open_and_lock_tables() to open_and_lock_tables_derived()
        with additional parameter 'derived'. open_and_lock_tables() is now
        inline declared in mysql_priv.h.
        Added a check for end-of-list in two loops in lock_tables().
        Added 'thd' argument to init_tmp_table_share().
      sql/sql_insert.cc:
        Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
                    corrupts a MERGE table
        Changed from open_ltable() to open_n_lock_single_table() in
        handle_delayed_insert().
        Reestablished LEX settings after lex initialization.
        Added 'thd' argument to init_tmp_table_share().
      sql/sql_parse.cc:
        Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
                    corrupts a MERGE table
        Made check_merge_table_access() a static function.
        Disabled use of CREATE...SELECT for MERGE tables.
      sql/sql_partition.cc:
        Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
                    corrupts a MERGE table
        Fixed comment typo.
      sql/sql_select.cc:
        Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
                    corrupts a MERGE table
        Added 'thd' argument to init_tmp_table_share().
      sql/sql_table.cc:
        Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
                    corrupts a MERGE table
        Optimized use of mysql_ha_flush() in mysql_rm_table_part2().
        Disabled the use of MERGE tables with prepare_for_restore() and
        prepare_for_repair().
        Changed from open_ltable() to open_n_lock_single_table() in
        mysql_alter_table() and mysql_checksum_table().
        Disabled change of child list under LOCK TABLES.
        Initialized table_list->table in mysql_recreate_table().
      sql/sql_trigger.cc:
        Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
                    corrupts a MERGE table
        Added code for allowing CREATE TRIGGER under LOCK TABLE, to be able
        to test it with MERGE tables.
      sql/table.cc:
        Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
                    corrupts a MERGE table
        Added 'thd' argument to init_tmp_table_share().
        Setting table_map_id from query_id in init_tmp_table_share().
        Added member function TABLE::is_children_attached().
      sql/table.h:
        Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
                    corrupts a MERGE table
        Added access method get_table_def_version() to TABLE_SHARE.
        Added elements for MERGE tables to TABLE and TABLE_LIST.
      storage/myisam/ha_myisam.cc:
        Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
                    corrupts a MERGE table
        Added an unrelated comment to the function comment of table2myisam().
      storage/myisam/ha_myisam.h:
        Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
                    corrupts a MERGE table
        Added new member function MI_INFO::file_ptr().
      storage/myisammrg/ha_myisammrg.cc:
        Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
                    corrupts a MERGE table
        Added callback functions to support parent open and children attach
        of MERGE tables.
        Changed ha_myisammrg::open() to initialize storage engine structures
        and create a list of child tables only. Child tables are not opened.
        Added ha_myisammrg::attach_children(), which does now the main part
        of MERGE open.
        Added ha_myisammrg::detach_children().
        Added calls to ::attach_children() and ::detach_children() to
        ::extra() on HA_EXTRA_ATTACH_CHILDREN and HA_EXTRA_DETACH_CHILDREN
        respectively.
        Added a check for matching TEMPORARY type for children against
        parent.
        Added a check for table def version.
        Added support for thd->open_options to attach_children().
        Changed child path name generation for temporary tables so that
        it does nothing special for temporary tables.
      storage/myisammrg/ha_myisammrg.h:
        Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
                    corrupts a MERGE table
        Added elements to class ha_myisammrg to support the new
        open approach.
        Changed empty destructor definition to a declaration.
        Implemented in ha_myisammrg.cc.
        Added declaration for methods attach_children() and
        detach_children().
        Added definition for method table_ptr() for use with
        callback functions.
      storage/myisammrg/myrg_close.c:
        Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
                    corrupts a MERGE table
        Added a check to avoid closing of MyISAM tables when the
        child tables are not attached.
        Added freeing of rec_per_key_part when the child tables
        are not attached.
      storage/myisammrg/myrg_extra.c:
        Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
                    corrupts a MERGE table
        Some ::extra() functions and ::reset() can be called when
        children are detached.
      storage/myisammrg/myrg_open.c:
        Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
                    corrupts a MERGE table
        
        Kept old myrg_open() for MERGE use independent from MySQL.
        Removed an always true condition in myrg_open().
        Set children_attached for independent MERGE use in myrg_open().
        
        Added myrg_parent_open(), myrg_attach_children(), and
        myrg_detach_children() for the new MERGE table open approach.
      mysql-test/r/merge-big.result:
        Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE corrupts a MERGE table
        New test result
      mysql-test/t/merge-big.test:
        Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE corrupts a MERGE table
        New test case
      c8450b27
  21. 05 Nov, 2007 1 commit
    • unknown's avatar
      Bug#31210 - INSERT DELAYED crashes server when used on · e5b2745e
      unknown authored
                  partitioned table
      
      Trying INSERT DELAYED on a partitioned table, that has not been
      used right before, crashes the server. When a table is used for
      select or update, it is kept open for some time. This period I
      mean with "right before".
      
      Information about partitioning of a table is stored in form of
      a string in the .frm file. Parsing of this string requires a
      correctly set up lexical analyzer (lex). The partitioning code
      uses a new temporary instance of a lex. But it does still refer
      to the previously active lex. The delayd insert thread does not
      initialize its lex though...
      
      Added initialization for thd->lex before open table in the delayed
      thread and at all other places where it is necessary to call
      lex_start() if all tables would be partitioned and need to parse
      the .frm file.
      
      
      mysql-test/r/partition_hash.result:
        Bug#31210 - INSERT DELAYED crashes server when used on
                    partitioned table
        Added test result
      mysql-test/t/partition_hash.test:
        Bug#31210 - INSERT DELAYED crashes server when used on
                    partitioned table
        Added test
      sql/event_scheduler.cc:
        Bug#31210 - INSERT DELAYED crashes server when used on
                    partitioned table
        Initialized lex for later use in open_table().
      sql/events.cc:
        Bug#31210 - INSERT DELAYED crashes server when used on
                    partitioned table
        Initialized lex for later use in open_table().
      sql/ha_ndbcluster_binlog.cc:
        Bug#31210 - INSERT DELAYED crashes server when used on
                    partitioned table
        Initialized lex for later use in open_table().
      sql/slave.cc:
        Bug#31210 - INSERT DELAYED crashes server when used on
                    partitioned table
        Initialized lex for later use in open_table().
      sql/sql_acl.cc:
        Bug#31210 - INSERT DELAYED crashes server when used on
                    partitioned table
        Initialized lex for later use in open_table().
      sql/sql_base.cc:
        Bug#31210 - INSERT DELAYED crashes server when used on
                    partitioned table
        Asserted that lex is initialized in open_table().
      sql/sql_connect.cc:
        Bug#31210 - INSERT DELAYED crashes server when used on
                    partitioned table
        Initialized lex for later use in open_table().
      sql/sql_insert.cc:
        Bug#31210 - INSERT DELAYED crashes server when used on
                    partitioned table
        Added initialization for thd->lex before open table.
      sql/sql_lex.cc:
        Bug#31210 - INSERT DELAYED crashes server when used on
                    partitioned table
        Added 'is_lex_started' to test if lex is initialized.
      sql/sql_lex.h:
        Bug#31210 - INSERT DELAYED crashes server when used on
                    partitioned table
        Added 'is_lex_started' to test if lex is initialized.
      sql/sql_plugin.cc:
        Bug#31210 - INSERT DELAYED crashes server when used on
                    partitioned table
        Initialized lex for later use in open_table().
      sql/sql_servers.cc:
        Bug#31210 - INSERT DELAYED crashes server when used on
                    partitioned table
        Initialized lex for later use in open_table().
      sql/sql_udf.cc:
        Bug#31210 - INSERT DELAYED crashes server when used on
                    partitioned table
        Initialized lex for later use in open_table().
      sql/table.cc:
        Bug#31210 - INSERT DELAYED crashes server when used on
                    partitioned table
        Asserted that lex is initialized in open_table_from_share().
      sql/tztime.cc:
        Bug#31210 - INSERT DELAYED crashes server when used on
                    partitioned table
        Initialized lex for later use in open_table().
      e5b2745e
  22. 01 Nov, 2007 1 commit
    • unknown's avatar
      Bug#30882 Dropping a temporary table inside a stored function may cause a server crash · 611dbd0b
      unknown authored
      If a stored function that contains a drop temporary table statement
      is invoked by a create temporary table of the same name may cause
      a server crash. The problem is that when dropping a table no check
      is done to ensure that table is not being used by some outer query
      (or outer statement), potentially leaving the outer query with a
      reference to a stale (freed) table.
      
      The solution is when dropping a temporary table, always check if
      the table is being used by some outer statement as a temporary
      table can be dropped inside stored procedures.
      
      The check is performed by looking at the TABLE::query_id value for
      temporary tables. To simplify this check and to solve a bug related
      to handling of temporary tables in prelocked mode, this patch changes
      the way in which this member is used to track the fact that table is
      used/unused. Now we ensure that TABLE::query_id is zero for unused
      temporary tables (which means that all temporary tables which were
      used by a statement should be marked as free for reuse after it's
      execution has been completed).
      
      
      mysql-test/include/handler.inc:
        Add test case for side effect of Bug#30882
      mysql-test/r/handler_innodb.result:
        Add test case result for side effect of Bug#30882
      mysql-test/r/handler_myisam.result:
        Add test case result for side effect of Bug#30882
      mysql-test/r/sp-error.result:
        Add test case result for Bug#30882
      mysql-test/t/sp-error.test:
        Add test case for Bug#30882
      sql/event_db_repository.cc:
        Update close_thread_tables call, no more default values.
      sql/mysql_priv.h:
        Remove implicit default parameters values of the close_thread_tables
        function as no callers are using it.
      sql/slave.cc:
        Update close_thread_tables call, no more default values
      sql/sp_head.cc:
        Update close_thread_tables call, no more default values
      sql/sql_base.cc:
        Changed the approach to distinguishing currently unused temporary tables.
        Now we ensure that such tables always have TABLE::query_id set to 0 and
        use this fact to perform checks during opening and dropping of temporary
        tables. This means that we have to call close_thread_tables() even for
        statements which use only temporary tables. To make this call cheaper,
        we re-factored close_thread_tables() to not take LOCK_open unless there
        are open base tables.
      sql/sql_handler.cc:
        Properly close temporary tables associated with a handler.
      sql/sql_insert.cc:
        close_temporary_table is now merged into drop_temporary_table.
      sql/sql_parse.cc:
        Now the condition doesn't cover all cases because close_thread_tables()
        must be called even for statements that use only temporary tables.
      sql/sql_table.cc:
        Use drop_temporary_table which perform checks to verify if
        the table is not being used. Error path problem is due to
        a handler tables issue and is going to be addressed in bug
        31397.
      sql/table.h:
        Rename previously unused clear_query_id and document the usage of
        query_id and open_by_handler.
      611dbd0b
  23. 30 Oct, 2007 2 commits
    • unknown's avatar
      manual merge · fcff3b5a
      unknown authored
      BitKeeper/deleted/.del-rpl_slave_skip-slave.opt:
        Delete: mysql-test/t/rpl_slave_skip-slave.opt
      BitKeeper/deleted/.del-rpl_slave_skip.test:
        Delete: mysql-test/t/rpl_slave_skip.test
      BitKeeper/deleted/.del-rpl_slave_skip.result:
        Delete: mysql-test/r/rpl_slave_skip.result
      fcff3b5a
    • unknown's avatar
      Manual merge 5.0-rpl -> 5.1-rpl. · 356bdcb7
      unknown authored
      involved bug#12691, bug#27571
      
      
      mysql-test/suite/rpl/r/rpl_sp_effects.result:
        results changed
      sql/slave.cc:
        pended manual merge done (mats)
      sql/sql_delete.cc:
        manual merge
      sql/sql_insert.cc:
        manual merge
      sql/sql_load.cc:
        manual merge
      sql/sql_update.cc:
        manual merge.
      356bdcb7
  24. 26 Oct, 2007 1 commit
    • unknown's avatar
      BUG#12691 (Exec_master_log_pos corrupted with SQL_SLAVE_SKIP_COUNTER): · f01321fd
      unknown authored
        
      Adding code to keep skipping events while inside a transaction. Execution
      will start just after the transaction has been skipped.
      
      
      sql/slave.cc:
        Adding code to set the thd->options flag for the slave SQL thread
        even when BEGIN, ROLLBACK, COMMIT, and XID events are being skipped.
            
        Adding code to not decrease the slave skip counter from 1 to 0 if we
        are inside a transaction. This will keep the counter at 1, and keep
        skipping events, until a transaction terminator is read. At that point,
        the slave skip counter will be decreased to 0, and events will be read
        and executed instead of read and skipped.
      mysql-test/r/rpl_slave_skip.result:
        New BitKeeper file ``mysql-test/r/rpl_slave_skip.result''
      mysql-test/t/rpl_slave_skip-slave.opt:
        New BitKeeper file ``mysql-test/t/rpl_slave_skip-slave.opt''
      mysql-test/t/rpl_slave_skip.test:
        New BitKeeper file ``mysql-test/t/rpl_slave_skip.test''
      f01321fd
  25. 20 Oct, 2007 1 commit
    • unknown's avatar
      BUG#24860 (Incorrect SLAVE_TRANSACTION_RETRIES code can result in slave stuck): · 219e6a64
      unknown authored
      If a temporary error occured inside a group on an event that was not the first
      event of the group, the slave could get stuck because the retry counter is reset
      whenever an event was executed successfully.
      
      This patch only reset the retry counter when an entire group has been successfully
      executed, or failed with a non-transient error.
      
      
      sql/slave.cc:
        Adding debug printouts to every place where Relay_log_info::trans_retries
        is changed and to has_temporary_error() to print the error when returning.
        
        Adding debug variable all_errors_are_temporary_errors to make all errors
        for slave thread temporary errors.
        
        Adding code so that the Relay_log_info::trans_retries is only reset when
        an entire group was sucessfully executed, or a non-temporary error occured.
      mysql-test/suite/rpl/r/rpl_temporary_errors.result:
        New BitKeeper file ``mysql-test/suite/rpl/r/rpl_temporary_errors.result''
      mysql-test/suite/rpl/t/rpl_temporary_errors-slave.opt:
        New BitKeeper file ``mysql-test/suite/rpl/t/rpl_temporary_errors-slave.opt''
      mysql-test/suite/rpl/t/rpl_temporary_errors.test:
        New BitKeeper file ``mysql-test/suite/rpl/t/rpl_temporary_errors.test''
      219e6a64
  26. 19 Oct, 2007 2 commits
    • unknown's avatar
      Rename: query_error -> is_slave_error. · 079ae230
      unknown authored
      Add comments.
      
      
      sql/ha_ndbcluster_binlog.cc:
        query_error -> slave_error
      sql/handler.cc:
        query_error -> slave_error
      sql/log.cc:
        query_error -> slave_error
      sql/log_event.cc:
        query_error -> slave_error
      sql/log_event_old.cc:
        query_error -> slave_error
      sql/mysqld.cc:
        query_error -> slave_error
      sql/protocol.cc:
        query_error -> slave_error
      sql/slave.cc:
        query_error -> slave_error
      sql/sp_head.cc:
        query_error -> slave_error
      sql/sql_class.cc:
        query_error -> slave_error
      sql/sql_class.h:
        Rename: query_error -> is_slave_error, to avoid confusion.
        Add commenta.
      sql/sql_connect.cc:
        Rename: query_error -> is_slave_error, to avoid confusion.
        Originally it was the same code to handle init-connect and init-slave 
        mysqld options. Then init-connect implementation forked off,
        but the one who copy-pasted the code didn't change it to not
        use a replication-specific variable.
      079ae230
    • unknown's avatar
      BUG#28618 (Skipping into the middle of a group with SQL_SLAVE_SKIP_COUNTER · 74ef292d
      unknown authored
      is possible):
      
      When skipping the beginning of a transaction starting with BEGIN, the OPTION_BEGIN
      flag was not set correctly, which caused the slave to not recognize that it was
      inside a group. This patch sets the OPTION_BEGIN flag for BEGIN, COMMIT, ROLLBACK,
      and XID events. It also adds checks if inside a group before decreasing the
      slave skip counter to zero.
      
      Begin_query_log_event was not marked that it could not end a group, which is now
      corrected.
      
      
      mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test:
        Correcting slave skip counter to get the correct behaviour.
      mysql-test/suite/rpl/r/rpl_slave_skip.result:
        Result change.
      mysql-test/suite/rpl/t/rpl_slave_skip.test:
        Adding tests to check that skipping works for transactions:
        - Skipping one group with BEGIN first
        - Skipping two groups with BEGIN first
        - Skipping one group without BEGIN first but with AUTOCOMMIT=0
        - LOAD DATA INFILE under statement-based replication
      mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result:
        Result change.
      sql/log_event.cc:
        Adding checks if we're in a group when the slave skip counter is 1.
        In that case, we should keep going.
        
        Adding helping member function Log_event::continue_group() denoting
        that this event cannot end a group, and if the skip counter indicates
        that the group ends after this event, it should not decrease the skip
        counter.
        
        Query_log_event will change the OPTION_BEGIN flag for BEGIN, COMMIT, and
        ROLLBACK, even when skipping because of a positive skip count, and
        Xid_log_event will also affect the OPTION_BEGIN flag, even when being
        skipped.
        
        Begin_load_query_log_event cannot end a group, so it is marked to
        continue the group.
      sql/log_event.h:
        Adding helper function Log_event::continue_group().
      sql/rpl_rli.h:
        Adding Relay_log_info::get_flag() to get the value of a
        replication flag.
      sql/slave.cc:
        Adding debug output and changing debug message.
      mysql-test/suite/rpl/data/rpl_bug28618.dat:
        New BitKeeper file ``mysql-test/suite/rpl/data/rpl_bug28618.dat''
      mysql-test/suite/rpl/t/rpl_slave_skip-slave.opt:
        New BitKeeper file ``mysql-test/suite/rpl/t/rpl_slave_skip-slave.opt''
      74ef292d
  27. 04 Oct, 2007 1 commit
    • unknown's avatar
      Bug #29309 Incorrect "Seconds_Behind_Master" value in SHOW SLAVE STATUS after FLUSH LOGS · bf8a85aa
      unknown authored
      Report claims that Seconds_behind_master behaves unexpectedly. 
      
      Code analysis shows that there is an evident flaw in that treating of FormatDescription event is wrong
      so  that after FLUSH LOGS on slave the Seconds_behind_master's calculation slips and incorrect
      value can be reported to SHOW SLAVE STATUS. 
      Even worse is that the gap between the correct and incorrect deltas grows with time.
      
      Fixed with prohibiting changes to rpl->last_master_timestamp by artifical events (any kind of).
      suggestion as comments is added how to fight with lack of info on the slave side by means of
      new heartbeat feature coming.
      
      The test can not be done ealily fully determistic.
      
      
      sql/log_event.cc:
        changing timestamp is affirmed only by non-artificial events. Artifical FD won't change it anymore.
        The simulation code is off unless server is started with the args from the opt-file.
        The simulation code assumes that it will execute specific schedule generated by rpl_replication_delay.test.
      sql/slave.cc:
        Comments are changed to announce a new possibility to cope with
        Seconds_behind_master jumping due to EOF special treatment (reset of the timestamp)
      mysql-test/suite/manual/r/rpl_replication_delay.result:
        result are not deterministic though there are comments saying the most probable expected
        value for Seconds_behind_master
      mysql-test/suite/manual/t/rpl_replication_delay-slave.opt:
        bug emulation
      mysql-test/suite/manual/t/rpl_replication_delay.test:
        specic test for bug#29309. It's hard to make it reliable as it deals with timestamps.
        (a way to automate the test like this is to have I_S table for show slave status' fields)
        
        A possible way to check results is to run
        grep -i 'show\|seconds' < suite/manual/r/rpl_replication_delay.reject and to get the lines like these:
        
        show slave status /* Second_behind reports 0 */;;
        Seconds_Behind_Master   0
        show slave status /* bug emulated: reports slave threads starting time about 3*3 not 3 secs */;;
        Seconds_Behind_Master   9
        show slave status /* reports the correct diff with master query time about 3+3 secs */;;
        Seconds_Behind_Master   6
        
        Due to time discreteness of time the reported numbers may slightly vary. That's why the test is not reliable.
      bf8a85aa
  28. 29 Aug, 2007 1 commit
    • unknown's avatar
      BUG#29968 (rpl_ndb_circular.test and rpl_ndb_log.test fail): · e5c8240a
      unknown authored
      Removing unguarded read of slave_running field from inside
      terminate_slave_threads(). This could cause premature exit in the event
      that the slave thread already were shutting down, but isn't finished yet.
      
      The fields slave_running, io_thd, and sql_thread are guarded by an
      associated run_lock. A read of these fields were not guarded inside
      terminate_slave_threads(), which caused an assertion to fire. The
      assertion was removed, and the code reorganized slightly.
      
      
      sql/slave.cc:
        Changing signature of terminate_slave_thread() to accept a skip_lock
        parameter instead of two mutexes. This mimics the signature of the
        terminate_slave_threads() function. Code is also changed as a result
        of this.
        
        Removing unguarded check of slave_running field in the master info and
        relay log info structure since that could cause premature exit of
        terminate_slave_threads().
        
        The thread variable for each of the slave threads can change before
        acquiring the run_lock mutex inside terminate_slave_thread(). Hence
        an assertion was removed that read the variable without guarding it
        with run_lock.
        
        Code that checked *slave_running status inside terminate_slave_thread()
        was reorganized slightly.
      sql/slave.h:
        Moving terminate_slave_thread() to use internal linkage.
      e5c8240a
  29. 16 Aug, 2007 2 commits
    • unknown's avatar
      Renaming MASTER_INFO to Master_info in order to follow the coding · 9a7658a3
      unknown authored
      standards (and help Doxygen generating good documentation).
      
      
      sql/ha_ndbcluster.cc:
        Renaming MASTER_INFO to Master_info.
      sql/log_event.cc:
        Renaming MASTER_INFO to Master_info.
      sql/repl_failsafe.cc:
        Renaming MASTER_INFO to Master_info.
      sql/repl_failsafe.h:
        Renaming MASTER_INFO to Master_info.
      sql/rpl_mi.cc:
        Renaming MASTER_INFO to Master_info.
      sql/rpl_mi.h:
        Renaming MASTER_INFO to Master_info.
      sql/rpl_rli.h:
        Renaming MASTER_INFO to Master_info.
      sql/slave.cc:
        Renaming MASTER_INFO to Master_info.
      sql/slave.h:
        Renaming MASTER_INFO to Master_info.
      sql/sql_repl.cc:
        Renaming MASTER_INFO to Master_info.
      sql/sql_repl.h:
        Renaming MASTER_INFO to Master_info.
      9a7658a3
    • unknown's avatar
      Renaming RELAY_LOG_INFO and st_relay_log_info to follow coding standards · 044a4a3e
      unknown authored
      (and be more friendly to Doxygen by removing unnecessary typedefs).
      
      
      sql/log.cc:
        Renaming struct st_relay_log_info to class Relay_log_info.
      sql/log.h:
        Renaming struct st_relay_log_info to class Relay_log_info.
      sql/log_event.cc:
        Renaming RELAY_LOG_INFO to Relay_log_info.
      sql/log_event.h:
        Renaming struct st_relay_log_info to class Relay_log_info.
        Renaming RELAY_LOG_INFO to Relay_log_info.
        Removing typedef RELAY_LOG_INFO.
      sql/log_event_old.cc:
        Renaming RELAY_LOG_INFO to Relay_log_info.
      sql/log_event_old.h:
        Renaming RELAY_LOG_INFO to Relay_log_info.
      sql/rpl_mi.h:
        Renaming RELAY_LOG_INFO to Relay_log_info.
      sql/rpl_record.cc:
        Renaming RELAY_LOG_INFO to Relay_log_info.
      sql/rpl_record.h:
        Renaming RELAY_LOG_INFO to Relay_log_info.
      sql/rpl_record_old.cc:
        Renaming RELAY_LOG_INFO to Relay_log_info.
      sql/rpl_record_old.h:
        Renaming RELAY_LOG_INFO to Relay_log_info.
      sql/rpl_rli.cc:
        Renaming struct st_relay_log_info to class Relay_log_info.
        Renaming RELAY_LOG_INFO to Relay_log_info.
      sql/rpl_rli.h:
        Renaming struct st_relay_log_info to class Relay_log_info.
        Renaming RELAY_LOG_INFO to Relay_log_info.
        Removing typedef RELAY_LOG_INFO.
      sql/rpl_utility.cc:
        Renaming RELAY_LOG_INFO to Relay_log_info.
      sql/rpl_utility.h:
        Renaming struct st_relay_log_info to class Relay_log_info.
        Renaming RELAY_LOG_INFO to Relay_log_info.
        Removing typedef RELAY_LOG_INFO.
      sql/slave.cc:
        Renaming RELAY_LOG_INFO to Relay_log_info.
      sql/slave.h:
        Renaming struct st_relay_log_info to class Relay_log_info.
        Renaming RELAY_LOG_INFO to Relay_log_info.
        Removing typedef RELAY_LOG_INFO.
      sql/sql_binlog.cc:
        Renaming RELAY_LOG_INFO to Relay_log_info.
      sql/sql_class.h:
        Renaming struct st_relay_log_info to class Relay_log_info.
        Renaming RELAY_LOG_INFO to Relay_log_info.
        Removing typedef RELAY_LOG_INFO.
      sql/sql_repl.cc:
        Renaming RELAY_LOG_INFO to Relay_log_info.
      044a4a3e
  30. 30 Jul, 2007 1 commit
    • unknown's avatar
      Slow query log to file now displays queries with microsecond precission · b59217eb
      unknown authored
      --long-query-time is now given in seconds with microseconds as decimals
      --min_examined_row_limit added for slow query log
      long_query_time user variable is now double with 6 decimals
      Added functions to get time in microseconds
      Added faster time() functions for system that has gethrtime()  (Solaris)
      We now do less time() calls.
      Added field->in_read_set() and field->in_write_set() for easier field manipulation by handlers
      set_var.cc and my_getopt() can now handle DOUBLE variables.
      All time() calls changed to my_time()
      my_time() now does retry's if time() call fails.
      Added debug function for stopping in mysql_admin_table() when tables are locked
      Some trivial function and struct variable renames to avoid merge errors.
      Fixed compiler warnings
      Initialization of some time variables on windows moved to my_init() 
      
      
      include/my_getopt.h:
        Added support for double arguments
      include/my_sys.h:
        Fixed wrong type to packfrm()
        Added new my_time functions
      include/mysql/plugin.h:
        Added support for DOUBLE
      libmysql/CMakeLists.txt:
        Added new time functions
      libmysql/Makefile.shared:
        Added new time functions
      mysql-test/r/variables.result:
        Testing of long_query_time
      mysql-test/t/variables.test:
        Testing of long_query_time
      mysys/charset.c:
        Fixed compiler warnings
      mysys/default_modify.c:
        Fixed compiler warnings
      mysys/hash.c:
        Fixed compiler warnings
      mysys/mf_getdate.c:
        Use my_time()
      mysys/mf_iocache2.c:
        Fixed compiler warnings
      mysys/mf_pack.c:
        Fixed compiler warnings
      mysys/mf_path.c:
        Fixed compiler warnings
      mysys/my_append.c:
        Fixed compiler warnings
      mysys/my_compress.c:
        Fixed compiler warnings
      mysys/my_copy.c:
        Fixed compiler warnings
      mysys/my_gethwaddr.c:
        Fixed compiler warnings
      mysys/my_getopt.c:
        Added support for double arguments
      mysys/my_getsystime.c:
        Added functions to get time in microseconds.
        Added faster time() functions for system that has gethrtime()  (Solaris)
        Moved windows initialization code to my_init()
      mysys/my_init.c:
        Added initializing of variables needed for windows time functions
      mysys/my_static.c:
        Added variables needed for windows time functions
      mysys/my_static.h:
        Added variables needed for windows time functions
      mysys/my_thr_init.c:
        Added THR_LOCK_time, used for faster my_time()
      mysys/mysys_priv.h:
        Added THR_LOCK_time, used for faster my_time()
      mysys/thr_alarm.c:
        time() -> my_time()
      sql/event_data_objects.cc:
        end_time() -> set_current_time()
      sql/event_queue.cc:
        end_time() -> set_current_time()
      sql/event_scheduler.cc:
        Fixed compiler warnings
      sql/field.h:
        Added field->in_read_set() and field->in_write_set() for easier field manipulation by handlers
      sql/item.h:
        Added decimal to Item_float(double)
      sql/item_cmpfunc.h:
        Added decimal to Item_float(double)
      sql/item_timefunc.cc:
        time() -> my_time()
      sql/item_xmlfunc.cc:
        Fixed compiler warning
      sql/lock.cc:
        lock_time() -> set_time_after_lock()
      sql/log.cc:
        Timing in slow query log to file is now done in microseconds
        Changed some while() loops to for() loops.
        Fixed indentation
        time() -> my_time()
      sql/log.h:
        Slow query logging is now done based on microseconds
      sql/log_event.cc:
        time() -> my_time()
        Fixed arguments to new Item_float()
      sql/mysql_priv.h:
        Fixed compiler warnings
        Added opt_log_slow_slave_statements
      sql/mysqld.cc:
        Added --log_slow_slave_statements and --min_examined_row_limit
        --long-query-time now takes a double argument with microsecond resolution
        Don't write shutdown message when using --help
        Removed not needed \n
        Thread create time and connect time is now done in microseconds
        time() -> my_time()
        Avoid some time() calls
      sql/net_serv.cc:
        Fixed compiler warnings
      sql/parse_file.cc:
        time() -> my_time()
      sql/set_var.cc:
        Added support for DOUBLE variables
        Added support for variables that are given in seconds with microsecond resolution
      sql/set_var.h:
        Added support for variables that are given in seconds with microsecond resolution
      sql/slave.cc:
        Allow logging of slave queries to slow query log if 'opt_log_slow_slave_statements' is given
        time() -> my_time()
      sql/sql_cache.h:
        Fixed compiler warning()
      sql/sql_class.cc:
        Initialize new THD variables
      sql/sql_class.h:
        long_query_time is now in microseconds
        Added min_examined_row_limit
        Reordered some THD elements for higher efficency
        Added timers in microseconds (connect_utime, thr_create_utime, start_utime and utime_after_lock)
        Start of query is now recorded both in seconds and in microseconds.
        Following renames was made for more clarity and avoid merge problems from earlier versions:
        connect_time -> connect_utime
        thr_create_time -> thr_create_utime
        end_time()  -> set_current_time()
        lock_time() -> set_time_after_lock()
        
        Added THD::start_utime, which is start of query in microseconds from some arbitary time
        Added function THD::current_utime()
        
        Removed safe_time() as retry's are handled in my_time()
      sql/sql_connect.cc:
        User resources are now using microsecond resolution
      sql/sql_insert.cc:
        end_time() -> set_current_time()
      sql-common/client.c:
        time() -> my_time()
      sql/sql_parse.cc:
        Testing if we should print to slow_query_log() is now done with microsecond precission.
        If min_examined_row_limit is given, only log queries to slow query log that has examined more rows than this.
      sql/sql_select.cc:
        Simplify code now that Item_float() takes decimals as argument
      sql/sql_show.cc:
        time() -> my_time()
        Added support for SYS_DOUBLE
      sql/sql_table.cc:
        Added debug function for stopping in mysql_admin_table() when tables are locked
      sql/structs.h:
        intime -> reset_utime
      b59217eb
  31. 27 Jul, 2007 1 commit
    • unknown's avatar
      WL#3984 (Revise locking of mysql.general_log and mysql.slow_log) · 4462578a
      unknown authored
      Bug#25422 (Hang with log tables)
      Bug 17876 (Truncating mysql.slow_log in a SP after using cursor locks the
                thread)
      Bug 23044 (Warnings on flush of a log table)
      Bug 29129 (Resetting general_log while the GLOBAL READ LOCK is set causes
                 a deadlock)
      
      Prior to this fix, the server would hang when performing concurrent
      ALTER TABLE or TRUNCATE TABLE statements against the LOG TABLES,
      which are mysql.general_log and mysql.slow_log.
      
      The root cause traces to the following code:
      in sql_base.cc, open_table()
        if (table->in_use != thd)
        {
          /* wait_for_condition will unlock LOCK_open for us */
          wait_for_condition(thd, &LOCK_open, &COND_refresh);
        }
      The problem with this code is that the current implementation of the
      LOGGER creates 'fake' THD objects, like
      - Log_to_csv_event_handler::general_log_thd
      - Log_to_csv_event_handler::slow_log_thd
      which are not associated to a real thread running in the server,
      so that waiting for these non-existing threads to release table locks
      cause the dead lock.
      
      In general, the design of Log_to_csv_event_handler does not fit into the
      general architecture of the server, so that the concept of general_log_thd
      and slow_log_thd has to be abandoned:
      - this implementation does not work with table locking
      - it will not work with commands like SHOW PROCESSLIST
      - having the log tables always opened does not integrate well with DDL
      operations / FLUSH TABLES / SET GLOBAL READ_ONLY
      
      With this patch, the fundamental design of the LOGGER has been changed to:
      - always open and close a log table when writing a log
      - remove totally the usage of fake THD objects
      - clarify how locking of log tables is implemented in general.
      
      See WL#3984 for details related to the new locking design.
      
      Additional changes (misc bugs exposed and fixed):
      
      1)
      
      mysqldump which would ignore some tables in dump_all_tables_in_db(),
       but forget to ignore the same in dump_all_views_in_db().
      
      2)
      
      mysqldump would also issue an empty "LOCK TABLE" command when all the tables
      to lock are to be ignored (numrows == 0), instead of not issuing the query.
      
      3)
      
      Internal errors handlers could intercept errors but not warnings
      (see sql_error.cc).
      
      4)
      
      Implementing a nested call to open tables, for the performance schema tables,
      exposed an existing bug in remove_table_from_cache(), which would perform:
        in_use->some_tables_deleted=1;
      against another thread, without any consideration about thread locking.
      This call inside remove_table_from_cache() was not required anyway,
      since calling mysql_lock_abort() takes care of aborting -- cleanly -- threads
      that might hold a lock on a table.
      This line (in_use->some_tables_deleted=1) has been removed.
      
      
      sql/handler.cc:
        Moved logic for system / log tables in the SQL layer.
      sql/handler.h:
        Moved logic for system / log tables in the SQL layer.
      sql/lock.cc:
        Revised locking of log tables
      sql/log.cc:
        Major cleanup: changed how log tables are locked / written to.
      sql/log.h:
        Major cleanup: changed how log tables are locked / written to.
      sql/mysql_priv.h:
        performance schema helpers
      sql/slave.cc:
        open_ltable() lock flags
      sql/sp.cc:
        open_ltable() lock flags
      sql/sql_acl.cc:
        open_ltable() lock flags
      sql/sql_class.h:
        performance schema helpers
      sql/sql_delete.cc:
        log tables cleanup in TRUNCATE
      sql/sql_error.cc:
        Internal handlers can also intercept warnings
      sql/sql_insert.cc:
        open_ltable() lock flags
      sql/sql_parse.cc:
        performance schema helpers
      sql/sql_plugin.cc:
        open_ltable() lock flags
      sql/sql_rename.cc:
        log tables cleanup in RENAME
      sql/sql_servers.cc:
        open_ltable() lock flags
      sql/sql_show.cc:
        Move INFORMATION_SCHEMA_NAME to table.cc
      sql/sql_table.cc:
        log tables cleanup (admin operations, ALTER TABLE)
      sql/sql_udf.cc:
        open_ltable() lock flags
      sql/table.cc:
        Implemented TABLE_CATEGORY.
      sql/share/errmsg.txt:
        Changed the wording and name of ER_CANT_READ_LOCK_LOG_TABLE
      sql/table.h:
        Implemented TABLE_CATEGORY.
      storage/csv/ha_tina.cc:
        Moved logic for system / log tables in the SQL layer.
      storage/csv/ha_tina.h:
        Moved logic for system / log tables in the SQL layer.
      storage/myisam/ha_myisam.cc:
        Moved logic for system / log tables in the SQL layer.
      storage/myisam/ha_myisam.h:
        Moved logic for system / log tables in the SQL layer.
      client/mysqldump.c:
        Don't lock tables in the ignore list.
        Don't issue empty LOCK TABLES queries.
      sql/sql_base.cc:
        log tables cleanup
        performance schema helpers
      mysql-test/r/ps.result:
        Adjust test results
      mysql-test/r/show_check.result:
        Adjust test results
      mysql-test/r/status.result:
        Adjust test results
      mysql-test/t/log_state.test:
        Added tests for Bug#29129
      mysql-test/t/ps.test:
        Make the test output deterministic
      mysql-test/t/show_check.test:
        Make the test output deterministic
      mysql-test/r/log_state.result:
        Changed the default location of the log output to LOG_FILE,
        for backward compatibility with MySQL 5.0
        ---
        Adjust test results
      mysql-test/r/log_tables.result:
        cleanup for -ps-protocol
      mysql-test/t/log_tables.test:
        cleanup for -ps-protocol
      sql/set_var.cc:
        Changed the default location of the log output to LOG_FILE,
        for backward compatibility with MySQL 5.0
        ---
        log tables cleanup
      4462578a
  32. 11 Jul, 2007 1 commit
    • unknown's avatar
      Fix for bug #24192 "MySQL replication does not exit server when running out of memory" · 8abc8b9d
      unknown authored
      In case of out-of-memory error received from the master, print the corresponding message to the error log and stop slave I/O thread to avoid reconnecting with a wrong binary log position.
      
      
      sql/slave.cc:
        In case of out-of-memory error received from the master, print the corresponding message to the error log and stop slave I/O thread to avoid reconnecting with a wrong binary log position.
      8abc8b9d
  33. 29 Jun, 2007 1 commit
    • unknown's avatar
      Fix for bug #19328: Slave timeout with COM_REGISTER_SLAVE error causing stop · 8aa59891
      unknown authored
      Problem: "Under high load, the slave registering to the master can timeout 
      during the COM_REGISTER_SLAVE execution. This causes an error, which 
      prevents the slave from connecting at all."
      
      Fix: Do not abort immediately, but retry registering on master.
      
      
      sql/slave.cc:
        Fix for bug #19328: Slave timeout with COM_REGISTER_SLAVE error causing stop
          - retry connecting after a failed slave registration on master.
            Reconnecting has been factored out (see try_to_reconnect() and 
            check_io_slave_killed()) to get rid of similar code used during 
            registering on master/dump requesting/event reading.
            All messages have been moved to reconnect_messages[] array 
            for easy usage and maintenance.
          - now one can force slave to reconnect using 
            ./mtr --mysqld=--loose-debug=d,FORCE_SLAVE_TO_RECONNECT_{REG, DUMP, EVENT}
      8aa59891
  34. 11 Jun, 2007 1 commit
    • unknown's avatar
      BUG#24954 (Last_errno and Last_error not set after master_retry_count has · abbf5941
      unknown authored
      been reached):
      
      Post-merge patch to handle all the changes to the tree since the tree
      was cloned.
      
      
      mysql-test/extra/rpl_tests/rpl_log.test:
        Replacing SHOW SLAVE STATUS with include file.
      mysql-test/extra/rpl_tests/rpl_max_relay_size.test:
        Replacing SHOW SLAVE STATUS with include file.
      mysql-test/extra/rpl_tests/rpl_reset_slave.test:
        Replacing SHOW SLAVE STATUS with include file.
      mysql-test/include/show_slave_status.inc:
        Column change.
      mysql-test/r/rpl_000015.result:
        Result file change.
      mysql-test/r/rpl_change_master.result:
        Result file change.
      mysql-test/r/rpl_empty_master_crash.result:
        Result file change.
      mysql-test/r/rpl_extraCol_innodb.result:
        Result file change.
      mysql-test/r/rpl_extraCol_myisam.result:
        Result file change.
      mysql-test/r/rpl_flushlog_loop.result:
        Result file change.
      mysql-test/r/rpl_incident.result:
        Result file change.
      mysql-test/r/rpl_known_bugs_detection.result:
        Result file change.
      mysql-test/r/rpl_loaddata.result:
        Result file change.
      mysql-test/r/rpl_loaddata_fatal.result:
        Result file change.
      mysql-test/r/rpl_log_pos.result:
        Result file change.
      mysql-test/r/rpl_ndb_basic.result:
        Result file change.
      mysql-test/r/rpl_ndb_circular.result:
        Result file change.
      mysql-test/r/rpl_ndb_extraCol.result:
        Result file change.
      mysql-test/r/rpl_ndb_idempotent.result:
        Result file change.
      mysql-test/r/rpl_ndb_log.result:
        Result file change.
      mysql-test/r/rpl_ndb_sync.result:
        Result file change.
      mysql-test/r/rpl_rbr_to_sbr.result:
        Result file change.
      mysql-test/r/rpl_redirect.result:
        Result file change.
      mysql-test/r/rpl_replicate_do.result:
        Result file change.
      mysql-test/r/rpl_rotate_logs.result:
        Result file change.
      mysql-test/r/rpl_row_inexist_tbl.result:
        Result file change.
      mysql-test/r/rpl_row_log.result:
        Result file change.
      mysql-test/r/rpl_row_log_innodb.result:
        Result file change.
      mysql-test/r/rpl_row_max_relay_size.result:
        Result file change.
      mysql-test/r/rpl_row_reset_slave.result:
        Result file change.
      mysql-test/r/rpl_row_tabledefs_2myisam.result:
        Result file change.
      mysql-test/r/rpl_row_tabledefs_3innodb.result:
        Result file change.
      mysql-test/r/rpl_row_until.result:
        Result file change.
      mysql-test/r/rpl_server_id1.result:
        Result file change.
      mysql-test/r/rpl_server_id2.result:
        Result file change.
      mysql-test/r/rpl_slave_skip.result:
        Result file change.
      mysql-test/r/rpl_ssl.result:
        Result file change.
      mysql-test/r/rpl_ssl1.result:
        Result file change.
      mysql-test/r/rpl_stm_log.result:
        Result file change.
      mysql-test/r/rpl_stm_max_relay_size.result:
        Result file change.
      mysql-test/r/rpl_stm_reset_slave.result:
        Result file change.
      mysql-test/r/rpl_stm_until.result:
        Result file change.
      mysql-test/t/rpl_000015.test:
        Replacing SHOW SLAVE STATUS with include file.
      mysql-test/t/rpl_change_master.test:
        Column position change.
        Making result of SHOW SLAVE STATUS vertical.
      mysql-test/t/rpl_empty_master_crash.test:
        Replacing SHOW SLAVE STATUS with include file.
      mysql-test/t/rpl_log_pos.test:
        Replacing SHOW SLAVE STATUS with include file.
      mysql-test/t/rpl_ndb_basic.test:
        Column position change.
      mysql-test/t/rpl_ndb_idempotent.test:
        Column position change.
      mysql-test/t/rpl_ndb_sync.test:
        Column position change.
        Making result of SHOW SLAVE STATUS vertical.
      mysql-test/t/rpl_redirect.test:
        Replacing SHOW SLAVE STATUS with include file.
      mysql-test/t/rpl_replicate_do.test:
        Column position change.
        Making result of SHOW SLAVE STATUS vertical.
      mysql-test/t/rpl_rotate_logs.test:
        Replacing SHOW SLAVE STATUS with include file.
      mysql-test/t/rpl_row_inexist_tbl.test:
        Replacing SHOW SLAVE STATUS with include file.
      mysql-test/t/rpl_row_until.test:
        Replacing SHOW SLAVE STATUS with include file.
      mysql-test/t/rpl_server_id1.test:
        Column position change.
        Making result of SHOW SLAVE STATUS vertical.
      mysql-test/t/rpl_server_id2.test:
        Column position change.
        Making result of SHOW SLAVE STATUS vertical.
      mysql-test/t/rpl_slave_status.test:
        Column position change.
      mysql-test/t/rpl_ssl.test:
        Column position change.
      mysql-test/t/rpl_ssl1.test:
        Column position change.
      mysql-test/t/rpl_stm_until.test:
        Replacing SHOW SLAVE STATUS with include file.
      sql/log_event.cc:
        Using member function last_error() instead of member variable.
        Replacing use of 'table' with 'm_table'.
        Suppressing warnings in debug printout.
        Setting thd->net.last_error on error return from unpack_row() to get
        a non-zero error message.  The error codes for are being harmonized
        in another worklog.
        Replacing use of slave_print_msg() with RELAY_LOG_INFO::report().
      sql/rpl_mi.h:
        Moving order of include files since they are dependent (!).
      sql/rpl_record.cc:
        Adding missing include file.
        Replacing use of slave_print_msg() with RELAY_LOG_INFO::report().
      sql/rpl_record_old.cc:
        Adding missing include file.
        Replacing use of slave_print_msg() with RELAY_LOG_INFO::report().
      sql/rpl_reporting.cc:
        Adding const modifier to member function.
        Using renamed member variable m_last_error.
      sql/rpl_reporting.h:
        Adding missing constant MAX_SLAVE_ERRMSG.
        Adding const modifier to Slave_reporting_capability::report().
        Hiding and renaming member variable last_error and incorporating
        member function for access in order to make it mutable.
      sql/rpl_rli.h:
        Moving constant MAX_SLAVE_ERRMSG.
      sql/rpl_utility.cc:
        Adding missing include file rpl_rli.h.
      sql/slave.cc:
        Replacing use of member variable last_error with call to member function
        last_error().
        Replacing use of slave_print_msg() with RELAY_LOG_INFO::report().
      abbf5941
  35. 09 Jun, 2007 1 commit
    • unknown's avatar
      BUG#24954 (Last_errno and Last_error not set after master_retry_count was reached): · 79a609aa
      unknown authored
      Adding new fields Last_{IO,SQL}_Errno and Last_{IO,SQL}_Error to output
      of SHOW SLAVE STATUS to hold errors from I/O and SQL thread respectively.
      Old fields Last_Error and Last_Errno are aliases for Last_SQL_Error and
      Last_SQL_Errno respectively.
      
      Fields are added last to output of SHOW SLAVE STATUS to allow old applications
      to use the same positional arguments into the row, while allowing new
      application to benefit from the added information.
      
      In addition, some new error codes are added (especially for the I/O
      thread) to be able to provide sensible error message.
      
      
      mysql-test/extra/rpl_tests/rpl_max_relay_size.test:
        Commenting out irrelevant fields Last_IO_Error and Last_IO_Errno
      mysql-test/r/binlog_row_mix_innodb_myisam.result:
        Result change
      mysql-test/r/rpl_000015.result:
        Result change
      mysql-test/r/rpl_change_master.result:
        Result change
      mysql-test/r/rpl_deadlock_innodb.result:
        Result change
      mysql-test/r/rpl_empty_master_crash.result:
        Result change
      mysql-test/r/rpl_extraCol_innodb.result:
        Result change
        ---
        Result change.
      mysql-test/r/rpl_extraCol_myisam.result:
        Result change
        ---
        Result change.
      mysql-test/r/rpl_flushlog_loop.result:
        Result change
      mysql-test/r/rpl_loaddata.result:
        Result change
      mysql-test/r/rpl_log_pos.result:
        Result change
      mysql-test/r/rpl_ndb_basic.result:
        Result change
      mysql-test/r/rpl_ndb_extraCol.result:
        Result change
        ---
        Result change.
      mysql-test/r/rpl_ndb_idempotent.result:
        Result change
      mysql-test/r/rpl_ndb_log.result:
        Result change
      mysql-test/r/rpl_openssl.result:
        Result change
      mysql-test/r/rpl_rbr_to_sbr.result:
        Result change
      mysql-test/r/rpl_redirect.result:
        Result change
      mysql-test/r/rpl_replicate_do.result:
        Result change
      mysql-test/r/rpl_rotate_logs.result:
        Result change
      mysql-test/r/rpl_row_inexist_tbl.result:
        Result change
      mysql-test/r/rpl_row_log.result:
        Result change
      mysql-test/r/rpl_row_log_innodb.result:
        Result change
      mysql-test/r/rpl_row_max_relay_size.result:
        Result change
      mysql-test/r/rpl_row_reset_slave.result:
        Result change
      mysql-test/r/rpl_row_tabledefs_2myisam.result:
        Result change
        ---
        Result change.
      mysql-test/r/rpl_row_tabledefs_3innodb.result:
        Result change
        ---
        Result change.
      mysql-test/r/rpl_row_until.result:
        Result change
      mysql-test/r/rpl_server_id1.result:
        Result change
      mysql-test/r/rpl_server_id2.result:
        Result change
      mysql-test/r/rpl_slave_status.result:
        Result change
      mysql-test/r/rpl_stm_log.result:
        Result change
      mysql-test/r/rpl_stm_max_relay_size.result:
        Result change
        ---
        Result change.
      mysql-test/r/rpl_stm_reset_slave.result:
        Result change
      mysql-test/r/rpl_stm_until.result:
        Result change
      mysql-test/t/binlog_row_mix_innodb_myisam.test:
        Test fixed.
      mysql-test/t/rpl_000015.test:
        Commenting out irrelevant fields Last_IO_Error and Last_IO_Errno
      mysql-test/t/rpl_change_master.test:
        Commenting out irrelevant fields Last_IO_Error and Last_IO_Errno
      mysql-test/t/rpl_empty_master_crash.test:
        Commenting out irrelevant fields Last_IO_Error and Last_IO_Errno
      mysql-test/t/rpl_flushlog_loop.test:
        Commenting out irrelevant fields Last_IO_Error and Last_IO_Errno
      mysql-test/t/rpl_log_pos.test:
        Commenting out irrelevant fields Last_IO_Error and Last_IO_Errno
      mysql-test/t/rpl_ndb_bank.test:
        Commenting out irrelevant fields Last_IO_Error and Last_IO_Errno
      mysql-test/t/rpl_ndb_basic.test:
        Commenting out irrelevant fields Last_IO_Error and Last_IO_Errno
      mysql-test/t/rpl_ndb_idempotent.test:
        Commenting out irrelevant fields Last_IO_Error and Last_IO_Errno
      mysql-test/t/rpl_ndb_sync.test:
        Commenting out irrelevant fields Last_IO_Error and Last_IO_Errno
      mysql-test/t/rpl_openssl.test:
        Commenting out irrelevant fields Last_IO_Error and Last_IO_Errno
      mysql-test/t/rpl_rbr_to_sbr.test:
        Commenting out irrelevant fields Last_IO_Error and Last_IO_Errno
      mysql-test/t/rpl_redirect.test:
        Commenting out irrelevant fields Last_IO_Error and Last_IO_Errno
      mysql-test/t/rpl_replicate_do.test:
        Commenting out irrelevant fields Last_IO_Error and Last_IO_Errno
      mysql-test/t/rpl_rotate_logs.test:
        Commenting out irrelevant fields Last_IO_Error and Last_IO_Errno
      mysql-test/t/rpl_row_inexist_tbl.test:
        Commenting out irrelevant fields Last_IO_Error and Last_IO_Errno
      mysql-test/t/rpl_row_until.test:
        Commenting out irrelevant fields Last_IO_Error and Last_IO_Errno
      mysql-test/t/rpl_server_id1.test:
        Commenting out irrelevant fields Last_IO_Error and Last_IO_Errno
      mysql-test/t/rpl_server_id2.test:
        Commenting out irrelevant fields Last_IO_Error and Last_IO_Errno
      mysql-test/t/rpl_slave_status.test:
        Commenting out irrelevant fields Last_IO_Error and Last_IO_Errno
      mysql-test/t/rpl_stm_until.test:
        Commenting out irrelevant fields Last_IO_Error and Last_IO_Errno
      sql/Makefile.am:
        Adding new files
      sql/log_event.cc:
        Changes to use Slave_reporting_capability for reporting errors.
        
        Adding debug variable to stop slave with an out-of-memory error or with
        a fatal error. The checks are put both in the new Execute_load_query_
        log_event and in the old Load_log_event which is used for Execute_load_
        log_event.
        
        Adding code to generate fatal error message.
        
        Eliminating redundant arguments when printing ER_NO_DEFAULT_FOR_FIELD
        message.
      sql/rpl_mi.cc:
        Using Slave_reporting_capability for error reporting.
      sql/rpl_mi.h:
        Using Slave_reporting_capability to handle I/O thread errors and other messages.
      sql/rpl_rli.cc:
        Using Slave_reporting_capability to handle SQL thread errors and other messages.
      sql/rpl_rli.h:
        Changes to use Slave_reporting_capability for reporting SQL thread error and other messages.
      sql/rpl_utility.cc:
        Changes to use Slave_reporting_capability for reporting errors.
      sql/slave.cc:
        Changes to use Slave_reporting_capability for reporting errors.
      sql/slave.h:
        Removing slave_print_msg()
      sql/share/errmsg.txt:
        New error messages.
        
        Making message for ER_NO_DEFAULT_FOR_FIELD consistent over languages
        (actually restoring old message).
        
        Adding argument to ER_SLAVE_FATAL_ERROR message.
      sql/sql_repl.cc:
        Using new names for thread masks.
      mysql-test/t/rpl_loaddata_fatal-slave.opt:
        New BitKeeper file ``mysql-test/t/rpl_loaddata_fatal-slave.opt''
      sql/rpl_reporting.cc:
        New BitKeeper file ``sql/rpl_reporting.cc''
      sql/rpl_reporting.h:
        New BitKeeper file ``sql/rpl_reporting.h''
      mysql-test/include/show_slave_status.inc:
        New BitKeeper file ``mysql-test/include/show_slave_status.inc''
      mysql-test/r/rpl_loaddata_fatal.result:
        New BitKeeper file ``mysql-test/r/rpl_loaddata_fatal.result''
      mysql-test/t/rpl_loaddata_fatal.test:
        New BitKeeper file ``mysql-test/t/rpl_loaddata_fatal.test''
      79a609aa
  36. 31 May, 2007 1 commit
    • unknown's avatar
      Added casts to avoid compiler warnings and fixed a wrong type. · c6ff8a65
      unknown authored
      ```yaml
      Added casts and fixed wrong type.
      ```
      
      Added casts and fixed wrong type.
      ---
      Merge jamppa@bk-internal.mysql.com:/home/bk/mysql-5.1-marvel
      into  a88-113-38-195.elisa-laajakaista.fi:/home/my/bk/mysql-5.1-marvel
      ---
      Don't give warning that readonly variable is forced to be readonly
      mysql-test-run run now fails if we have [Warning] and [ERROR] as tags in .err file
      Fixed wrong reference to the mysql manual
      Fixed wrong prototype that caused some tests to fail on 64 bit platforms
      ---
      Disabled compiler warnings mainly for Win 64.
      ---
      Added casts to remove compiler warnings on windows
      Give warnings also for safe_mutex errors found by test system
      Added some warnings from different machines in pushbuild
      ---
      Merge bk-internal.mysql.com:/home/bk/mysql-5.1-marvel
      into  mysql.com:/home/my/mysql-5.1
      ---
      Added escapes for double quotes and parenthesis.
      ---
      Archive db fix plus added non-critical warnings
      in ignore list.
      ---
      Fixed previously added patch and added new ignored warning.
      
      
      client/mysqltest.c:
        Added casts to avoid compiler warnings.
        ---
        Added casts to avoid compiler warnings.
      mysql-test/lib/mtr_report.pl:
        Test run now fails if we have [Warning] and [ERROR] as tags in .err file
        Added list of all common 'not fatal' errors to ignore error list
        ---
        Give warnings also for safe_mutex errors
        Added some warnings from different machines in pushbuild
        ---
        Added escapes for double quotes and parenthesis.
        ---
        Added non-critical warnings to be ignored.
        ---
        Fixed a wrong regexp
        Added new non-critical warning
      mysql-test/mysql-test-run-shell.sh:
        Fixed some wrong startup options
      mysql-test/r/func_misc.result:
        Test case for archive db fix.
      mysql-test/t/disabled.def:
        Disable instance manager tests because they generate warnings (and probably don't read the option files correctly)
      mysql-test/t/func_misc.test:
        Test case for archive db fix.
      mysys/array.c:
        Added casts to avoid compiler warnings.
      mysys/hash.c:
        Added casts to avoid compiler warnings.
      mysys/my_compress.c:
        Added casts to remove compiler warnings on windows
      mysys/my_conio.c:
        To avoid a warning from compiler.
      mysys/my_pread.c:
        Archive db fix.
      mysys/my_quick.c:
        Added cast to avoid compiler warning.
        ---
        Added cast to avoid compiler warning.
      sql/ha_ndbcluster_binlog.cc:
        Ensure we log all binglog errors with the "NDB Binlog" tag
      sql/ha_partition.cc:
        result is type bool, so calculation should be forced to
        that also.
      sql/log.cc:
        Fixed compiler problem on Solaris.
      sql/slave.cc:
        Make errors uniform
      sql/sql_class.cc:
        Added cast to remove compiler warnings on windows
      sql/sql_map.cc:
        Added casts to avoid compiler warnings.
        ---
        Added casts to avoid compiler warnings.
      sql/sql_plugin.cc:
        Fixed wrong type.
        ---
        Don't give warning that readonly variable is forced to be readonly
      sql/stacktrace.c:
        Corrected manual reference
      storage/archive/azio.c:
        Archive db fix.
        ---
        Fixed previously added patch.
      storage/blackhole/ha_blackhole.cc:
        Fixed wrong prototype that caused test to fail on 64 bit platforms
      storage/example/ha_example.cc:
        Fixed wrong prototype that caused test to fail on 64 bit platforms
      strings/ctype-ucs2.c:
        Fixed wrong type.
        ---
        Fixed wrong type.
      support-files/compiler_warnings.supp:
        Added new disabled warnings for Win 64.
      c6ff8a65