1. 03 Feb, 2010 1 commit
  2. 31 Jan, 2010 1 commit
  3. 30 Jan, 2010 2 commits
    • unknown's avatar
      Auto Merge fix for bug#50157 · 3d50457e
      unknown authored
      3d50457e
    • unknown's avatar
      BUG#50157 Assertion !active_tranxs_->is_tranx_end_pos(..) in ReplSemiSyncMaster::commitTrx · 2cd69a29
      unknown authored
      The root cause of the crash is that a TranxNode is freed before it is used.
      A TranxNode is allocated and inserted into the active list each time 
      a log event is written and flushed into the binlog file. 
      The memory for TranxNode is allocated with thd_alloc and will be freed 
      at the end of the statement. The after_commit/after_rollback callback
      was supposed to be called before the end of each statement and remove the node from
      the active list. However this assumption is not correct in all cases(e.g. call 
      'CREATE TEMPORARY TABLE myisam_t SELECT * FROM innodb_t' in a transaction
       and delete all temporary tables automatically when a session closed), 
      and can cause the memory allocated for TranxNode be freed
      before it was removed from the active list. So The TranxNode pointer in the active
      list would become a wild pointer and cause the crash.
      
      After this patch, We have a class called a TranxNodeAllocate which manages the memory
      for allocating and freeing TranxNode. It uses my_malloc to allocate memory.
      
      
      sql/rpl_handler.cc:
        params are not initialized.
      2cd69a29
  4. 29 Jan, 2010 3 commits
    • Andrei Elkin's avatar
      merging to a local bug fixes tree · 551f5b56
      Andrei Elkin authored
      551f5b56
    • Andrei Elkin's avatar
      Bug #50192 Strange effect in replication test, trigger, auto_increment · f705fe66
      Andrei Elkin authored
      The auto-inc unsafe warning makes sense even though it's just
      one auto-inc table could be involved via a trigger or a stored
      function.
      However its content was not updated by bug@45677 fixes continuing to mention
      two tables whereas the fixes refined semantics of replication of auto_increment 
      in stored routine.
      
      Fixed with updating the error message, renaming the error and an internal unsafe-condition 
      constants.
      
      A documentation notice
      ======================
      
            Inserting into an autoincrement column in a stored function or a trigger
            is unsafe for replication.
            Even with just one autoincrement column, if the routine is invoked more than 
            once slave is not guaranteed to execute the statement graph same way as 
            the master.
            And since it's impossible to estimate how many times a routine can be invoked at 
            the query pre-execution phase (see lock_tables), the statement is marked
            pessimistically unsafe. 
      
      
      
      mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result:
        results updated to include the expected unsafe warning.
      mysql-test/suite/binlog/t/binlog_stm_unsafe_warning.test:
        regression test for bug#50192 to diplaying the unsafe warning comes out to the user warning stack.
      sql/share/errmsg-utf8.txt:
        Updating the auto-inc unsafe message to correspond to bug@45677 fixes' new sematics.
      sql/share/errmsg.txt:
        Updating the auto-inc unsafe message to correspond to bug@45677 fixes' new sematics.
      sql/sql_base.cc:
        changing a symbolic name to correspond to updated by bug@45677 fixes new sematics.
      sql/sql_lex.cc:
        changing a symbolic name to correspond to updated by bug@45677 fixes new sematics.
      sql/sql_lex.h:
        changing a symbolic name to correspond to updated by bug@45677 fixes new sematics
        and description comments.
      f705fe66
    • Horst.Hunger's avatar
      1bdc8a2b
  5. 27 Jan, 2010 3 commits
  6. 25 Jan, 2010 9 commits
  7. 22 Jan, 2010 3 commits
  8. 21 Jan, 2010 4 commits
    • Alfranio Correia's avatar
      BUG#46364 MyISAM transbuffer problems (NTM problem) · 5bedb960
      Alfranio Correia authored
            
      It is well-known that due to concurrency issues, a slave can become
      inconsistent when a transaction contains updates to both transaction and
      non-transactional tables.
                          
      In a nutshell, the current code-base tries to preserve causality among the
      statements by writing non-transactional statements to the txn-cache which
      is flushed upon commit. However, modifications done to non-transactional
      tables on behalf of a transaction become immediately visible to other
      connections but may not immediately get into the binary log and therefore
      consistency may be broken.
                  
      In general, it is impossible to automatically detect causality/dependency
      among statements by just analyzing the statements sent to the server. This
      happen because dependency may be hidden in the application code and it is
      necessary to know a priori all the statements processed in the context of
      a transaction such as in a procedure. Moreover, even for the few cases that
      we could automatically address in the server, the computation effort
      required could make the approach infeasible.
                  
      So, in this patch we introduce the option
            - "--binlog-direct-non-transactional-updates" that can be used to bypass
            the current behavior in order to write directly to binary log statements
            that change non-transactional tables.
      
      Besides, it is used to enable the WL#2687 which is disabled by default.
      
      mysql-test/extra/rpl_tests/rpl_binlog_max_cache_size.test:
        Changes the result set as the STMT mode behaves as both the ROW and MIXED modes and as such uses the non-trx-cache and takes longer to fill the trx-cache up and trigger an error.
      mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test:
        Changes the result set as the STMT mode behaves as both the ROW and MIXED modes and as such uses the non-trx-cache. It also fixes comments.
      mysql-test/extra/rpl_tests/rpl_mixing_engines.test:
        The STMT mode is unsafe when mixed-statements are executed thus making slaves to go out of sync. For that reason, it checks consistency if not in STMT mode.
      mysql-test/include/default_mysqld.cnf:
        Makes binlog-direct-non-transactional-updates "TRUE" by default in the test
        cases.
      mysql-test/r/mysqld--help-notwin.result:
        Updates the result file with the new option.
      mysql-test/r/mysqld--help-win.result:
        Updates the result file with the new option.
      mysql-test/suite/binlog/r/binlog_multi_engine.result:
        Updates the result file because non-trx-changes are written ahead of the
        transaction.
      mysql-test/suite/binlog/r/binlog_switch_inside_trans.result:
        Verifies if the user cannot change the opion binlog_direct_non_transactional_updates
        within a transaction or a procedure/function/trigger.
      mysql-test/suite/binlog/t/binlog_stm_mix_innodb_myisam-master.opt:
        Sets binlog_direct_non_transactional_updates to FALSE in order to avoid changing
        the test case and its result file.
      mysql-test/suite/binlog/t/binlog_switch_inside_trans.test:
        Verifies if the user cannot change the opion binlog_direct_non_transactional_updates
        within a transaction or a procedure/function/trigger.
      mysql-test/suite/ndb/r/ndb_binlog_format.result:
        Updates the result file because non-trx-changes are written ahead of the
        transaction.
      mysql-test/suite/rpl/r/rpl_begin_commit_rollback.result:
        Sets binlog_direct_non_transactional_updates to FALSE in order to avoid changing the test case and its result file.
      mysql-test/suite/rpl/r/rpl_concurrency_error.result:
        Updates the result file because non-trx-changes are written ahead of the
        transaction
      mysql-test/suite/rpl/r/rpl_mixed_implicit_commit_binlog.result:
        Updates the result file because non-trx-changes are written ahead of the
        transaction.
      mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result:
        Updates the result file because non-trx-changes are written ahead of the
        transaction.
      mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result:
        Changes the result set as the STMT mode behaves as both the ROW and MIXED modes and as such uses the non-trx-cache and takes longer to fill the trx-cache up and trigger an error.
      mysql-test/suite/rpl/r/rpl_stm_implicit_commit_binlog.result:
        Updates the result file because non-trx-changes are written ahead of the
        transaction.
      mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result:
        Updates the result file because non-trx-changes are written ahead of the
        transaction.
      mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result:
        Sets binlog_direct_non_transactional_updates to FALSE in order to avoid changing the test case and its result file.
      mysql-test/suite/rpl/r/rpl_stm_stop_middle_group.result:
        Sets binlog_direct_non_transactional_updates to FALSE in order to avoid changing the test case and its result file.
      mysql-test/suite/rpl/t/rpl_begin_commit_rollback.test:
        Sets binlog_direct_non_transactional_updates to FALSE in order to avoid changing the test case and its result file.
      mysql-test/suite/rpl/t/rpl_stm_start_stop_slave.test:
        Sets binlog_direct_non_transactional_updates to FALSE in order to avoid changing the test case and its result file.
      mysql-test/suite/rpl/t/rpl_stm_stop_middle_group.test:
        Sets binlog_direct_non_transactional_updates to FALSE in order to avoid changing the test case and its result file.
      sql/log.cc:
        Verifies if changes should be written to either the trx-cache or non-trx-cache through the use of the function use_trans_cache(). It also organizes the code.
      sql/log.h:
        Changes the signature of some functions by adding the modifier "const" to the thd parameter. Specifically, the following functions are changed: 
                bool trans_has_updated_trans_table(const THD* thd);
                bool stmt_has_updated_trans_table(const THD *thd);
                bool use_trans_cache(const THD*, bool is_transactional);
      sql/share/errmsg-utf8.txt:
        Creates error messages to report when an user tries to change the new option
        binlog_direct_non_transactional_updates within a transaction or a procedure/
        function/trigger.
      sql/share/errmsg.txt:
        Creates error messages to report when an user tries to change the new option
        binlog_direct_non_transactional_updates within a transaction or a procedure/
        function/trigger.
      sql/sql_class.h:
        Adds the new option binlog_direct_non_transactional_updates.
      sql/sys_vars.cc:
        Adds the new option binlog_direct_non_transactional_updates.
      support-files/my-small.cnf.sh:
        Adds binlog-direct-non-transactional-updates to the example file. By default
        the option is disabled.
      5bedb960
    • Alfranio Correia's avatar
      BUG#46364 MyISAM transbuffer problems (NTM problem) · b146191e
      Alfranio Correia authored
            
      It is well-known that due to concurrency issues, a slave can become
      inconsistent when a transaction contains updates to both transaction and
      non-transactional tables.
                          
      In a nutshell, the current code-base tries to preserve causality among the
      statements by writing non-transactional statements to the txn-cache which
      is flushed upon commit. However, modifications done to non-transactional
      tables on behalf of a transaction become immediately visible to other
      connections but may not immediately get into the binary log and therefore
      consistency may be broken.
                  
      In general, it is impossible to automatically detect causality/dependency
      among statements by just analyzing the statements sent to the server. This
      happen because dependency may be hidden in the application code and it is
      necessary to know a priori all the statements processed in the context of
      a transaction such as in a procedure. Moreover, even for the few cases that
      we could automatically address in the server, the computation effort
      required could make the approach infeasible.
                  
      So, in this patch we introduce the option
            - "--binlog-direct-non-transactional-updates" that can be used to bypass
            the current behavior in order to write directly to binary log statements
            that change non-transactional tables.
      
      Besides, it is used to enable the WL#2687 which is disabled by default.
      
      mysql-test/extra/rpl_tests/rpl_binlog_max_cache_size.test:
        Changes the result set as the STMT mode behaves as both the ROW and MIXED modes and as such uses the non-trx-cache and takes longer to fill the trx-cache up and trigger an error.
      mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test:
        Changes the result set as the STMT mode behaves as both the ROW and MIXED modes and as such uses the non-trx-cache. It also fixes comments.
      mysql-test/extra/rpl_tests/rpl_mixing_engines.test:
        The STMT mode is unsafe when mixed-statements are executed thus making slaves to go out of sync. For that reason, it checks consistency if not in STMT mode.
      mysql-test/include/default_mysqld.cnf:
        Makes binlog-direct-non-transactional-updates "TRUE" by default in the test
        cases.
      mysql-test/r/mysqld--help-notwin.result:
        Updates the result file with the new option.
      mysql-test/r/mysqld--help-win.result:
        Updates the result file with the new option.
      mysql-test/suite/binlog/r/binlog_multi_engine.result:
        Updates the result file because non-trx-changes are written ahead of the
        transaction.
      mysql-test/suite/binlog/r/binlog_switch_inside_trans.result:
        Verifies if the user cannot change the opion binlog_direct_non_transactional_updates
        within a transaction or a procedure/function/trigger.
      mysql-test/suite/binlog/t/binlog_stm_mix_innodb_myisam-master.opt:
        Sets binlog_direct_non_transactional_updates to FALSE in order to avoid changing
        the test case and its result file.
      mysql-test/suite/binlog/t/binlog_switch_inside_trans.test:
        Verifies if the user cannot change the opion binlog_direct_non_transactional_updates
        within a transaction or a procedure/function/trigger.
      mysql-test/suite/ndb/r/ndb_binlog_format.result:
        Updates the result file because non-trx-changes are written ahead of the
        transaction.
      mysql-test/suite/rpl/r/rpl_begin_commit_rollback.result:
        Sets binlog_direct_non_transactional_updates to FALSE in order to avoid changing the test case and its result file.
      mysql-test/suite/rpl/r/rpl_concurrency_error.result:
        Updates the result file because non-trx-changes are written ahead of the
        transaction
      mysql-test/suite/rpl/r/rpl_mixed_implicit_commit_binlog.result:
        Updates the result file because non-trx-changes are written ahead of the
        transaction.
      mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result:
        Updates the result file because non-trx-changes are written ahead of the
        transaction.
      mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result:
        Changes the result set as the STMT mode behaves as both the ROW and MIXED modes and as such uses the non-trx-cache and takes longer to fill the trx-cache up and trigger an error.
      mysql-test/suite/rpl/r/rpl_stm_implicit_commit_binlog.result:
        Updates the result file because non-trx-changes are written ahead of the
        transaction.
      mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result:
        Updates the result file because non-trx-changes are written ahead of the
        transaction.
      mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result:
        Sets binlog_direct_non_transactional_updates to FALSE in order to avoid changing the test case and its result file.
      mysql-test/suite/rpl/r/rpl_stm_stop_middle_group.result:
        Sets binlog_direct_non_transactional_updates to FALSE in order to avoid changing the test case and its result file.
      mysql-test/suite/rpl/t/rpl_begin_commit_rollback.test:
        Sets binlog_direct_non_transactional_updates to FALSE in order to avoid changing the test case and its result file.
      mysql-test/suite/rpl/t/rpl_stm_start_stop_slave.test:
        Sets binlog_direct_non_transactional_updates to FALSE in order to avoid changing the test case and its result file.
      mysql-test/suite/rpl/t/rpl_stm_stop_middle_group.test:
        Sets binlog_direct_non_transactional_updates to FALSE in order to avoid changing the test case and its result file.
      sql/log.cc:
        Verifies if changes should be written to either the trx-cache or non-trx-cache through the use of the function use_trans_cache(). It also organizes the code.
      sql/log.h:
        Changes the signature of some functions by adding the modifier "const" to the thd parameter. Specifically, the following functions are changed: 
                bool trans_has_updated_trans_table(const THD* thd);
                bool stmt_has_updated_trans_table(const THD *thd);
                bool use_trans_cache(const THD*, bool is_transactional);
      sql/share/errmsg-utf8.txt:
        Creates error messages to report when an user tries to change the new option
        binlog_direct_non_transactional_updates within a transaction or a procedure/
        function/trigger.
      sql/share/errmsg.txt:
        Creates error messages to report when an user tries to change the new option
        binlog_direct_non_transactional_updates within a transaction or a procedure/
        function/trigger.
      sql/sql_class.h:
        Adds the new option binlog_direct_non_transactional_updates.
      sql/sys_vars.cc:
        Adds the new option binlog_direct_non_transactional_updates.
      support-files/my-small.cnf.sh:
        Adds binlog-direct-non-transactional-updates to the example file. By default
        the option is disabled.
      b146191e
    • Alexander Nozdrin's avatar
      Auto-merge from mysql-next-mr. · d1be11fa
      Alexander Nozdrin authored
      d1be11fa
    • Alexander Nozdrin's avatar
      Auto-merge from mysql-next-mr. · 679ef0c1
      Alexander Nozdrin authored
      679ef0c1
  9. 20 Jan, 2010 7 commits
  10. 19 Jan, 2010 3 commits
  11. 18 Jan, 2010 4 commits