An error occurred fetching the project authors.
  1. 30 Jun, 2015 1 commit
  2. 30 Sep, 2014 1 commit
    • Michael Widenius's avatar
      MDEV-5120 Test suite test maria-no-logging fails · 70823e1d
      Michael Widenius authored
      The reason for the failure was a bug in an include file on debian that causes 'struct stat'
      to have different sized depending on the environment.
      
      This patch fixes so that we always include my_global.h or my_config.h before we include any other files.
      
      Other things:
      - Removed #include <my_global.h> in some include files; Better to always do this at the top level to have as few
        "always-include-this-file-first' files as possible.
      - Removed usage of some include files that where already included by my_global.h or by other files.
      
      
      client/mysql_plugin.c:
        Use my_global.h first
      client/mysqlslap.c:
        Remove duplicated include files
      extra/comp_err.c:
        Remove duplicated include files
      include/m_string.h:
        Remove duplicated include files
      include/maria.h:
        Remove duplicated include files
      libmysqld/emb_qcache.cc:
        Use my_global.h first
      plugin/semisync/semisync.h:
        Use my_pthread.h first
      sql/datadict.cc:
        Use my_global.h first
      sql/debug_sync.cc:
        Use my_global.h first
      sql/derror.cc:
        Use my_global.h first
      sql/des_key_file.cc:
        Use my_global.h first
      sql/discover.cc:
        Use my_global.h first
      sql/event_data_objects.cc:
        Use my_global.h first
      sql/event_db_repository.cc:
        Use my_global.h first
      sql/event_parse_data.cc:
        Use my_global.h first
      sql/event_queue.cc:
        Use my_global.h first
      sql/event_scheduler.cc:
        Use my_global.h first
      sql/events.cc:
        Use my_global.h first
      sql/field.cc:
        Use my_global.h first
        Remove duplicated include files
      sql/field_conv.cc:
        Use my_global.h first
      sql/filesort.cc:
        Use my_global.h first
        Remove duplicated include files
      sql/gstream.cc:
        Use my_global.h first
      sql/ha_ndbcluster.cc:
        Use my_global.h first
      sql/ha_ndbcluster_binlog.cc:
        Use my_global.h first
      sql/ha_ndbcluster_cond.cc:
        Use my_global.h first
      sql/ha_partition.cc:
        Use my_global.h first
      sql/handler.cc:
        Use my_global.h first
      sql/hash_filo.cc:
        Use my_global.h first
      sql/hostname.cc:
        Use my_global.h first
      sql/init.cc:
        Use my_global.h first
      sql/item.cc:
        Use my_global.h first
      sql/item_buff.cc:
        Use my_global.h first
      sql/item_cmpfunc.cc:
        Use my_global.h first
      sql/item_create.cc:
        Use my_global.h first
      sql/item_geofunc.cc:
        Use my_global.h first
      sql/item_inetfunc.cc:
        Use my_global.h first
      sql/item_row.cc:
        Use my_global.h first
      sql/item_strfunc.cc:
        Use my_global.h first
      sql/item_subselect.cc:
        Use my_global.h first
      sql/item_sum.cc:
        Use my_global.h first
      sql/item_timefunc.cc:
        Use my_global.h first
      sql/item_xmlfunc.cc:
        Use my_global.h first
      sql/key.cc:
        Use my_global.h first
      sql/lock.cc:
        Use my_global.h first
      sql/log.cc:
        Use my_global.h first
      sql/log_event.cc:
        Use my_global.h first
      sql/log_event_old.cc:
        Use my_global.h first
      sql/mf_iocache.cc:
        Use my_global.h first
      sql/mysql_install_db.cc:
        Remove duplicated include files
      sql/mysqld.cc:
        Remove duplicated include files
      sql/net_serv.cc:
        Remove duplicated include files
      sql/opt_range.cc:
        Use my_global.h first
      sql/opt_subselect.cc:
        Use my_global.h first
      sql/opt_sum.cc:
        Use my_global.h first
      sql/parse_file.cc:
        Use my_global.h first
      sql/partition_info.cc:
        Use my_global.h first
      sql/procedure.cc:
        Use my_global.h first
      sql/protocol.cc:
        Use my_global.h first
      sql/records.cc:
        Use my_global.h first
      sql/records.h:
        Don't include my_global.h
        Better to do this at the upper level
      sql/repl_failsafe.cc:
        Use my_global.h first
      sql/rpl_filter.cc:
        Use my_global.h first
      sql/rpl_gtid.cc:
        Use my_global.h first
      sql/rpl_handler.cc:
        Use my_global.h first
      sql/rpl_injector.cc:
        Use my_global.h first
      sql/rpl_record.cc:
        Use my_global.h first
      sql/rpl_record_old.cc:
        Use my_global.h first
      sql/rpl_reporting.cc:
        Use my_global.h first
      sql/rpl_rli.cc:
        Use my_global.h first
      sql/rpl_tblmap.cc:
        Use my_global.h first
      sql/rpl_utility.cc:
        Use my_global.h first
      sql/set_var.cc:
        Added comment
      sql/slave.cc:
        Use my_global.h first
      sql/sp.cc:
        Use my_global.h first
      sql/sp_cache.cc:
        Use my_global.h first
      sql/sp_head.cc:
        Use my_global.h first
      sql/sp_pcontext.cc:
        Use my_global.h first
      sql/sp_rcontext.cc:
        Use my_global.h first
      sql/spatial.cc:
        Use my_global.h first
      sql/sql_acl.cc:
        Use my_global.h first
      sql/sql_admin.cc:
        Use my_global.h first
      sql/sql_analyse.cc:
        Use my_global.h first
      sql/sql_audit.cc:
        Use my_global.h first
      sql/sql_base.cc:
        Use my_global.h first
      sql/sql_binlog.cc:
        Use my_global.h first
      sql/sql_bootstrap.cc:
        Use my_global.h first
        Use my_global.h first
      sql/sql_cache.cc:
        Use my_global.h first
      sql/sql_class.cc:
        Use my_global.h first
      sql/sql_client.cc:
        Use my_global.h first
      sql/sql_connect.cc:
        Use my_global.h first
      sql/sql_crypt.cc:
        Use my_global.h first
      sql/sql_cursor.cc:
        Use my_global.h first
      sql/sql_db.cc:
        Use my_global.h first
      sql/sql_delete.cc:
        Use my_global.h first
      sql/sql_derived.cc:
        Use my_global.h first
      sql/sql_do.cc:
        Use my_global.h first
      sql/sql_error.cc:
        Use my_global.h first
      sql/sql_explain.cc:
        Use my_global.h first
      sql/sql_expression_cache.cc:
        Use my_global.h first
      sql/sql_handler.cc:
        Use my_global.h first
      sql/sql_help.cc:
        Use my_global.h first
      sql/sql_insert.cc:
        Use my_global.h first
      sql/sql_lex.cc:
        Use my_global.h first
      sql/sql_load.cc:
        Use my_global.h first
      sql/sql_locale.cc:
        Use my_global.h first
      sql/sql_manager.cc:
        Use my_global.h first
      sql/sql_parse.cc:
        Use my_global.h first
      sql/sql_partition.cc:
        Use my_global.h first
      sql/sql_plugin.cc:
        Added comment
      sql/sql_prepare.cc:
        Use my_global.h first
      sql/sql_priv.h:
        Added error if we use this before including my_global.h
        This check is here becasue so many files includes sql_priv.h first.
      sql/sql_profile.cc:
        Use my_global.h first
      sql/sql_reload.cc:
        Use my_global.h first
      sql/sql_rename.cc:
        Use my_global.h first
      sql/sql_repl.cc:
        Use my_global.h first
      sql/sql_select.cc:
        Use my_global.h first
      sql/sql_servers.cc:
        Use my_global.h first
      sql/sql_show.cc:
        Added comment
      sql/sql_signal.cc:
        Use my_global.h first
      sql/sql_statistics.cc:
        Use my_global.h first
      sql/sql_table.cc:
        Use my_global.h first
      sql/sql_tablespace.cc:
        Use my_global.h first
      sql/sql_test.cc:
        Use my_global.h first
      sql/sql_time.cc:
        Use my_global.h first
      sql/sql_trigger.cc:
        Use my_global.h first
      sql/sql_udf.cc:
        Use my_global.h first
      sql/sql_union.cc:
        Use my_global.h first
      sql/sql_update.cc:
        Use my_global.h first
      sql/sql_view.cc:
        Use my_global.h first
      sql/sys_vars.cc:
        Added comment
      sql/table.cc:
        Use my_global.h first
      sql/thr_malloc.cc:
        Use my_global.h first
      sql/transaction.cc:
        Use my_global.h first
      sql/uniques.cc:
        Use my_global.h first
      sql/unireg.cc:
        Use my_global.h first
      sql/unireg.h:
        Removed inclusion of my_global.h
      storage/archive/ha_archive.cc:
        Added comment
      storage/blackhole/ha_blackhole.cc:
        Use my_global.h first
      storage/csv/ha_tina.cc:
        Use my_global.h first
      storage/csv/transparent_file.cc:
        Use my_global.h first
      storage/federated/ha_federated.cc:
        Use my_global.h first
      storage/federatedx/federatedx_io.cc:
        Use my_global.h first
      storage/federatedx/federatedx_io_mysql.cc:
        Use my_global.h first
      storage/federatedx/federatedx_io_null.cc:
        Use my_global.h first
      storage/federatedx/federatedx_txn.cc:
        Use my_global.h first
      storage/heap/ha_heap.cc:
        Use my_global.h first
      storage/innobase/handler/handler0alter.cc:
        Use my_global.h first
      storage/maria/ha_maria.cc:
        Use my_global.h first
      storage/maria/unittest/ma_maria_log_cleanup.c:
        Remove duplicated include files
      storage/maria/unittest/test_file.c:
        Added comment
      storage/myisam/ha_myisam.cc:
        Move sql_plugin.h first as this includes my_global.h
      storage/myisammrg/ha_myisammrg.cc:
        Use my_global.h first
      storage/oqgraph/oqgraph_thunk.cc:
        Use my_config.h and my_global.h first
        One could not include my_global.h before oqgraph_thunk.h (don't know why)
      storage/spider/ha_spider.cc:
        Use my_global.h first
      storage/spider/hs_client/config.cpp:
        Use my_global.h first
      storage/spider/hs_client/escape.cpp:
        Use my_global.h first
      storage/spider/hs_client/fatal.cpp:
        Use my_global.h first
      storage/spider/hs_client/hstcpcli.cpp:
        Use my_global.h first
      storage/spider/hs_client/socket.cpp:
        Use my_global.h first
      storage/spider/hs_client/string_util.cpp:
        Use my_global.h first
      storage/spider/spd_conn.cc:
        Use my_global.h first
      storage/spider/spd_copy_tables.cc:
        Use my_global.h first
      storage/spider/spd_db_conn.cc:
        Use my_global.h first
      storage/spider/spd_db_handlersocket.cc:
        Use my_global.h first
      storage/spider/spd_db_mysql.cc:
        Use my_global.h first
      storage/spider/spd_db_oracle.cc:
        Use my_global.h first
      storage/spider/spd_direct_sql.cc:
        Use my_global.h first
      storage/spider/spd_i_s.cc:
        Use my_global.h first
      storage/spider/spd_malloc.cc:
        Use my_global.h first
      storage/spider/spd_param.cc:
        Use my_global.h first
      storage/spider/spd_ping_table.cc:
        Use my_global.h first
      storage/spider/spd_sys_table.cc:
        Use my_global.h first
      storage/spider/spd_table.cc:
        Use my_global.h first
      storage/spider/spd_trx.cc:
        Use my_global.h first
      storage/xtradb/handler/handler0alter.cc:
        Use my_global.h first
      storage/xtradb/handler/i_s.cc:
        Use my_global.h first
      70823e1d
  3. 23 Oct, 2012 1 commit
    • unknown's avatar
      MDEV-500: Session variable for server_id · ab8e8f4b
      unknown authored
      MDEV-26: Global transaction id, partial commit
      
      Change server_id to be a session variable.
      User with SUPER can set it to binlog with different server_id.
      Implement backward-compatible ::server_id mirror for plugins.
      ab8e8f4b
  4. 27 Oct, 2011 2 commits
    • Andrei Elkin's avatar
      Bug#11763573 - 56299: MUTEX DEADLOCK WITH COM_BINLOG_DUMP, BINLOG PURGE, AND PROCESSLIST/KILL · 95fdeb89
      Andrei Elkin authored
      The bug case is similar to one fixed earlier bug_49536.
      Deadlock involving LOCK_log appears to be possible because the purge running thread
      is holding LOCK_log whereas there is no sense of doing that and which fact was
      exploited by the earlier bug fixes.
      
      Fixed with small reengineering of rotate_and_purge(), adding two new methods and
      setting up a policy to execute those instead of the former
      rotate_and_purge(RP_LOCK_LOG_IS_ALREADY_LOCKED).
      The policy for using rotate(), purge() is that if the caller acquires LOCK_log itself,
      it should call rotate(), release the mutex and run purge().
      
      Side effect of this patch is refining error message of bug@11747416 to print
      the whole path.
      
      
      
      mysql-test/suite/rpl/r/rpl_cant_read_event_incident.result:
        the file name printing is changed to a relative path instead of just the file name.
      mysql-test/suite/rpl/r/rpl_log_pos.result:
        the file name printing is changed to a relative path instead of just the file name.
      mysql-test/suite/rpl/r/rpl_manual_change_index_file.result:
        the file name printing is changed to a relative path instead of just the file name.
      mysql-test/suite/rpl/r/rpl_packet.result:
        the file name printing is changed to a relative path instead of just the file name.
      mysql-test/suite/rpl/r/rpl_rotate_purge_deadlock.result:
        new result file is added.
      mysql-test/suite/rpl/t/rpl_cant_read_event_incident.test:
        The test of that bug can't satisfy windows and unix backslash interpretation so windows
        execution is chosen to bypass.
      mysql-test/suite/rpl/t/rpl_rotate_purge_deadlock-master.opt:
        new opt file is added.
      mysql-test/suite/rpl/t/rpl_rotate_purge_deadlock.test:
        regression test is added as well as verification of a 
        possible side effect of the fixes is tried.
      sql/log.cc:
        LOCK_log is never taken during execution of log purging routine.
        The former MYSQL_BIN_LOG::rotate_and_purge is made to necessarily 
        acquiring and releasing LOCK_log. 
        If caller takes the mutex itself it has to use a new rotate(), purge() 
        methods combination and to never let purge() be run with LOCK_log grabbed.
        
        
        
        split apart to allow
        the caller to chose either it
        Simulation of concurrently rotating/purging threads is added.
      sql/log.h:
        new rotate(), purge() methods are added to be used instead of
        the former rotate_and_purge(RP_LOCK_LOG_IS_ALREADY_LOCKED).
        rotate_and_purge() signature is changed. Caller should not call rotate_and_purge()
        but rather {rotate(), purge()} if LOCK_log is acquired by it.
      sql/rpl_injector.cc:
        changes to reflect the new rotate_and_purge() signature.
      sql/sql_class.h:
        unnecessary constants are removed.
      sql/sql_parse.cc:
        changes to reflect the new rotate_and_purge() signature.
      sql/sql_reload.cc:
        changes to reflect the new rotate_and_purge() signature.
      sql/sql_repl.cc:
        followup for bug@11747416: the file name printing is changed to a relative 
        path instead of just the file name.
      95fdeb89
    • Andrei Elkin's avatar
      Bug#11763573 - 56299: MUTEX DEADLOCK WITH COM_BINLOG_DUMP, BINLOG PURGE, AND PROCESSLIST/KILL · a7127418
      Andrei Elkin authored
      The bug case is similar to one fixed earlier bug_49536.
      Deadlock involving LOCK_log appears to be possible because the purge running thread
      is holding LOCK_log whereas there is no sense of doing that and which fact was
      exploited by the earlier bug fixes.
      
      Fixed with small reengineering of rotate_and_purge(), adding two new methods and
      setting up a policy to execute those instead of the former
      rotate_and_purge(RP_LOCK_LOG_IS_ALREADY_LOCKED).
      The policy for using rotate(), purge() is that if the caller acquires LOCK_log itself,
      it should call rotate(), release the mutex and run purge().
      
      Side effect of this patch is refining error message of bug@11747416 to print
      the whole path.
      a7127418
  5. 30 Nov, 2010 2 commits
    • Luis Soares's avatar
      BUG#46166: MYSQL_BIN_LOG::new_file_impl is not propagating error · 647c6193
      Luis Soares authored
                 when generating new name.
            
      If find_uniq_filename returns an error, then this error is not
      being propagated upwards, and execution does not report error to
      the user (although a entry in the error log is generated).
                        
      Additionally, some more errors were ignored in new_file_impl:
      - when writing the rotate event
      - when reopening the index and binary log file
                        
      This patch addresses this by propagating the error up in the
      execution stack. Furthermore, when rotation of the binary log
      fails, an incident event is written, because there may be a
      chance that some changes for a given statement, were not properly
      logged. For example, in SBR, LOAD DATA INFILE statement requires
      more than one event to be logged, should rotation fail while
      logging part of the LOAD DATA events, then the logged data would
      become inconsistent with the data in the storage engine.
      
      mysql-test/include/restart_mysqld.inc:
        Refactored restart_mysqld so that it is not hardcoded for
        mysqld.1, but rather for the current server.
      mysql-test/suite/binlog/t/binlog_index.test:
        The error on open of index and binary log on new_file_impl 
        is now caught. Thence the user will get an error message. 
        We need to accomodate this change in the test case for the
        failing FLUSH LOGS.
      mysql-test/suite/rpl/t/rpl_binlog_errors-master.opt:
        Sets max_binlog_size to 4096.
      mysql-test/suite/rpl/t/rpl_binlog_errors.test:
        Added some test cases for asserting that the error is found 
        and reported.
      sql/handler.cc:
        Catching error now returned by unlog (in ha_commit_trans) and 
        returning it.
      sql/log.cc:
        Propagating errors from new_file_impl upwards. The errors that
        new_file_impl catches now are:
        - error on generate_new_name
        - error on writing the rotate event
        - error when opening the index or the binary log file.
      sql/log.h:
        Changing declaration of:
        - rotate_and_purge
        - new_file
        - new_file_without_locking
        - new_file_impl
        - unlog
        They now return int instead of void.
      sql/mysql_priv.h:
        Change signature of reload_acl_and_cache so that write_to_binlog
        is an int instead of bool.
      sql/mysqld.cc:
        Redeclaring not_used var as int instead of bool.
      sql/rpl_injector.cc:
        Changes to catch the return from rotate_and_purge.
      sql/slave.cc:
        Changes to catch the return values for new_file and rotate_relay_log.
      sql/slave.h:
        Changes to rotate_relay_log declaration (now returns int 
        instead of void).
      sql/sql_load.cc:
        In SBR, some logging of LOAD DATA events goes through
        IO_CACHE_CALLBACK invocation at mf_iocache.c:_my_b_get. The
        IO_CACHE implementation is ignoring the return value for from
        these callbacks (pre_read and post_read), so we need to find out
        at the end of the execution if the error is set or not in THD.
      sql/sql_parse.cc:
        Catching the rotate_relay_log and rotate_and_purge return values.
        Semantic change in reload_acl_and_cache so that we report errors
        in binlog interactions through the write_to_binlog output parameter.
        If there was any failure while rotating the binary log, we should
        then report the error to the client when handling SQLCOMM_FLUSH.
      647c6193
    • Luis Soares's avatar
      BUG#46166: MYSQL_BIN_LOG::new_file_impl is not propagating error · aaefb52d
      Luis Soares authored
                 when generating new name.
            
      If find_uniq_filename returns an error, then this error is not
      being propagated upwards, and execution does not report error to
      the user (although a entry in the error log is generated).
                        
      Additionally, some more errors were ignored in new_file_impl:
      - when writing the rotate event
      - when reopening the index and binary log file
                        
      This patch addresses this by propagating the error up in the
      execution stack. Furthermore, when rotation of the binary log
      fails, an incident event is written, because there may be a
      chance that some changes for a given statement, were not properly
      logged. For example, in SBR, LOAD DATA INFILE statement requires
      more than one event to be logged, should rotation fail while
      logging part of the LOAD DATA events, then the logged data would
      become inconsistent with the data in the storage engine.
      aaefb52d
  6. 08 Jul, 2010 2 commits
    • Davi Arnaut's avatar
      Bug#34043: Server loops excessively in _checkchunk() when safemalloc is enabled · f56dd32b
      Davi Arnaut authored
      Essentially, the problem is that safemalloc is excruciatingly
      slow as it checks all allocated blocks for overrun at each
      memory management primitive, yielding a almost exponential
      slowdown for the memory management functions (malloc, realloc,
      free). The overrun check basically consists of verifying some
      bytes of a block for certain magic keys, which catches some
      simple forms of overrun. Another minor problem is violation
      of aliasing rules and that its own internal list of blocks
      is prone to corruption.
      
      Another issue with safemalloc is rather the maintenance cost
      as the tool has a significant impact on the server code.
      Given the magnitude of memory debuggers available nowadays,
      especially those that are provided with the platform malloc
      implementation, maintenance of a in-house and largely obsolete
      memory debugger becomes a burden that is not worth the effort
      due to its slowness and lack of support for detecting more
      common forms of heap corruption.
      
      Since there are third-party tools that can provide the same
      functionality at a lower or comparable performance cost, the
      solution is to simply remove safemalloc. Third-party tools
      can provide the same functionality at a lower or comparable
      performance cost. 
      
      The removal of safemalloc also allows a simplification of the
      malloc wrappers, removing quite a bit of kludge: redefinition
      of my_malloc, my_free and the removal of the unused second
      argument of my_free. Since free() always check whether the
      supplied pointer is null, redudant checks are also removed.
      
      Also, this patch adds unit testing for my_malloc and moves
      my_realloc implementation into the same file as the other
      memory allocation primitives.
      
      client/mysqldump.c:
        Pass my_free directly as its signature is compatible with the
        callback type -- which wasn't the case for free_table_ent.
      f56dd32b
    • Davi Arnaut's avatar
      Bug#34043: Server loops excessively in _checkchunk() when safemalloc is enabled · a10ae353
      Davi Arnaut authored
      Essentially, the problem is that safemalloc is excruciatingly
      slow as it checks all allocated blocks for overrun at each
      memory management primitive, yielding a almost exponential
      slowdown for the memory management functions (malloc, realloc,
      free). The overrun check basically consists of verifying some
      bytes of a block for certain magic keys, which catches some
      simple forms of overrun. Another minor problem is violation
      of aliasing rules and that its own internal list of blocks
      is prone to corruption.
      
      Another issue with safemalloc is rather the maintenance cost
      as the tool has a significant impact on the server code.
      Given the magnitude of memory debuggers available nowadays,
      especially those that are provided with the platform malloc
      implementation, maintenance of a in-house and largely obsolete
      memory debugger becomes a burden that is not worth the effort
      due to its slowness and lack of support for detecting more
      common forms of heap corruption.
      
      Since there are third-party tools that can provide the same
      functionality at a lower or comparable performance cost, the
      solution is to simply remove safemalloc. Third-party tools
      can provide the same functionality at a lower or comparable
      performance cost. 
      
      The removal of safemalloc also allows a simplification of the
      malloc wrappers, removing quite a bit of kludge: redefinition
      of my_malloc, my_free and the removal of the unused second
      argument of my_free. Since free() always check whether the
      supplied pointer is null, redudant checks are also removed.
      
      Also, this patch adds unit testing for my_malloc and moves
      my_realloc implementation into the same file as the other
      memory allocation primitives.
      a10ae353
  7. 31 Mar, 2010 2 commits
    • Mats Kindahl's avatar
      WL#5030: Split and remove mysql_priv.h · 23d8586d
      Mats Kindahl authored
      This patch:
      
      - Moves all definitions from the mysql_priv.h file into
        header files for the component where the variable is
        defined
      - Creates header files if the component lacks one
      - Eliminates all include directives from mysql_priv.h
      - Eliminates all circular include cycles
      - Rename time.cc to sql_time.cc
      - Rename mysql_priv.h to sql_priv.h
      23d8586d
    • Mats Kindahl's avatar
      WL#5030: Split and remove mysql_priv.h · e409d6f6
      Mats Kindahl authored
      This patch:
      
      - Moves all definitions from the mysql_priv.h file into
        header files for the component where the variable is
        defined
      - Creates header files if the component lacks one
      - Eliminates all include directives from mysql_priv.h
      - Eliminates all circular include cycles
      - Rename time.cc to sql_time.cc
      - Rename mysql_priv.h to sql_priv.h
      e409d6f6
  8. 04 Feb, 2010 2 commits
    • Konstantin Osipov's avatar
      Merge next-mr -> next-4284. · 00dc9a6e
      Konstantin Osipov authored
      Cherry-pick a fix Bug#37148 from next-mr, to preserve
      file ids of the added files, and ensure that all the necessary
      changes have been pulled.
      
      Since initially Bug#37148 was null-merged into 6.0,
      the changeset that is now being cherry-picked was likewise
      null merged into next-4284.
      
      Now that Bug#37148 has been reapplied to 6.0, try to make
      it work with next-4284. This is also necessary to be able
      to pull other changes from 5.1-rep into next-4284.
      
      To resolve the merge issues use this changeset applied
      to 6.0:
      revid:jperkin@sun.com-20091216103628-ylhqf7s6yegui2t9
      revno: 3776.1.1
      committer: He Zhenxing <zhenxing.he@sun.com>
      branch nick: 6.0-codebase-bugfixing
      timestamp: Thu 2009-12-17 17:02:50 +0800
      message:
        Fix merge problem with Bug#37148
      
      
      
      00dc9a6e
    • Konstantin Osipov's avatar
      Merge next-mr -> next-4284. · 06e1a73a
      Konstantin Osipov authored
      Cherry-pick a fix Bug#37148 from next-mr, to preserve
      file ids of the added files, and ensure that all the necessary
      changes have been pulled.
      
      Since initially Bug#37148 was null-merged into 6.0,
      the changeset that is now being cherry-picked was likewise
      null merged into next-4284.
      
      Now that Bug#37148 has been reapplied to 6.0, try to make
      it work with next-4284. This is also necessary to be able
      to pull other changes from 5.1-rep into next-4284.
      
      To resolve the merge issues use this changeset applied
      to 6.0:
      revid:jperkin@sun.com-20091216103628-ylhqf7s6yegui2t9
      revno: 3776.1.1
      committer: He Zhenxing <zhenxing.he@sun.com>
      branch nick: 6.0-codebase-bugfixing
      timestamp: Thu 2009-12-17 17:02:50 +0800
      message:
        Fix merge problem with Bug#37148
      
      
      06e1a73a
  9. 28 Jan, 2010 2 commits
    • Davi Arnaut's avatar
      Fix for compiler warnings: · c3a73a8f
      Davi Arnaut authored
      Rename method as to not hide a base.
      Reorder attributes initialization.
      Remove unused variable.
      Rework code to silence a warning due to assignment used as truth value.
      
      
      sql/item_strfunc.cc:
        Rename method as to not hide a base.
      sql/item_strfunc.h:
        Rename method as to not hide a base.
      sql/log_event.cc:
        Reorder attributes initialization.
      sql/rpl_injector.cc:
        Rework code to silence a warning due to assignment used as truth value.
      sql/rpl_record.cc:
        Remove unused variable.
      sql/sql_db.cc:
        Rework code to silence a warning due to assignment used as truth value.
      sql/sql_parse.cc:
        Rework code to silence a warning due to assignment used as truth value.
      sql/sql_table.cc:
        Rework code to silence a warning due to assignment used as truth value.
      c3a73a8f
    • Davi Arnaut's avatar
      Fix for compiler warnings: · b5d307e8
      Davi Arnaut authored
      Rename method as to not hide a base.
      Reorder attributes initialization.
      Remove unused variable.
      Rework code to silence a warning due to assignment used as truth value.
      b5d307e8
  10. 25 Jan, 2010 2 commits
  11. 24 Jan, 2010 2 commits
  12. 22 Dec, 2009 2 commits
    • Konstantin Osipov's avatar
      A prerequisite patch for the fix for Bug#46224 · dfdbc845
      Konstantin Osipov authored
      "HANDLER statements within a transaction might lead to deadlocks".
      Introduce a notion of a sentinel to MDL_context. A sentinel
      is a ticket that separates all tickets in the context into two
      groups: before and after it. Currently we can have (and need) only
      one designated sentinel -- it separates all locks taken by LOCK
      TABLE or HANDLER statement, which must survive COMMIT and ROLLBACK
      and all other locks, which must be released at COMMIT or ROLLBACK.
      The tricky part is maintaining the sentinel up to date when
      someone release its corresponding ticket. This can happen, e.g.
      if someone issues DROP TABLE under LOCK TABLES (generally,
      see all calls to release_all_locks_for_name()).
      MDL_context::release_ticket() is modified to take care of it.
      
      ******
      A fix and a test case for Bug#46224 "HANDLER statements within a
      transaction might lead to deadlocks".
      
      An attempt to mix HANDLER SQL statements, which are transaction-
      agnostic, an open multi-statement transaction,
      and DDL against the involved tables (in a concurrent connection) 
      could lead to a deadlock. The deadlock would occur when
      HANDLER OPEN or HANDLER READ would have to wait on a conflicting
      metadata lock. If the connection that issued HANDLER statement
      also had other metadata locks (say, acquired in scope of a 
      transaction), a classical deadlock situation of mutual wait
      could occur.
      
      Incompatible change: entering LOCK TABLES mode automatically
      closes all open HANDLERs in the current connection.
      
      Incompatible change: previously an attempt to wait on a lock
      in a connection that has an open HANDLER statement could wait
      indefinitely/deadlock. After this patch, an error ER_LOCK_DEADLOCK
      is produced.
      
      The idea of the fix is to merge thd->handler_mdl_context
      with the main mdl_context of the connection, used for transactional
      locks. This makes deadlock detection possible, since all waits
      with locks are "visible" and available to analysis in a single
      MDL context of the connection.
      
      Since HANDLER locks and transactional locks have a different life
      cycle -- HANDLERs are explicitly open and closed, and so
      are HANDLER locks, explicitly acquired and released, whereas
      transactional locks "accumulate" till the end of a transaction
      and are released only with COMMIT, ROLLBACK and ROLLBACK TO SAVEPOINT,
      a concept of "sentinel" was introduced to MDL_context.
      All locks, HANDLER and others, reside in the same linked list.
      However, a selected element of the list separates locks with
      different life cycle. HANDLER locks always reside at the
      end of the list, after the sentinel. Transactional locks are
      prepended to the beginning of the list, before the sentinel.
      Thus, ROLLBACK, COMMIT or ROLLBACK TO SAVEPOINT, only
      release those locks that reside before the sentinel. HANDLER locks
      must be released explicitly as part of HANDLER CLOSE statement,
      or an implicit close. 
      The same approach with sentinel
      is also employed for LOCK TABLES locks. Since HANDLER and LOCK TABLES
      statement has never worked together, the implementation is
      made simple and only maintains one sentinel, which is used either
      for HANDLER locks, or for LOCK TABLES locks.
      
      
      mysql-test/include/handler.inc:
        Add test coverage for Bug#46224 "HANDLER statements within a
        transaction might lead to deadlocks".
        Extended HANDLER coverage to cover a mix of HANDLER, transactions
        and DDL statements.
      mysql-test/r/handler_innodb.result:
        Update results (Bug#46224).
      mysql-test/r/handler_myisam.result:
        Update results (Bug#46224).
      sql/lock.cc:
        Remove thd->some_tables_deleted, it's never used.
      sql/log_event.cc:
        No need to check for thd->locked_tables_mode, 
        it's done inside release_transactional_locks().
      sql/mdl.cc:
        Implement the concept of HANDLER and LOCK TABLES "sentinel".
        Implement a method to clone an acquired ticket.
        Do not return tickets beyond the sentinel when acquiring
        locks, create a copy.
        Remove methods to merge and backup MDL_context, they are now
        not used (Hurra!). This opens a path to a proper constructor
        and destructor of class MDL_context (to be done in a separate
        patch).
        Modify find_ticket() to provide information about where
        the ticket position is with regard to the sentinel.
      sql/mdl.h:
        Add declarations necessary for the implementation of the concept
        of "sentinel", a dedicated ticket separating transactional and
        non-transactional locks.
      sql/mysql_priv.h:
        Add mark_tmp_table_for_reuse() declaration, 
        a function to "close" a single session (temporary) table.
      sql/sql_base.cc:
        Remove thd->some_tables_deleted.
        Modify deadlock-prevention asserts and deadlock detection
        heuristics to take into account that from now on HANDLER locks
        reside in the same locking context.
        Add broadcast_refresh() to mysql_notify_thread_having_shared_lock():
        this is necessary for the case when a thread having a shared lock
        is asleep in tdc_wait_for_old_versions(). This situation is only
        possible with HANDLER t1 OPEN; FLUSH TABLE (since all over code paths
        that lead to tdc_wait_for_old_versions() always have an
        empty MDL_context). Previously the server would simply deadlock
        in this situation.
      sql/sql_class.cc:
        Remove now unused member "THD::some_tables_deleted". 
        Move mysql_ha_cleanup() a few lines above in THD::cleanup() 
        to make sure that all handlers are closed when it's time to 
        destroy the MDL_context of this connection.
        Remove handler_mdl_context and handler_tables.
      sql/sql_class.h:
        Remove THD::handler_tables, THD::handler_mdl_context,
        THD::some_tables_deleted.
      sql/sql_handler.cc:
        Remove thd->handler_tables.
        Remove thd->handler_mdl_context.
        Rewrite mysql_ha_open() to have no special provision for MERGE
        tables, now that we don't have to manipulate with thd->handler_tables
        it's easy to do.
        Remove dead code.
        Fix a bug in mysql_ha_flush() when we would always flush
        a temporary HANDLER when mysql_ha_flush() is called (actually
        mysql_ha_flush() never needs to flush temporary tables).
      sql/sql_insert.cc:
        Update a comment, no more thd->some_tables_deleted.
      sql/sql_parse.cc:
        Implement an incompatible change: entering LOCK TABLES closes
        active HANDLERs, if any.
        Now that we have a sentinel, we don't need to check
        for thd->locked_tables_mode when releasing metadata locks in
        COMMIT/ROLLBACK.
      sql/sql_plist.h:
        Add new (now necessary) methods to the list class.
      sql/sql_prepare.cc:
        Make sure we don't release HANDLER locks when rollback to a
        savepoint, set to not keep locks taken at PREPARE.
      sql/sql_servers.cc:
        Update to a new signature of MDL_context::release_all_locks().
      sql/sql_table.cc:
        Remove thd->some_tables_deleted.
      sql/transaction.cc:
        Add comments. 
        Make sure rollback to (MDL) savepoint works under LOCK TABLES and
        with HANDLER tables.
      dfdbc845
    • Konstantin Osipov's avatar
      A prerequisite patch for the fix for Bug#46224 · 39a1a50d
      Konstantin Osipov authored
      "HANDLER statements within a transaction might lead to deadlocks".
      Introduce a notion of a sentinel to MDL_context. A sentinel
      is a ticket that separates all tickets in the context into two
      groups: before and after it. Currently we can have (and need) only
      one designated sentinel -- it separates all locks taken by LOCK
      TABLE or HANDLER statement, which must survive COMMIT and ROLLBACK
      and all other locks, which must be released at COMMIT or ROLLBACK.
      The tricky part is maintaining the sentinel up to date when
      someone release its corresponding ticket. This can happen, e.g.
      if someone issues DROP TABLE under LOCK TABLES (generally,
      see all calls to release_all_locks_for_name()).
      MDL_context::release_ticket() is modified to take care of it.
      
      ******
      A fix and a test case for Bug#46224 "HANDLER statements within a
      transaction might lead to deadlocks".
      
      An attempt to mix HANDLER SQL statements, which are transaction-
      agnostic, an open multi-statement transaction,
      and DDL against the involved tables (in a concurrent connection) 
      could lead to a deadlock. The deadlock would occur when
      HANDLER OPEN or HANDLER READ would have to wait on a conflicting
      metadata lock. If the connection that issued HANDLER statement
      also had other metadata locks (say, acquired in scope of a 
      transaction), a classical deadlock situation of mutual wait
      could occur.
      
      Incompatible change: entering LOCK TABLES mode automatically
      closes all open HANDLERs in the current connection.
      
      Incompatible change: previously an attempt to wait on a lock
      in a connection that has an open HANDLER statement could wait
      indefinitely/deadlock. After this patch, an error ER_LOCK_DEADLOCK
      is produced.
      
      The idea of the fix is to merge thd->handler_mdl_context
      with the main mdl_context of the connection, used for transactional
      locks. This makes deadlock detection possible, since all waits
      with locks are "visible" and available to analysis in a single
      MDL context of the connection.
      
      Since HANDLER locks and transactional locks have a different life
      cycle -- HANDLERs are explicitly open and closed, and so
      are HANDLER locks, explicitly acquired and released, whereas
      transactional locks "accumulate" till the end of a transaction
      and are released only with COMMIT, ROLLBACK and ROLLBACK TO SAVEPOINT,
      a concept of "sentinel" was introduced to MDL_context.
      All locks, HANDLER and others, reside in the same linked list.
      However, a selected element of the list separates locks with
      different life cycle. HANDLER locks always reside at the
      end of the list, after the sentinel. Transactional locks are
      prepended to the beginning of the list, before the sentinel.
      Thus, ROLLBACK, COMMIT or ROLLBACK TO SAVEPOINT, only
      release those locks that reside before the sentinel. HANDLER locks
      must be released explicitly as part of HANDLER CLOSE statement,
      or an implicit close. 
      The same approach with sentinel
      is also employed for LOCK TABLES locks. Since HANDLER and LOCK TABLES
      statement has never worked together, the implementation is
      made simple and only maintains one sentinel, which is used either
      for HANDLER locks, or for LOCK TABLES locks.
      39a1a50d
  13. 04 Dec, 2009 2 commits
    • Konstantin Osipov's avatar
      Backport of revno ## 2617.31.1, 2617.31.3, 2617.31.4, 2617.31.5, · a14bbee5
      Konstantin Osipov authored
      2617.31.12, 2617.31.15, 2617.31.15, 2617.31.16, 2617.43.1
      - initial changeset that introduced the fix for 
      Bug#989 and follow up fixes for all test suite failures
      introduced in the initial changeset. 
      ------------------------------------------------------------
      revno: 2617.31.1
      committer: Davi Arnaut <Davi.Arnaut@Sun.COM>
      branch nick: 4284-6.0
      timestamp: Fri 2009-03-06 19:17:00 -0300
      message:
      Bug#989: If DROP TABLE while there's an active transaction, wrong binlog order
      WL#4284: Transactional DDL locking
      
      Currently the MySQL server does not keep metadata locks on
      schema objects for the duration of a transaction, thus failing
      to guarantee the integrity of the schema objects being used
      during the transaction and to protect then from concurrent
      DDL operations. This also poses a problem for replication as
      a DDL operation might be replicated even thought there are
      active transactions using the object being modified.
      
      The solution is to defer the release of metadata locks until
      a active transaction is either committed or rolled back. This
      prevents other statements from modifying the table for the
      entire duration of the transaction. This provides commitment
      ordering for guaranteeing serializability across multiple
      transactions.
      
      - Incompatible change:
      
      If MySQL's metadata locking system encounters a lock conflict,
      the usual schema is to use the try and back-off technique to
      avoid deadlocks -- this schema consists in releasing all locks
      and trying to acquire them all in one go.
      
      But in a transactional context this algorithm can't be utilized
      as its not possible to release locks acquired during the course
      of the transaction without breaking the transaction commitments.
      To avoid deadlocks in this case, the ER_LOCK_DEADLOCK will be
      returned if a lock conflict is encountered during a transaction.
      
      Let's consider an example:
      
      A transaction has two statements that modify table t1, then table
      t2, and then commits. The first statement of the transaction will
      acquire a shared metadata lock on table t1, and it will be kept
      utill COMMIT to ensure serializability.
      
      At the moment when the second statement attempts to acquire a
      shared metadata lock on t2, a concurrent ALTER or DROP statement
      might have locked t2 exclusively. The prescription of the current
      locking protocol is that the acquirer of the shared lock backs off
      -- gives up all his current locks and retries. This implies that
      the entire multi-statement transaction has to be rolled back.
      
      - Incompatible change:
      
      FLUSH commands such as FLUSH PRIVILEGES and FLUSH TABLES WITH READ
      LOCK won't cause locked tables to be implicitly unlocked anymore.
      
      
      mysql-test/extra/binlog_tests/drop_table.test:
        Add test case for Bug#989.
      mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test:
        Fix test case to reflect the fact that transactions now hold
        metadata locks for the duration of a transaction.
      mysql-test/include/mix1.inc:
        Fix test case to reflect the fact that transactions now hold
        metadata locks for the duration of a transaction.
      mysql-test/include/mix2.inc:
        Fix test case to reflect the fact that transactions now hold
        metadata locks for the duration of a transaction.
      mysql-test/r/flush_block_commit.result:
        Update test case result (WL#4284).
      mysql-test/r/flush_block_commit_notembedded.result:
        Update test case result (WL#4284).
      mysql-test/r/innodb.result:
        Update test case result (WL#4284).
      mysql-test/r/innodb_mysql.result:
        Update test case result (WL#4284).
      mysql-test/r/lock.result:
        Add test case result for an effect of WL#4284/Bug#989
        (all locks should be released when a connection terminates).
      mysql-test/r/mix2_myisam.result:
        Update test case result (effects of WL#4284/Bug#989).
      mysql-test/r/not_embedded_server.result:
        Update test case result (effects of WL#4284/Bug#989).
        Add a test case for interaction of WL#4284 and FLUSH PRIVILEGES.
      mysql-test/r/partition_innodb_semi_consistent.result:
        Update test case result (effects of WL#4284/Bug#989).
      mysql-test/r/partition_sync.result:
        Temporarily disable the test case for Bug#43867,
        which will be fixed by a subsequent backport.
      mysql-test/r/ps.result:
        Add a test case for effect of PREPARE on transactional
        locks: we take a savepoint at beginning of PREAPRE
        and release it at the end. Thus PREPARE does not 
        accumulate metadata locks (Bug#989/WL#4284).
      mysql-test/r/read_only_innodb.result:
        Update test case result (effects of WL#4284/Bug#989).
      mysql-test/suite/binlog/r/binlog_row_drop_tbl.result:
        Add a test case result (WL#4284/Bug#989).
      mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result:
        Update test case result (effects of WL#4284/Bug#989).
      mysql-test/suite/binlog/r/binlog_stm_drop_tbl.result:
        Add a test case result (WL#4284/Bug#989).
      mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result:
        Update test case result (effects of WL#4284/Bug#989).
      mysql-test/suite/binlog/r/binlog_unsafe.result:
        A side effect of Bug#989 -- slightly different table map ids.
      mysql-test/suite/binlog/t/binlog_row_drop_tbl.test:
        Add a test case for WL#4284/Bug#989.
      mysql-test/suite/binlog/t/binlog_stm_drop_tbl.test:
        Add a test case for WL#4284/Bug#989.
      mysql-test/suite/binlog/t/binlog_stm_row.test:
        Update to the new state name. This
        is actually a follow up to another patch for WL#4284, 
        that changes Locked thread state to Table lock.
      mysql-test/suite/ndb/r/ndb_index_ordered.result:
        Remove result for disabled part of the test case.
      mysql-test/suite/ndb/t/disabled.def:
        Temporarily disable a test case (Bug#45621).
      mysql-test/suite/ndb/t/ndb_index_ordered.test:
        Disable a part of a test case (needs update to
        reflect semantics of Bug#989).
      mysql-test/suite/rpl/t/disabled.def:
        Disable tests made meaningless by transactional metadata
        locking.
      mysql-test/suite/sys_vars/r/autocommit_func.result:
        Add a commit (Bug#989).
      mysql-test/suite/sys_vars/t/autocommit_func.test:
        Add a commit (Bug#989).
      mysql-test/t/flush_block_commit.test:
        Fix test case to reflect the fact that transactions now hold
        metadata locks for the duration of a transaction.
      mysql-test/t/flush_block_commit_notembedded.test:
        Fix test case to reflect the fact that transactions now hold
        metadata locks for the duration of a transaction.
        Add a test case for transaction-scope locks and the global
        read lock (Bug#989/WL#4284).
      mysql-test/t/innodb.test:
        Fix test case to reflect the fact that transactions now hold
        metadata locks for the duration of a transaction
        (effects of Bug#989/WL#4284).
      mysql-test/t/lock.test:
        Add a test case for Bug#989/WL#4284.
      mysql-test/t/not_embedded_server.test:
        Add a test case for Bug#989/WL#4284.
      mysql-test/t/partition_innodb_semi_consistent.test:
        Replace TRUNCATE with DELETE, to not issue
        an implicit commit of a transaction, and not depend
        on metadata locks.
      mysql-test/t/partition_sync.test:
        Temporarily disable the test case for Bug#43867,
        which needs a fix to be backported from 6.0.
      mysql-test/t/ps.test:
        Add a test case for semantics of PREPARE and transaction-scope
        locks: metadata locks on tables used in PREPARE are enclosed into a
        temporary savepoint, taken at the beginning of PREPARE,
        and released at the end. Thus PREPARE does not effect
        what locks a transaction owns.
      mysql-test/t/read_only_innodb.test:
        Fix test case to reflect the fact that transactions now hold
        metadata locks for the duration of a transaction 
        (Bug#989/WL#4284).
        
        Wait for the read_only statement to actually flush tables before
        sending other concurrent statements that depend on its state.
      mysql-test/t/xa.test:
        Fix test case to reflect the fact that transactions now hold
        metadata locks for the duration of a transaction 
        (Bug#989/WL#4284).
      sql/ha_ndbcluster_binlog.cc:
        Backport bits of changes of ha_ndbcluster_binlog.cc
        from 6.0, to fix the failing binlog test suite with
        WL#4284. WL#4284 implementation does not work
        with 5.1 implementation of ndbcluster binlog index.
      sql/log_event.cc:
        Release metadata locks after issuing a commit.
      sql/mdl.cc:
        Style changes (WL#4284).
      sql/mysql_priv.h:
        Rename parameter to match the name used in the definition (WL#4284).
      sql/rpl_injector.cc:
        Release metadata locks on commit (WL#4284).
      sql/rpl_rli.cc:
        Remove assert made meaningless, metadata locks are released
        at the end of the transaction.
      sql/set_var.cc:
        Close tables and release locks if autocommit mode is set.
      sql/slave.cc:
        Release metadata locks after a rollback.
      sql/sql_acl.cc:
        Don't implicitly unlock locked tables. Issue a implicit commit
        at the end and unlock tables.
      sql/sql_base.cc:
        Defer the release of metadata locks when closing tables
        if not required to.
        Issue a deadlock error if the locking protocol requires
        that a transaction re-acquire its locks.
        
        Release metadata locks when closing tables for reopen.
      sql/sql_class.cc:
        Release metadata locks if the thread is killed.
      sql/sql_parse.cc:
        Release metadata locks after implicitly committing a active
        transaction, or after explicit commits or rollbacks.
      sql/sql_plugin.cc:
        
        Allocate MDL request on the stack as the use of the table
        is contained within the function. It will be removed from
        the context once close_thread_tables is called at the end
        of the function.
      sql/sql_prepare.cc:
        The problem is that the prepare phase of the CREATE TABLE
        statement takes a exclusive metadata lock lock and this can
        cause a self-deadlock the thread already holds a shared lock
        on the table being that should be created.
        
        The solution is to make the prepare phase take a shared
        metadata lock when preparing a CREATE TABLE statement. The
        execution of the statement will still acquire a exclusive
        lock, but won't cause any problem as it issues a implicit
        commit.
        
        After some discussions with stakeholders it has been decided that
        metadata locks acquired during a PREPARE statement must be released
        once the statement is prepared even if it is prepared within a multi
        statement transaction.
      sql/sql_servers.cc:
        Don't implicitly unlock locked tables. Issue a implicit commit
        at the end and unlock tables.
      sql/sql_table.cc:
        Close table and release metadata locks after a admin operation.
      sql/table.h:
        The problem is that the prepare phase of the CREATE TABLE
        statement takes a exclusive metadata lock lock and this can
        cause a self-deadlock the thread already holds a shared lock
        on the table being that should be created.
        
        The solution is to make the prepare phase take a shared
        metadata lock when preparing a CREATE TABLE statement. The
        execution of the statement will still acquire a exclusive
        lock, but won't cause any problem as it issues a implicit
        commit.
      sql/transaction.cc:
        Release metadata locks after the implicitly committed due
        to a new transaction being started. Also, release metadata
        locks acquired after a savepoint if the transaction is rolled
        back to the save point.
        
        The problem is that in some cases transaction-long metadata locks
        could be released before the transaction was committed. This could
        happen when a active transaction was ended by a "START TRANSACTION"
        or "BEGIN" statement, in which case the metadata locks would be
        released before the actual commit of the active transaction.
        
        The solution is to defer the release of metadata locks to after the
        transaction has been implicitly committed. No test case is provided
        as the effort to provide one is too disproportional to the size of
        the fix.
      a14bbee5
    • Konstantin Osipov's avatar
      Backport of revno ## 2617.31.1, 2617.31.3, 2617.31.4, 2617.31.5, · 0b39c189
      Konstantin Osipov authored
      2617.31.12, 2617.31.15, 2617.31.15, 2617.31.16, 2617.43.1
      - initial changeset that introduced the fix for 
      Bug#989 and follow up fixes for all test suite failures
      introduced in the initial changeset. 
      ------------------------------------------------------------
      revno: 2617.31.1
      committer: Davi Arnaut <Davi.Arnaut@Sun.COM>
      branch nick: 4284-6.0
      timestamp: Fri 2009-03-06 19:17:00 -0300
      message:
      Bug#989: If DROP TABLE while there's an active transaction, wrong binlog order
      WL#4284: Transactional DDL locking
      
      Currently the MySQL server does not keep metadata locks on
      schema objects for the duration of a transaction, thus failing
      to guarantee the integrity of the schema objects being used
      during the transaction and to protect then from concurrent
      DDL operations. This also poses a problem for replication as
      a DDL operation might be replicated even thought there are
      active transactions using the object being modified.
      
      The solution is to defer the release of metadata locks until
      a active transaction is either committed or rolled back. This
      prevents other statements from modifying the table for the
      entire duration of the transaction. This provides commitment
      ordering for guaranteeing serializability across multiple
      transactions.
      
      - Incompatible change:
      
      If MySQL's metadata locking system encounters a lock conflict,
      the usual schema is to use the try and back-off technique to
      avoid deadlocks -- this schema consists in releasing all locks
      and trying to acquire them all in one go.
      
      But in a transactional context this algorithm can't be utilized
      as its not possible to release locks acquired during the course
      of the transaction without breaking the transaction commitments.
      To avoid deadlocks in this case, the ER_LOCK_DEADLOCK will be
      returned if a lock conflict is encountered during a transaction.
      
      Let's consider an example:
      
      A transaction has two statements that modify table t1, then table
      t2, and then commits. The first statement of the transaction will
      acquire a shared metadata lock on table t1, and it will be kept
      utill COMMIT to ensure serializability.
      
      At the moment when the second statement attempts to acquire a
      shared metadata lock on t2, a concurrent ALTER or DROP statement
      might have locked t2 exclusively. The prescription of the current
      locking protocol is that the acquirer of the shared lock backs off
      -- gives up all his current locks and retries. This implies that
      the entire multi-statement transaction has to be rolled back.
      
      - Incompatible change:
      
      FLUSH commands such as FLUSH PRIVILEGES and FLUSH TABLES WITH READ
      LOCK won't cause locked tables to be implicitly unlocked anymore.
      0b39c189
  14. 03 Dec, 2009 2 commits
    • Konstantin Osipov's avatar
      Backport of: · c52d4830
      Konstantin Osipov authored
      ------------------------------------------------------------
      revno: 2630.22.3
      committer: Davi Arnaut <Davi.Arnaut@Sun.COM>
      branch nick: 4284-6.0
      timestamp: Thu 2008-08-07 22:33:43 -0300
      message:
      WL#4284: Transactional DDL locking
      
      Make transaction management more modular through a new interface.
      
      The overall objective of this change is to provide groundwork
      for the design of transactional DDL locking by cleaning up the
      transaction high level API to better distinguish operations implicit
      and explicit, and single statement transaction from operations on
      the normal transaction.
      
      Having a a high-level interface for transaction management provides
      a better base for implementing transactional concepts that are not
      always tied to storage engines and also makes it easier to interect
      with other higher level modules of the server.
      
      client/Makefile.am:
        Add new file to the build.
      libmysqld/CMakeLists.txt:
        Add new file to the build.
      libmysqld/Makefile.am:
        Add new file to the build.
      sql/CMakeLists.txt:
        Add new file to the build.
      sql/Makefile.am:
        Add new file to the build.
      sql/handler.cc:
        Remove multiplexer commit or rollback function. Most callers already
        have enough information to decided whether to rollback or commit.
        Having plain and well named functions makes it easier to read
        and understand code.
      sql/handler.h:
        Remove wrapper function as the low level transaction functions
        shouldn't be called directly anymore.
      sql/log_event.cc:
        Rename transaction management functions to the new names.
      sql/log_event_old.cc:
        Rename transaction management functions to the new names.
      sql/mysql_priv.h:
        Remove obsolete functions for implicit and explicit commit.
      sql/rpl_injector.cc:
        Rename transaction management functions to the new names.
      sql/rpl_rli.cc:
        Rename transaction management functions to the new names.
      sql/set_var.cc:
        Rename transaction management functions to the new names.
      sql/slave.cc:
        Rename transaction management functions to the new names.
      sql/sql_base.cc:
        Rename transaction management functions to the new names.
      sql/sql_class.cc:
        Rename transaction management functions to the new names.
      sql/sql_delete.cc:
        Rename transaction management functions to the new names.
      sql/sql_do.cc:
        Rename transaction management functions to the new names.
      sql/sql_insert.cc:
        Rename transaction management functions to the new names.
      sql/sql_parse.cc:
        Rename transaction management functions to the new names.
      sql/sql_partition.cc:
        Rename transaction management functions to the new names.
      sql/sql_table.cc:
        Rename transaction management functions to the new names.
      sql/transaction.cc:
        Implement wrapper functions to differentiate operations on
        the single statement transaction from the ones operating
        on the normal transaction.
      sql/transaction.h:
        Export new functions for dealing with transaction commands.
      c52d4830
    • Konstantin Osipov's avatar
      Backport of: · c43f894c
      Konstantin Osipov authored
      ------------------------------------------------------------
      revno: 2630.22.3
      committer: Davi Arnaut <Davi.Arnaut@Sun.COM>
      branch nick: 4284-6.0
      timestamp: Thu 2008-08-07 22:33:43 -0300
      message:
      WL#4284: Transactional DDL locking
      
      Make transaction management more modular through a new interface.
      
      The overall objective of this change is to provide groundwork
      for the design of transactional DDL locking by cleaning up the
      transaction high level API to better distinguish operations implicit
      and explicit, and single statement transaction from operations on
      the normal transaction.
      
      Having a a high-level interface for transaction management provides
      a better base for implementing transactional concepts that are not
      always tied to storage engines and also makes it easier to interect
      with other higher level modules of the server.
      c43f894c
  15. 21 Nov, 2009 2 commits
    • He Zhenxing's avatar
      BUG#37148 Most callers of mysql_bin_log.write ignore the return result · dd383cad
      He Zhenxing authored
      This is the non-ndb part of the patch.
      
      The return value of mysql_bin_log.write was ignored by most callers,
      which may lead to inconsistent on master and slave if the transaction
      was committed while the binlog was not correctly written. If
      my_error() is call in mysql_bin_log.write, this could also lead to
      assertion issue if my_ok() or my_error() is called after.
      
      This fixed the problem by let the caller to check and handle the
      return value of mysql_bin_log.write. This patch only adresses the
      simple cases.
      
      
      mysql-test/include/binlog_inject_error.inc:
        inject binlog write error when doing a query
      mysql-test/suite/binlog/t/binlog_write_error.test:
        Simple test case to check if proper error is reported when injecting binlog write errors.
      sql/events.cc:
        check return value of mysql_bin_log.write
      sql/log.cc:
        check return value of mysql_bin_log.write
      sql/log_event.cc:
        check return value of mysql_bin_log.write
      sql/log_event_old.cc:
        check return value of mysql_bin_log.write
      sql/mysql_priv.h:
        Change write_bin_log to return int instead of void
      sql/rpl_injector.cc:
        check return value of writing binlog
      sql/sp.cc:
        check return value of writing binlog
      sql/sp_head.cc:
        return 1 if writing binlog failed
      sql/sql_acl.cc:
        check return value of writing binlog
      sql/sql_base.cc:
        check return value of writing binlog
      sql/sql_class.h:
        Change binlog_show_create_table to return int
      sql/sql_db.cc:
        Change write_to_binlog to return int
        check return value of writing binlog
      sql/sql_delete.cc:
        check return value of writing binlog
      sql/sql_insert.cc:
        check return value of writing binlog
      sql/sql_load.cc:
        check return value of writing binlog
      sql/sql_parse.cc:
        check return value of writing binlog
      sql/sql_partition.cc:
        check return value of writing binlog
      sql/sql_rename.cc:
        check return value of writing binlog
      sql/sql_repl.cc:
        check return value of writing binlog
      sql/sql_table.cc:
        Change write_bin_log to return int, and return 1 if there was error writing binlog
      sql/sql_tablespace.cc:
        check return value of writing binlog
      sql/sql_trigger.cc:
        check return value of writing binlog
      sql/sql_udf.cc:
        check return value of writing binlog
      sql/sql_update.cc:
        check return value of writing binlog
      sql/sql_view.cc:
        check return value of writing binlog
      dd383cad
    • He Zhenxing's avatar
      BUG#37148 Most callers of mysql_bin_log.write ignore the return result · 9b65f578
      He Zhenxing authored
      This is the non-ndb part of the patch.
      
      The return value of mysql_bin_log.write was ignored by most callers,
      which may lead to inconsistent on master and slave if the transaction
      was committed while the binlog was not correctly written. If
      my_error() is call in mysql_bin_log.write, this could also lead to
      assertion issue if my_ok() or my_error() is called after.
      
      This fixed the problem by let the caller to check and handle the
      return value of mysql_bin_log.write. This patch only adresses the
      simple cases.
      9b65f578
  16. 14 Jul, 2009 2 commits
    • Sven Sandberg's avatar
      BUG#39934: Slave stops for engine that only support row-based logging · 41783de5
      Sven Sandberg authored
      General overview:
      The logic for switching to row format when binlog_format=MIXED had
      numerous flaws. The underlying problem was the lack of a consistent
      architecture.
      General purpose of this changeset:
      This changeset introduces an architecture for switching to row format
      when binlog_format=MIXED. It enforces the architecture where it has
      to. It leaves some bugs to be fixed later. It adds extensive tests to
      verify that unsafe statements work as expected and that appropriate
      errors are produced by problems with the selection of binlog format.
      It was not practical to split this into smaller pieces of work.
      
      Problem 1:
      To determine the logging mode, the code has to take several parameters
      into account (namely: (1) the value of binlog_format; (2) the
      capabilities of the engines; (3) the type of the current statement:
      normal, unsafe, or row injection). These parameters may conflict in
      several ways, namely:
       - binlog_format=STATEMENT for a row injection
       - binlog_format=STATEMENT for an unsafe statement
       - binlog_format=STATEMENT for an engine only supporting row logging
       - binlog_format=ROW for an engine only supporting statement logging
       - statement is unsafe and engine does not support row logging
       - row injection in a table that does not support statement logging
       - statement modifies one table that does not support row logging and
         one that does not support statement logging
      Several of these conflicts were not detected, or were detected with
      an inappropriate error message. The problem of BUG#39934 was that no
      appropriate error message was written for the case when an engine
      only supporting row logging executed a row injection with
      binlog_format=ROW. However, all above cases must be handled.
      Fix 1:
      Introduce new error codes (sql/share/errmsg.txt). Ensure that all
      conditions are detected and handled in decide_logging_format()
      
      Problem 2:
      The binlog format shall be determined once per statement, in
      decide_logging_format(). It shall not be changed before or after that.
      Before decide_logging_format() is called, all information necessary to
      determine the logging format must be available. This principle ensures
      that all unsafe statements are handled in a consistent way.
      However, this principle is not followed:
      thd->set_current_stmt_binlog_row_based_if_mixed() is called in several
      places, including from code executing UPDATE..LIMIT,
      INSERT..SELECT..LIMIT, DELETE..LIMIT, INSERT DELAYED, and
      SET @@binlog_format. After Problem 1 was fixed, that caused
      inconsistencies where these unsafe statements would not print the
      appropriate warnings or errors for some of the conflicts.
      Fix 2:
      Remove calls to THD::set_current_stmt_binlog_row_based_if_mixed() from
      code executed after decide_logging_format(). Compensate by calling the
      set_current_stmt_unsafe() at parse time. This way, all unsafe statements
      are detected by decide_logging_format().
      
      Problem 3:
      INSERT DELAYED is not unsafe: it is logged in statement format even if
      binlog_format=MIXED, and no warning is printed even if
      binlog_format=STATEMENT. This is BUG#45825.
      Fix 3:
      Made INSERT DELAYED set itself to unsafe at parse time. This allows
      decide_logging_format() to detect that a warning should be printed or
      the binlog_format changed.
      
      Problem 4:
      LIMIT clause were not marked as unsafe when executed inside stored
      functions/triggers/views/prepared statements. This is
      BUG#45785.
      Fix 4:
      Make statements containing the LIMIT clause marked as unsafe at
      parse time, instead of at execution time. This allows propagating
      unsafe-ness to the view.
      
      
      mysql-test/extra/rpl_tests/create_recursive_construct.inc:
        Added auxiliary file used by binlog_unsafe.test to create and
        execute recursive constructs
        (functions/procedures/triggers/views/prepared statements).
      mysql-test/extra/rpl_tests/rpl_foreign_key.test:
        removed unnecessary set @@session.binlog_format
      mysql-test/extra/rpl_tests/rpl_insert_delayed.test:
        Filter out table id from table map events in binlog listing.
        Got rid of $binlog_format_statement.
      mysql-test/extra/rpl_tests/rpl_ndb_apply_status.test:
        disable warnings around call to unsafe procedure
      mysql-test/include/rpl_udf.inc:
        Disabled warnings for code that generates warnings
        for some binlog formats. That would otherwise cause
        inconsistencies in the result file.
      mysql-test/r/mysqldump.result:
        Views are now unsafe if they contain a LIMIT clause.
        That fixed BUG#45831. Due to BUG#45832, a warning is
        printed for the CREATE VIEW statement.
      mysql-test/r/sp_trans.result:
        Unsafe statements in stored procedures did not give a warning if
        binlog_format=statement. This is BUG#45824. Now they do, so this
        result file gets a new warning.
      mysql-test/suite/binlog/r/binlog_multi_engine.result:
        Error message changed.
      mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result:
        INSERT DELAYED didn't generate a warning when binlog_format=STATEMENT.
        That was BUG#45825. Now there is a warning, so result file needs to be
        updated.
      mysql-test/suite/binlog/r/binlog_stm_ps.result:
        Changed error message.
      mysql-test/suite/binlog/r/binlog_unsafe.result:
        updated result file:
         - error message changed
         - added test for most combinations of unsafe constructs invoked
           from recursive constructs
         - INSERT DELAYED now gives a warning (because BUG#45826 is fixed)
         - INSERT..SELECT..LIMIT now gives a warning from inside recursive
           constructs (because BUG#45785 was fixed)
         - When a recursive construct (e.g., stored proc or function)
           contains more than one statement, at least one of which is
           unsafe, then all statements in the recursive construct give
           warnings. This is a new bug introduced by this changeset.
           It will be addressed in a post-push fix.
      mysql-test/suite/binlog/t/binlog_innodb.test:
        Changed error code for innodb updates with READ COMMITTED or 
        READ UNCOMMITTED transaction isolation level and
        binlog_format=statement.
      mysql-test/suite/binlog/t/binlog_multi_engine.test:
        The error code has changed for statements where more than one
        engine is involved and one of them is self-logging.
      mysql-test/suite/binlog/t/binlog_unsafe-master.opt:
        Since binlog_unsafe now tests unsafe-ness of UDF's, we need an extra
        flag in the .opt file.
      mysql-test/suite/binlog/t/binlog_unsafe.test:
         - Clarified comment.
         - Rewrote first part of test. Now it tests not only unsafe variables
           and functions, but also unsafe-ness due to INSERT..SELECT..LIMIT,
           INSERT DELAYED, insert into two autoinc columns, use of UDF's, and
           access to log tables in the mysql database.
           Also, in addition to functions, procedures, triggers, and prepared
           statements, it now also tests views; and it constructs recursive
           calls in two levels by combining these recursive constructs.
           Part of the logic is in extra/rpl_tests/create_recursive_construct.inc.
         - added tests for all special system variables that should not be unsafe.
         - added specific tests for BUG#45785 and BUG#45825
      mysql-test/suite/rpl/r/rpl_events.result:
        updated result file
      mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result:
        updated result file
      mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result:
        updated result file
      mysql-test/suite/rpl/r/rpl_foreign_key_innodb.result:
        updated result file
      mysql-test/suite/rpl/r/rpl_idempotency.result:
        updated result file
      mysql-test/suite/rpl/r/rpl_mix_found_rows.result:
        Split rpl_found_rows.test into rpl_mix_found_rows.test (a new file) and
        rpl_stm_found_rows.test (renamed rpl_found_rows.test). This file equals
        the second half of the old rpl_found_rows.result, with the following
        modifications:
         - minor formatting changes
         - additional initialization
      mysql-test/suite/rpl/r/rpl_mix_insert_delayed.result:
        Moved out code operating in mixed mode from rpl_stm_insert_delayed
        (into rpl_mix_insert_delayed) and got rid of explicit setting of
        binlog format.
      mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result:
        updated result file
      mysql-test/suite/rpl/r/rpl_row_idempotency.result:
        Moved the second half of rpl_idempotency.test, which only
        executed in row mode, to rpl_row_idempotency.test. This is
        the new result file.
      mysql-test/suite/rpl/r/rpl_row_insert_delayed.result:
        Got rid of unnecessary explicit setting of binlog format.
      mysql-test/suite/rpl/r/rpl_stm_found_rows.result:
        Split rpl_found_rows.test into rpl_mix_found_rows.test (a new file) and
        rpl_stm_found_rows.test (renamed rpl_found_rows.test). Changes in
        this file:
         - minor formatting changes
         - warning is now issued for unsafe statements inside procedures
           (since BUG#45824 is fixed)
         - second half of file is moved to rpl_mix_found_rows.result
      mysql-test/suite/rpl/r/rpl_stm_insert_delayed.result:
        Moved out code operating in mixed mode from rpl_stm_insert_delayed
        (into rpl_mix_insert_delayed) and got rid of explicit setting of
        binlog format.
      mysql-test/suite/rpl/r/rpl_stm_loadfile.result:
        error message changed
      mysql-test/suite/rpl/r/rpl_temporary_errors.result:
        updated result file
      mysql-test/suite/rpl/r/rpl_udf.result:
        Remove explicit set of binlog format (and triplicate test execution)
        and rely on test system executing the test in all binlog formats.
      mysql-test/suite/rpl/t/rpl_bug31076.test:
        Test is only valid in mixed or row mode since it generates row events.
      mysql-test/suite/rpl/t/rpl_events.test:
        Removed explicit set of binlog_format and removed duplicate testing.
        Instead, we rely on the test system to try all binlog formats.
      mysql-test/suite/rpl/t/rpl_extraColmaster_innodb.test:
        Removed triplicate testing and instead relying on test system.
        Test is only relevant for row format since statement-based replication
        cannot handle extra columns on master.
      mysql-test/suite/rpl/t/rpl_extraColmaster_myisam.test:
        Removed triplicate testing and instead relying on test system.
        Test is only relevant for row format since statement-based replication
        cannot handle extra columns on master.
      mysql-test/suite/rpl/t/rpl_idempotency-slave.opt:
        Removed .opt file to avoid server restarts.
      mysql-test/suite/rpl/t/rpl_idempotency.test:
        - Moved out row-only tests to a new test file, rpl_row_idempotency.test.
          rpl_idempotency now only contains tests that execute in all
          binlog_formats.
        - While I was here, also removed .opt file to avoid server restarts.
          The slave_exec_mode is now set inside the test instead.
      mysql-test/suite/rpl/t/rpl_mix_found_rows.test:
        Split rpl_found_rows.test into rpl_mix_found_rows.test (a new file) and
        rpl_stm_found_rows.test (renamed rpl_found_rows.test). This file
        contains the second half of the original rpl_found_rows.test with the
        follwing changes:
         - initialization
         - removed SET_BINLOG_FORMAT and added have_binlog_format_mixed.inc
         - minor formatting changes
      mysql-test/suite/rpl/t/rpl_mix_insert_delayed.test:
        Moved out code operating in mixed mode from rpl_stm_insert_delayed
        (into rpl_mix_insert_delayed) and got rid of explicit setting of
        binlog format.
      mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test:
        Test cannot execute in statement mode, since we no longer
        switch to row format when binlog_format=statement.
        Enforced mixed mode throughout the test.
      mysql-test/suite/rpl/t/rpl_row_idempotency.test:
        Moved the second half of rpl_idempotency.test, which only
        executed in row mode, to this new file. We now rely on the
        test system to set binlog format.
      mysql-test/suite/rpl/t/rpl_row_insert_delayed.test:
         - Got rid of unnecessary explicit setting of binlog format.
         - extra/rpl_tests/rpl_insert_delayed.test does not need the
           $binlog_format_statement variable any more, so that was
           removed.
      mysql-test/suite/rpl/t/rpl_slave_skip.test:
        The test switches binlog_format internally and master generates both
        row and statement events. Hence, the slave must be able to log in both
        statement and row format. Hence test was changed to only execute in
        mixed mode.
      mysql-test/suite/rpl/t/rpl_stm_found_rows.test:
        Split rpl_found_rows.test into rpl_mix_found_rows.test (a new file) and
        rpl_stm_found_rows.test (renamed rpl_found_rows.test). Changes in
        this file:
         - minor formatting changes
         - added have_binlog_format_statement and removed SET BINLOG_FORMAT.
         - second half of file is moved to rpl_mix_found_rows.test
         - added cleanup code
      mysql-test/suite/rpl/t/rpl_stm_insert_delayed.test:
        Moved out code operating in mixed mode from rpl_stm_insert_delayed
        (into rpl_mix_insert_delayed) and got rid of explicit setting of
        binlog format.
      mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test:
        The test switches binlog_format internally and master generates both
        row and statement events. Hence, the slave must be able to log in both
        statement and row format. Hence test was changed to only execute in
        mixed mode on slave.
      mysql-test/suite/rpl/t/rpl_temporary_errors.test:
        Removed explicit set of binlog format. Instead, the test now only
        executes in row mode.
      mysql-test/suite/rpl/t/rpl_udf.test:
        Remove explicit set of binlog format (and triplicate test execution)
        and rely on test system executing the test in all binlog formats.
      mysql-test/suite/rpl_ndb/combinations:
        Added combinations file for rpl_ndb.
      mysql-test/suite/rpl_ndb/r/rpl_ndb_binlog_format_errors.result:
        new result file
      mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result:
        updated result file
      mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb.test:
        The test needs slave to be able to switch to row mode, so the
        test was changed to only execute in mixed and row mode.
      mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam.test:
        The test needs slave to be able to switch to row mode, so the
        test was changed to only execute in mixed and row mode.
      mysql-test/suite/rpl_ndb/t/rpl_ndb_basic.test:
        The test needs slave to be able to switch to row mode, so the
        test was changed to only execute in mixed and row mode.
      mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors-master.opt:
        new option file
      mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors-slave.opt:
        new option file
      mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors.test:
        New test case to verify all errors and warnings generated by
        decide_logging_format.
      mysql-test/suite/rpl_ndb/t/rpl_ndb_blob.test:
        The test needs slave to be able to switch to row mode, so the
        test was changed to only execute in mixed and row mode.
      mysql-test/suite/rpl_ndb/t/rpl_ndb_blob2.test:
        The test needs slave to be able to switch to row mode, so the
        test was changed to only execute in mixed and row mode.
      mysql-test/suite/rpl_ndb/t/rpl_ndb_circular.test:
        The test needs slave to be able to switch to row mode, so the
        test was changed to only execute in mixed and row mode.
      mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_simplex.test:
        The test needs slave to be able to switch to row mode, so the
        test was changed to only execute in mixed and row mode.
        While I was here, also made the test clean up after itself.
      mysql-test/suite/rpl_ndb/t/rpl_ndb_commit_afterflush.test:
        The test needs slave to be able to switch to row mode, so the
        test was changed to only execute in mixed and row mode.
      mysql-test/suite/rpl_ndb/t/rpl_ndb_ctype_ucs2_def.test:
        The test needs slave to be able to switch to row mode, so the
        test was changed to only execute in mixed and row mode.
      mysql-test/suite/rpl_ndb/t/rpl_ndb_delete_nowhere.test:
        The test needs slave to be able to switch to row mode, so the
        test was changed to only execute in mixed and row mode.
      mysql-test/suite/rpl_ndb/t/rpl_ndb_do_db.test:
        The test needs slave to be able to switch to row mode, so the
        test was changed to only execute in mixed and row mode.
      mysql-test/suite/rpl_ndb/t/rpl_ndb_do_table.test:
        The test needs slave to be able to switch to row mode, so the
        test was changed to only execute in mixed and row mode.
      mysql-test/suite/rpl_ndb/t/rpl_ndb_func003.test:
        The test needs slave to be able to switch to row mode, so the
        test was changed to only execute in mixed and row mode.
      mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb_trans.test:
        The test needs slave to be able to switch to row mode, so the
        test was changed to only execute in mixed and row mode.
      mysql-test/suite/rpl_ndb/t/rpl_ndb_insert_ignore.test:
        The test needs slave to be able to switch to row mode, so the
        test was changed to only execute in mixed and row mode.
      mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_engines_transactions.test:
        The test needs slave to be able to switch to row mode, so the
        test was changed to only execute in mixed and row mode.
      mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update3.test:
        The test needs slave to be able to switch to row mode, so the
        test was changed to only execute in mixed and row mode.
      mysql-test/suite/rpl_ndb/t/rpl_ndb_rep_ignore.test:
        The test needs slave to be able to switch to row mode, so the
        test was changed to only execute in mixed and row mode.
      mysql-test/suite/rpl_ndb/t/rpl_ndb_row_001.test:
        The test needs slave to be able to switch to row mode, so the
        test was changed to only execute in mixed and row mode.
      mysql-test/suite/rpl_ndb/t/rpl_ndb_sp003.test:
        The test needs slave to be able to switch to row mode, so the
        test was changed to only execute in mixed and row mode.
      mysql-test/suite/rpl_ndb/t/rpl_ndb_sp006.test:
        The test needs slave to be able to switch to row mode, so the
        test was changed to only execute in mixed and row mode.
      mysql-test/suite/rpl_ndb/t/rpl_ndb_trig004.test:
        The test needs slave to be able to switch to row mode, so the
        test was changed to only execute in mixed and row mode.
      mysql-test/t/partition_innodb_stmt.test:
        Changed error code for innodb updates with READ COMMITTED or 
        READ UNCOMMITTED transaction isolation level and
        binlog_format=statement.
      sql/event_db_repository.cc:
        Use member function to read current_stmt_binlog_row_based.
      sql/events.cc:
        Use member function to read current_stmt_binlog_row_based.
      sql/ha_ndbcluster_binlog.cc:
        reset_current_stmt_binlog_row_based() is not a no-op for the ndb_binlog
        thread any more. Instead, the ndb_binlog thread now forces row mode both
        initially and just after calling mysql_parse.  (mysql_parse() is the only
        place where reset_current_stmt_binlog_row_based() may be called from
        the ndb_binlog thread, so these are the only two places that need to
        change.)
      sql/ha_partition.cc:
        Use member function to read current_stmt_binlog_row_based.
      sql/handler.cc:
        Use member function to read current_stmt_binlog_row_based.
      sql/item_create.cc:
        Added DBUG_ENTER to some functions, to be able to trace when
        set_stmt_unsafe is called.
      sql/log.cc:
        Use member function to read current_stmt_binlog_row_based.
      sql/log_event.cc:
         - Moved logic for changing to row format out of do_apply_event (and into
           decide_logging_format).
         - Added @todo comment for post-push cleanup.
      sql/log_event_old.cc:
        Move logic for changing to row format out of do_apply_event (and into
        decide_logging_format).
      sql/mysql_priv.h:
        Make decide_logging_format() a member of the THD class, for two reasons:
         - It is natural from an object-oriented perspective.
         - decide_logging_format() needs to access private members of THD
           (specifically, the new binlog_warning_flags field).
      sql/rpl_injector.cc:
        Removed call to set_current_stmt_binlog_row_based().
        From now on, only decide_logging_fromat is allowed to modify
        current_stmt_binlog_row_based. This call is from the ndb_binlog
        thread, mostly executing code in ha_ndbcluster_binlog.cc.
        This call can be safely removed, because:
         - current_stmt_binlog_row_based is initialized for the ndb_binlog
           thread's THD object when the THD object is created. So we're
           not going to read uninitialized memory.
         - The behavior of ndb_binlog thread does not use the state of the
           current_stmt_binlog_row_based. It is conceivable that the
           ndb_binlog thread would rely on the current_stmt_binlog_format
           in two situations:
            (1) when it calls mysql_parse;
            (2) when it calls THD::binlog_query.
           In case (1), it always clears THD::options&OPTION_BIN_LOG (because
           run_query() in ha_ndbcluster_binlog.cc is only called with
           disable_binlogging = TRUE).
           In case (2), it always uses qtype=STMT_QUERY_TYPE.
      sql/set_var.cc:
        Added @todo comment for post-push cleanup.
      sql/share/errmsg.txt:
        Added new error messages and clarified ER_BINLOG_UNSAFE_STATEMENT.
      sql/sp.cc:
        Added DBUG_ENTER, to be able to trace when set_stmt_unsafe is called.
        Got rid of MYSQL_QUERY_TYPE: it was equivalent to STMT_QUERY_TYPE.
      sql/sp_head.cc:
        Use member function to read current_stmt_binlog_row_based.
      sql/sp_head.h:
        Added DBUG_ENTER, to be able to trace when set_stmt_unsafe is called.
      sql/sql_acl.cc:
        Got rid of MYSQL_QUERY_TYPE: it was equivalent to STMT_QUERY_TYPE.
      sql/sql_base.cc:
         - Made decide_logging_format take care of all logic for deciding the
           logging format, and for determining the related warnings and errors.
           See comment above decide_logging_format for details.
         - Made decide_logging_format a member function of THD, since it needs
           to access private members of THD and since its purpose is to update
           the state of a THD object.
         - Added DBUG_ENTER, to be able to trace when set_stmt_unsafe is called.
      sql/sql_class.cc:
        - Moved logic for determining unsafe warnings away from THD::binlog_query
          (and into decide_logging_format()). Now, it works like this:
          1. decide_logging_format detects that the current statement shall
             produce a warning, if it ever makes it to the binlog
          2. decide_logging_format sets a flag of THD::binlog_warning_flags.
          3. THD::binlog_query reads the flag. If the flag is set, it generates
             a warning.
        - Use member function to read current_stmt_binlog_row_based.
      sql/sql_class.h:
        - Added THD::binlog_warning_flags (see sql_class.cc for explanation).
        - Made decide_logging_format() and reset_for_next_command() member
          functions of THD (instead of standalone functions). This was needed
          for two reasons: (1) the functions need to access the private member
          THD::binlog_warning_flags; (2) the purpose of these functions is to
          update the staet of a THD object, so from an object-oriented point
          of view they should be member functions.
        - Encapsulated current_stmt_binlog_row_based, so it is now private and
          can only be accessed from a member function. Also changed the
          data type to an enumeration instead of a bool.
        - Removed MYSQL_QUERY_TYPE, because it was equivalent to
          STMT_QUERY_TYPE anyways.
        - When reset_current_stmt_binlog_row_based was called from the
          ndb_binlog thread, it would behave as a no-op. This special
          case has been removed, and the behavior of
          reset_current_stmt_binlog_row_based does not depend on which thread
          calls it any more. The special case did not serve any purpose,
          since the ndb binlog thread did not take the
          current_stmt_binlog_row_based flag into account anyways.
      sql/sql_delete.cc:
        - Moved logic for setting row format for DELETE..LIMIT away from
          mysql_prepare_delete.
          (Instead, we mark the statement as unsafe at parse time (sql_yacc.yy)
          and rely on decide_logging_format() (sql_class.cc) to set row format.)
          This is part of the fix for BUG#45831.
        - Use member function to read current_stmt_binlog_row_based.
      sql/sql_insert.cc:
         - Removed unnecessary calls to thd->lex->set_stmt_unsafe() and
           thd->set_current_stmt_binlog_row_based_if_mixed() from
           handle_delayed_insert(). The calls are unnecessary because they
           have already been made; they were made in the constructor of
           the `di' object.
         - Since decide_logging_format() is now a member function of THD, code
           that calls decide_logging_format() had to be updated.
         - Added DBUG_ENTER call, to be able to trace when set_stmt_unsafe is
           called.
         - Moved call to set_stmt_unsafe() for INSERT..SELECT..LIMIT away from
           mysql_insert_select_prepare() (and into decide_logging_format).
           This is part of the fix for BUG#45831.
         - Use member function to read current_stmt_binlog_row_based.
      sql/sql_lex.h:
         - Added the flag BINLOG_STMT_FLAG_ROW_INJECTION to enum_binlog_stmt_flag.
           This was necessary so that a statement can identify itself as a row
           injection.
         - Added appropriate setter and getter functions for the new flag.
         - Added or clarified some comments.
         - Added DBUG_ENTER()
      sql/sql_load.cc:
        Use member function to read current_stmt_binlog_row_based.
      sql/sql_parse.cc:
         - Made mysql_reset_thd_for_next_command() clear thd->binlog_warning_flags.
         - Since thd->binlog_warning_flags is private, it must be set in a
           member function of THD. Hence, moved the body of
           mysql_reset_thd_for_next_command() to the new member function
           THD::reset_thd_for_next_command(), and made
           mysql_reset_thd_for_next_command() call
           THD::reset_thd_for_next_command().
         - Removed confusing comment.
         - Use member function to read current_stmt_binlog_row_based.
      sql/sql_repl.cc:
        Use member function to read current_stmt_binlog_row_based.
      sql/sql_table.cc:
        Use member function to read current_stmt_binlog_row_based.
      sql/sql_udf.cc:
        Use member function to read current_stmt_binlog_row_based.
      sql/sql_update.cc:
        Moved logic for setting row format for UPDATE..LIMIT away from
        mysql_prepare_update.
        (Instead, we mark the statement as unsafe at parse time (sql_yacc.yy)
        and rely on decide_logging_format() (sql_class.cc) to set row format.)
        This is part of the fix for BUG#45831.
      sql/sql_yacc.yy:
        Made INSERT DELAYED, INSERT..SELECT..LIMIT, UPDATE..LIMIT, and
        DELETE..LIMIT mark themselves as unsafe at parse time (instead
        of at execution time).
        This is part of the fixes BUG#45831 and BUG#45825.
      storage/example/ha_example.cc:
        Made exampledb accept inserts. This was needed by the new test case
        rpl_ndb_binlog_format_errors, because it needs an engine that
        is statement-only (and accepts inserts).
      storage/example/ha_example.h:
        Made exampledb a statement-only engine instead of a row-only engine.
        No existing test relied exampledb's row-only capabilities. The new
        test case rpl_ndb_binlog_format_errors needs an engine that is
        statement-only.
      storage/innobase/handler/ha_innodb.cc:
        - Changed error error code and message given by innodb when 
          binlog_format=STATEMENT and transaction isolation level is
          READ COMMITTED or READ UNCOMMITTED.
        - While I was here, also simplified the condition for
          checking when to give the error.
      41783de5
    • Sven Sandberg's avatar
      BUG#39934: Slave stops for engine that only support row-based logging · f3985c64
      Sven Sandberg authored
      General overview:
      The logic for switching to row format when binlog_format=MIXED had
      numerous flaws. The underlying problem was the lack of a consistent
      architecture.
      General purpose of this changeset:
      This changeset introduces an architecture for switching to row format
      when binlog_format=MIXED. It enforces the architecture where it has
      to. It leaves some bugs to be fixed later. It adds extensive tests to
      verify that unsafe statements work as expected and that appropriate
      errors are produced by problems with the selection of binlog format.
      It was not practical to split this into smaller pieces of work.
      
      Problem 1:
      To determine the logging mode, the code has to take several parameters
      into account (namely: (1) the value of binlog_format; (2) the
      capabilities of the engines; (3) the type of the current statement:
      normal, unsafe, or row injection). These parameters may conflict in
      several ways, namely:
       - binlog_format=STATEMENT for a row injection
       - binlog_format=STATEMENT for an unsafe statement
       - binlog_format=STATEMENT for an engine only supporting row logging
       - binlog_format=ROW for an engine only supporting statement logging
       - statement is unsafe and engine does not support row logging
       - row injection in a table that does not support statement logging
       - statement modifies one table that does not support row logging and
         one that does not support statement logging
      Several of these conflicts were not detected, or were detected with
      an inappropriate error message. The problem of BUG#39934 was that no
      appropriate error message was written for the case when an engine
      only supporting row logging executed a row injection with
      binlog_format=ROW. However, all above cases must be handled.
      Fix 1:
      Introduce new error codes (sql/share/errmsg.txt). Ensure that all
      conditions are detected and handled in decide_logging_format()
      
      Problem 2:
      The binlog format shall be determined once per statement, in
      decide_logging_format(). It shall not be changed before or after that.
      Before decide_logging_format() is called, all information necessary to
      determine the logging format must be available. This principle ensures
      that all unsafe statements are handled in a consistent way.
      However, this principle is not followed:
      thd->set_current_stmt_binlog_row_based_if_mixed() is called in several
      places, including from code executing UPDATE..LIMIT,
      INSERT..SELECT..LIMIT, DELETE..LIMIT, INSERT DELAYED, and
      SET @@binlog_format. After Problem 1 was fixed, that caused
      inconsistencies where these unsafe statements would not print the
      appropriate warnings or errors for some of the conflicts.
      Fix 2:
      Remove calls to THD::set_current_stmt_binlog_row_based_if_mixed() from
      code executed after decide_logging_format(). Compensate by calling the
      set_current_stmt_unsafe() at parse time. This way, all unsafe statements
      are detected by decide_logging_format().
      
      Problem 3:
      INSERT DELAYED is not unsafe: it is logged in statement format even if
      binlog_format=MIXED, and no warning is printed even if
      binlog_format=STATEMENT. This is BUG#45825.
      Fix 3:
      Made INSERT DELAYED set itself to unsafe at parse time. This allows
      decide_logging_format() to detect that a warning should be printed or
      the binlog_format changed.
      
      Problem 4:
      LIMIT clause were not marked as unsafe when executed inside stored
      functions/triggers/views/prepared statements. This is
      BUG#45785.
      Fix 4:
      Make statements containing the LIMIT clause marked as unsafe at
      parse time, instead of at execution time. This allows propagating
      unsafe-ness to the view.
      f3985c64
  17. 19 Feb, 2008 2 commits
    • unknown's avatar
      A fix and a test case for Bug#12713 "Error in a stored function called from · 526798db
      unknown authored
      a SELECT doesn't cause ROLLBACK of statem".
      
      The idea of the fix is to ensure that we always commit the current
      statement at the end of dispatch_command(). In order to not issue
      redundant disc syncs, an optimization of the two-phase commit
      protocol is implemented to bypass the two phase commit if
      the transaction is read-only.
      
      
      mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result:
        Update test results.
      mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result:
        Update test results.
      mysql-test/suite/rpl_ndb/t/disabled.def:
        Disable the tests, for which this changeset reveals a bug:
        the injector thread does not always add 'statement commit' to the
        rows injected in circular replication set up.
        To be investigated separately.
      sql/ha_ndbcluster_binlog.cc:
        Add close_thread_tables() to run_query: this ensures
        that all tables are closed and there is no pending statement transaction.
      sql/handler.cc:
        Implement optimisation of read-only transactions.
        If a transaction consists only of DML statements that do not change
        data, we do not perform a two-phase commit for it 
        (run one phase commit only).
      sql/handler.h:
        Implement optimisation of read-only transactions.
        If a transaction consists only of DML statements that do not change
        data, we do not perform a two-phase commit for it 
        (run one phase commit only).
      sql/log.cc:
        Mark the binlog transaction read-write whenever it's started.
        We never read from binlog, so it's safe and least intrusive to add
        this mark up here.
      sql/log_event.cc:
        Update to the new layout of thd->transaction.
      sql/rpl_injector.cc:
        Always commit statement transaction before committing the global one.
      sql/sp.cc:
        Ad comments.
      sql/sp_head.cc:
        Add comments.
      sql/sql_base.cc:
        Commit transaction at the end of the statement. Always.
      sql/sql_class.cc:
        Update thd_ha_data to return the right pointer in the new layout.
        
        Fix select_dumpvar::send_data to properly return operation status.
        A test case from commit.inc would lead to an assertion failure in the 
        diagnostics area (double assignment). Not test otherwise by the test suite.
      sql/sql_class.h:
        Implement a new layout of storage engine transaction info in which 
        it is easy to access all members related to the handlerton only
        based on ht->slot.
      sql/sql_cursor.cc:
        Update to the new layout of thd->transaction.
      sql/sql_delete.cc:
        Remove wrong and now redundant calls to ha_autocommit_or_rollback.
        The transaction is committed in one place, at the end of the statement.
        Remove calls to mysql_unlock_tables, since some engines count locks
        and commit statement transaction in unlock_tables(), which essentially
        equates mysql_unlock_tables to ha_autocommit_or_rollback.
        Previously it was necessary to unlock tables soon because we wanted
        to avoid sending of 'ok' packet to the client under locked tables.
        This is no longer necessary, since OK packet is also sent from one place
        at the end of transaction.
      sql/sql_do.cc:
        Add DO always clears the error, we must rollback the current
        statement before this happens. Otherwise the statement will be committed,
        and not rolled back in the end.
      sql/sql_insert.cc:
        Remove wrong and now redundant calls to ha_autocommit_or_rollback.
        The transaction is committed in one place, at the end of the statement.
        Remove calls to mysql_unlock_tables, since some engines count locks
        and commit statement transaction in unlock_tables(), which essentially
        equates mysql_unlock_tables to ha_autocommit_or_rollback.
        Previously it was necessary to unlock tables soon because we wanted
        to avoid sending of 'ok' packet to the client under locked tables.
        This is no longer necessary, since OK packet is also sent from one place
        at the end of transaction.
      sql/sql_load.cc:
        Remove wrong and now redundant calls to ha_autocommit_or_rollback.
        The transaction is committed in one place, at the end of the statement.
        Remove calls to mysql_unlock_tables, since some engines count locks
        and commit statement transaction in unlock_tables(), which essentially
        equates mysql_unlock_tables to ha_autocommit_or_rollback.
        Previously it was necessary to unlock tables soon because we wanted
        to avoid sending of 'ok' packet to the client under locked tables.
        This is no longer necessary, since OK packet is also sent from one place
        at the end of transaction.
      sql/sql_parse.cc:
        Implement optimisation of read-only transactions: bypass 2-phase
        commit for them.
        Always commit statement transaction before commiting the global one.
        Fix an unrelated crash in check_table_access, when called from 
        information_schema.
      sql/sql_partition.cc:
        Partitions commit at the end of a DDL operation.
        Make sure that send_ok() is done only if the commit has succeeded.
      sql/sql_table.cc:
        Use ha_autocommit_or_rollback and end_active_trans everywhere.
        Add end_trans to mysql_admin_table, so that it leaves no pending
        transaction.
      sql/sql_udf.cc:
        Remvove a redundant call to close_thread_tables()
      sql/sql_update.cc:
        Remove wrong and now redundant calls to ha_autocommit_or_rollback.
        The transaction is committed in one place, at the end of the statement.
        Remove calls to mysql_unlock_tables, since some engines count locks
        and commit statement transaction in unlock_tables(), which essentially
        equates mysql_unlock_tables to ha_autocommit_or_rollback.
        Previously it was necessary to unlock tables soon because we wanted
        to avoid sending of 'ok' packet to the client under locked tables.
        This is no longer necessary, since OK packet is also sent from one place
        at the end of transaction.
      mysql-test/include/commit.inc:
        New BitKeeper file ``mysql-test/include/commit.inc''
      mysql-test/r/commit_1innodb.result:
        New BitKeeper file ``mysql-test/r/commit_1innodb.result''
      mysql-test/t/commit_1innodb.test:
        New BitKeeper file ``mysql-test/t/commit_1innodb.test''
      526798db
    • kostja@dipika.(none)'s avatar
      A fix and a test case for Bug#12713 "Error in a stored function called from · acf9b1f3
      kostja@dipika.(none) authored
      a SELECT doesn't cause ROLLBACK of statem".
      
      The idea of the fix is to ensure that we always commit the current
      statement at the end of dispatch_command(). In order to not issue
      redundant disc syncs, an optimization of the two-phase commit
      protocol is implemented to bypass the two phase commit if
      the transaction is read-only.
      acf9b1f3
  18. 11 Jan, 2008 1 commit
    • unknown's avatar
      WL#3072 Maria Recovery · 17f07388
      unknown authored
      All statements doing an implicit commit now also do one in Maria.
      This is useful because LOCK TABLES; REPAIR; crash; is not rollback-able,
      the implicit commit of REPAIR avoid that Recovery tries to rollback
      and fails.
      Fix for BUG#33827 "COMMIT AND CHAIN causes serious Valgrind error"
      (maybe not the definite one, depends on the assigned dev).
      
      
      mysql-test/t/maria-recovery.test:
        test of REPAIR's implicit commit. I cannot commit the result file
        because maria-recovery fails in vanilla tree (seen in pushbuild) but
        its new section looks like:
        repair table t1;
        Table   Op      Msg_type        Msg_text
        mysqltest.t1    repair  status  OK
        insert into t1 values(2);
        select * from t1;
        a
        1
        2
        3
        SET SESSION debug="+d,maria_flush_whole_log,maria_flush_whole_page_cache,maria_crash";
        * crashing mysqld intentionally
        set global maria_checkpoint_interval=1;
        ERROR HY000: Lost connection to MySQL server during query
        * recovery happens
        check table t1 extended;
        Table   Op      Msg_type        Msg_text
        mysqltest.t1    check   status  OK
        * testing that checksum after recovery is as expected
        Checksum-check
        failure
        use mysqltest;
        select * from t1;
        a
        1
        3
        Which is as it should be.
      sql/rpl_injector.cc:
        fix for BUG#33827
      sql/sql_parse.cc:
        - All DDLs and mysql_admin_table() (REPAIR etc) use end_actrive_trans()
        to do an implicit commit so we add there an implicit commit of the
        Maria transaction.
        - Fix for BUG#33827
      storage/maria/ha_maria.cc:
        - A method to do implicit commit in Maria
        - After an implicit commit, if it was under LOCK TABLES, the locked
        tables have a stale file->trn: update it.
      storage/maria/ha_maria.h:
        new static method
      storage/maria/ma_check.c:
        bugfix: this disabling of transactionality had the effect that if
        LOCK TABLES; REPAIR; INSERT then the INSERT ran non-transactional
        (so couldn't be undone in case of crash, if, by bad chance, its
        effect on pages went to disk).
      storage/maria/ma_checkpoint.c:
        indentation
      storage/maria/ma_recovery.c:
        dbug statements
      storage/maria/trnman.c:
        When doing an implicit commit we need to know the number of locked
        tables of the committed transaction and copy it to the new transaction
      storage/maria/trnman_public.h:
        prototype change
      17f07388
  19. 12 Apr, 2007 2 commits
    • unknown's avatar
      Bug#17095 circular replication for ndb · f3d010f7
      unknown authored
      - test case
      - reset server id in injector
      
      
      client/mysqltest.c:
        save master pos for ndb should look at handled epoch instead of applied
      sql/rpl_injector.cc:
        Bug#17095 circular replication for ndb
        - reset server id in injector
      mysql-test/r/rpl_ndb_circular.result:
        New BitKeeper file ``mysql-test/r/rpl_ndb_circular.result''
      mysql-test/t/rpl_ndb_circular.test:
        New BitKeeper file ``mysql-test/t/rpl_ndb_circular.test''
      f3d010f7
    • tomas@whalegate.ndb.mysql.com's avatar
      Bug#17095 circular replication for ndb · 036f4e40
      tomas@whalegate.ndb.mysql.com authored
      - test case
      - reset server id in injector
      036f4e40
  20. 03 Apr, 2007 2 commits
  21. 29 Mar, 2007 2 commits
    • unknown's avatar
      WL#3464: Add replication event to denote gap in replication · adaf162b
      unknown authored
      Adding an event that can be used to denote that an incident occured
      on the master. The event can be used to denote a gap in the replication
      stream, but can also be used to denote other incidents.
      
      In addition, the injector interface is extended with functions to
      generate an incident event. The function will also rotate the binary
      log after generating an incident event to get a fresh binary log.
      
      
      client/Makefile.am:
        Adding file rpl_constants.h with constants for replication.
      mysql-test/extra/binlog_tests/binlog.test:
        Binlog position change
      mysql-test/extra/binlog_tests/binlog_insert_delayed.test:
        Binlog position change
      mysql-test/extra/binlog_tests/ctype_cp932_binlog.test:
        Binlog position change
      mysql-test/extra/binlog_tests/ctype_ucs_binlog.test:
        Binlog position change
      mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test:
        Binlog position change
      mysql-test/extra/rpl_tests/rpl_deadlock.test:
        Binlog position change
      mysql-test/extra/rpl_tests/rpl_log.test:
        Binlog position change
      mysql-test/extra/rpl_tests/rpl_multi_query.test:
        Binlog position change
      mysql-test/extra/rpl_tests/rpl_row_charset.test:
        Binlog position change
      mysql-test/extra/rpl_tests/rpl_row_sp002.test:
        Binlog position change
      mysql-test/extra/rpl_tests/rpl_row_sp003.test:
        Binlog position change
      mysql-test/extra/rpl_tests/rpl_stm_charset.test:
        Binlog position change
      mysql-test/include/show_binlog_events.inc:
        Binlog position change
      mysql-test/r/binlog_row_binlog.result:
        Result change
      mysql-test/r/binlog_row_ctype_ucs.result:
        Result change
      mysql-test/r/binlog_row_insert_select.result:
        Result change
      mysql-test/r/binlog_row_mix_innodb_myisam.result:
        Result change
      mysql-test/r/binlog_stm_binlog.result:
        Result change
      mysql-test/r/binlog_stm_ctype_ucs.result:
        Result change
      mysql-test/r/binlog_stm_insert_select.result:
        Result change
      mysql-test/r/binlog_stm_mix_innodb_myisam.result:
        Result change
      mysql-test/r/ctype_cp932_binlog_row.result:
        Result change
      mysql-test/r/ctype_cp932_binlog_stm.result:
        Result change
      mysql-test/r/flush_block_commit_notembedded.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_flushlog_loop.result:
        Result change
      mysql-test/r/rpl_loaddata.result:
        Result change
      mysql-test/r/rpl_loaddata_s.result:
        Result change
      mysql-test/r/rpl_log_pos.result:
        Result change
      mysql-test/r/rpl_ndb_charset.result:
        Result change
      mysql-test/r/rpl_ndb_log.result:
        Result change
      mysql-test/r/rpl_ndb_multi.result:
        Result change
      mysql-test/r/rpl_rbr_to_sbr.result:
        Result change
      mysql-test/r/rpl_rotate_logs.result:
        Result change
      mysql-test/r/rpl_row_basic_11bugs.result:
        Result change
      mysql-test/r/rpl_row_charset.result:
        Result change
      mysql-test/r/rpl_row_create_table.result:
        Result change
      mysql-test/r/rpl_row_delayed_ins.result:
        Result change
      mysql-test/r/rpl_row_drop.result:
        Result change
      mysql-test/r/rpl_row_flsh_tbls.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_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_sp.result:
        Result change
      mysql-test/r/rpl_stm_charset.result:
        Result change
      mysql-test/r/rpl_stm_flsh_tbls.result:
        Result change
      mysql-test/r/rpl_stm_log.result:
        Result change
      mysql-test/r/rpl_stm_max_relay_size.result:
        Result change
      mysql-test/r/rpl_stm_multi_query.result:
        Result change
      mysql-test/r/rpl_stm_reset_slave.result:
        Result change
      mysql-test/r/rpl_stm_until.result:
        Result change
      mysql-test/r/rpl_switch_stm_row_mixed.result:
        Result change
      mysql-test/r/rpl_truncate_2myisam.result:
        Result change
      mysql-test/r/rpl_truncate_3innodb.result:
        Result change
      mysql-test/r/rpl_truncate_7ndb.result:
        Result change
      mysql-test/r/user_var-binlog.result:
        Result change
      mysql-test/t/binlog_row_mix_innodb_myisam.test:
        Binlog position change
      mysql-test/t/binlog_stm_mix_innodb_myisam.test:
        Binlog position change
      mysql-test/t/ctype_cp932_binlog_stm.test:
        Binlog position change
      mysql-test/t/mysqlbinlog.test:
        Binlog position change
      mysql-test/t/mysqlbinlog2.test:
        Binlog position change
      mysql-test/t/rpl_loaddata_s.test:
        Binlog position change
      mysql-test/t/rpl_log_pos.test:
        Binlog position change
      mysql-test/t/rpl_row_basic_11bugs.test:
        Binlog position change
      mysql-test/t/rpl_row_create_table.test:
        Binlog position change
      mysql-test/t/rpl_row_flsh_tbls.test:
        Binlog position change
      mysql-test/t/rpl_row_mysqlbinlog.test:
        Binlog position change
      mysql-test/t/rpl_sp.test:
        Binlog position change
      mysql-test/t/rpl_stm_flsh_tbls.test:
        Binlog position change
      mysql-test/t/rpl_switch_stm_row_mixed.test:
        Binlog position change
      mysql-test/t/user_var-binlog.test:
        Binlog position change
      sql/Makefile.am:
        Adding file rpl_constants.h with constants for replication.
      sql/log_event.cc:
        Changing prototype for read_str() to be const-correct and changing code to match that.
        Adding incident log event.
      sql/log_event.h:
        Adding incident log event.
      sql/rpl_injector.cc:
        Adding support for generating incidents into the binary log.
      sql/rpl_injector.h:
        Adding support for generating incidents into the binary log.
      sql/share/errmsg.txt:
        Adding new error message to indicate an incident.
      sql/sql_parse.cc:
        Adding code to generate an incident log event just before executing a REPLACE
        if the variable "incident_database_resync_on_replace" is set.
      mysql-test/r/rpl_incident.result:
        New BitKeeper file ``mysql-test/r/rpl_incident.result''
      mysql-test/t/rpl_incident.test:
        New BitKeeper file ``mysql-test/t/rpl_incident.test''
      sql/rpl_constants.h:
        New BitKeeper file ``sql/rpl_constants.h''
      adaf162b
    • mats@romeo.(none)'s avatar
      WL#3464: Add replication event to denote gap in replication · 7c187c2c
      mats@romeo.(none) authored
      Adding an event that can be used to denote that an incident occured
      on the master. The event can be used to denote a gap in the replication
      stream, but can also be used to denote other incidents.
      
      In addition, the injector interface is extended with functions to
      generate an incident event. The function will also rotate the binary
      log after generating an incident event to get a fresh binary log.
      7c187c2c
  22. 31 Dec, 2006 2 commits
    • unknown's avatar
      Many files: · d73b5b8e
      unknown authored
        Removed "MySQL Finland AB & TCX DataKonsult AB" from copyright header
        Adjusted year(s) in copyright header 
        Added GPL copyright text
      my_vle.h, rpl_utility.h, my_vle.c, base64-t.c, rpl_utility.cc:
        Changed copyright header formatting some
      plugin_example.c, daemon_example.c:
        Added "Copyright (C) 2006 MySQL AB" to GPL header
      
      
      CMakeLists.txt:
        Added GPL copyright text
      client/CMakeLists.txt:
        Added GPL copyright text
      dbug/CMakeLists.txt:
        Added GPL copyright text
      extra/CMakeLists.txt:
        Added GPL copyright text
      extra/yassl/CMakeLists.txt:
        Added GPL copyright text
      extra/yassl/taocrypt/CMakeLists.txt:
        Added GPL copyright text
      libmysql/CMakeLists.txt:
        Added GPL copyright text
      libmysqld/CMakeLists.txt:
        Added GPL copyright text
      libmysqld/examples/CMakeLists.txt:
        Added GPL copyright text
      mysys/CMakeLists.txt:
        Added GPL copyright text
      regex/CMakeLists.txt:
        Added GPL copyright text
      server-tools/instance-manager/CMakeLists.txt:
        Added GPL copyright text
      sql/CMakeLists.txt:
        Added GPL copyright text
      storage/archive/CMakeLists.txt:
        Added GPL copyright text
      storage/blackhole/CMakeLists.txt:
        Added GPL copyright text
      storage/csv/CMakeLists.txt:
        Added GPL copyright text
      storage/example/CMakeLists.txt:
        Added GPL copyright text
      storage/federated/CMakeLists.txt:
        Added GPL copyright text
      storage/heap/CMakeLists.txt:
        Added GPL copyright text
      storage/innobase/CMakeLists.txt:
        Added GPL copyright text
      storage/myisam/CMakeLists.txt:
        Added GPL copyright text
      storage/myisammrg/CMakeLists.txt:
        Added GPL copyright text
      strings/CMakeLists.txt:
        Added GPL copyright text
      tests/CMakeLists.txt:
        Added GPL copyright text
      vio/CMakeLists.txt:
        Added GPL copyright text
      zlib/CMakeLists.txt:
        Added GPL copyright text
      include/my_vle.h:
        Changed copyright header formatting some
      mysys/my_vle.c:
        Changed copyright header formatting some
      plugin/daemon_example/daemon_example.c:
        Added "Copyright (C) 2006 MySQL AB" to GPL header
      plugin/fulltext/plugin_example.c:
        Added "Copyright (C) 2006 MySQL AB" to GPL header
      plugin/Makefile.am:
        Removed "MySQL Finland AB & TCX DataKonsult AB" from copyright header
        Adjusted year(s) in copyright header
      sql/authors.h:
        Removed "MySQL Finland AB & TCX DataKonsult AB" from copyright header
        Adjusted year(s) in copyright header
      sql/contributors.h:
        Removed "MySQL Finland AB & TCX DataKonsult AB" from copyright header
        Adjusted year(s) in copyright header
      sql/item_xmlfunc.cc:
        Removed "MySQL Finland AB & TCX DataKonsult AB" from copyright header
        Adjusted year(s) in copyright header
      sql/partition_element.h:
        Removed "MySQL Finland AB & TCX DataKonsult AB" from copyright header
        Adjusted year(s) in copyright header
      sql/partition_info.h:
        Removed "MySQL Finland AB & TCX DataKonsult AB" from copyright header
        Adjusted year(s) in copyright header
      sql/rpl_injector.cc:
        Removed "MySQL Finland AB & TCX DataKonsult AB" from copyright header
        Adjusted year(s) in copyright header
      sql/rpl_injector.h:
        Removed "MySQL Finland AB & TCX DataKonsult AB" from copyright header
        Adjusted year(s) in copyright header
      sql/sql_binlog.cc:
        Removed "MySQL Finland AB & TCX DataKonsult AB" from copyright header
        Adjusted year(s) in copyright header
      sql/sql_servers.h:
        Removed "MySQL Finland AB & TCX DataKonsult AB" from copyright header
        Adjusted year(s) in copyright header
      storage/Makefile.am:
        Removed "MySQL Finland AB & TCX DataKonsult AB" from copyright header
        Adjusted year(s) in copyright header
      storage/archive/Makefile.am:
        Removed "MySQL Finland AB & TCX DataKonsult AB" from copyright header
        Adjusted year(s) in copyright header
      storage/blackhole/Makefile.am:
        Removed "MySQL Finland AB & TCX DataKonsult AB" from copyright header
        Adjusted year(s) in copyright header
      storage/csv/Makefile.am:
        Removed "MySQL Finland AB & TCX DataKonsult AB" from copyright header
        Adjusted year(s) in copyright header
      storage/example/Makefile.am:
        Removed "MySQL Finland AB & TCX DataKonsult AB" from copyright header
        Adjusted year(s) in copyright header
      storage/federated/Makefile.am:
        Removed "MySQL Finland AB & TCX DataKonsult AB" from copyright header
        Adjusted year(s) in copyright header
      win/Makefile.am:
        Removed "MySQL Finland AB & TCX DataKonsult AB" from copyright header
        Adjusted year(s) in copyright header
      sql/rpl_utility.cc:
        Changed copyright header formatting some
      sql/rpl_utility.h:
        Changed copyright header formatting some
      unittest/mysys/base64-t.c:
        Changed copyright header formatting some
      include/my_uctype.h:
        Added GPL copyright text
      plugin/daemon_example/Makefile.am:
        Added GPL copyright text
      plugin/fulltext/Makefile.am:
        Added GPL copyright text
      scripts/make_win_bin_dist:
        Added GPL copyright text
      server-tools/instance-manager/user_management_commands.cc:
        Added GPL copyright text
      sql/sql_builtin.cc.in:
        Added GPL copyright text
      sql/sql_show.h:
        Added GPL copyright text
      storage/archive/archive_test.c:
        Added GPL copyright text
      storage/ndb/src/kernel/blocks/dbtup/test_varpage.cpp:
        Added GPL copyright text
      storage/ndb/src/kernel/blocks/diskpage.cpp:
        Added GPL copyright text
      storage/ndb/src/kernel/vm/Rope.cpp:
        Added GPL copyright text
      storage/ndb/src/mgmsrv/ParamInfo.hpp:
        Added GPL copyright text
      strings/uctypedump.c:
        Added GPL copyright text
      unittest/Makefile.am:
        Added GPL copyright text
      unittest/examples/Makefile.am:
        Added GPL copyright text
      unittest/examples/core-t.c:
        Added GPL copyright text
      unittest/examples/no_plan-t.c:
        Added GPL copyright text
      unittest/examples/simple-t.c:
        Added GPL copyright text
      unittest/examples/skip-t.c:
        Added GPL copyright text
      unittest/examples/skip_all-t.c:
        Added GPL copyright text
      unittest/examples/todo-t.c:
        Added GPL copyright text
      unittest/mysys/Makefile.am:
        Added GPL copyright text
      unittest/mytap/Makefile.am:
        Added GPL copyright text
      unittest/mytap/t/Makefile.am:
        Added GPL copyright text
      unittest/mytap/t/basic-t.c:
        Added GPL copyright text
      unittest/unit.pl:
        Added GPL copyright text
      win/build-vs71.bat:
        Added GPL copyright text
      win/build-vs8.bat:
        Added GPL copyright text
      win/configure.js:
        Added GPL copyright text
      d73b5b8e
    • kent@mysql.com/kent-amd64.(none)'s avatar
      Many files: · 67868597
      kent@mysql.com/kent-amd64.(none) authored
        Removed "MySQL Finland AB & TCX DataKonsult AB" from copyright header
        Adjusted year(s) in copyright header 
        Added GPL copyright text
      my_vle.h, rpl_utility.h, my_vle.c, base64-t.c, rpl_utility.cc:
        Changed copyright header formatting some
      plugin_example.c, daemon_example.c:
        Added "Copyright (C) 2006 MySQL AB" to GPL header
      67868597