[Commits] bzr commit into MariaDB 5.1, with Maria 1.5:maria branch (monty:2889)

Michael Widenius monty at askmonty.org
Fri Aug 6 10:03:11 EEST 2010


#At lp:maria based on revid:monty at askmonty.org-20100730074527-k9hy17rq5twpzyuk

 2889 Michael Widenius	2010-08-06 [merge]
      Merge of 5.1-release
      removed:
        mysql-test/include/show_slave_status2.inc
        mysql-test/r/innodb-index.result
        mysql-test/r/innodb-use-sys-malloc.result
        mysql-test/r/innodb_xtradb_bug317074.result
        mysql-test/suite/rpl/r/rpl_000015.result
        mysql-test/suite/rpl/t/rpl_000015-slave.opt
        mysql-test/suite/rpl/t/rpl_000015.cnf
        mysql-test/suite/rpl/t/rpl_000015.test
        mysql-test/t/innodb-index.test
        mysql-test/t/innodb-use-sys-malloc-master.opt
        mysql-test/t/innodb_xtradb_bug317074.test
      added:
        mysql-test/extra/rpl_tests/rpl_record_compare.test
        mysql-test/include/check_concurrent_insert.inc
        mysql-test/include/check_no_concurrent_insert.inc
        mysql-test/include/check_no_row_lock.inc
        mysql-test/include/check_shared_row_lock.inc
        mysql-test/include/check_slave_is_running.inc
        mysql-test/include/check_slave_no_error.inc
        mysql-test/include/check_slave_param.inc
        mysql-test/include/get_relay_log_pos.inc
        mysql-test/include/have_real_innodb_plugin.inc
        mysql-test/include/have_xtradb.inc
        mysql-test/include/mysqlhotcopy.inc
        mysql-test/include/percona_query_cache_with_comments.inc
        mysql-test/include/percona_query_cache_with_comments_begin.inc
        mysql-test/include/percona_query_cache_with_comments_clear.inc
        mysql-test/include/percona_query_cache_with_comments_end.inc
        mysql-test/include/percona_query_cache_with_comments_eval.inc
        mysql-test/include/percona_query_cache_with_comments_show.inc
        mysql-test/r/innodb_mysql_lock2.result
        mysql-test/r/lock_sync.result
        mysql-test/r/mysqlhotcopy_archive.result
        mysql-test/r/mysqlhotcopy_myisam.result
        mysql-test/std_data/intersect-bug50389.tsv
        mysql-test/suite/innodb/r/innodb.result
        mysql-test/suite/innodb/r/innodb_bug48024.result
        mysql-test/suite/innodb/r/innodb_bug49164.result
        mysql-test/suite/innodb/r/innodb_bug53674.result
        mysql-test/suite/innodb/r/innodb_bug54044.result
        mysql-test/suite/innodb/r/innodb_multi_update.result
        mysql-test/suite/innodb/t/innodb.test
        mysql-test/suite/innodb/t/innodb_bug48024.test
        mysql-test/suite/innodb/t/innodb_bug49164.test
        mysql-test/suite/innodb/t/innodb_bug53674-master.opt
        mysql-test/suite/innodb/t/innodb_bug53674.test
        mysql-test/suite/innodb/t/innodb_bug54044.test
        mysql-test/suite/innodb/t/innodb_multi_update.test
        mysql-test/suite/innodb_plugin/r/innodb-autoinc-optimize.result
        mysql-test/suite/innodb_plugin/r/innodb-ucs2.result
        mysql-test/suite/innodb_plugin/r/innodb_autoinc_lock_mode_zero.result
        mysql-test/suite/innodb_plugin/r/innodb_bug30919.result
        mysql-test/suite/innodb_plugin/r/innodb_bug42419.result
        mysql-test/suite/innodb_plugin/r/innodb_bug48024.result
        mysql-test/suite/innodb_plugin/r/innodb_bug49164-xb.result
        mysql-test/suite/innodb_plugin/r/innodb_bug49164.result
        mysql-test/suite/innodb_plugin/r/innodb_bug53290.result
        mysql-test/suite/innodb_plugin/r/innodb_bug53591.result
        mysql-test/suite/innodb_plugin/r/innodb_bug53592.result
        mysql-test/suite/innodb_plugin/r/innodb_bug53674.result
        mysql-test/suite/innodb_plugin/r/innodb_bug54044.result
        mysql-test/suite/innodb_plugin/r/innodb_bug54679.result
        mysql-test/suite/innodb_plugin/r/innodb_gis.result
        mysql-test/suite/innodb_plugin/r/innodb_lock_wait_timeout_1.result
        mysql-test/suite/innodb_plugin/r/innodb_multi_update.result
        mysql-test/suite/innodb_plugin/r/innodb_mysql.result
        mysql-test/suite/innodb_plugin/r/innodb_mysql_rbk.result
        mysql-test/suite/innodb_plugin/r/innodb_notembedded.result
        mysql-test/suite/innodb_plugin/r/innodb_timeout_rollback.result
        mysql-test/suite/innodb_plugin/t/disabled.def
        mysql-test/suite/innodb_plugin/t/innodb-autoinc-optimize.test
        mysql-test/suite/innodb_plugin/t/innodb-ucs2.test
        mysql-test/suite/innodb_plugin/t/innodb_autoinc_lock_mode_zero-master.opt
        mysql-test/suite/innodb_plugin/t/innodb_autoinc_lock_mode_zero.test
        mysql-test/suite/innodb_plugin/t/innodb_bug30919-master.opt
        mysql-test/suite/innodb_plugin/t/innodb_bug30919.test
        mysql-test/suite/innodb_plugin/t/innodb_bug42419.test
        mysql-test/suite/innodb_plugin/t/innodb_bug48024.test
        mysql-test/suite/innodb_plugin/t/innodb_bug49164.test
        mysql-test/suite/innodb_plugin/t/innodb_bug53290.test
        mysql-test/suite/innodb_plugin/t/innodb_bug53591.test
        mysql-test/suite/innodb_plugin/t/innodb_bug53592.test
        mysql-test/suite/innodb_plugin/t/innodb_bug53674-master.opt
        mysql-test/suite/innodb_plugin/t/innodb_bug53674.test
        mysql-test/suite/innodb_plugin/t/innodb_bug54044.test
        mysql-test/suite/innodb_plugin/t/innodb_bug54679.test
        mysql-test/suite/innodb_plugin/t/innodb_gis.test
        mysql-test/suite/innodb_plugin/t/innodb_lock_wait_timeout_1-master.opt
        mysql-test/suite/innodb_plugin/t/innodb_lock_wait_timeout_1.test
        mysql-test/suite/innodb_plugin/t/innodb_multi_update.test
        mysql-test/suite/innodb_plugin/t/innodb_mysql-master.opt
        mysql-test/suite/innodb_plugin/t/innodb_mysql.test
        mysql-test/suite/innodb_plugin/t/innodb_mysql_rbk-master.opt
        mysql-test/suite/innodb_plugin/t/innodb_mysql_rbk.test
        mysql-test/suite/innodb_plugin/t/innodb_notembedded.test
        mysql-test/suite/innodb_plugin/t/innodb_timeout_rollback-master.opt
        mysql-test/suite/innodb_plugin/t/innodb_timeout_rollback.test
        mysql-test/suite/parts/r/optimizer.result
        mysql-test/suite/parts/r/partition_debug_sync_innodb.result
        mysql-test/suite/parts/t/optimizer.test
        mysql-test/suite/parts/t/partition_debug_sync_innodb-master.opt
        mysql-test/suite/parts/t/partition_debug_sync_innodb.test
        mysql-test/suite/percona/
        mysql-test/suite/percona/disabled.def
        mysql-test/suite/percona/percona_innodb_deadlock_count.result
        mysql-test/suite/percona/percona_innodb_deadlock_count.test
        mysql-test/suite/percona/percona_innodb_doublewrite_file-master.opt
        mysql-test/suite/percona/percona_innodb_doublewrite_file.result
        mysql-test/suite/percona/percona_innodb_doublewrite_file.test
        mysql-test/suite/percona/percona_log_slow_slave_statements-and-use_global_long_query_time-master.opt
        mysql-test/suite/percona/percona_log_slow_slave_statements-and-use_global_long_query_time-slave.opt
        mysql-test/suite/percona/percona_log_slow_slave_statements-and-use_global_long_query_time.result
        mysql-test/suite/percona/percona_log_slow_slave_statements-and-use_global_long_query_time.test
        mysql-test/suite/percona/percona_log_slow_slave_statements-master.opt
        mysql-test/suite/percona/percona_log_slow_slave_statements-slave.opt
        mysql-test/suite/percona/percona_log_slow_slave_statements.result
        mysql-test/suite/percona/percona_log_slow_slave_statements.test
        mysql-test/suite/percona/percona_query_cache_with_comments.inc.backup
        mysql-test/suite/percona/percona_query_cache_with_comments.result
        mysql-test/suite/percona/percona_query_cache_with_comments.test
        mysql-test/suite/percona/percona_query_cache_with_comments_crash.result
        mysql-test/suite/percona/percona_query_cache_with_comments_crash.test
        mysql-test/suite/percona/percona_query_cache_with_comments_disable.result
        mysql-test/suite/percona/percona_query_cache_with_comments_disable.test
        mysql-test/suite/percona/percona_query_cache_with_comments_prepared_statements.result
        mysql-test/suite/percona/percona_query_cache_with_comments_prepared_statements.test
        mysql-test/suite/percona/percona_show_temp_tables.result
        mysql-test/suite/percona/percona_show_temp_tables.test
        mysql-test/suite/percona/percona_slow_query_log-control_global_slow-master.opt
        mysql-test/suite/percona/percona_slow_query_log-control_global_slow.result
        mysql-test/suite/percona/percona_slow_query_log-control_global_slow.test
        mysql-test/suite/percona/percona_slow_query_log-log_slow_filter-master.opt
        mysql-test/suite/percona/percona_slow_query_log-log_slow_filter.result
        mysql-test/suite/percona/percona_slow_query_log-log_slow_filter.test
        mysql-test/suite/percona/percona_slow_query_log-log_slow_verbosity-master.opt
        mysql-test/suite/percona/percona_slow_query_log-log_slow_verbosity.result
        mysql-test/suite/percona/percona_slow_query_log-log_slow_verbosity.test
        mysql-test/suite/percona/percona_slow_query_log-long_query_time-master.opt
        mysql-test/suite/percona/percona_slow_query_log-long_query_time.result
        mysql-test/suite/percona/percona_slow_query_log-long_query_time.test
        mysql-test/suite/percona/percona_slow_query_log-microseconds_in_slow_query_log-master.opt
        mysql-test/suite/percona/percona_slow_query_log-microseconds_in_slow_query_log.result
        mysql-test/suite/percona/percona_slow_query_log-microseconds_in_slow_query_log.test
        mysql-test/suite/percona/percona_slow_query_log-min_examined_row_limit-master.opt
        mysql-test/suite/percona/percona_slow_query_log-min_examined_row_limit.result
        mysql-test/suite/percona/percona_slow_query_log-min_examined_row_limit.test
        mysql-test/suite/percona/percona_slow_query_log-use_global_long_query_time-master.opt
        mysql-test/suite/percona/percona_slow_query_log-use_global_long_query_time.result
        mysql-test/suite/percona/percona_slow_query_log-use_global_long_query_time.test
        mysql-test/suite/percona/percona_suppress_log_warning_1592-master.opt
        mysql-test/suite/percona/percona_suppress_log_warning_1592.result
        mysql-test/suite/percona/percona_suppress_log_warning_1592.test
        mysql-test/suite/percona/percona_xtradb_admin_command.result
        mysql-test/suite/percona/percona_xtradb_admin_command.test
        mysql-test/suite/percona/percona_xtradb_bug317074.result
        mysql-test/suite/percona/percona_xtradb_bug317074.test
        mysql-test/suite/rpl/r/rpl_row_rec_comp_innodb.result
        mysql-test/suite/rpl/r/rpl_row_rec_comp_myisam.result
        mysql-test/suite/rpl/t/rpl_row_rec_comp_innodb.test
        mysql-test/suite/rpl/t/rpl_row_rec_comp_myisam.test
        mysql-test/suite/rpl_ndb/r/rpl_ndb_mixed_tables.result
        mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_tables-master.opt
        mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_tables-slave.opt
        mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_tables.test
        mysql-test/t/innodb_mysql_lock2.test
        mysql-test/t/lock_sync.test
        mysql-test/t/mysqlhotcopy_archive.test
        mysql-test/t/mysqlhotcopy_myisam.test
        storage/xtradb/include/ut0rbt.h
        storage/xtradb/ut/ut0rbt.c
      renamed:
        mysql-test/r/innodb-autoinc-optimize.result => mysql-test/suite/innodb/r/innodb-autoinc-optimize.result
        mysql-test/r/innodb-ucs2.result => mysql-test/suite/innodb/r/innodb-ucs2.result
        mysql-test/r/innodb_autoinc_lock_mode_zero.result => mysql-test/suite/innodb/r/innodb_autoinc_lock_mode_zero.result
        mysql-test/r/innodb_bug30919.result => mysql-test/suite/innodb/r/innodb_bug30919.result
        mysql-test/r/innodb_bug42419.result => mysql-test/suite/innodb/r/innodb_bug42419.result
        mysql-test/r/innodb_gis.result => mysql-test/suite/innodb/r/innodb_gis.result
        mysql-test/r/innodb_lock_wait_timeout_1.result => mysql-test/suite/innodb/r/innodb_lock_wait_timeout_1.result
        mysql-test/r/innodb_mysql.result => mysql-test/suite/innodb/r/innodb_mysql.result
        mysql-test/r/innodb_mysql_rbk.result => mysql-test/suite/innodb/r/innodb_mysql_rbk.result
        mysql-test/r/innodb_notembedded.result => mysql-test/suite/innodb/r/innodb_notembedded.result
        mysql-test/r/innodb_timeout_rollback.result => mysql-test/suite/innodb/r/innodb_timeout_rollback.result
        mysql-test/suite/rpl/r/rpl_row_disabled_slave_key.result => mysql-test/suite/rpl/r/rpl_row_find_row.result
        mysql-test/suite/rpl/t/rpl_row_disabled_slave_key.test => mysql-test/suite/rpl/t/rpl_row_find_row.test
        mysql-test/t/innodb-autoinc-optimize.test => mysql-test/suite/innodb/t/innodb-autoinc-optimize.test
        mysql-test/t/innodb-ucs2.test => mysql-test/suite/innodb/t/innodb-ucs2.test
        mysql-test/t/innodb_autoinc_lock_mode_zero-master.opt => mysql-test/suite/innodb/t/innodb_autoinc_lock_mode_zero-master.opt
        mysql-test/t/innodb_autoinc_lock_mode_zero.test => mysql-test/suite/innodb/t/innodb_autoinc_lock_mode_zero.test
        mysql-test/t/innodb_bug30919-master.opt => mysql-test/suite/innodb/t/innodb_bug30919-master.opt
        mysql-test/t/innodb_bug30919.test => mysql-test/suite/innodb/t/innodb_bug30919.test
        mysql-test/t/innodb_bug42419.test => mysql-test/suite/innodb/t/innodb_bug42419.test
        mysql-test/t/innodb_gis.test => mysql-test/suite/innodb/t/innodb_gis.test
        mysql-test/t/innodb_lock_wait_timeout_1-master.opt => mysql-test/suite/innodb/t/innodb_lock_wait_timeout_1-master.opt
        mysql-test/t/innodb_lock_wait_timeout_1.test => mysql-test/suite/innodb/t/innodb_lock_wait_timeout_1.test
        mysql-test/t/innodb_mysql-master.opt => mysql-test/suite/innodb/t/innodb_mysql-master.opt
        mysql-test/t/innodb_mysql.test => mysql-test/suite/innodb/t/innodb_mysql.test
        mysql-test/t/innodb_mysql_rbk-master.opt => mysql-test/suite/innodb/t/innodb_mysql_rbk-master.opt
        mysql-test/t/innodb_mysql_rbk.test => mysql-test/suite/innodb/t/innodb_mysql_rbk.test
        mysql-test/t/innodb_notembedded.test => mysql-test/suite/innodb/t/innodb_notembedded.test
        mysql-test/t/innodb_timeout_rollback-master.opt => mysql-test/suite/innodb/t/innodb_timeout_rollback-master.opt
        mysql-test/t/innodb_timeout_rollback.test => mysql-test/suite/innodb/t/innodb_timeout_rollback.test
        storage/innobase/CMakeLists.txt => storage/innobase/CMakeLists.txt.disabled
      modified:
        BUILD/SETUP.sh
        BUILD/build_mccge.sh
        BUILD/compile-amd64-valgrind-max
        BUILD/compile-pentium-icc-valgrind-max
        BUILD/compile-pentium-valgrind-max
        BUILD/compile-pentium-valgrind-max-no-ndb
        BUILD/compile-pentium64-valgrind-max
        Makefile.am
        client/mysql.cc
        client/mysql_upgrade.c
        client/mysqladmin.cc
        client/mysqlbinlog.cc
        client/mysqlcheck.c
        client/mysqldump.c
        client/mysqlimport.c
        client/mysqlshow.c
        client/mysqlslap.c
        client/mysqltest.cc
        config/ac-macros/ssl.m4
        configure.in
        extra/comp_err.c
        extra/my_print_defaults.c
        extra/mysql_waitpid.c
        extra/perror.c
        extra/resolve_stack_dump.c
        extra/resolveip.c
        extra/yassl/CMakeLists.txt
        extra/yassl/certs/ca-cert.pem
        extra/yassl/certs/client-cert.der
        extra/yassl/certs/client-cert.pem
        extra/yassl/certs/dsa-cert.pem
        extra/yassl/certs/server-cert.pem
        extra/yassl/include/lock.hpp
        extra/yassl/src/Makefile.am
        extra/yassl/src/lock.cpp
        extra/yassl/taocrypt/CMakeLists.txt
        extra/yassl/taocrypt/benchmark/Makefile.am
        extra/yassl/taocrypt/src/Makefile.am
        extra/yassl/taocrypt/test/Makefile.am
        extra/yassl/taocrypt/test/memory.cpp
        extra/yassl/testsuite/Makefile.am
        include/m_string.h
        include/my_alarm.h
        include/my_base.h
        include/my_bitmap.h
        include/my_getopt.h
        include/my_global.h
        include/my_sys.h
        include/my_valgrind.h
        include/myisam.h
        include/sslopt-longopts.h
        libmysql/libmysql.c
        mysql-test/Makefile.am
        mysql-test/collections/default.experimental
        mysql-test/extra/binlog_tests/binlog.test
        mysql-test/extra/binlog_tests/blackhole.test
        mysql-test/extra/binlog_tests/mix_innodb_myisam_side_effects.test
        mysql-test/extra/rpl_tests/rpl_deadlock.test
        mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test
        mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test
        mysql-test/extra/rpl_tests/rpl_flsh_tbls.test
        mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test
        mysql-test/extra/rpl_tests/rpl_insert_delayed.test
        mysql-test/extra/rpl_tests/rpl_log.test
        mysql-test/extra/rpl_tests/rpl_max_relay_size.test
        mysql-test/extra/rpl_tests/rpl_ndb_apply_status.test
        mysql-test/extra/rpl_tests/rpl_reset_slave.test
        mysql-test/extra/rpl_tests/rpl_row_basic.test
        mysql-test/extra/rpl_tests/rpl_row_tabledefs.test
        mysql-test/include/have_innodb_plugin.inc
        mysql-test/include/rpl_stmt_seq.inc
        mysql-test/include/show_binlog_events.inc
        mysql-test/include/show_rpl_debug_info.inc
        mysql-test/include/show_slave_status.inc
        mysql-test/include/test_fieldsize.inc
        mysql-test/include/wait_for_binlog_event.inc
        mysql-test/include/wait_for_slave_io_error.inc
        mysql-test/include/wait_for_slave_param.inc
        mysql-test/include/wait_for_slave_sql_error.inc
        mysql-test/include/wait_for_slave_sql_error_and_skip.inc
        mysql-test/include/wait_for_status_var.inc
        mysql-test/include/wait_until_count_sessions.inc
        mysql-test/lib/mtr_cases.pm
        mysql-test/lib/mtr_misc.pl
        mysql-test/lib/v1/mtr_process.pl
        mysql-test/mysql-test-run.pl
        mysql-test/r/alter_table-big.result
        mysql-test/r/bug39022.result
        mysql-test/r/create-big.result
        mysql-test/r/ctype_cp932_binlog_stm.result
        mysql-test/r/delete.result
        mysql-test/r/error_simulation.result
        mysql-test/r/events_scheduling.result
        mysql-test/r/explain.result
        mysql-test/r/flush_block_commit_notembedded.result
        mysql-test/r/func_in.result
        mysql-test/r/func_isnull.result
        mysql-test/r/func_like.result
        mysql-test/r/group_by.result
        mysql-test/r/group_min_max.result
        mysql-test/r/handler_myisam.result
        mysql-test/r/information_schema.result
        mysql-test/r/information_schema_all_engines.result
        mysql-test/r/innodb.result
        mysql-test/r/join_outer.result
        mysql-test/r/loaddata.result
        mysql-test/r/log_state.result
        mysql-test/r/multi_update.result
        mysql-test/r/mysqldump.result
        mysql-test/r/outfile_loaddata.result
        mysql-test/r/partition_error.result
        mysql-test/r/renamedb.result
        mysql-test/r/schema.result
        mysql-test/r/select.result
        mysql-test/r/sp_trans_log.result
        mysql-test/r/subselect.result
        mysql-test/r/type_time.result
        mysql-test/r/upgrade.result
        mysql-test/r/variables.result
        mysql-test/r/variables_debug.result
        mysql-test/suite/binlog/r/binlog_base64_flag.result
        mysql-test/suite/binlog/r/binlog_innodb.result
        mysql-test/suite/binlog/r/binlog_row_binlog.result
        mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result
        mysql-test/suite/binlog/r/binlog_stm_binlog.result
        mysql-test/suite/binlog/r/binlog_stm_blackhole.result
        mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result
        mysql-test/suite/binlog/t/binlog_base64_flag.test
        mysql-test/suite/binlog/t/binlog_innodb.test
        mysql-test/suite/binlog/t/binlog_stm_binlog.test
        mysql-test/suite/bugs/r/rpl_bug12691.result
        mysql-test/suite/bugs/r/rpl_bug36391.result
        mysql-test/suite/bugs/t/rpl_bug12691.test
        mysql-test/suite/bugs/t/rpl_bug36391.test
        mysql-test/suite/engines/funcs/r/rpl_000015.result
        mysql-test/suite/engines/funcs/r/rpl_REDIRECT.result
        mysql-test/suite/engines/funcs/r/rpl_change_master.result
        mysql-test/suite/engines/funcs/r/rpl_empty_master_crash.result
        mysql-test/suite/engines/funcs/r/rpl_flushlog_loop.result
        mysql-test/suite/engines/funcs/r/rpl_loaddata_s.result
        mysql-test/suite/engines/funcs/r/rpl_log_pos.result
        mysql-test/suite/engines/funcs/r/rpl_rbr_to_sbr.result
        mysql-test/suite/engines/funcs/r/rpl_row_drop.result
        mysql-test/suite/engines/funcs/r/rpl_row_inexist_tbl.result
        mysql-test/suite/engines/funcs/r/rpl_row_max_relay_size.result
        mysql-test/suite/engines/funcs/r/rpl_row_reset_slave.result
        mysql-test/suite/engines/funcs/r/rpl_row_until.result
        mysql-test/suite/engines/funcs/r/rpl_server_id1.result
        mysql-test/suite/engines/funcs/r/rpl_server_id2.result
        mysql-test/suite/engines/funcs/r/rpl_slave_status.result
        mysql-test/suite/engines/funcs/r/rpl_stm_max_relay_size.result
        mysql-test/suite/engines/funcs/r/rpl_stm_reset_slave.result
        mysql-test/suite/engines/funcs/r/rpl_switch_stm_row_mixed.result
        mysql-test/suite/engines/funcs/t/rpl_000015.test
        mysql-test/suite/engines/funcs/t/rpl_REDIRECT.test
        mysql-test/suite/engines/funcs/t/rpl_change_master.test
        mysql-test/suite/engines/funcs/t/rpl_empty_master_crash.test
        mysql-test/suite/engines/funcs/t/rpl_flushlog_loop.test
        mysql-test/suite/engines/funcs/t/rpl_loaddata_s.test
        mysql-test/suite/engines/funcs/t/rpl_log_pos.test
        mysql-test/suite/engines/funcs/t/rpl_rbr_to_sbr.test
        mysql-test/suite/engines/funcs/t/rpl_row_drop.test
        mysql-test/suite/engines/funcs/t/rpl_row_inexist_tbl.test
        mysql-test/suite/engines/funcs/t/rpl_row_until.test
        mysql-test/suite/engines/funcs/t/rpl_server_id1.test
        mysql-test/suite/engines/funcs/t/rpl_server_id2.test
        mysql-test/suite/engines/funcs/t/rpl_slave_status.test
        mysql-test/suite/engines/funcs/t/rpl_switch_stm_row_mixed.test
        mysql-test/suite/funcs_1/r/is_columns_is.result
        mysql-test/suite/funcs_1/r/is_engines.result
        mysql-test/suite/funcs_1/t/is_columns_is.test
        mysql-test/suite/funcs_1/t/is_engines_innodb.test
        mysql-test/suite/innodb/r/innodb-autoinc-44030.result
        mysql-test/suite/innodb/r/innodb_bug21704.result
        mysql-test/suite/innodb/r/innodb_misc1.result
        mysql-test/suite/innodb/t/disabled.def
        mysql-test/suite/innodb/t/innodb-autoinc-44030.test
        mysql-test/suite/innodb/t/innodb_misc1.test
        mysql-test/suite/innodb_plugin/r/innodb.result
        mysql-test/suite/innodb_plugin/r/innodb_bug46000.result
        mysql-test/suite/innodb_plugin/t/innodb-timeout.test
        mysql-test/suite/innodb_plugin/t/innodb.test
        mysql-test/suite/innodb_plugin/t/innodb_bug52745.test
        mysql-test/suite/manual/r/rpl_replication_delay.result
        mysql-test/suite/manual/t/rpl_replication_delay.test
        mysql-test/suite/maria/r/maria.result
        mysql-test/suite/maria/t/maria.test
        mysql-test/suite/ndb_team/r/rpl_ndb_extraColMaster.result
        mysql-test/suite/ndb_team/r/rpl_ndb_mix_innodb.result
        mysql-test/suite/parts/r/rpl_partition.result
        mysql-test/suite/parts/t/rpl_partition.test
        mysql-test/suite/pbxt/r/join_nested.result
        mysql-test/suite/pbxt/r/renamedb.result
        mysql-test/suite/pbxt/t/check.test
        mysql-test/suite/pbxt/t/count_distinct2.test
        mysql-test/suite/pbxt/t/derived.test
        mysql-test/suite/pbxt/t/renamedb.test
        mysql-test/suite/rpl/include/rpl_mixed_ddl.inc
        mysql-test/suite/rpl/include/rpl_mixed_dml.inc
        mysql-test/suite/rpl/r/rpl_binlog_grant.result
        mysql-test/suite/rpl/r/rpl_bug33931.result
        mysql-test/suite/rpl/r/rpl_change_master.result
        mysql-test/suite/rpl/r/rpl_deadlock_innodb.result
        mysql-test/suite/rpl/r/rpl_do_grant.result
        mysql-test/suite/rpl/r/rpl_dual_pos_advance.result
        mysql-test/suite/rpl/r/rpl_empty_master_crash.result
        mysql-test/suite/rpl/r/rpl_extraCol_innodb.result
        mysql-test/suite/rpl/r/rpl_extraCol_myisam.result
        mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result
        mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result
        mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result
        mysql-test/suite/rpl/r/rpl_flushlog_loop.result
        mysql-test/suite/rpl/r/rpl_get_master_version_and_clock.result
        mysql-test/suite/rpl/r/rpl_grant.result
        mysql-test/suite/rpl/r/rpl_incident.result
        mysql-test/suite/rpl/r/rpl_innodb_mixed_ddl.result
        mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result
        mysql-test/suite/rpl/r/rpl_known_bugs_detection.result
        mysql-test/suite/rpl/r/rpl_loaddata_fatal.result
        mysql-test/suite/rpl/r/rpl_log_pos.result
        mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result
        mysql-test/suite/rpl/r/rpl_replicate_do.result
        mysql-test/suite/rpl/r/rpl_rotate_logs.result
        mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result
        mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result
        mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result
        mysql-test/suite/rpl/r/rpl_row_colSize.result
        mysql-test/suite/rpl/r/rpl_row_create_table.result
        mysql-test/suite/rpl/r/rpl_row_drop.result
        mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result
        mysql-test/suite/rpl/r/rpl_row_log.result
        mysql-test/suite/rpl/r/rpl_row_log_innodb.result
        mysql-test/suite/rpl/r/rpl_row_max_relay_size.result
        mysql-test/suite/rpl/r/rpl_row_reset_slave.result
        mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result
        mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result
        mysql-test/suite/rpl/r/rpl_row_until.result
        mysql-test/suite/rpl/r/rpl_skip_error.result
        mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result
        mysql-test/suite/rpl/r/rpl_slave_skip.result
        mysql-test/suite/rpl/r/rpl_sp.result
        mysql-test/suite/rpl/r/rpl_ssl.result
        mysql-test/suite/rpl/r/rpl_ssl1.result
        mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result
        mysql-test/suite/rpl/r/rpl_stm_insert_delayed.result
        mysql-test/suite/rpl/r/rpl_stm_log.result
        mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result
        mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result
        mysql-test/suite/rpl/r/rpl_stm_reset_slave.result
        mysql-test/suite/rpl/r/rpl_stm_until.result
        mysql-test/suite/rpl/r/rpl_temporary_errors.result
        mysql-test/suite/rpl/t/rpl_binlog_grant.test
        mysql-test/suite/rpl/t/rpl_bug33931.test
        mysql-test/suite/rpl/t/rpl_change_master.test
        mysql-test/suite/rpl/t/rpl_critical_errors.test
        mysql-test/suite/rpl/t/rpl_do_grant.test
        mysql-test/suite/rpl/t/rpl_dual_pos_advance.test
        mysql-test/suite/rpl/t/rpl_empty_master_crash.test
        mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test
        mysql-test/suite/rpl/t/rpl_flushlog_loop.test
        mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test
        mysql-test/suite/rpl/t/rpl_grant.test
        mysql-test/suite/rpl/t/rpl_incident.test
        mysql-test/suite/rpl/t/rpl_known_bugs_detection.test
        mysql-test/suite/rpl/t/rpl_loaddata_fatal.test
        mysql-test/suite/rpl/t/rpl_log_pos.test
        mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test
        mysql-test/suite/rpl/t/rpl_replicate_do.test
        mysql-test/suite/rpl/t/rpl_rotate_logs.test
        mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test
        mysql-test/suite/rpl/t/rpl_row_create_table.test
        mysql-test/suite/rpl/t/rpl_row_drop.test
        mysql-test/suite/rpl/t/rpl_row_until.test
        mysql-test/suite/rpl/t/rpl_skip_error.test
        mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test
        mysql-test/suite/rpl/t/rpl_slave_skip.test
        mysql-test/suite/rpl/t/rpl_sp.test
        mysql-test/suite/rpl/t/rpl_ssl.test
        mysql-test/suite/rpl/t/rpl_ssl1.test
        mysql-test/suite/rpl/t/rpl_stm_mixing_engines.test
        mysql-test/suite/rpl/t/rpl_stm_until.test
        mysql-test/suite/rpl/t/rpl_temporary_errors.test
        mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test
        mysql-test/suite/rpl_ndb/my.cnf
        mysql-test/suite/rpl_ndb/r/rpl_ndb_basic.result
        mysql-test/suite/rpl_ndb/r/rpl_ndb_circular.result
        mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result
        mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result
        mysql-test/suite/rpl_ndb/r/rpl_ndb_idempotent.result
        mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result
        mysql-test/suite/rpl_ndb/r/rpl_ndb_mixed_engines_transactions.result
        mysql-test/suite/rpl_ndb/r/rpl_ndb_multi.result
        mysql-test/suite/rpl_ndb/r/rpl_ndb_stm_innodb.result
        mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result
        mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result
        mysql-test/suite/rpl_ndb/r/rpl_truncate_7ndb.result
        mysql-test/suite/rpl_ndb/t/rpl_ndb_basic.test
        mysql-test/suite/rpl_ndb/t/rpl_ndb_circular.test
        mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_simplex.test
        mysql-test/suite/rpl_ndb/t/rpl_ndb_idempotent.test
        mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_engines_transactions.test
        mysql-test/suite/rpl_ndb/t/rpl_ndb_multi.test
        mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb.test
        mysql-test/suite/rpl_ndb/t/rpl_ndb_sync.test
        mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb.test
        mysql-test/suite/sys_vars/r/slow_query_log_func.result
        mysql-test/suite/sys_vars/r/tx_isolation_func.result
        mysql-test/suite/sys_vars/t/slow_query_log_func.test
        mysql-test/suite/sys_vars/t/tx_isolation_func.test
        mysql-test/t/alter_table-big.test
        mysql-test/t/bug39022.test
        mysql-test/t/create-big.test
        mysql-test/t/ctype_cp932_binlog_stm.test
        mysql-test/t/delete.test
        mysql-test/t/disabled.def
        mysql-test/t/error_simulation.test
        mysql-test/t/events_scheduling.test
        mysql-test/t/events_time_zone.test
        mysql-test/t/explain.test
        mysql-test/t/flush_block_commit_notembedded.test
        mysql-test/t/func_in.test
        mysql-test/t/func_isnull.test
        mysql-test/t/func_like.test
        mysql-test/t/group_by.test
        mysql-test/t/group_min_max.test
        mysql-test/t/handler_myisam.test
        mysql-test/t/information_schema.test
        mysql-test/t/innodb.test
        mysql-test/t/join_outer.test
        mysql-test/t/loaddata.test
        mysql-test/t/log_state.test
        mysql-test/t/multi_update.test
        mysql-test/t/mysqldump.test
        mysql-test/t/outfile_loaddata.test
        mysql-test/t/partition_error.test
        mysql-test/t/renamedb.test
        mysql-test/t/schema.test
        mysql-test/t/select.test
        mysql-test/t/sp_trans_log.test
        mysql-test/t/subselect.test
        mysql-test/t/type_time.test
        mysql-test/t/upgrade.test
        mysql-test/t/variables.test
        mysql-test/t/variables_debug.test
        mysql-test/valgrind.supp
        mysys/mf_wfile.c
        mysys/my_alloc.c
        mysys/my_bitmap.c
        mysys/my_getopt.c
        mysys/my_malloc.c
        mysys/safemalloc.c
        mysys/thr_alarm.c
        scripts/make_binary_distribution.sh
        scripts/mysql_install_db.sh
        server-tools/instance-manager/options.cc
        sql-common/client.c
        sql/authors.h
        sql/event_data_objects.cc
        sql/field.cc
        sql/ha_partition.cc
        sql/handler.cc
        sql/handler.h
        sql/item.cc
        sql/item_cmpfunc.cc
        sql/item_cmpfunc.h
        sql/item_subselect.cc
        sql/item_sum.cc
        sql/item_sum.h
        sql/log.cc
        sql/log.h
        sql/log_event.cc
        sql/log_event.h
        sql/log_event_old.cc
        sql/mysql_priv.h
        sql/mysqld.cc
        sql/net_serv.cc
        sql/opt_range.cc
        sql/opt_range.h
        sql/opt_sum.cc
        sql/repl_failsafe.cc
        sql/rpl_mi.cc
        sql/rpl_mi.h
        sql/rpl_rli.cc
        sql/set_var.cc
        sql/set_var.h
        sql/slave.cc
        sql/sp.cc
        sql/sp_head.cc
        sql/sql_base.cc
        sql/sql_binlog.cc
        sql/sql_class.cc
        sql/sql_class.h
        sql/sql_connect.cc
        sql/sql_db.cc
        sql/sql_delete.cc
        sql/sql_derived.cc
        sql/sql_handler.cc
        sql/sql_insert.cc
        sql/sql_lex.cc
        sql/sql_lex.h
        sql/sql_list.h
        sql/sql_load.cc
        sql/sql_olap.cc
        sql/sql_parse.cc
        sql/sql_partition.cc
        sql/sql_plugin.cc
        sql/sql_prepare.cc
        sql/sql_repl.cc
        sql/sql_select.cc
        sql/sql_show.cc
        sql/sql_table.cc
        sql/sql_trigger.cc
        sql/sql_union.cc
        sql/sql_update.cc
        sql/sql_view.cc
        sql/sql_yacc.yy
        sql/table.cc
        sql/table.h
        sql/thr_malloc.cc
        sql/unireg.cc
        storage/archive/archive_reader.c
        storage/innobase/buf/buf0flu.c
        storage/innobase/dict/dict0dict.c
        storage/innobase/fsp/fsp0fsp.c
        storage/innobase/handler/ha_innodb.cc
        storage/innobase/handler/ha_innodb.h
        storage/innobase/include/db0err.h
        storage/innobase/include/dict0dict.h
        storage/innobase/include/lock0lock.h
        storage/innobase/include/mach0data.ic
        storage/innobase/include/row0mysql.h
        storage/innobase/include/sync0sync.h
        storage/innobase/include/trx0trx.h
        storage/innobase/include/univ.i
        storage/innobase/lock/lock0lock.c
        storage/innobase/row/row0ins.c
        storage/innobase/row/row0mysql.c
        storage/innobase/row/row0sel.c
        storage/innobase/row/row0undo.c
        storage/innobase/srv/srv0srv.c
        storage/innobase/srv/srv0start.c
        storage/innobase/trx/trx0trx.c
        storage/innodb_plugin/ChangeLog
        storage/innodb_plugin/btr/btr0btr.c
        storage/innodb_plugin/btr/btr0cur.c
        storage/innodb_plugin/btr/btr0sea.c
        storage/innodb_plugin/buf/buf0buddy.c
        storage/innodb_plugin/buf/buf0buf.c
        storage/innodb_plugin/buf/buf0flu.c
        storage/innodb_plugin/buf/buf0lru.c
        storage/innodb_plugin/dict/dict0boot.c
        storage/innodb_plugin/dict/dict0crea.c
        storage/innodb_plugin/dict/dict0dict.c
        storage/innodb_plugin/dict/dict0load.c
        storage/innodb_plugin/dict/dict0mem.c
        storage/innodb_plugin/fil/fil0fil.c
        storage/innodb_plugin/fsp/fsp0fsp.c
        storage/innodb_plugin/handler/ha_innodb.cc
        storage/innodb_plugin/handler/ha_innodb.h
        storage/innodb_plugin/handler/handler0alter.cc
        storage/innodb_plugin/include/buf0buf.ic
        storage/innodb_plugin/include/buf0lru.h
        storage/innodb_plugin/include/db0err.h
        storage/innodb_plugin/include/dict0boot.h
        storage/innodb_plugin/include/dict0dict.h
        storage/innodb_plugin/include/dict0mem.h
        storage/innodb_plugin/include/fil0fil.h
        storage/innodb_plugin/include/ha_prototypes.h
        storage/innodb_plugin/include/lock0lock.h
        storage/innodb_plugin/include/log0log.ic
        storage/innodb_plugin/include/mach0data.ic
        storage/innodb_plugin/include/rem0cmp.h
        storage/innodb_plugin/include/row0mysql.h
        storage/innodb_plugin/include/sync0rw.h
        storage/innodb_plugin/include/sync0sync.h
        storage/innodb_plugin/include/trx0trx.h
        storage/innodb_plugin/include/univ.i
        storage/innodb_plugin/lock/lock0lock.c
        storage/innodb_plugin/os/os0file.c
        storage/innodb_plugin/page/page0zip.c
        storage/innodb_plugin/rem/rem0cmp.c
        storage/innodb_plugin/row/row0ins.c
        storage/innodb_plugin/row/row0merge.c
        storage/innodb_plugin/row/row0mysql.c
        storage/innodb_plugin/row/row0purge.c
        storage/innodb_plugin/row/row0sel.c
        storage/innodb_plugin/row/row0uins.c
        storage/innodb_plugin/row/row0umod.c
        storage/innodb_plugin/row/row0undo.c
        storage/innodb_plugin/row/row0upd.c
        storage/innodb_plugin/setup.sh
        storage/innodb_plugin/srv/srv0srv.c
        storage/innodb_plugin/sync/sync0arr.c
        storage/innodb_plugin/sync/sync0rw.c
        storage/innodb_plugin/trx/trx0i_s.c
        storage/innodb_plugin/trx/trx0trx.c
        storage/maria/ma_recovery.c
        storage/maria/ma_recovery.h
        storage/maria/ma_write.c
        storage/maria/maria_chk.c
        storage/maria/maria_ftdump.c
        storage/maria/maria_pack.c
        storage/maria/maria_read_log.c
        storage/myisam/mi_test1.c
        storage/myisam/myisamchk.c
        storage/myisam/myisamlog.c
        storage/myisam/myisampack.c
        storage/myisammrg/ha_myisammrg.cc
        storage/xtradb/CMakeLists.txt
        storage/xtradb/ChangeLog
        storage/xtradb/Makefile.am
        storage/xtradb/btr/btr0btr.c
        storage/xtradb/btr/btr0cur.c
        storage/xtradb/btr/btr0pcur.c
        storage/xtradb/buf/buf0buddy.c
        storage/xtradb/buf/buf0buf.c
        storage/xtradb/buf/buf0flu.c
        storage/xtradb/buf/buf0lru.c
        storage/xtradb/buf/buf0rea.c
        storage/xtradb/data/data0data.c
        storage/xtradb/dict/dict0boot.c
        storage/xtradb/dict/dict0crea.c
        storage/xtradb/dict/dict0dict.c
        storage/xtradb/dict/dict0load.c
        storage/xtradb/dict/dict0mem.c
        storage/xtradb/fil/fil0fil.c
        storage/xtradb/fsp/fsp0fsp.c
        storage/xtradb/ha/ha0ha.c
        storage/xtradb/ha/hash0hash.c
        storage/xtradb/handler/ha_innodb.cc
        storage/xtradb/handler/ha_innodb.h
        storage/xtradb/handler/handler0alter.cc
        storage/xtradb/handler/i_s.cc
        storage/xtradb/handler/innodb_patch_info.h
        storage/xtradb/ibuf/ibuf0ibuf.c
        storage/xtradb/include/btr0btr.h
        storage/xtradb/include/btr0btr.ic
        storage/xtradb/include/btr0cur.h
        storage/xtradb/include/btr0pcur.h
        storage/xtradb/include/btr0pcur.ic
        storage/xtradb/include/buf0buf.h
        storage/xtradb/include/buf0buf.ic
        storage/xtradb/include/buf0flu.h
        storage/xtradb/include/data0type.ic
        storage/xtradb/include/dict0boot.h
        storage/xtradb/include/dict0dict.h
        storage/xtradb/include/dict0mem.h
        storage/xtradb/include/fil0fil.h
        storage/xtradb/include/hash0hash.h
        storage/xtradb/include/hash0hash.ic
        storage/xtradb/include/lock0lock.h
        storage/xtradb/include/log0log.h
        storage/xtradb/include/log0log.ic
        storage/xtradb/include/log0recv.h
        storage/xtradb/include/mem0dbg.h
        storage/xtradb/include/mem0dbg.ic
        storage/xtradb/include/mem0mem.h
        storage/xtradb/include/mem0mem.ic
        storage/xtradb/include/mtr0log.ic
        storage/xtradb/include/mtr0mtr.ic
        storage/xtradb/include/os0file.h
        storage/xtradb/include/que0que.h
        storage/xtradb/include/que0que.ic
        storage/xtradb/include/row0mysql.h
        storage/xtradb/include/row0sel.h
        storage/xtradb/include/srv0srv.h
        storage/xtradb/include/sync0rw.h
        storage/xtradb/include/sync0sync.h
        storage/xtradb/include/trx0rseg.h
        storage/xtradb/include/trx0sys.h
        storage/xtradb/include/trx0sys.ic
        storage/xtradb/include/trx0trx.h
        storage/xtradb/include/trx0types.h
        storage/xtradb/include/univ.i
        storage/xtradb/include/ut0rnd.ic
        storage/xtradb/lock/lock0lock.c
        storage/xtradb/log/log0log.c
        storage/xtradb/log/log0recv.c
        storage/xtradb/mem/mem0dbg.c
        storage/xtradb/mem/mem0mem.c
        storage/xtradb/os/os0file.c
        storage/xtradb/page/page0page.c
        storage/xtradb/page/page0zip.c
        storage/xtradb/plug.in
        storage/xtradb/rem/rem0rec.c
        storage/xtradb/row/row0ins.c
        storage/xtradb/row/row0merge.c
        storage/xtradb/row/row0mysql.c
        storage/xtradb/row/row0row.c
        storage/xtradb/row/row0sel.c
        storage/xtradb/row/row0umod.c
        storage/xtradb/row/row0upd.c
        storage/xtradb/srv/srv0srv.c
        storage/xtradb/srv/srv0start.c
        storage/xtradb/sync/sync0sync.c
        storage/xtradb/trx/trx0i_s.c
        storage/xtradb/trx/trx0rec.c
        storage/xtradb/trx/trx0rseg.c
        storage/xtradb/trx/trx0sys.c
        storage/xtradb/trx/trx0trx.c
        strings/decimal.c
        support-files/compiler_warnings.supp
        support-files/mysql.spec.sh
        tests/mysql_client_test.c
        unittest/examples/Makefile.am
        unittest/examples/no_plan-t.c
        unittest/mytap/tap.c
        unittest/mytap/tap.h
        mysql-test/suite/innodb/r/innodb_mysql.result
        mysql-test/suite/rpl/r/rpl_row_find_row.result
        mysql-test/suite/rpl/t/rpl_row_find_row.test
        mysql-test/suite/innodb/t/innodb_mysql.test

=== modified file 'BUILD/SETUP.sh'
--- a/BUILD/SETUP.sh	2010-01-07 12:02:18 +0000
+++ b/BUILD/SETUP.sh	2010-08-02 09:01:24 +0000
@@ -127,8 +127,12 @@ fi
 
 # Set flags for various build configurations.
 # Used in -valgrind builds
+# Override -DFORCE_INIT_OF_VARS from debug_cflags. It enables the macro
+# LINT_INIT(), which is only useful for silencing spurious warnings
+# of static analysis tools. We want LINT_INIT() to be a no-op in Valgrind.
 valgrind_flags="-USAFEMALLOC -UFORCE_INIT_OF_VARS -DHAVE_valgrind "
 valgrind_flags="$valgrind_flags -DMYSQL_SERVER_SUFFIX=-valgrind-max"
+valgrind_configs="--with-valgrind"
 #
 # Used in -debug builds
 debug_cflags="-DUNIV_MUST_NOT_INLINE -DEXTRA_DEBUG -DFORCE_INIT_OF_VARS "

=== modified file 'BUILD/build_mccge.sh'
--- a/BUILD/build_mccge.sh	2009-05-06 12:03:24 +0000
+++ b/BUILD/build_mccge.sh	2010-08-02 09:01:24 +0000
@@ -941,6 +941,7 @@ set_valgrind_flags()
     loc_valgrind_flags="-USAFEMALLOC -UFORCE_INIT_OF_VARS -DHAVE_valgrind "
     loc_valgrind_flags="$loc_valgrind_flags -DMYSQL_SERVER_SUFFIX=-valgrind-max"
     compiler_flags="$compiler_flags $loc_valgrind_flags"
+    with_flags="$with_flags --with-valgrind"
   fi
 }
 

=== modified file 'BUILD/compile-amd64-valgrind-max'
--- a/BUILD/compile-amd64-valgrind-max	2007-01-23 13:09:14 +0000
+++ b/BUILD/compile-amd64-valgrind-max	2010-05-20 10:40:42 +0000
@@ -4,7 +4,7 @@ path=`dirname $0`
 . "$path/SETUP.sh"
 
 extra_flags="$amd64_cflags $debug_cflags $valgrind_flags"
-extra_configs="$amd64_configs $debug_configs $max_configs"
+extra_configs="$amd64_configs $debug_configs $valgrind_configs $max_configs"
 
 . "$path/FINISH.sh"
 

=== modified file 'BUILD/compile-pentium-icc-valgrind-max'
--- a/BUILD/compile-pentium-icc-valgrind-max	2006-04-05 12:50:12 +0000
+++ b/BUILD/compile-pentium-icc-valgrind-max	2010-05-20 10:40:42 +0000
@@ -29,6 +29,6 @@ extra_flags="$pentium_cflags $debug_cfla
 c_warnings="-Wall -Wcheck -wd161,444,279,810,981,1292,1469,1572"
 cxx_warnings="$c_warnings -wd869,874"
 base_cxxflags="-fno-exceptions -fno-rtti"
-extra_configs="$pentium_configs $debug_configs"
+extra_configs="$pentium_configs $debug_configs $valgrind_configs"
 
 . "$path/FINISH.sh"

=== modified file 'BUILD/compile-pentium-valgrind-max'
--- a/BUILD/compile-pentium-valgrind-max	2007-04-11 12:12:00 +0000
+++ b/BUILD/compile-pentium-valgrind-max	2010-05-20 10:40:42 +0000
@@ -4,7 +4,7 @@ path=`dirname $0`
 . "$path/SETUP.sh"
 
 extra_flags="$pentium_cflags $debug_cflags $valgrind_flags"
-extra_configs="$pentium_configs $debug_configs $max_configs"
+extra_configs="$pentium_configs $debug_configs $valgrind_configs $max_configs"
 
 . "$path/FINISH.sh"
 

=== modified file 'BUILD/compile-pentium-valgrind-max-no-ndb'
--- a/BUILD/compile-pentium-valgrind-max-no-ndb	2008-05-27 15:35:35 +0000
+++ b/BUILD/compile-pentium-valgrind-max-no-ndb	2010-05-20 10:40:42 +0000
@@ -4,7 +4,7 @@ path=`dirname $0`
 . "$path/SETUP.sh"
 
 extra_flags="$pentium_cflags $debug_cflags $valgrind_flags"
-extra_configs="$pentium_configs $debug_configs $max_no_ndb_configs"
+extra_configs="$pentium_configs $debug_configs $valgrind_configs $max_no_ndb_configs"
 
 . "$path/FINISH.sh"
 

=== modified file 'BUILD/compile-pentium64-valgrind-max'
--- a/BUILD/compile-pentium64-valgrind-max	2006-04-05 13:50:33 +0000
+++ b/BUILD/compile-pentium64-valgrind-max	2010-05-20 10:40:42 +0000
@@ -4,7 +4,7 @@ path=`dirname $0`
 . "$path/SETUP.sh"
 
 extra_flags="$pentium64_cflags $debug_cflags $valgrind_flags"
-extra_configs="$pentium_configs $debug_configs $max_configs"
+extra_configs="$pentium_configs $debug_configs $valgrind_configs $max_configs"
 
 . "$path/FINISH.sh"
 

=== modified file 'Makefile.am'
--- a/Makefile.am	2010-01-15 15:27:55 +0000
+++ b/Makefile.am	2010-08-02 09:01:24 +0000
@@ -161,8 +161,8 @@ test-bt:
 	-if [ -e bin/ndbd -o -e storage/ndb/src/kernel/ndbd ] ; then \
 	  cd mysql-test ; \
 	    MTR_BUILD_THREAD=auto \
-	      @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --comment=ndb+rpl_ndb+ps --force --timer \
-	          --ps-protocol --mysqld=--binlog-format=row --suite=ndb,rpl_ndb ; \
+	      @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --comment=ndb+ps --force --timer \
+	          --ps-protocol --mysqld=--binlog-format=row --suite=ndb ; \
 	    MTR_BUILD_THREAD=auto \
 	      @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --comment=ndb --force --timer \
 	          --with-ndbcluster-only ; \

=== modified file 'client/mysql.cc'
--- a/client/mysql.cc	2010-07-16 10:35:49 +0000
+++ b/client/mysql.cc	2010-08-02 09:01:24 +0000
@@ -1347,65 +1347,73 @@ static struct my_option my_long_options[
    0, 0, 0, 0, 0},
   {"abort-source-on-error", OPT_ABORT_SOURCE_ON_ERROR,
    "Abort 'source filename' operations in case of errors",
-   (uchar**) &batch_abort_on_error, (uchar**) &batch_abort_on_error, 0,
+   &batch_abort_on_error, &batch_abort_on_error, 0,
    GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
 #ifdef __NETWARE__
   {"autoclose", OPT_AUTO_CLOSE, "Automatically close the screen on exit for Netware.",
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
 #endif
   {"auto-rehash", OPT_AUTO_REHASH,
-   "Enable automatic rehashing. One doesn't need to use 'rehash' to get table and field completion, but startup and reconnecting may take a longer time. Disable with --disable-auto-rehash.",
-   (uchar**) &opt_rehash, (uchar**) &opt_rehash, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0,
+   "Enable automatic rehashing. One doesn't need to use 'rehash' to get table "
+   "and field completion, but startup and reconnecting may take a longer time. "
+   "Disable with --disable-auto-rehash.",
+   &opt_rehash, &opt_rehash, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0,
    0, 0},
   {"no-auto-rehash", 'A',
-   "No automatic rehashing. One has to use 'rehash' to get table and field completion. This gives a quicker start of mysql and disables rehashing on reconnect.",
+   "No automatic rehashing. One has to use 'rehash' to get table and field "
+   "completion. This gives a quicker start of mysql and disables rehashing "
+   "on reconnect.",
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"batch", 'B',
-   "Don't use history file. Disable interactive behavior. (Enables --silent.)", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
+   "Don't use history file. Disable interactive behavior. (Enables --silent.)",
+   0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"character-sets-dir", OPT_CHARSETS_DIR,
-   "Directory for character set files.", (uchar**) &charsets_dir,
-   (uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+   "Directory for character set files.", &charsets_dir,
+   &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"column-type-info", OPT_COLUMN_TYPES, "Display column type information.",
-   (uchar**) &column_types_flag, (uchar**) &column_types_flag,
+   &column_types_flag, &column_types_flag,
    0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"comments", 'c', "Preserve comments. Send comments to the server."
    " The default is --skip-comments (discard comments), enable with --comments.",
-   (uchar**) &preserve_comments, (uchar**) &preserve_comments,
+   &preserve_comments, &preserve_comments,
    0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"compress", 'C', "Use compression in server/client protocol.",
-   (uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
+   &opt_compress, &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
    0, 0, 0},
-
 #ifdef DBUG_OFF
   {"debug", '#', "This is a non-debug version. Catch this and exit.",
    0,0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0},
 #else
-  {"debug", '#', "Output debug log.", (uchar**) &default_dbug_option,
-   (uchar**) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
+  {"debug", '#', "Output debug log.", &default_dbug_option,
+   &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
 #endif
   {"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.",
-   (uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0,
+   &debug_check_flag, &debug_check_flag, 0,
    GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"debug-info", 'T', "Print some debug info at exit.", (uchar**) &debug_info_flag,
-   (uchar**) &debug_info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"database", 'D', "Database to use.", (uchar**) &current_db,
-   (uchar**) &current_db, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+  {"debug-info", 'T', "Print some debug info at exit.", &debug_info_flag,
+   &debug_info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+  {"database", 'D', "Database to use.", &current_db,
+   &current_db, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"default-character-set", OPT_DEFAULT_CHARSET,
-   "Set the default character set.", (uchar**) &default_charset,
-   (uchar**) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-  {"delimiter", OPT_DELIMITER, "Delimiter to be used.", (uchar**) &delimiter_str,
-   (uchar**) &delimiter_str, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+   "Set the default character set.", &default_charset,
+   &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+  {"delimiter", OPT_DELIMITER, "Delimiter to be used.", &delimiter_str,
+   &delimiter_str, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"execute", 'e', "Execute command and quit. (Disables --force and history file.)", 0,
    0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"vertical", 'E', "Print the output of a query (rows) vertically.",
-   (uchar**) &vertical, (uchar**) &vertical, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
+   &vertical, &vertical, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
    0},
   {"force", 'f', "Continue even if we get an SQL error. Sets abort-source-on-error to 0",
-   (uchar**) &ignore_errors, (uchar**) &ignore_errors, 0, GET_BOOL, NO_ARG, 0, 0,
+   &ignore_errors, &ignore_errors, 0, GET_BOOL, NO_ARG, 0, 0,
    0, 0, 0, 0},
   {"named-commands", 'G',
-   "Enable named commands. Named commands mean this program's internal commands; see mysql> help . When enabled, the named commands can be used from any line of the query, otherwise only from the first line, before an enter. Disable with --disable-named-commands. This option is disabled by default.",
-   (uchar**) &named_cmds, (uchar**) &named_cmds, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
+   "Enable named commands. Named commands mean this program's internal "
+   "commands; see mysql> help . When enabled, the named commands can be "
+   "used from any line of the query, otherwise only from the first line, "
+   "before an enter. Disable with --disable-named-commands. This option "
+   "is disabled by default.",
+   &named_cmds, &named_cmds, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
    0, 0},
   {"no-named-commands", 'g',
    "Named commands are disabled. Use \\* form only, or use named commands "
@@ -1415,47 +1423,54 @@ static struct my_option my_long_options[
    "WARNING: option deprecated; use --disable-named-commands instead.",
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"ignore-spaces", 'i', "Ignore space after function names.",
-   (uchar**) &ignore_spaces, (uchar**) &ignore_spaces, 0, GET_BOOL, NO_ARG, 0, 0,
+   &ignore_spaces, &ignore_spaces, 0, GET_BOOL, NO_ARG, 0, 0,
    0, 0, 0, 0},
   {"local-infile", OPT_LOCAL_INFILE, "Enable/disable LOAD DATA LOCAL INFILE.",
-   (uchar**) &opt_local_infile,
-   (uchar**) &opt_local_infile, 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0},
-  {"no-beep", 'b', "Turn off beep on error.", (uchar**) &opt_nobeep,
-   (uchar**) &opt_nobeep, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, 
-  {"host", 'h', "Connect to host.", (uchar**) &current_host,
-   (uchar**) &current_host, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-  {"html", 'H', "Produce HTML output.", (uchar**) &opt_html, (uchar**) &opt_html,
+   &opt_local_infile,
+   &opt_local_infile, 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0},
+  {"no-beep", 'b', "Turn off beep on error.", &opt_nobeep,
+   &opt_nobeep, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, 
+  {"host", 'h', "Connect to host.", &current_host,
+   &current_host, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+  {"html", 'H', "Produce HTML output.", &opt_html, &opt_html,
    0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"xml", 'X', "Produce XML output.", (uchar**) &opt_xml, (uchar**) &opt_xml, 0,
+  {"xml", 'X', "Produce XML output.", &opt_xml, &opt_xml, 0,
    GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"line-numbers", OPT_LINE_NUMBERS, "Write line numbers for errors.",
-   (uchar**) &line_numbers, (uchar**) &line_numbers, 0, GET_BOOL,
+   &line_numbers, &line_numbers, 0, GET_BOOL,
    NO_ARG, 1, 0, 0, 0, 0, 0},  
   {"skip-line-numbers", 'L', "Don't write line number for errors.", 0, 0, 0, GET_NO_ARG,
    NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"unbuffered", 'n', "Flush buffer after each query.", (uchar**) &unbuffered,
-   (uchar**) &unbuffered, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+  {"unbuffered", 'n', "Flush buffer after each query.", &unbuffered,
+   &unbuffered, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"column-names", OPT_COLUMN_NAMES, "Write column names in results.",
-   (uchar**) &column_names, (uchar**) &column_names, 0, GET_BOOL,
+   &column_names, &column_names, 0, GET_BOOL,
    NO_ARG, 1, 0, 0, 0, 0, 0},
   {"skip-column-names", 'N',
    "Don't write column names in results.",
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"set-variable", 'O',
-   "Change the value of a variable. Please note that this option is deprecated; you can set variables directly with --variable-name=value.",
+   "Change the value of a variable. Please note that this option is "
+   "deprecated; you can set variables directly with --variable-name=value.",
    0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"sigint-ignore", OPT_SIGINT_IGNORE, "Ignore SIGINT (CTRL-C).",
-   (uchar**) &opt_sigint_ignore,  (uchar**) &opt_sigint_ignore, 0, GET_BOOL,
+   &opt_sigint_ignore,  &opt_sigint_ignore, 0, GET_BOOL,
    NO_ARG, 0, 0, 0, 0, 0, 0},
   {"one-database", 'o',
-   "Only update the default database. This is useful for skipping updates to other database in the update log.",
+   "Only update the default database. This is useful for skipping updates "
+   "to other database in the update log.",
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
 #ifdef USE_POPEN
   {"pager", OPT_PAGER,
-   "Pager to use to display results. If you don't supply an option, the default pager is taken from your ENV variable PAGER. Valid pagers are less, more, cat [> filename], etc. See interactive help (\\h) also. This option does not work in batch mode. Disable with --disable-pager. This option is disabled by default.",
+   "Pager to use to display results. If you don't supply an option, the "
+   "default pager is taken from your ENV variable PAGER. Valid pagers are "
+   "less, more, cat [> filename], etc. See interactive help (\\h) also. "
+   "This option does not work in batch mode. Disable with --disable-pager. "
+   "This option is disabled by default.",
    0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
   {"no-pager", OPT_NOPAGER,
-   "Disable pager and print to stdout. See interactive help (\\h) also. WARNING: option deprecated; use --disable-pager instead.",
+   "Disable pager and print to stdout. See interactive help (\\h) also. "
+   "WARNING: option deprecated; use --disable-pager instead.",
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
 #endif
   {"password", 'p',
@@ -1471,48 +1486,53 @@ static struct my_option my_long_options[
    "/etc/services, "
 #endif
    "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
-   (uchar**) &opt_mysql_port,
-   (uchar**) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,  0},
+   &opt_mysql_port,
+   &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,  0},
   {"prompt", OPT_PROMPT, "Set the mysql prompt to this value.",
-   (uchar**) &current_prompt, (uchar**) &current_prompt, 0, GET_STR_ALLOC,
+   &current_prompt, &current_prompt, 0, GET_STR_ALLOC,
    REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"protocol", OPT_MYSQL_PROTOCOL, "The protocol to use for connection (tcp, socket, pipe, memory).",
    0, 0, 0, GET_STR,  REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"quick", 'q',
-   "Don't cache result, print it row by row. This may slow down the server if the output is suspended. Doesn't use history file.",
-   (uchar**) &quick, (uchar**) &quick, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+   "Don't cache result, print it row by row. This may slow down the server "
+   "if the output is suspended. Doesn't use history file.",
+   &quick, &quick, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"raw", 'r', "Write fields without conversion. Used with --batch.",
-   (uchar**) &opt_raw_data, (uchar**) &opt_raw_data, 0, GET_BOOL, NO_ARG, 0, 0, 0,
+   &opt_raw_data, &opt_raw_data, 0, GET_BOOL, NO_ARG, 0, 0, 0,
    0, 0, 0},
-  {"reconnect", OPT_RECONNECT, "Reconnect if the connection is lost. Disable with --disable-reconnect. This option is enabled by default.", 
-   (uchar**) &opt_reconnect, (uchar**) &opt_reconnect, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
-  {"silent", 's', "Be more silent. Print results with a tab as separator, each row on new line.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0,
-   0, 0},
+  {"reconnect", OPT_RECONNECT, "Reconnect if the connection is lost. Disable "
+   "with --disable-reconnect. This option is enabled by default.",
+   &opt_reconnect, &opt_reconnect, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
+  {"silent", 's', "Be more silent. Print results with a tab as separator, "
+   "each row on new line.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
 #ifdef HAVE_SMEM
   {"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
-   "Base name of shared memory.", (uchar**) &shared_memory_base_name, (uchar**) &shared_memory_base_name, 
-   0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+   "Base name of shared memory.", &shared_memory_base_name,
+   &shared_memory_base_name, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #endif
   {"socket", 'S', "The socket file to use for connection.",
-   (uchar**) &opt_mysql_unix_port, (uchar**) &opt_mysql_unix_port, 0, GET_STR_ALLOC,
+   &opt_mysql_unix_port, &opt_mysql_unix_port, 0, GET_STR_ALLOC,
    REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #include "sslopt-longopts.h"
-  {"table", 't', "Output in table format.", (uchar**) &output_tables,
-   (uchar**) &output_tables, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+  {"table", 't', "Output in table format.", &output_tables,
+   &output_tables, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"tee", OPT_TEE,
-   "Append everything into outfile. See interactive help (\\h) also. Does not work in batch mode. Disable with --disable-tee. This option is disabled by default.",
+   "Append everything into outfile. See interactive help (\\h) also. "
+   "Does not work in batch mode. Disable with --disable-tee. "
+   "This option is disabled by default.",
    0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-  {"no-tee", OPT_NOTEE, "Disable outfile. See interactive help (\\h) also. WARNING: Option deprecated; use --disable-tee instead.", 0, 0, 0, GET_NO_ARG,
-   NO_ARG, 0, 0, 0, 0, 0, 0},
+  {"no-tee", OPT_NOTEE, "Disable outfile. See interactive help (\\h) also. "
+   "WARNING: Option deprecated; use --disable-tee instead.",
+   0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
 #ifndef DONT_ALLOW_USER_CHANGE
-  {"user", 'u', "User for login if not current user.", (uchar**) &current_user,
-   (uchar**) &current_user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+  {"user", 'u', "User for login if not current user.", &current_user,
+   &current_user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #endif
   {"safe-updates", 'U', "Only allow UPDATE and DELETE that uses keys.",
-   (uchar**) &safe_updates, (uchar**) &safe_updates, 0, GET_BOOL, NO_ARG, 0, 0,
+   &safe_updates, &safe_updates, 0, GET_BOOL, NO_ARG, 0, 0,
    0, 0, 0, 0},
   {"i-am-a-dummy", 'U', "Synonym for option --safe-updates, -U.",
-   (uchar**) &safe_updates, (uchar**) &safe_updates, 0, GET_BOOL, NO_ARG, 0, 0,
+   &safe_updates, &safe_updates, 0, GET_BOOL, NO_ARG, 0, 0,
    0, 0, 0, 0},
   {"verbose", 'v', "Write more. (-v -v -v gives the table output format).", 0,
    0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
@@ -1522,35 +1542,32 @@ static struct my_option my_long_options[
    NO_ARG, 0, 0, 0, 0, 0, 0},
   {"connect_timeout", OPT_CONNECT_TIMEOUT,
    "Number of seconds before connection timeout.",
-   (uchar**) &opt_connect_timeout,
-   (uchar**) &opt_connect_timeout, 0, GET_ULONG, REQUIRED_ARG, 0, 0, 3600*12, 0,
-   0, 0},
+   &opt_connect_timeout, &opt_connect_timeout, 0, GET_ULONG, REQUIRED_ARG,
+   0, 0, 3600*12, 0, 0, 0},
   {"max_allowed_packet", OPT_MAX_ALLOWED_PACKET,
    "The maximum packet length to send to or receive from server.",
-   (uchar**) &opt_max_allowed_packet, (uchar**) &opt_max_allowed_packet, 0,
+   &opt_max_allowed_packet, &opt_max_allowed_packet, 0,
    GET_ULONG, REQUIRED_ARG, 16 *1024L*1024L, 4096,
    (longlong) 2*1024L*1024L*1024L, MALLOC_OVERHEAD, 1024, 0},
   {"net_buffer_length", OPT_NET_BUFFER_LENGTH,
    "The buffer size for TCP/IP and socket communication.",
-   (uchar**) &opt_net_buffer_length, (uchar**) &opt_net_buffer_length, 0, GET_ULONG,
+   &opt_net_buffer_length, &opt_net_buffer_length, 0, GET_ULONG,
    REQUIRED_ARG, 16384, 1024, 512*1024*1024L, MALLOC_OVERHEAD, 1024, 0},
   {"select_limit", OPT_SELECT_LIMIT,
    "Automatic limit for SELECT when using --safe-updates.",
-   (uchar**) &select_limit,
-   (uchar**) &select_limit, 0, GET_ULONG, REQUIRED_ARG, 1000L, 1, ULONG_MAX,
-   0, 1, 0},
+   &select_limit, &select_limit, 0, GET_ULONG, REQUIRED_ARG, 1000L,
+   1, ULONG_MAX, 0, 1, 0},
   {"max_join_size", OPT_MAX_JOIN_SIZE,
    "Automatic limit for rows in a join when using --safe-updates.",
-   (uchar**) &max_join_size,
-   (uchar**) &max_join_size, 0, GET_ULONG, REQUIRED_ARG, 1000000L, 1, ULONG_MAX,
-   0, 1, 0},
+   &max_join_size, &max_join_size, 0, GET_ULONG, REQUIRED_ARG, 1000000L,
+   1, ULONG_MAX, 0, 1, 0},
   {"secure-auth", OPT_SECURE_AUTH, "Refuse client connecting to server if it"
-    " uses old (pre-4.1.1) protocol.", (uchar**) &opt_secure_auth,
-    (uchar**) &opt_secure_auth, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+    " uses old (pre-4.1.1) protocol.", &opt_secure_auth,
+    &opt_secure_auth, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"server-arg", OPT_SERVER_ARG, "Send embedded server this as a parameter.",
    0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"show-warnings", OPT_SHOW_WARNINGS, "Show warnings after every statement.",
-    (uchar**) &show_warnings, (uchar**) &show_warnings, 0, GET_BOOL, NO_ARG, 
+    &show_warnings, &show_warnings, 0, GET_BOOL, NO_ARG,
     0, 0, 0, 0, 0, 0},
   { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
 };

=== modified file 'client/mysql_upgrade.c'
--- a/client/mysql_upgrade.c	2010-04-28 12:52:24 +0000
+++ b/client/mysql_upgrade.c	2010-08-02 09:01:24 +0000
@@ -68,7 +68,7 @@ static struct my_option my_long_options[
    "Directory for character set files.", 0,
    0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"compress", OPT_COMPRESS, "Use compression in server/client protocol.",
-   (uchar**)&not_used, (uchar**)&not_used, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+   &not_used, &not_used, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"datadir", 'd',
    "Not used by mysql_upgrade. Only for backward compatibility.",
    0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
@@ -76,26 +76,26 @@ static struct my_option my_long_options[
   {"debug", '#', "This is a non-debug version. Catch this and exit.",
    0, 0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0},
 #else
-  {"debug", '#', "Output debug log.", (uchar* *) & default_dbug_option,
-   (uchar* *) & default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
+  {"debug", '#', "Output debug log.", &default_dbug_option,
+   &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
 #endif
   {"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.",
-   (uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0,
+   &debug_check_flag, &debug_check_flag, 0,
    GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"debug-info", 'T', "Print some debug info at exit.", (uchar**) &debug_info_flag,
-   (uchar**) &debug_info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+  {"debug-info", 'T', "Print some debug info at exit.", &debug_info_flag,
+   &debug_info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"default-character-set", OPT_DEFAULT_CHARSET,
    "Set the default character set.", 0,
    0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"force", 'f', "Force execution of mysqlcheck even if mysql_upgrade "
    "has already been executed for the current version of MySQL.",
-   (uchar**)&opt_force, (uchar**)&opt_force, 0,
+   &opt_force, &opt_force, 0,
    GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"host",'h', "Connect to host.", 0,
    0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"password", 'p',
    "Password to use when connecting to server. If password is not given,"
-   " it's solicited on the tty.", (uchar**) &opt_password,(uchar**) &opt_password,
+   " it's solicited on the tty.", &opt_password,&opt_password,
    0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
 #ifdef __WIN__
   {"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0,
@@ -121,15 +121,15 @@ static struct my_option my_long_options[
 #include <sslopt-longopts.h>
   {"tmpdir", 't', "Directory for temporary files.",
    0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-  {"user", 'u', "User for login if not current user.", (uchar**) &opt_user,
-   (uchar**) &opt_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+  {"user", 'u', "User for login if not current user.", &opt_user,
+   &opt_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"verbose", 'v', "Display more output about the process.",
-   (uchar**) &opt_verbose, (uchar**) &opt_verbose, 0,
+   &opt_verbose, &opt_verbose, 0,
    GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
   {"write-binlog", OPT_WRITE_BINLOG,
    "All commands including mysqlcheck are binlogged. Enabled by default;"
    "use --skip-write-binlog when commands should not be sent to replication slaves.",
-   (uchar**) &opt_write_binlog, (uchar**) &opt_write_binlog, 0, GET_BOOL, NO_ARG,
+   &opt_write_binlog, &opt_write_binlog, 0, GET_BOOL, NO_ARG,
    1, 0, 0, 0, 0, 0},
   {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
 };

=== modified file 'client/mysqladmin.cc'
--- a/client/mysqladmin.cc	2010-04-28 12:52:24 +0000
+++ b/client/mysqladmin.cc	2010-08-02 09:01:24 +0000
@@ -122,37 +122,37 @@ static struct my_option my_long_options[
 #endif
   {"count", 'c',
    "Number of iterations to make. This works with -i (--sleep) only.",
-   (uchar**) &nr_iterations, (uchar**) &nr_iterations, 0, GET_UINT,
+   &nr_iterations, &nr_iterations, 0, GET_UINT,
    REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #ifndef DBUG_OFF
   {"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.",
    0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
 #endif
   {"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.",
-   (uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0,
+   &debug_check_flag, &debug_check_flag, 0,
    GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.",
-   (uchar**) &debug_info_flag, (uchar**) &debug_info_flag,
+   &debug_info_flag, &debug_info_flag,
    0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"force", 'f',
    "Don't ask for confirmation on drop database; with multiple commands, continue even if an error occurs.",
-   (uchar**) &option_force, (uchar**) &option_force, 0, GET_BOOL, NO_ARG, 0, 0,
+   &option_force, &option_force, 0, GET_BOOL, NO_ARG, 0, 0,
    0, 0, 0, 0},
   {"compress", 'C', "Use compression in server/client protocol.",
-   (uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
+   &opt_compress, &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
    0, 0, 0},
   {"character-sets-dir", OPT_CHARSETS_DIR,
-   "Directory for character set files.", (uchar**) &charsets_dir,
-   (uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+   "Directory for character set files.", &charsets_dir,
+   &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"default-character-set", OPT_DEFAULT_CHARSET,
-   "Set the default character set.", (uchar**) &default_charset,
-   (uchar**) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+   "Set the default character set.", &default_charset,
+   &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"help", '?', "Display this help and exit.", 0, 0, 0, GET_NO_ARG,
    NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"host", 'h', "Connect to host.", (uchar**) &host, (uchar**) &host, 0, GET_STR,
+  {"host", 'h', "Connect to host.", &host, &host, 0, GET_STR,
    REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-  {"no-beep", 'b', "Turn off beep on error.", (uchar**) &opt_nobeep,
-   (uchar**) &opt_nobeep, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, 
+  {"no-beep", 'b', "Turn off beep on error.", &opt_nobeep,
+   &opt_nobeep, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, 
   {"password", 'p',
    "Password to use when connecting to server. If password is not given it's asked from the tty.",
    0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
@@ -166,50 +166,52 @@ static struct my_option my_long_options[
    "/etc/services, "
 #endif
    "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
-   (uchar**) &tcp_port,
-   (uchar**) &tcp_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+   &tcp_port,
+   &tcp_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"protocol", OPT_MYSQL_PROTOCOL, "The protocol to use for connection (tcp, socket, pipe, memory).",
     0, 0, 0, GET_STR,  REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"relative", 'r',
-   "Show difference between current and previous values when used with -i. Currently only works with extended-status.",
-   (uchar**) &opt_relative, (uchar**) &opt_relative, 0, GET_BOOL, NO_ARG, 0, 0, 0,
+   "Show difference between current and previous values when used with -i. "
+   "Currently only works with extended-status.",
+   &opt_relative, &opt_relative, 0, GET_BOOL, NO_ARG, 0, 0, 0,
   0, 0, 0},
   {"set-variable", 'O',
-   "Change the value of a variable. Please note that this option is deprecated; you can set variables directly with --variable-name=value.",
+   "Change the value of a variable. Please note that this option is "
+   "deprecated; you can set variables directly with --variable-name=value.",
    0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #ifdef HAVE_SMEM
   {"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
-   "Base name of shared memory.", (uchar**) &shared_memory_base_name, (uchar**) &shared_memory_base_name,
+   "Base name of shared memory.", &shared_memory_base_name, &shared_memory_base_name,
    0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #endif
   {"silent", 's', "Silently exit if one can't connect to server.",
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"socket", 'S', "The socket file to use for connection.",
-   (uchar**) &unix_port, (uchar**) &unix_port, 0, GET_STR, REQUIRED_ARG, 0, 0, 0,
+   &unix_port, &unix_port, 0, GET_STR, REQUIRED_ARG, 0, 0, 0,
    0, 0, 0},
   {"sleep", 'i', "Execute commands repeatedly with a sleep between.",
-   (uchar**) &interval, (uchar**) &interval, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0,
+   &interval, &interval, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0,
    0, 0},
 #include <sslopt-longopts.h>
 #ifndef DONT_ALLOW_USER_CHANGE
-  {"user", 'u', "User for login if not current user.", (uchar**) &user,
-   (uchar**) &user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+  {"user", 'u', "User for login if not current user.", &user,
+   &user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #endif
-  {"verbose", 'v', "Write more information.", (uchar**) &opt_verbose,
-   (uchar**) &opt_verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+  {"verbose", 'v', "Write more information.", &opt_verbose,
+   &opt_verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"version", 'V', "Output version information and exit.", 0, 0, 0, GET_NO_ARG,
    NO_ARG, 0, 0, 0, 0, 0, 0},
   {"vertical", 'E',
    "Print output vertically. Is similar to --relative, but prints output vertically.",
-   (uchar**) &opt_vertical, (uchar**) &opt_vertical, 0, GET_BOOL, NO_ARG, 0, 0, 0,
+   &opt_vertical, &opt_vertical, 0, GET_BOOL, NO_ARG, 0, 0, 0,
    0, 0, 0},
   {"wait", 'w', "Wait and retry if connection is down.", 0, 0, 0, GET_UINT,
    OPT_ARG, 0, 0, 0, 0, 0, 0},
-  {"connect_timeout", OPT_CONNECT_TIMEOUT, "", (uchar**) &opt_connect_timeout,
-   (uchar**) &opt_connect_timeout, 0, GET_ULONG, REQUIRED_ARG, 3600*12, 0,
+  {"connect_timeout", OPT_CONNECT_TIMEOUT, "", &opt_connect_timeout,
+   &opt_connect_timeout, 0, GET_ULONG, REQUIRED_ARG, 3600*12, 0,
    3600*12, 0, 1, 0},
-  {"shutdown_timeout", OPT_SHUTDOWN_TIMEOUT, "", (uchar**) &opt_shutdown_timeout,
-   (uchar**) &opt_shutdown_timeout, 0, GET_ULONG, REQUIRED_ARG,
+  {"shutdown_timeout", OPT_SHUTDOWN_TIMEOUT, "", &opt_shutdown_timeout,
+   &opt_shutdown_timeout, 0, GET_ULONG, REQUIRED_ARG,
    SHUTDOWN_DEF_TIMEOUT, 0, 3600*12, 0, 1, 0},
   { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
 };

=== modified file 'client/mysqlbinlog.cc'
--- a/client/mysqlbinlog.cc	2010-04-28 12:52:24 +0000
+++ b/client/mysqlbinlog.cc	2010-08-02 09:01:24 +0000
@@ -1004,9 +1004,8 @@ static struct my_option my_long_options[
    "events); 'always' prints base64 whenever possible. 'always' is for "
    "debugging only and should not be used in a production system. If this "
    "argument is not given, the default is 'auto'; if it is given with no "
-   "argument, 'always' is used."
-   ,(uchar**) &opt_base64_output_mode_str,
-   (uchar**) &opt_base64_output_mode_str,
+   "argument, 'always' is used.",
+   &opt_base64_output_mode_str, &opt_base64_output_mode_str,
    0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
   /*
     mysqlbinlog needs charsets knowledge, to be able to convert a charset
@@ -1015,43 +1014,43 @@ static struct my_option my_long_options[
     SET @`a`:=_cp850 0x4DFC6C6C6572 COLLATE `cp850_general_ci`;
   */
   {"character-sets-dir", OPT_CHARSETS_DIR,
-   "Directory for character set files.", (uchar**) &charsets_dir,
-   (uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+   "Directory for character set files.", &charsets_dir,
+   &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"database", 'd', "List entries for just this database (local log only).",
-   (uchar**) &database, (uchar**) &database, 0, GET_STR_ALLOC, REQUIRED_ARG,
+   &database, &database, 0, GET_STR_ALLOC, REQUIRED_ARG,
    0, 0, 0, 0, 0, 0},
 #ifndef DBUG_OFF
-  {"debug", '#', "Output debug log.", (uchar**) &default_dbug_option,
-   (uchar**) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
+  {"debug", '#', "Output debug log.", &default_dbug_option,
+   &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
 #endif
   {"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit .",
-   (uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0,
+   &debug_check_flag, &debug_check_flag, 0,
    GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.",
-   (uchar**) &debug_info_flag, (uchar**) &debug_info_flag,
+   &debug_info_flag, &debug_info_flag,
    0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"disable-log-bin", 'D', "Disable binary log. This is useful, if you "
     "enabled --to-last-log and are sending the output to the same MySQL server. "
     "This way you could avoid an endless loop. You would also like to use it "
     "when restoring after a crash to avoid duplication of the statements you "
     "already have. NOTE: you will need a SUPER privilege to use this option.",
-   (uchar**) &disable_log_bin, (uchar**) &disable_log_bin, 0, GET_BOOL,
+   &disable_log_bin, &disable_log_bin, 0, GET_BOOL,
    NO_ARG, 0, 0, 0, 0, 0, 0},
   {"force-if-open", 'F', "Force if binlog was not closed properly.",
-   (uchar**) &force_if_open_opt, (uchar**) &force_if_open_opt, 0, GET_BOOL, NO_ARG,
+   &force_if_open_opt, &force_if_open_opt, 0, GET_BOOL, NO_ARG,
    1, 0, 0, 0, 0, 0},
   {"force-read", 'f', "Force reading unknown binlog events.",
-   (uchar**) &force_opt, (uchar**) &force_opt, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
+   &force_opt, &force_opt, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
    0, 0},
   {"hexdump", 'H', "Augment output with hexadecimal and ASCII event dump.",
-   (uchar**) &opt_hexdump, (uchar**) &opt_hexdump, 0, GET_BOOL, NO_ARG,
+   &opt_hexdump, &opt_hexdump, 0, GET_BOOL, NO_ARG,
    0, 0, 0, 0, 0, 0},
-  {"host", 'h', "Get the binlog from server.", (uchar**) &host, (uchar**) &host,
+  {"host", 'h', "Get the binlog from server.", &host, &host,
    0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"local-load", 'l', "Prepare local temporary files for LOAD DATA INFILE in the specified directory.",
-   (uchar**) &dirname_for_local_load, (uchar**) &dirname_for_local_load, 0,
+   &dirname_for_local_load, &dirname_for_local_load, 0,
    GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-  {"offset", 'o', "Skip the first N entries.", (uchar**) &offset, (uchar**) &offset,
+  {"offset", 'o', "Skip the first N entries.", &offset, &offset,
    0, GET_ULL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"password", 'p', "Password to connect to remote server.",
    0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
@@ -1061,10 +1060,10 @@ static struct my_option my_long_options[
    "/etc/services, "
 #endif
    "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
-   (uchar**) &port, (uchar**) &port, 0, GET_INT, REQUIRED_ARG,
+   &port, &port, 0, GET_INT, REQUIRED_ARG,
    0, 0, 0, 0, 0, 0},
   {"position", OPT_POSITION, "Deprecated. Use --start-position instead.",
-   (uchar**) &start_position, (uchar**) &start_position, 0, GET_ULL,
+   &start_position, &start_position, 0, GET_ULL,
    REQUIRED_ARG, BIN_LOG_HEADER_SIZE, BIN_LOG_HEADER_SIZE,
    /* COM_BINLOG_DUMP accepts only 4 bytes for the position */
    (ulonglong)(~(uint32)0), 0, 0, 0},
@@ -1072,31 +1071,31 @@ static struct my_option my_long_options[
    "The protocol to use for connection (tcp, socket, pipe, memory).",
    0, 0, 0, GET_STR,  REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"read-from-remote-server", 'R', "Read binary logs from a MySQL server.",
-   (uchar**) &remote_opt, (uchar**) &remote_opt, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
+   &remote_opt, &remote_opt, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
    0, 0},
   {"result-file", 'r', "Direct output to a given file.", 0, 0, 0, GET_STR,
    REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"server-id", OPT_SERVER_ID,
    "Extract only binlog entries created by the server having the given id.",
-   (uchar**) &server_id, (uchar**) &server_id, 0, GET_ULONG,
+   &server_id, &server_id, 0, GET_ULONG,
    REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"set-charset", OPT_SET_CHARSET,
-   "Add 'SET NAMES character_set' to the output.", (uchar**) &charset,
-   (uchar**) &charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+   "Add 'SET NAMES character_set' to the output.", &charset,
+   &charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #ifdef HAVE_SMEM
   {"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
-   "Base name of shared memory.", (uchar**) &shared_memory_base_name, 
-   (uchar**) &shared_memory_base_name, 
+   "Base name of shared memory.", &shared_memory_base_name,
+   &shared_memory_base_name,
    0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #endif
   {"short-form", 's', "Just show regular queries: no extra info and no "
    "row-based events. This is for testing only, and should not be used in "
    "production systems. If you want to suppress base64-output, consider "
    "using --base64-output=never instead.",
-   (uchar**) &short_form, (uchar**) &short_form, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
+   &short_form, &short_form, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
    0, 0},
   {"socket", 'S', "The socket file to use for connection.",
-   (uchar**) &sock, (uchar**) &sock, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 
+   &sock, &sock, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 
    0, 0},
   {"start-datetime", OPT_START_DATETIME,
    "Start reading the binlog at first event having a datetime equal or "
@@ -1104,12 +1103,12 @@ static struct my_option my_long_options[
    "in the local time zone, in any format accepted by the MySQL server "
    "for DATETIME and TIMESTAMP types, for example: 2004-12-25 11:25:56 "
    "(you should probably use quotes for your shell to set it properly).",
-   (uchar**) &start_datetime_str, (uchar**) &start_datetime_str,
+   &start_datetime_str, &start_datetime_str,
    0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"start-position", 'j',
    "Start reading the binlog at position N. Applies to the first binlog "
    "passed on the command line.",
-   (uchar**) &start_position, (uchar**) &start_position, 0, GET_ULL,
+   &start_position, &start_position, 0, GET_ULL,
    REQUIRED_ARG, BIN_LOG_HEADER_SIZE, BIN_LOG_HEADER_SIZE,
    /* COM_BINLOG_DUMP accepts only 4 bytes for the position */
    (ulonglong)(~(uint32)0), 0, 0, 0},
@@ -1119,22 +1118,22 @@ static struct my_option my_long_options[
    "in the local time zone, in any format accepted by the MySQL server "
    "for DATETIME and TIMESTAMP types, for example: 2004-12-25 11:25:56 "
    "(you should probably use quotes for your shell to set it properly).",
-   (uchar**) &stop_datetime_str, (uchar**) &stop_datetime_str,
+   &stop_datetime_str, &stop_datetime_str,
    0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"stop-position", OPT_STOP_POSITION,
    "Stop reading the binlog at position N. Applies to the last binlog "
    "passed on the command line.",
-   (uchar**) &stop_position, (uchar**) &stop_position, 0, GET_ULL,
+   &stop_position, &stop_position, 0, GET_ULL,
    REQUIRED_ARG, (ulonglong)(~(my_off_t)0), BIN_LOG_HEADER_SIZE,
    (ulonglong)(~(my_off_t)0), 0, 0, 0},
   {"to-last-log", 't', "Requires -R. Will not stop at the end of the \
 requested binlog but rather continue printing until the end of the last \
 binlog of the MySQL server. If you send the output to the same MySQL server, \
 that may lead to an endless loop.",
-   (uchar**) &to_last_remote_log, (uchar**) &to_last_remote_log, 0, GET_BOOL,
+   &to_last_remote_log, &to_last_remote_log, 0, GET_BOOL,
    NO_ARG, 0, 0, 0, 0, 0, 0},
   {"user", 'u', "Connect to the remote server as username.",
-   (uchar**) &user, (uchar**) &user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0,
+   &user, &user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0,
    0, 0},
   {"verbose", 'v', "Reconstruct SQL statements out of row events. "
                    "-v -v adds comments on column data types.",
@@ -1143,7 +1142,7 @@ that may lead to an endless loop.",
    0, 0, 0, 0, 0},
   {"open_files_limit", OPT_OPEN_FILES_LIMIT,
    "Used to reserve file descriptors for use by this program.",
-   (uchar**) &open_files_limit, (uchar**) &open_files_limit, 0, GET_ULONG,
+   &open_files_limit, &open_files_limit, 0, GET_ULONG,
    REQUIRED_ARG, MY_NFILE, 8, OS_FILE_LIMIT, 0, 1, 0},
   {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
 };

=== modified file 'client/mysqlcheck.c'
--- a/client/mysqlcheck.c	2010-04-28 12:52:24 +0000
+++ b/client/mysqlcheck.c	2010-08-02 09:01:24 +0000
@@ -54,13 +54,13 @@ static struct my_option my_long_options[
 {
   {"all-databases", 'A',
    "Check all the databases. This is the same as --databases with all databases selected.",
-   (uchar**) &opt_alldbs, (uchar**) &opt_alldbs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
+   &opt_alldbs, &opt_alldbs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
    0, 0},
   {"analyze", 'a', "Analyze given tables.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0,
    0, 0, 0, 0},
   {"all-in-1", '1',
    "Instead of issuing one query for each table, use one query per database, naming all tables in the database in a comma-separated list.",
-   (uchar**) &opt_all_in_1, (uchar**) &opt_all_in_1, 0, GET_BOOL, NO_ARG, 0, 0, 0,
+   &opt_all_in_1, &opt_all_in_1, 0, GET_BOOL, NO_ARG, 0, 0, 0,
    0, 0, 0},
 #ifdef __NETWARE__
   {"autoclose", OPT_AUTO_CLOSE, "Automatically close the screen on exit for Netware.",
@@ -68,11 +68,11 @@ static struct my_option my_long_options[
 #endif
   {"auto-repair", OPT_AUTO_REPAIR,
    "If a checked table is corrupted, automatically fix it. Repairing will be done after all tables have been checked, if corrupted ones were found.",
-   (uchar**) &opt_auto_repair, (uchar**) &opt_auto_repair, 0, GET_BOOL, NO_ARG, 0,
+   &opt_auto_repair, &opt_auto_repair, 0, GET_BOOL, NO_ARG, 0,
    0, 0, 0, 0, 0},
   {"character-sets-dir", OPT_CHARSETS_DIR,
-   "Directory for character set files.", (uchar**) &charsets_dir,
-   (uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+   "Directory for character set files.", &charsets_dir,
+   &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"check", 'c', "Check table for errors.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0,
    0, 0, 0, 0},
   {"check-only-changed", 'C',
@@ -82,11 +82,11 @@ static struct my_option my_long_options[
    "Check tables for version-dependent changes. May be used with --auto-repair to correct tables requiring version-dependent updates.",
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"compress", OPT_COMPRESS, "Use compression in server/client protocol.",
-   (uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
+   &opt_compress, &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
    0, 0, 0},
   {"databases", 'B',
    "Check several databases. Note the difference in usage; in this case no tables are given. All name arguments are regarded as database names.",
-   (uchar**) &opt_databases, (uchar**) &opt_databases, 0, GET_BOOL, NO_ARG,
+   &opt_databases, &opt_databases, 0, GET_BOOL, NO_ARG,
    0, 0, 0, 0, 0, 0},
 #ifdef DBUG_OFF
   {"debug", '#', "This is a non-debug version. Catch this and exit.",
@@ -96,40 +96,40 @@ static struct my_option my_long_options[
    0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
 #endif
   {"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.",
-   (uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0,
+   &debug_check_flag, &debug_check_flag, 0,
    GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.",
-   (uchar**) &debug_info_flag, (uchar**) &debug_info_flag,
+   &debug_info_flag, &debug_info_flag,
    0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"default-character-set", OPT_DEFAULT_CHARSET,
-   "Set the default character set.", (uchar**) &default_charset,
-   (uchar**) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+   "Set the default character set.", &default_charset,
+   &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"fast",'F', "Check only tables that haven't been closed properly.",
-   (uchar**) &opt_fast, (uchar**) &opt_fast, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
+   &opt_fast, &opt_fast, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
    0},
   {"fix-db-names", OPT_FIX_DB_NAMES, "Fix database names.",
-    (uchar**) &opt_fix_db_names, (uchar**) &opt_fix_db_names,
+    &opt_fix_db_names, &opt_fix_db_names,
     0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"fix-table-names", OPT_FIX_TABLE_NAMES, "Fix table names.",
-    (uchar**) &opt_fix_table_names, (uchar**) &opt_fix_table_names,
+    &opt_fix_table_names, &opt_fix_table_names,
     0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"force", 'f', "Continue even if we get an SQL error.",
-   (uchar**) &ignore_errors, (uchar**) &ignore_errors, 0, GET_BOOL, NO_ARG, 0, 0,
+   &ignore_errors, &ignore_errors, 0, GET_BOOL, NO_ARG, 0, 0,
    0, 0, 0, 0},
   {"extended", 'e',
    "If you are using this option with CHECK TABLE, it will ensure that the table is 100 percent consistent, but will take a long time. If you are using this option with REPAIR TABLE, it will force using old slow repair with keycache method, instead of much faster repair by sorting.",
-   (uchar**) &opt_extended, (uchar**) &opt_extended, 0, GET_BOOL, NO_ARG, 0, 0, 0,
+   &opt_extended, &opt_extended, 0, GET_BOOL, NO_ARG, 0, 0, 0,
    0, 0, 0},
   {"help", '?', "Display this help message and exit.", 0, 0, 0, GET_NO_ARG,
    NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"host",'h', "Connect to host.", (uchar**) &current_host,
-   (uchar**) &current_host, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+  {"host",'h', "Connect to host.", &current_host,
+   &current_host, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"medium-check", 'm',
    "Faster than extended-check, but only finds 99.99 percent of all errors. Should be good enough for most cases.",
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"write-binlog", OPT_WRITE_BINLOG,
    "Log ANALYZE, OPTIMIZE and REPAIR TABLE commands. Enabled by default; use --skip-write-binlog when commands should not be sent to replication slaves.",
-   (uchar**) &opt_write_binlog, (uchar**) &opt_write_binlog, 0, GET_BOOL, NO_ARG,
+   &opt_write_binlog, &opt_write_binlog, 0, GET_BOOL, NO_ARG,
    1, 0, 0, 0, 0, 0},
   {"optimize", 'o', "Optimize table.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0,
    0, 0},
@@ -146,38 +146,38 @@ static struct my_option my_long_options[
    "/etc/services, "
 #endif
    "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
-   (uchar**) &opt_mysql_port,
-   (uchar**) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
+   &opt_mysql_port,
+   &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
    0},
   {"protocol", OPT_MYSQL_PROTOCOL, "The protocol to use for connection (tcp, socket, pipe, memory).",
    0, 0, 0, GET_STR,  REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"quick", 'q',
    "If you are using this option with CHECK TABLE, it prevents the check from scanning the rows to check for wrong links. This is the fastest check. If you are using this option with REPAIR TABLE, it will try to repair only the index tree. This is the fastest repair method for a table.",
-   (uchar**) &opt_quick, (uchar**) &opt_quick, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
+   &opt_quick, &opt_quick, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
    0},
   {"repair", 'r',
    "Can fix almost anything except unique keys that aren't unique.",
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
 #ifdef HAVE_SMEM
   {"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
-   "Base name of shared memory.", (uchar**) &shared_memory_base_name, (uchar**) &shared_memory_base_name,
+   "Base name of shared memory.", &shared_memory_base_name, &shared_memory_base_name,
    0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #endif
-  {"silent", 's', "Print only error messages.", (uchar**) &opt_silent,
-   (uchar**) &opt_silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+  {"silent", 's', "Print only error messages.", &opt_silent,
+   &opt_silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"socket", 'S', "The socket file to use for connection.",
-   (uchar**) &opt_mysql_unix_port, (uchar**) &opt_mysql_unix_port, 0, GET_STR,
+   &opt_mysql_unix_port, &opt_mysql_unix_port, 0, GET_STR,
    REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #include <sslopt-longopts.h>
   {"tables", OPT_TABLES, "Overrides option --databases (-B).", 0, 0, 0,
    GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"use-frm", OPT_FRM,
    "When used with REPAIR, get table structure from .frm file, so the table can be repaired even if .MYI header is corrupted.",
-   (uchar**) &opt_frm, (uchar**) &opt_frm, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
+   &opt_frm, &opt_frm, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
    0},
 #ifndef DONT_ALLOW_USER_CHANGE
-  {"user", 'u', "User for login if not current user.", (uchar**) &current_user,
-   (uchar**) &current_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+  {"user", 'u', "User for login if not current user.", &current_user,
+   &current_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #endif
   {"verbose", 'v', "Print info about the various stages.", 0, 0, 0, GET_NO_ARG,
    NO_ARG, 0, 0, 0, 0, 0, 0},

=== modified file 'client/mysqldump.c'
--- a/client/mysqldump.c	2010-06-23 00:48:11 +0000
+++ b/client/mysqldump.c	2010-08-02 09:01:24 +0000
@@ -180,115 +180,115 @@ HASH ignore_table;
 static struct my_option my_long_options[] =
 {
   {"all", OPT_ALL, "Deprecated. Use --create-options instead.",
-   (uchar**) &create_options, (uchar**) &create_options, 0, GET_BOOL, NO_ARG, 1,
+   &create_options, &create_options, 0, GET_BOOL, NO_ARG, 1,
    0, 0, 0, 0, 0},
   {"all-databases", 'A',
    "Dump all the databases. This will be same as --databases with all databases selected.",
-   (uchar**) &opt_alldbs, (uchar**) &opt_alldbs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
+   &opt_alldbs, &opt_alldbs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
    0, 0},
   {"all-tablespaces", 'Y',
    "Dump all the tablespaces.",
-   (uchar**) &opt_alltspcs, (uchar**) &opt_alltspcs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
+   &opt_alltspcs, &opt_alltspcs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
    0, 0},
   {"no-tablespaces", 'y',
    "Do not dump any tablespace information.",
-   (uchar**) &opt_notspcs, (uchar**) &opt_notspcs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
+   &opt_notspcs, &opt_notspcs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
    0, 0},
   {"add-drop-database", OPT_DROP_DATABASE, "Add a DROP DATABASE before each create.",
-   (uchar**) &opt_drop_database, (uchar**) &opt_drop_database, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
+   &opt_drop_database, &opt_drop_database, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
    0},
   {"add-drop-table", OPT_DROP, "Add a DROP TABLE before each create.",
-   (uchar**) &opt_drop, (uchar**) &opt_drop, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0,
+   &opt_drop, &opt_drop, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0,
    0},
   {"add-locks", OPT_LOCKS, "Add locks around INSERT statements.",
-   (uchar**) &opt_lock, (uchar**) &opt_lock, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0,
+   &opt_lock, &opt_lock, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0,
    0},
   {"allow-keywords", OPT_KEYWORDS,
-   "Allow creation of column names that are keywords.", (uchar**) &opt_keywords,
-   (uchar**) &opt_keywords, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+   "Allow creation of column names that are keywords.", &opt_keywords,
+   &opt_keywords, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
 #ifdef __NETWARE__
   {"autoclose", OPT_AUTO_CLOSE, "Automatically close the screen on exit for Netware.",
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
 #endif
   {"character-sets-dir", OPT_CHARSETS_DIR,
-   "Directory for character set files.", (uchar**) &charsets_dir,
-   (uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+   "Directory for character set files.", &charsets_dir,
+   &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"comments", 'i', "Write additional information.",
-   (uchar**) &opt_comments, (uchar**) &opt_comments, 0, GET_BOOL, NO_ARG,
+   &opt_comments, &opt_comments, 0, GET_BOOL, NO_ARG,
    1, 0, 0, 0, 0, 0},
   {"compatible", OPT_COMPATIBLE,
    "Change the dump to be compatible with a given mode. By default tables are dumped in a format optimized for MySQL. Legal modes are: ansi, mysql323, mysql40, postgresql, oracle, mssql, db2, maxdb, no_key_options, no_table_options, no_field_options. One can use several modes separated by commas. Note: Requires MySQL server version 4.1.0 or higher. This option is ignored with earlier server versions.",
-   (uchar**) &opt_compatible_mode_str, (uchar**) &opt_compatible_mode_str, 0,
+   &opt_compatible_mode_str, &opt_compatible_mode_str, 0,
    GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"compact", OPT_COMPACT,
    "Give less verbose output (useful for debugging). Disables structure comments and header/footer constructs.  Enables options --skip-add-drop-table --skip-add-locks --skip-comments --skip-disable-keys --skip-set-charset.",
-   (uchar**) &opt_compact, (uchar**) &opt_compact, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
+   &opt_compact, &opt_compact, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
    0, 0},
   {"complete-insert", 'c', "Use complete insert statements.",
-   (uchar**) &opt_complete_insert, (uchar**) &opt_complete_insert, 0, GET_BOOL,
+   &opt_complete_insert, &opt_complete_insert, 0, GET_BOOL,
    NO_ARG, 0, 0, 0, 0, 0, 0},
   {"compress", 'C', "Use compression in server/client protocol.",
-   (uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
+   &opt_compress, &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
    0, 0, 0},
   {"create-options", 'a',
    "Include all MySQL specific create options.",
-   (uchar**) &create_options, (uchar**) &create_options, 0, GET_BOOL, NO_ARG, 1,
+   &create_options, &create_options, 0, GET_BOOL, NO_ARG, 1,
    0, 0, 0, 0, 0},
   {"databases", 'B',
    "Dump several databases. Note the difference in usage; in this case no tables are given. All name arguments are regarded as database names. 'USE db_name;' will be included in the output.",
-   (uchar**) &opt_databases, (uchar**) &opt_databases, 0, GET_BOOL, NO_ARG, 0, 0,
+   &opt_databases, &opt_databases, 0, GET_BOOL, NO_ARG, 0, 0,
    0, 0, 0, 0},
 #ifdef DBUG_OFF
   {"debug", '#', "This is a non-debug version. Catch this and exit.",
    0,0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0},
 #else
-  {"debug", '#', "Output debug log.", (uchar**) &default_dbug_option,
-   (uchar**) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
+  {"debug", '#', "Output debug log.", &default_dbug_option,
+   &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
 #endif
   {"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.",
-   (uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0,
+   &debug_check_flag, &debug_check_flag, 0,
    GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.",
-   (uchar**) &debug_info_flag, (uchar**) &debug_info_flag,
+   &debug_info_flag, &debug_info_flag,
    0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"default-character-set", OPT_DEFAULT_CHARSET,
-   "Set the default character set.", (uchar**) &default_charset,
-   (uchar**) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+   "Set the default character set.", &default_charset,
+   &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"delayed-insert", OPT_DELAYED, "Insert rows with INSERT DELAYED.",
-   (uchar**) &opt_delayed, (uchar**) &opt_delayed, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
+   &opt_delayed, &opt_delayed, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
    0, 0},
   {"delete-master-logs", OPT_DELETE_MASTER_LOGS,
    "Delete logs on master after backup. This automatically enables --master-data.",
-   (uchar**) &opt_delete_master_logs, (uchar**) &opt_delete_master_logs, 0,
+   &opt_delete_master_logs, &opt_delete_master_logs, 0,
    GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"disable-keys", 'K',
-   "'/*!40000 ALTER TABLE tb_name DISABLE KEYS */; and '/*!40000 ALTER TABLE tb_name ENABLE KEYS */; will be put in the output.", (uchar**) &opt_disable_keys,
-   (uchar**) &opt_disable_keys, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
+   "'/*!40000 ALTER TABLE tb_name DISABLE KEYS */; and '/*!40000 ALTER TABLE tb_name ENABLE KEYS */; will be put in the output.", &opt_disable_keys,
+   &opt_disable_keys, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
   {"events", 'E', "Dump events.",
-     (uchar**) &opt_events, (uchar**) &opt_events, 0, GET_BOOL,
+     &opt_events, &opt_events, 0, GET_BOOL,
      NO_ARG, 0, 0, 0, 0, 0, 0},
   {"extended-insert", 'e',
    "Use multiple-row INSERT syntax that include several VALUES lists.",
-   (uchar**) &extended_insert, (uchar**) &extended_insert, 0, GET_BOOL, NO_ARG,
+   &extended_insert, &extended_insert, 0, GET_BOOL, NO_ARG,
    1, 0, 0, 0, 0, 0},
   {"fields-terminated-by", OPT_FTB,
    "Fields in the output file are terminated by the given string.", 
-   (uchar**) &fields_terminated, (uchar**) &fields_terminated, 0, 
+   &fields_terminated, &fields_terminated, 0, 
    GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"fields-enclosed-by", OPT_ENC,
    "Fields in the output file are enclosed by the given character.", 
-   (uchar**) &enclosed, (uchar**) &enclosed, 0, 
+   &enclosed, &enclosed, 0, 
    GET_STR, REQUIRED_ARG, 0, 0, 0, 0 ,0, 0},
   {"fields-optionally-enclosed-by", OPT_O_ENC,
    "Fields in the output file are optionally enclosed by the given character.", 
-   (uchar**) &opt_enclosed, (uchar**) &opt_enclosed, 0, 
+   &opt_enclosed, &opt_enclosed, 0, 
    GET_STR, REQUIRED_ARG, 0, 0, 0, 0 ,0, 0},
   {"fields-escaped-by", OPT_ESC, 
    "Fields in the output file are escaped by the given character.",
-   (uchar**) &escaped, (uchar**) &escaped, 0, 
+   &escaped, &escaped, 0, 
    GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"first-slave", OPT_FIRST_SLAVE, "Deprecated, renamed to --lock-all-tables.",
-   (uchar**) &opt_lock_all_tables, (uchar**) &opt_lock_all_tables, 0, GET_BOOL, NO_ARG,
+   &opt_lock_all_tables, &opt_lock_all_tables, 0, GET_BOOL, NO_ARG,
    0, 0, 0, 0, 0, 0},
   {"flush-logs", 'F', "Flush logs file in server before starting dump. "
    "Note that if you dump many databases at once (using the option "
@@ -299,24 +299,24 @@ static struct my_option my_long_options[
    "to the moment all tables are locked. So if you want your dump and "
    "the log flush to happen at the same exact moment you should use "
    "--lock-all-tables or --master-data with --flush-logs.",
-   (uchar**) &flush_logs, (uchar**) &flush_logs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
+   &flush_logs, &flush_logs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
    0, 0},
   {"flush-privileges", OPT_ESC, "Emit a FLUSH PRIVILEGES statement "
    "after dumping the mysql database.  This option should be used any "
    "time the dump contains the mysql database and any other database "
    "that depends on the data in the mysql database for proper restore. ",
-   (uchar**) &flush_privileges, (uchar**) &flush_privileges, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
+   &flush_privileges, &flush_privileges, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
    0, 0},
   {"force", 'f', "Continue even if we get an SQL error.",
-   (uchar**) &ignore_errors, (uchar**) &ignore_errors, 0, GET_BOOL, NO_ARG,
+   &ignore_errors, &ignore_errors, 0, GET_BOOL, NO_ARG,
    0, 0, 0, 0, 0, 0},
   {"help", '?', "Display this help message and exit.", 0, 0, 0, GET_NO_ARG,
    NO_ARG, 0, 0, 0, 0, 0, 0},
   {"hex-blob", OPT_HEXBLOB, "Dump binary strings (BINARY, "
     "VARBINARY, BLOB) in hexadecimal format.",
-   (uchar**) &opt_hex_blob, (uchar**) &opt_hex_blob, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"host", 'h', "Connect to host.", (uchar**) &current_host,
-   (uchar**) &current_host, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+   &opt_hex_blob, &opt_hex_blob, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+  {"host", 'h', "Connect to host.", &current_host,
+   &current_host, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"ignore-table", OPT_IGNORE_TABLE,
    "Do not dump the specified table. To specify more than one table to ignore, "
    "use the directive multiple times, once for each table.  Each table must "
@@ -324,21 +324,21 @@ static struct my_option my_long_options[
    "--ignore-table=database.table.",
    0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"insert-ignore", OPT_INSERT_IGNORE, "Insert rows with INSERT IGNORE.",
-   (uchar**) &opt_ignore, (uchar**) &opt_ignore, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
+   &opt_ignore, &opt_ignore, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
    0, 0},
   {"lines-terminated-by", OPT_LTB, 
    "Lines in the output file are terminated by the given string.",
-   (uchar**) &lines_terminated, (uchar**) &lines_terminated, 0, GET_STR,
+   &lines_terminated, &lines_terminated, 0, GET_STR,
    REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"lock-all-tables", 'x', "Locks all tables across all databases. This "
    "is achieved by taking a global read lock for the duration of the whole "
    "dump. Automatically turns --single-transaction and --lock-tables off.",
-   (uchar**) &opt_lock_all_tables, (uchar**) &opt_lock_all_tables, 0, GET_BOOL, NO_ARG,
+   &opt_lock_all_tables, &opt_lock_all_tables, 0, GET_BOOL, NO_ARG,
    0, 0, 0, 0, 0, 0},
-  {"lock-tables", 'l', "Lock all tables for read.", (uchar**) &lock_tables,
-   (uchar**) &lock_tables, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
+  {"lock-tables", 'l', "Lock all tables for read.", &lock_tables,
+   &lock_tables, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
   {"log-error", OPT_ERROR_LOG_FILE, "Append warnings and errors to given file.",
-   (uchar**) &log_error_file, (uchar**) &log_error_file, 0, GET_STR,
+   &log_error_file, &log_error_file, 0, GET_STR,
    REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"master-data", OPT_MASTER_DATA,
    "This causes the binary log position and filename to be appended to the "
@@ -350,33 +350,33 @@ static struct my_option my_long_options[
    "don't forget to read about --single-transaction below). In all cases, "
    "any action on logs will happen at the exact moment of the dump. "
    "Option automatically turns --lock-tables off.",
-   (uchar**) &opt_master_data, (uchar**) &opt_master_data, 0,
+   &opt_master_data, &opt_master_data, 0,
    GET_UINT, OPT_ARG, 0, 0, MYSQL_OPT_MASTER_DATA_COMMENTED_SQL, 0, 0, 0},
   {"max_allowed_packet", OPT_MAX_ALLOWED_PACKET, 
    "The maximum packet length to send to or receive from server.",
-    (uchar**) &opt_max_allowed_packet, (uchar**) &opt_max_allowed_packet, 0,
+    &opt_max_allowed_packet, &opt_max_allowed_packet, 0,
     GET_ULONG, REQUIRED_ARG, 24*1024*1024, 4096,
    (longlong) 2L*1024L*1024L*1024L, MALLOC_OVERHEAD, 1024, 0},
   {"net_buffer_length", OPT_NET_BUFFER_LENGTH, 
    "The buffer size for TCP/IP and socket communication.",
-    (uchar**) &opt_net_buffer_length, (uchar**) &opt_net_buffer_length, 0,
+    &opt_net_buffer_length, &opt_net_buffer_length, 0,
     GET_ULONG, REQUIRED_ARG, 1024*1024L-1025, 4096, 16*1024L*1024L,
    MALLOC_OVERHEAD-1024, 1024, 0},
   {"no-autocommit", OPT_AUTOCOMMIT,
    "Wrap tables with autocommit/commit statements.",
-   (uchar**) &opt_autocommit, (uchar**) &opt_autocommit, 0, GET_BOOL, NO_ARG,
+   &opt_autocommit, &opt_autocommit, 0, GET_BOOL, NO_ARG,
    0, 0, 0, 0, 0, 0},
   {"no-create-db", 'n',
    "Suppress the CREATE DATABASE ... IF EXISTS statement that normally is "
    "output for each dumped database if --all-databases or --databases is "
    "given.",
-   (uchar**) &opt_create_db, (uchar**) &opt_create_db, 0, 
+   &opt_create_db, &opt_create_db, 0, 
    GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"no-create-info", 't', "Don't write table creation info.",
-   (uchar**) &opt_no_create_info, (uchar**) &opt_no_create_info, 0, GET_BOOL,
+   &opt_no_create_info, &opt_no_create_info, 0, GET_BOOL,
    NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"no-data", 'd', "No row information.", (uchar**) &opt_no_data,
-   (uchar**) &opt_no_data, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+  {"no-data", 'd', "No row information.", &opt_no_data,
+   &opt_no_data, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"no-set-names", 'N',"Suppress the SET NAMES statement",
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"opt", OPT_OPTIMIZE,
@@ -384,7 +384,7 @@ static struct my_option my_long_options[
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"order-by-primary", OPT_ORDER_BY_PRIMARY,
    "Sorts each table's rows by primary key, or first unique key, if such a key exists.  Useful when dumping a MyISAM table to be loaded into an InnoDB table, but will make the dump itself take considerably longer.",
-   (uchar**) &opt_order_by_primary, (uchar**) &opt_order_by_primary, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+   &opt_order_by_primary, &opt_order_by_primary, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"password", 'p',
    "Password to use when connecting to server. If password is not given it's solicited on the tty.",
    0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
@@ -392,36 +392,36 @@ static struct my_option my_long_options[
   {"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG,
    NO_ARG, 0, 0, 0, 0, 0, 0},
 #endif
-  {"port", 'P', "Port number to use for connection.", (uchar**) &opt_mysql_port,
-   (uchar**) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
+  {"port", 'P', "Port number to use for connection.", &opt_mysql_port,
+   &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
    0},
   {"protocol", OPT_MYSQL_PROTOCOL, 
    "The protocol to use for connection (tcp, socket, pipe, memory).",
    0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"quick", 'q', "Don't buffer query, dump directly to stdout.",
-   (uchar**) &quick, (uchar**) &quick, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
+   &quick, &quick, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
   {"quote-names",'Q', "Quote table and column names with backticks (`).",
-   (uchar**) &opt_quoted, (uchar**) &opt_quoted, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0,
+   &opt_quoted, &opt_quoted, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0,
    0, 0},
   {"replace", OPT_MYSQL_REPLACE_INTO, "Use REPLACE INTO instead of INSERT INTO.",
-   (uchar**) &opt_replace_into, (uchar**) &opt_replace_into, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
+   &opt_replace_into, &opt_replace_into, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
    0, 0},
   {"result-file", 'r',
    "Direct output to a given file. This option should be used in MSDOS, because it prevents new line '\\n' from being converted to '\\r\\n' (carriage return + line feed).",
    0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"routines", 'R', "Dump stored routines (functions and procedures).",
-     (uchar**) &opt_routines, (uchar**) &opt_routines, 0, GET_BOOL,
+     &opt_routines, &opt_routines, 0, GET_BOOL,
      NO_ARG, 0, 0, 0, 0, 0, 0},
   {"set-charset", OPT_SET_CHARSET,
    "Add 'SET NAMES default_character_set' to the output. Enabled by default; suppress with --skip-set-charset.",
-   (uchar**) &opt_set_charset, (uchar**) &opt_set_charset, 0, GET_BOOL, NO_ARG, 1,
+   &opt_set_charset, &opt_set_charset, 0, GET_BOOL, NO_ARG, 1,
    0, 0, 0, 0, 0},
   {"set-variable", 'O',
    "Change the value of a variable. Please note that this option is deprecated; you can set variables directly with --variable-name=value.",
    0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #ifdef HAVE_SMEM
   {"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
-   "Base name of shared memory.", (uchar**) &shared_memory_base_name, (uchar**) &shared_memory_base_name,
+   "Base name of shared memory.", &shared_memory_base_name, &shared_memory_base_name,
    0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #endif
   /*
@@ -439,42 +439,42 @@ static struct my_option my_long_options[
    "connection should use the following statements: ALTER TABLE, DROP "
    "TABLE, RENAME TABLE, TRUNCATE TABLE, as consistent snapshot is not "
    "isolated from them. Option automatically turns off --lock-tables.",
-   (uchar**) &opt_single_transaction, (uchar**) &opt_single_transaction, 0,
+   &opt_single_transaction, &opt_single_transaction, 0,
    GET_BOOL, NO_ARG,  0, 0, 0, 0, 0, 0},
   {"dump-date", OPT_DUMP_DATE, "Put a dump date to the end of the output.",
-   (uchar**) &opt_dump_date, (uchar**) &opt_dump_date, 0,
+   &opt_dump_date, &opt_dump_date, 0,
    GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
   {"skip-opt", OPT_SKIP_OPTIMIZATION,
    "Disable --opt. Disables --add-drop-table, --add-locks, --create-options, --quick, --extended-insert, --lock-tables, --set-charset, and --disable-keys.",
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"socket", 'S', "The socket file to use for connection.",
-   (uchar**) &opt_mysql_unix_port, (uchar**) &opt_mysql_unix_port, 0, 
+   &opt_mysql_unix_port, &opt_mysql_unix_port, 0, 
    GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #include <sslopt-longopts.h>
   {"tab",'T',
    "Create tab-separated textfile for each table to given path. (Create .sql "
    "and .txt files.) NOTE: This only works if mysqldump is run on the same "
    "machine as the mysqld server.",
-   (uchar**) &path, (uchar**) &path, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+   &path, &path, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"tables", OPT_TABLES, "Overrides option --databases (-B).",
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"triggers", OPT_TRIGGERS, "Dump triggers for each dumped table.",
-   (uchar**) &opt_dump_triggers, (uchar**) &opt_dump_triggers, 0, GET_BOOL,
+   &opt_dump_triggers, &opt_dump_triggers, 0, GET_BOOL,
    NO_ARG, 1, 0, 0, 0, 0, 0},
   {"tz-utc", OPT_TZ_UTC,
     "SET TIME_ZONE='+00:00' at top of dump to allow dumping of TIMESTAMP data when a server has data in different time zones or data is being moved between servers with different time zones.",
-    (uchar**) &opt_tz_utc, (uchar**) &opt_tz_utc, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
+    &opt_tz_utc, &opt_tz_utc, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
 #ifndef DONT_ALLOW_USER_CHANGE
   {"user", 'u', "User for login if not current user.",
-   (uchar**) &current_user, (uchar**) &current_user, 0, GET_STR, REQUIRED_ARG,
+   &current_user, &current_user, 0, GET_STR, REQUIRED_ARG,
    0, 0, 0, 0, 0, 0},
 #endif
   {"verbose", 'v', "Print info about the various stages.",
-   (uchar**) &verbose, (uchar**) &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+   &verbose, &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"version",'V', "Output version information and exit.", 0, 0, 0,
    GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"where", 'w', "Dump only selected records. Quotes are mandatory.",
-   (uchar**) &where, (uchar**) &where, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+   &where, &where, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"xml", 'X', "Dump a database as well formed XML.", 0, 0, 0, GET_NO_ARG,
    NO_ARG, 0, 0, 0, 0, 0, 0},
   {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}

=== modified file 'client/mysqlimport.c'
--- a/client/mysqlimport.c	2010-02-04 12:39:42 +0000
+++ b/client/mysqlimport.c	2010-06-10 20:16:43 +0000
@@ -73,68 +73,68 @@ static struct my_option my_long_options[
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
 #endif
   {"character-sets-dir", OPT_CHARSETS_DIR,
-   "Directory for character set files.", (uchar**) &charsets_dir,
-   (uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+   "Directory for character set files.", &charsets_dir,
+   &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"default-character-set", OPT_DEFAULT_CHARSET,
-   "Set the default character set.", (uchar**) &default_charset,
-   (uchar**) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+   "Set the default character set.", &default_charset,
+   &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"columns", 'c',
    "Use only these columns to import the data to. Give the column names in a comma separated list. This is same as giving columns to LOAD DATA INFILE.",
-   (uchar**) &opt_columns, (uchar**) &opt_columns, 0, GET_STR, REQUIRED_ARG, 0, 0, 0,
+   &opt_columns, &opt_columns, 0, GET_STR, REQUIRED_ARG, 0, 0, 0,
    0, 0, 0},
   {"compress", 'C', "Use compression in server/client protocol.",
-   (uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
+   &opt_compress, &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
    0, 0, 0},
   {"debug",'#', "Output debug log. Often this is 'd:t:o,filename'.", 0, 0, 0,
    GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
   {"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.",
-   (uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0,
+   &debug_check_flag, &debug_check_flag, 0,
    GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.",
-   (uchar**) &debug_info_flag, (uchar**) &debug_info_flag,
+   &debug_info_flag, &debug_info_flag,
    0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"delete", 'd', "First delete all rows from table.", (uchar**) &opt_delete,
-   (uchar**) &opt_delete, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+  {"delete", 'd', "First delete all rows from table.", &opt_delete,
+   &opt_delete, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"fields-terminated-by", OPT_FTB,
    "Fields in the input file are terminated by the given string.", 
-   (uchar**) &fields_terminated, (uchar**) &fields_terminated, 0, 
+   &fields_terminated, &fields_terminated, 0, 
    GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"fields-enclosed-by", OPT_ENC,
    "Fields in the import file are enclosed by the given character.", 
-   (uchar**) &enclosed, (uchar**) &enclosed, 0, 
+   &enclosed, &enclosed, 0, 
    GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"fields-optionally-enclosed-by", OPT_O_ENC,
    "Fields in the input file are optionally enclosed by the given character.", 
-   (uchar**) &opt_enclosed, (uchar**) &opt_enclosed, 0, 
+   &opt_enclosed, &opt_enclosed, 0, 
    GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"fields-escaped-by", OPT_ESC, 
    "Fields in the input file are escaped by the given character.",
-   (uchar**) &escaped, (uchar**) &escaped, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0,
+   &escaped, &escaped, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0,
    0, 0},
   {"force", 'f', "Continue even if we get an SQL error.",
-   (uchar**) &ignore_errors, (uchar**) &ignore_errors, 0, GET_BOOL, NO_ARG, 0, 0,
+   &ignore_errors, &ignore_errors, 0, GET_BOOL, NO_ARG, 0, 0,
    0, 0, 0, 0},
   {"help", '?', "Displays this help and exits.", 0, 0, 0, GET_NO_ARG, NO_ARG,
    0, 0, 0, 0, 0, 0},
-  {"host", 'h', "Connect to host.", (uchar**) &current_host,
-   (uchar**) &current_host, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+  {"host", 'h', "Connect to host.", &current_host,
+   &current_host, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"ignore", 'i', "If duplicate unique key was found, keep old row.",
-   (uchar**) &ignore, (uchar**) &ignore, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+   &ignore, &ignore, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"ignore-lines", OPT_IGN_LINES, "Ignore first n lines of data infile.",
-   (uchar**) &opt_ignore_lines, (uchar**) &opt_ignore_lines, 0, GET_LL,
+   &opt_ignore_lines, &opt_ignore_lines, 0, GET_LL,
    REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"lines-terminated-by", OPT_LTB, 
    "Lines in the input file are terminated by the given string.",
-   (uchar**) &lines_terminated, (uchar**) &lines_terminated, 0, GET_STR,
+   &lines_terminated, &lines_terminated, 0, GET_STR,
    REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-  {"local", 'L', "Read all files through the client.", (uchar**) &opt_local_file,
-   (uchar**) &opt_local_file, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+  {"local", 'L', "Read all files through the client.", &opt_local_file,
+   &opt_local_file, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"lock-tables", 'l', "Lock all tables for write (this disables threads).",
-    (uchar**) &lock_tables, (uchar**) &lock_tables, 0, GET_BOOL, NO_ARG, 
+    &lock_tables, &lock_tables, 0, GET_BOOL, NO_ARG, 
     0, 0, 0, 0, 0, 0},
   {"low-priority", OPT_LOW_PRIORITY,
-   "Use LOW_PRIORITY when updating the table.", (uchar**) &opt_low_priority,
-   (uchar**) &opt_low_priority, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+   "Use LOW_PRIORITY when updating the table.", &opt_low_priority,
+   &opt_low_priority, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"password", 'p',
    "Password to use when connecting to server. If password is not given it's asked from the tty.",
    0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
@@ -148,35 +148,35 @@ static struct my_option my_long_options[
    "/etc/services, "
 #endif
    "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
-   (uchar**) &opt_mysql_port,
-   (uchar**) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
+   &opt_mysql_port,
+   &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
    0},
   {"protocol", OPT_MYSQL_PROTOCOL, "The protocol to use for connection (tcp, socket, pipe, memory).",
    0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"replace", 'r', "If duplicate unique key was found, replace old row.",
-   (uchar**) &replace, (uchar**) &replace, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+   &replace, &replace, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
 #ifdef HAVE_SMEM
   {"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
-   "Base name of shared memory.", (uchar**) &shared_memory_base_name, (uchar**) &shared_memory_base_name,
+   "Base name of shared memory.", &shared_memory_base_name, &shared_memory_base_name,
    0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #endif
-  {"silent", 's', "Be more silent.", (uchar**) &silent, (uchar**) &silent, 0,
+  {"silent", 's', "Be more silent.", &silent, &silent, 0,
    GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"socket", 'S', "The socket file to use for connection.",
-   (uchar**) &opt_mysql_unix_port, (uchar**) &opt_mysql_unix_port, 0, GET_STR,
+   &opt_mysql_unix_port, &opt_mysql_unix_port, 0, GET_STR,
    REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #include <sslopt-longopts.h>
   {"use-threads", OPT_USE_THREADS,
    "Load files in parallel. The argument is the number "
    "of threads to use for loading data.",
-   (uchar**) &opt_use_threads, (uchar**) &opt_use_threads, 0, 
+   &opt_use_threads, &opt_use_threads, 0, 
    GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #ifndef DONT_ALLOW_USER_CHANGE
-  {"user", 'u', "User for login if not current user.", (uchar**) &current_user,
-   (uchar**) &current_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+  {"user", 'u', "User for login if not current user.", &current_user,
+   &current_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #endif
-  {"verbose", 'v', "Print info about the various stages.", (uchar**) &verbose,
-   (uchar**) &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+  {"verbose", 'v', "Print info about the various stages.", &verbose,
+   &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"version", 'V', "Output version information and exit.", 0, 0, 0, GET_NO_ARG,
    NO_ARG, 0, 0, 0, 0, 0, 0},
   { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}

=== modified file 'client/mysqlshow.c'
--- a/client/mysqlshow.c	2010-02-04 12:39:42 +0000
+++ b/client/mysqlshow.c	2010-06-10 20:16:43 +0000
@@ -164,35 +164,35 @@ static struct my_option my_long_options[
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
 #endif
   {"character-sets-dir", 'c', "Directory for character set files.",
-   (uchar**) &charsets_dir, (uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0,
+   &charsets_dir, &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0,
    0, 0, 0, 0, 0},
   {"default-character-set", OPT_DEFAULT_CHARSET,
-   "Set the default character set.", (uchar**) &default_charset,
-   (uchar**) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+   "Set the default character set.", &default_charset,
+   &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"count", OPT_COUNT,
    "Show number of rows per table (may be slow for non-MyISAM tables).",
-   (uchar**) &opt_count, (uchar**) &opt_count, 0, GET_BOOL, NO_ARG, 0, 0, 0,
+   &opt_count, &opt_count, 0, GET_BOOL, NO_ARG, 0, 0, 0,
    0, 0, 0},
   {"compress", 'C', "Use compression in server/client protocol.",
-   (uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
+   &opt_compress, &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
    0, 0, 0},
   {"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.",
    0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
   {"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.",
-   (uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0,
+   &debug_check_flag, &debug_check_flag, 0,
    GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.",
-   (uchar**) &debug_info_flag, (uchar**) &debug_info_flag,
+   &debug_info_flag, &debug_info_flag,
    0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"help", '?', "Display this help and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG,
    0, 0, 0, 0, 0, 0},
-  {"host", 'h', "Connect to host.", (uchar**) &host, (uchar**) &host, 0, GET_STR,
+  {"host", 'h', "Connect to host.", &host, &host, 0, GET_STR,
    REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"status", 'i', "Shows a lot of extra information about each table.",
-   (uchar**) &opt_status, (uchar**) &opt_status, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
+   &opt_status, &opt_status, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
    0, 0},
-  {"keys", 'k', "Show keys for table.", (uchar**) &opt_show_keys,
-   (uchar**) &opt_show_keys, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+  {"keys", 'k', "Show keys for table.", &opt_show_keys,
+   &opt_show_keys, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"password", 'p',
    "Password to use when connecting to server. If password is not given, it's "
    "solicited on the tty.",
@@ -203,8 +203,8 @@ static struct my_option my_long_options[
    "/etc/services, "
 #endif
    "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
-   (uchar**) &opt_mysql_port,
-   (uchar**) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
+   &opt_mysql_port,
+   &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
    0},
 #ifdef __WIN__
   {"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG,
@@ -215,19 +215,20 @@ static struct my_option my_long_options[
    0, 0, 0, GET_STR,  REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #ifdef HAVE_SMEM
   {"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
-   "Base name of shared memory.", (uchar**) &shared_memory_base_name, (uchar**) &shared_memory_base_name,
-   0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+   "Base name of shared memory.", &shared_memory_base_name,
+   &shared_memory_base_name, 0, GET_STR_ALLOC, REQUIRED_ARG,
+   0, 0, 0, 0, 0, 0},
 #endif
   {"show-table-type", 't', "Show table type column.",
-   (uchar**) &opt_table_type, (uchar**) &opt_table_type, 0, GET_BOOL,
+   &opt_table_type, &opt_table_type, 0, GET_BOOL,
    NO_ARG, 0, 0, 0, 0, 0, 0},
   {"socket", 'S', "The socket file to use for connection.",
-   (uchar**) &opt_mysql_unix_port, (uchar**) &opt_mysql_unix_port, 0, GET_STR,
+   &opt_mysql_unix_port, &opt_mysql_unix_port, 0, GET_STR,
    REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #include <sslopt-longopts.h>
 #ifndef DONT_ALLOW_USER_CHANGE
-  {"user", 'u', "User for login if not current user.", (uchar**) &user,
-   (uchar**) &user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+  {"user", 'u', "User for login if not current user.", &user,
+   &user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #endif
   {"verbose", 'v',
    "More verbose output; you can use this multiple times to get even more "

=== modified file 'client/mysqlslap.c'
--- a/client/mysqlslap.c	2010-04-28 12:52:24 +0000
+++ b/client/mysqlslap.c	2010-08-02 09:01:24 +0000
@@ -525,62 +525,62 @@ static struct my_option my_long_options[
     0, 0, 0, 0, 0, 0},
   {"auto-generate-sql", 'a',
     "Generate SQL where not supplied by file or command line.",
-    (uchar**) &auto_generate_sql, (uchar**) &auto_generate_sql,
+    &auto_generate_sql, &auto_generate_sql,
     0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"auto-generate-sql-add-autoincrement", OPT_SLAP_AUTO_GENERATE_ADD_AUTO,
     "Add an AUTO_INCREMENT column to auto-generated tables.",
-    (uchar**) &auto_generate_sql_autoincrement, 
-    (uchar**) &auto_generate_sql_autoincrement,
+    &auto_generate_sql_autoincrement,
+    &auto_generate_sql_autoincrement,
     0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"auto-generate-sql-execute-number", OPT_SLAP_AUTO_GENERATE_EXECUTE_QUERIES,
     "Set this number to generate a set number of queries to run.",
-    (uchar**) &auto_actual_queries, (uchar**) &auto_actual_queries,
+    &auto_actual_queries, &auto_actual_queries,
     0, GET_ULL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"auto-generate-sql-guid-primary", OPT_SLAP_AUTO_GENERATE_GUID_PRIMARY,
     "Add GUID based primary keys to auto-generated tables.",
-    (uchar**) &auto_generate_sql_guid_primary, 
-    (uchar**) &auto_generate_sql_guid_primary,
+    &auto_generate_sql_guid_primary,
+    &auto_generate_sql_guid_primary,
     0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"auto-generate-sql-load-type", OPT_SLAP_AUTO_GENERATE_SQL_LOAD_TYPE,
     "Specify test load type: mixed, update, write, key, or read; default is mixed.",
-    (uchar**) &auto_generate_sql_type, (uchar**) &auto_generate_sql_type,
+    &auto_generate_sql_type, &auto_generate_sql_type,
     0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"auto-generate-sql-secondary-indexes", 
     OPT_SLAP_AUTO_GENERATE_SECONDARY_INDEXES, 
     "Number of secondary indexes to add to auto-generated tables.",
-    (uchar**) &auto_generate_sql_secondary_indexes, 
-    (uchar**) &auto_generate_sql_secondary_indexes, 0,
+    &auto_generate_sql_secondary_indexes,
+    &auto_generate_sql_secondary_indexes, 0,
     GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"auto-generate-sql-unique-query-number", 
     OPT_SLAP_AUTO_GENERATE_UNIQUE_QUERY_NUM,
     "Number of unique queries to generate for automatic tests.",
-    (uchar**) &auto_generate_sql_unique_query_number, 
-    (uchar**) &auto_generate_sql_unique_query_number,
+    &auto_generate_sql_unique_query_number,
+    &auto_generate_sql_unique_query_number,
     0, GET_ULL, REQUIRED_ARG, 10, 0, 0, 0, 0, 0},
   {"auto-generate-sql-unique-write-number", 
     OPT_SLAP_AUTO_GENERATE_UNIQUE_WRITE_NUM,
     "Number of unique queries to generate for auto-generate-sql-write-number.",
-    (uchar**) &auto_generate_sql_unique_write_number, 
-    (uchar**) &auto_generate_sql_unique_write_number,
+    &auto_generate_sql_unique_write_number,
+    &auto_generate_sql_unique_write_number,
     0, GET_ULL, REQUIRED_ARG, 10, 0, 0, 0, 0, 0},
   {"auto-generate-sql-write-number", OPT_SLAP_AUTO_GENERATE_WRITE_NUM,
     "Number of row inserts to perform for each thread (default is 100).",
-    (uchar**) &auto_generate_sql_number, (uchar**) &auto_generate_sql_number,
+    &auto_generate_sql_number, &auto_generate_sql_number,
     0, GET_ULL, REQUIRED_ARG, 100, 0, 0, 0, 0, 0},
   {"commit", OPT_SLAP_COMMIT, "Commit records every X number of statements.",
-    (uchar**) &commit_rate, (uchar**) &commit_rate, 0, GET_UINT, REQUIRED_ARG,
+    &commit_rate, &commit_rate, 0, GET_UINT, REQUIRED_ARG,
     0, 0, 0, 0, 0, 0},
   {"compress", 'C', "Use compression in server/client protocol.",
-    (uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
+    &opt_compress, &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
     0, 0, 0},
   {"concurrency", 'c', "Number of clients to simulate for query to run.",
-    (uchar**) &concurrency_str, (uchar**) &concurrency_str, 0, GET_STR,
+    &concurrency_str, &concurrency_str, 0, GET_STR,
     REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"create", OPT_SLAP_CREATE_STRING, "File or string to use create tables.",
-    (uchar**) &create_string, (uchar**) &create_string, 0, GET_STR, REQUIRED_ARG,
+    &create_string, &create_string, 0, GET_STR, REQUIRED_ARG,
     0, 0, 0, 0, 0, 0},
   {"create-schema", OPT_CREATE_SLAP_SCHEMA, "Schema to run tests in.",
-    (uchar**) &create_schema_string, (uchar**) &create_schema_string, 0, GET_STR, 
+    &create_schema_string, &create_schema_string, 0, GET_STR, 
     REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"csv", OPT_SLAP_CSV,
 	"Generate CSV output to named file or to stdout if no file is named.",
@@ -590,47 +590,48 @@ static struct my_option my_long_options[
    0, 0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0},
 #else
   {"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.",
-    (uchar**) &default_dbug_option, (uchar**) &default_dbug_option, 0, GET_STR,
+    &default_dbug_option, &default_dbug_option, 0, GET_STR,
     OPT_ARG, 0, 0, 0, 0, 0, 0},
 #endif
   {"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.",
-   (uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0,
+   &debug_check_flag, &debug_check_flag, 0,
    GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"debug-info", 'T', "Print some debug info at exit.", (uchar**) &debug_info_flag,
-   (uchar**) &debug_info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+  {"debug-info", 'T', "Print some debug info at exit.", &debug_info_flag,
+   &debug_info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"delimiter", 'F',
     "Delimiter to use in SQL statements supplied in file or command line.",
-    (uchar**) &delimiter, (uchar**) &delimiter, 0, GET_STR, REQUIRED_ARG,
+    &delimiter, &delimiter, 0, GET_STR, REQUIRED_ARG,
     0, 0, 0, 0, 0, 0},
   {"detach", OPT_SLAP_DETACH,
     "Detach (close and reopen) connections after X number of requests.",
-    (uchar**) &detach_rate, (uchar**) &detach_rate, 0, GET_UINT, REQUIRED_ARG, 
+    &detach_rate, &detach_rate, 0, GET_UINT, REQUIRED_ARG, 
     0, 0, 0, 0, 0, 0},
-  {"engine", 'e', "Comma separated list of storage engines to use for creating the table."
-     " The test is run for each engine. You can also specify an option for an engine"
-     " after a `:', like memory:max_row=2300",
-    (uchar**) &default_engine, (uchar**) &default_engine, 0,
+  {"engine", 'e',
+   "Comma separated list of storage engines to use for creating the table."
+   " The test is run for each engine. You can also specify an option for an "
+   "engine after a `:', like memory:max_row=2300",
+   &default_engine, &default_engine, 0,
     GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-  {"host", 'h', "Connect to host.", (uchar**) &host, (uchar**) &host, 0, GET_STR,
+  {"host", 'h', "Connect to host.", &host, &host, 0, GET_STR,
     REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-  {"iterations", 'i', "Number of times to run the tests.", (uchar**) &iterations,
-    (uchar**) &iterations, 0, GET_UINT, REQUIRED_ARG, 1, 0, 0, 0, 0, 0},
+  {"iterations", 'i', "Number of times to run the tests.", &iterations,
+    &iterations, 0, GET_UINT, REQUIRED_ARG, 1, 0, 0, 0, 0, 0},
   {"number-char-cols", 'x', 
     "Number of VARCHAR columns to create in table if specifying --auto-generate-sql.",
-    (uchar**) &num_char_cols_opt, (uchar**) &num_char_cols_opt, 0, GET_STR, REQUIRED_ARG,
+    &num_char_cols_opt, &num_char_cols_opt, 0, GET_STR, REQUIRED_ARG,
     0, 0, 0, 0, 0, 0},
   {"number-int-cols", 'y', 
     "Number of INT columns to create in table if specifying --auto-generate-sql.",
-    (uchar**) &num_int_cols_opt, (uchar**) &num_int_cols_opt, 0, GET_STR, REQUIRED_ARG, 
+    &num_int_cols_opt, &num_int_cols_opt, 0, GET_STR, REQUIRED_ARG, 
     0, 0, 0, 0, 0, 0},
   {"number-of-queries", OPT_MYSQL_NUMBER_OF_QUERY, 
     "Limit each client to this number of queries (this is not exact).",
-    (uchar**) &num_of_query, (uchar**) &num_of_query, 0,
+    &num_of_query, &num_of_query, 0,
     GET_ULL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"only-print", OPT_MYSQL_ONLY_PRINT,
     "Do not connect to the databases, but instead print out what would have "
      "been done.",
-    (uchar**) &opt_only_print, (uchar**) &opt_only_print, 0, GET_BOOL,  NO_ARG,
+    &opt_only_print, &opt_only_print, 0, GET_BOOL,  NO_ARG,
     0, 0, 0, 0, 0, 0},
   {"password", 'p',
     "Password to use when connecting to server. If password is not given it's "
@@ -639,58 +640,54 @@ static struct my_option my_long_options[
   {"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG,
     NO_ARG, 0, 0, 0, 0, 0, 0},
 #endif
-  {"port", 'P', "Port number to use for connection.", (uchar**) &opt_mysql_port,
-    (uchar**) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, MYSQL_PORT, 0, 0, 0, 0,
+  {"port", 'P', "Port number to use for connection.", &opt_mysql_port,
+    &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, MYSQL_PORT, 0, 0, 0, 0,
     0},
   {"post-query", OPT_SLAP_POST_QUERY,
     "Query to run or file containing query to execute after tests have completed.",
-    (uchar**) &user_supplied_post_statements, 
-    (uchar**) &user_supplied_post_statements,
+    &user_supplied_post_statements, &user_supplied_post_statements,
     0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"post-system", OPT_SLAP_POST_SYSTEM,
     "system() string to execute after tests have completed.",
-    (uchar**) &post_system, 
-    (uchar**) &post_system,
+    &post_system, &post_system,
     0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"pre-query", OPT_SLAP_PRE_QUERY, 
     "Query to run or file containing query to execute before running tests.",
-    (uchar**) &user_supplied_pre_statements, 
-    (uchar**) &user_supplied_pre_statements,
+    &user_supplied_pre_statements, &user_supplied_pre_statements,
     0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"pre-system", OPT_SLAP_PRE_SYSTEM, 
     "system() string to execute before running tests.",
-    (uchar**) &pre_system, 
-    (uchar**) &pre_system,
+    &pre_system, &pre_system,
     0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"protocol", OPT_MYSQL_PROTOCOL,
     "The protocol to use for connection (tcp, socket, pipe, memory).",
     0, 0, 0, GET_STR,  REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"query", 'q', "Query to run or file containing query to run.",
-    (uchar**) &user_supplied_query, (uchar**) &user_supplied_query,
+    &user_supplied_query, &user_supplied_query,
     0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #ifdef HAVE_SMEM
   {"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
-    "Base name of shared memory.", (uchar**) &shared_memory_base_name,
-    (uchar**) &shared_memory_base_name, 0, GET_STR_ALLOC, REQUIRED_ARG,
+    "Base name of shared memory.", &shared_memory_base_name,
+    &shared_memory_base_name, 0, GET_STR_ALLOC, REQUIRED_ARG,
     0, 0, 0, 0, 0, 0},
 #endif
   {"silent", 's', "Run program in silent mode - no output.",
-    (uchar**) &opt_silent, (uchar**) &opt_silent, 0, GET_BOOL,  NO_ARG,
+    &opt_silent, &opt_silent, 0, GET_BOOL,  NO_ARG,
     0, 0, 0, 0, 0, 0},
   {"socket", 'S', "The socket file to use for connection.",
-    (uchar**) &opt_mysql_unix_port, (uchar**) &opt_mysql_unix_port, 0, GET_STR,
+    &opt_mysql_unix_port, &opt_mysql_unix_port, 0, GET_STR,
     REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #include <sslopt-longopts.h>
 #ifndef DONT_ALLOW_USER_CHANGE
-  {"user", 'u', "User for login if not current user.", (uchar**) &user,
-    (uchar**) &user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+  {"user", 'u', "User for login if not current user.", &user,
+    &user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #endif
   {"verbose", 'v',
-    "More verbose output; you can use this multiple times to get even more "
-      "verbose output.", (uchar**) &verbose, (uchar**) &verbose, 0, 
-      GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"version", 'V', "Output version information and exit.", 0, 0, 0, GET_NO_ARG,
-    NO_ARG, 0, 0, 0, 0, 0, 0},
+   "More verbose output; you can use this multiple times to get even more "
+   "verbose output.", &verbose, &verbose, 0, GET_NO_ARG, NO_ARG,
+   0, 0, 0, 0, 0, 0},
+  {"version", 'V', "Output version information and exit.", 0, 0, 0,
+   GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
   {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
 };
 

=== modified file 'client/mysqltest.cc'
--- a/client/mysqltest.cc	2010-06-23 00:48:11 +0000
+++ b/client/mysqltest.cc	2010-08-02 09:01:24 +0000
@@ -5881,18 +5881,18 @@ static struct my_option my_long_options[
 {
   {"help", '?', "Display this help and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG,
    0, 0, 0, 0, 0, 0},
-  {"basedir", 'b', "Basedir for tests.", (uchar**) &opt_basedir,
-   (uchar**) &opt_basedir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+  {"basedir", 'b', "Basedir for tests.", &opt_basedir,
+   &opt_basedir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"character-sets-dir", OPT_CHARSETS_DIR,
-   "Directory for character set files.", (uchar**) &opt_charsets_dir,
-   (uchar**) &opt_charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+   "Directory for character set files.", &opt_charsets_dir,
+   &opt_charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"compress", 'C', "Use the compressed server/client protocol.",
-   (uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
+   &opt_compress, &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
    0, 0, 0},
   {"cursor-protocol", OPT_CURSOR_PROTOCOL, "Use cursors for prepared statements.",
-   (uchar**) &cursor_protocol, (uchar**) &cursor_protocol, 0,
+   &cursor_protocol, &cursor_protocol, 0,
    GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"database", 'D', "Database to use.", (uchar**) &opt_db, (uchar**) &opt_db, 0,
+  {"database", 'D', "Database to use.", &opt_db, &opt_db, 0,
    GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #ifdef DBUG_OFF
   {"debug", '#', "This is a non-debug version. Catch this and exit",
@@ -5902,33 +5902,33 @@ static struct my_option my_long_options[
    0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
 #endif
   {"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.",
-   (uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0,
+   &debug_check_flag, &debug_check_flag, 0,
    GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.",
-   (uchar**) &debug_info_flag, (uchar**) &debug_info_flag,
+   &debug_info_flag, &debug_info_flag,
    0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"global-subst", OPT_GLOBAL_SUBST, "argument should be 'X,Y' ;"
    " substitute string X with another Y accross the whole test's current"
    " result before comparing with expected result file",
-   (uchar**) &global_subst, (uchar**) &global_subst, 0,
+   &global_subst, &global_subst, 0,
    GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-  {"host", 'h', "Connect to host.", (uchar**) &opt_host, (uchar**) &opt_host, 0,
+  {"host", 'h', "Connect to host.", &opt_host, &opt_host, 0,
    GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-  {"include", 'i', "Include SQL before each test case.", (uchar**) &opt_include,
-   (uchar**) &opt_include, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-  {"logdir", OPT_LOG_DIR, "Directory for log files", (uchar**) &opt_logdir,
-   (uchar**) &opt_logdir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+  {"include", 'i', "Include SQL before each test case.", &opt_include,
+   &opt_include, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+  {"logdir", OPT_LOG_DIR, "Directory for log files", &opt_logdir,
+   &opt_logdir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"mark-progress", OPT_MARK_PROGRESS,
    "Write line number and elapsed time to <testname>.progress.",
-   (uchar**) &opt_mark_progress, (uchar**) &opt_mark_progress, 0,
+   &opt_mark_progress, &opt_mark_progress, 0,
    GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"max-connect-retries", OPT_MAX_CONNECT_RETRIES,
    "Maximum number of attempts to connect to server.",
-   (uchar**) &opt_max_connect_retries, (uchar**) &opt_max_connect_retries, 0,
+   &opt_max_connect_retries, &opt_max_connect_retries, 0,
    GET_INT, REQUIRED_ARG, 500, 1, 10000, 0, 0, 0},
   {"max-connections", OPT_MAX_CONNECTIONS,
    "Max number of open connections to server",
-   (uchar**) &opt_max_connections, (uchar**) &opt_max_connections, 0,
+   &opt_max_connections, &opt_max_connections, 0,
    GET_INT, REQUIRED_ARG, 128, 8, 5120, 0, 0, 0},
   {"password", 'p', "Password to use when connecting to server.",
    0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
@@ -5938,18 +5938,17 @@ static struct my_option my_long_options[
    "/etc/services, "
 #endif
    "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
-   (uchar**) &opt_port,
-   (uchar**) &opt_port, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+   &opt_port, &opt_port, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"ps-protocol", OPT_PS_PROTOCOL, 
    "Use prepared-statement protocol for communication.",
-   (uchar**) &ps_protocol, (uchar**) &ps_protocol, 0,
+   &ps_protocol, &ps_protocol, 0,
    GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"quiet", 's', "Suppress all normal output.", (uchar**) &silent,
-   (uchar**) &silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+  {"quiet", 's', "Suppress all normal output.", &silent,
+   &silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"record", 'r', "Record output of test_file into result file.",
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"result-file", 'R', "Read/store result from/in this file.",
-   (uchar**) &result_file_name, (uchar**) &result_file_name, 0,
+   &result_file_name, &result_file_name, 0,
    GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"server-arg", 'A', "Send option value to embedded server as a parameter.",
    0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
@@ -5957,28 +5956,28 @@ static struct my_option my_long_options[
    0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
 #ifdef HAVE_SMEM
   {"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
-   "Base name of shared memory.", (uchar**) &shared_memory_base_name, 
-   (uchar**) &shared_memory_base_name, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 
+   "Base name of shared memory.", &shared_memory_base_name, 
+   &shared_memory_base_name, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 
    0, 0, 0},
 #endif
   {"silent", 's', "Suppress all normal output. Synonym for --quiet.",
-   (uchar**) &silent, (uchar**) &silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+   &silent, &silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"skip-safemalloc", OPT_SKIP_SAFEMALLOC,
    "Don't use the memory allocation checking.", 0, 0, 0, GET_NO_ARG, NO_ARG,
    0, 0, 0, 0, 0, 0},
   {"sleep", 'T', "Always sleep this many seconds on sleep commands.",
-   (uchar**) &opt_sleep, (uchar**) &opt_sleep, 0, GET_INT, REQUIRED_ARG, -1, -1, 0,
+   &opt_sleep, &opt_sleep, 0, GET_INT, REQUIRED_ARG, -1, -1, 0,
    0, 0, 0},
   {"socket", 'S', "The socket file to use for connection.",
-   (uchar**) &unix_sock, (uchar**) &unix_sock, 0, GET_STR, REQUIRED_ARG, 0, 0, 0,
+   &unix_sock, &unix_sock, 0, GET_STR, REQUIRED_ARG, 0, 0, 0,
    0, 0, 0},
   {"sp-protocol", OPT_SP_PROTOCOL, "Use stored procedures for select.",
-   (uchar**) &sp_protocol, (uchar**) &sp_protocol, 0,
+   &sp_protocol, &sp_protocol, 0,
    GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
 #include "sslopt-longopts.h"
   {"tail-lines", OPT_TAIL_LINES,
    "Number of lines of the result to include in a failure report.",
-   (uchar**) &opt_tail_lines, (uchar**) &opt_tail_lines, 0,
+   &opt_tail_lines, &opt_tail_lines, 0,
    GET_INT, REQUIRED_ARG, 0, 0, 10000, 0, 0, 0},
   {"test-file", 'x', "Read test from/in this file (default stdin).",
    0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
@@ -5989,14 +5988,14 @@ static struct my_option my_long_options[
    0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"tmpdir", 't', "Temporary directory where sockets are put.",
    0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-  {"user", 'u', "User for login.", (uchar**) &opt_user, (uchar**) &opt_user, 0,
+  {"user", 'u', "User for login.", &opt_user, &opt_user, 0,
    GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-  {"verbose", 'v', "Write more.", (uchar**) &verbose, (uchar**) &verbose, 0,
+  {"verbose", 'v', "Write more.", &verbose, &verbose, 0,
    GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"version", 'V', "Output version information and exit.",
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"view-protocol", OPT_VIEW_PROTOCOL, "Use views for select.",
-   (uchar**) &view_protocol, (uchar**) &view_protocol, 0,
+   &view_protocol, &view_protocol, 0,
    GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
 };

=== modified file 'config/ac-macros/ssl.m4'
--- a/config/ac-macros/ssl.m4	2007-09-26 16:47:55 +0000
+++ b/config/ac-macros/ssl.m4	2010-06-08 21:14:18 +0000
@@ -38,11 +38,20 @@ AC_DEFUN([MYSQL_USE_BUNDLED_YASSL], [
   esac
   AC_SUBST([yassl_taocrypt_extra_cxxflags])
 
+  # Thread safe check
+  yassl_thread_cxxflags=""
+  yassl_thread_safe=""
+  if test "$with_server" != "no" -o "$THREAD_SAFE_CLIENT" != "no"; then
+    yassl_thread_cxxflags="-DYASSL_THREAD_SAFE"
+    yassl_thread_safe="(thread-safe)"
+  fi
+  AC_SUBST([yassl_thread_cxxflags])
+
   # Link extra/yassl/include/openssl subdir to include/
   yassl_h_ln_cmd="\$(LN) -s \$(top_srcdir)/extra/yassl/include/openssl openssl"
   AC_SUBST(yassl_h_ln_cmd)
 
-  AC_MSG_RESULT([using bundled yaSSL])
+  AC_MSG_RESULT([using bundled yaSSL $yassl_thread_safe])
 ])
 
 

=== modified file 'configure.in'
--- a/configure.in	2010-05-26 18:55:40 +0000
+++ b/configure.in	2010-08-02 09:01:24 +0000
@@ -12,7 +12,7 @@ dnl
 dnl When changing the major version number please also check the switch
 dnl statement in mysqlbinlog::check_master_version().  You may also need
 dnl to update version.c in ndb.
-AC_INIT([MariaDB Server], [5.1.47-MariaDB], [], [mysql])
+AC_INIT([MySQL Server], [5.1.49-MariaDB], [], [mysql])
 
 AC_CONFIG_SRCDIR([sql/mysqld.cc])
 AC_CANONICAL_SYSTEM
@@ -829,9 +829,9 @@ AC_TYPE_SIZE_T
 AC_HEADER_DIRENT
 AC_HEADER_STDC
 AC_HEADER_SYS_WAIT
-AC_CHECK_HEADERS(fcntl.h fenv.h float.h floatingpoint.h ieeefp.h limits.h \
- memory.h pwd.h select.h fnmatch.h \
- stdlib.h stddef.h sys/stat.h valgrind/memcheck.h \
+AC_CHECK_HEADERS(fcntl.h fenv.h float.h floatingpoint.h fpu_control.h \
+ ieeefp.h limits.h memory.h pwd.h select.h fnmatch.h \
+ stdlib.h stddef.h sys/stat.h \
  strings.h string.h synch.h sys/mman.h sys/socket.h netinet/in.h arpa/inet.h \
  sys/timeb.h sys/types.h sys/un.h sys/vadvise.h sys/wait.h term.h \
  unistd.h utime.h sys/utime.h termio.h termios.h sched.h crypt.h alloca.h \
@@ -1723,6 +1723,17 @@ else
   CXXFLAGS="$OPTIMIZE_CXXFLAGS $CXXFLAGS"
 fi
 
+AC_ARG_WITH([valgrind],
+  [AS_HELP_STRING([--with-valgrind],
+    [Valgrind instrumentation @<:@default=no@:>@])],
+    [], [with_valgrind=no])
+
+if test "$with_valgrind" != "no"
+then
+  AC_CHECK_HEADERS([valgrind/valgrind.h valgrind/memcheck.h],
+    [AC_DEFINE([HAVE_VALGRIND], [1], [Define for Valgrind support])])
+fi
+
 # Debug Sync Facility. NOTE: depends on 'with_debug'. Must be behind it.
 AC_MSG_CHECKING(if Debug Sync Facility should be enabled.)
 AC_ARG_ENABLE(debug_sync,

=== modified file 'extra/comp_err.c'
--- a/extra/comp_err.c	2010-04-28 12:52:24 +0000
+++ b/extra/comp_err.c	2010-08-04 18:36:11 +0000
@@ -99,31 +99,30 @@ static struct my_option my_long_options[
   {"debug", '#', "This is a non-debug version. Catch this and exit",
    0, 0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0},
 #else
-  {"debug", '#', "Output debug log", (uchar**) & default_dbug_option,
-   (uchar**) & default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
+  {"debug", '#', "Output debug log", &default_dbug_option,
+   &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
 #endif
-  {"debug-info", 'T', "Print some debug info at exit.", (uchar**) & info_flag,
-   (uchar**) & info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+  {"debug-info", 'T', "Print some debug info at exit.", &info_flag,
+   &info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"help", '?', "Displays this help and exits.", 0, 0, 0, GET_NO_ARG,
    NO_ARG, 0, 0, 0, 0, 0, 0},
   {"version", 'V', "Prints version", 0, 0, 0, GET_NO_ARG,
    NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"charset", 'C', "Charset dir", (uchar**) & charsets_dir,
-   (uchar**) & charsets_dir,
+  {"charset", 'C', "Charset dir",
+   (char**) &charsets_dir, (char**) &charsets_dir,
    0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-  {"in_file", 'F', "Input file", (uchar**) & TXTFILE, (uchar**) & TXTFILE,
+  {"in_file", 'F', "Input file", &TXTFILE, &TXTFILE,
    0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-  {"out_dir", 'D', "Output base directory", (uchar**) & DATADIRECTORY,
-   (uchar**) & DATADIRECTORY,
+  {"out_dir", 'D', "Output base directory", &DATADIRECTORY, &DATADIRECTORY,
    0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-  {"out_file", 'O', "Output filename (errmsg.sys)", (uchar**) & OUTFILE,
-   (uchar**) & OUTFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-  {"header_file", 'H', "mysqld_error.h file ", (uchar**) & HEADERFILE,
-   (uchar**) & HEADERFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-  {"name_file", 'N', "mysqld_ername.h file ", (uchar**) & NAMEFILE,
-   (uchar**) & NAMEFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-  {"state_file", 'S', "sql_state.h file", (uchar**) & STATEFILE,
-   (uchar**) & STATEFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+  {"out_file", 'O', "Output filename (errmsg.sys)", &OUTFILE,
+   &OUTFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+  {"header_file", 'H', "mysqld_error.h file ", &HEADERFILE,
+   &HEADERFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+  {"name_file", 'N', "mysqld_ername.h file ", &NAMEFILE,
+   &NAMEFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+  {"state_file", 'S', "sql_state.h file", &STATEFILE,
+   &STATEFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
 };
 

=== modified file 'extra/my_print_defaults.c'
--- a/extra/my_print_defaults.c	2007-05-10 09:59:39 +0000
+++ b/extra/my_print_defaults.c	2010-08-04 18:36:11 +0000
@@ -46,31 +46,36 @@ static struct my_option my_long_options[
       searched for a file of this name (and standard filename extensions are
       added if the file has no extension)
   */
-  {"config-file", 'c', "Deprecated, please use --defaults-file instead.  Name of config file to read; if no extension is given, default extension (e.g., .ini or .cnf) will be added",
-   (uchar**) &config_file, (uchar**) &config_file, 0, GET_STR, REQUIRED_ARG,
+  {"config-file", 'c', "Deprecated, please use --defaults-file instead. "
+   "Name of config file to read; if no extension is given, default "
+   "extension (e.g., .ini or .cnf) will be added",
+   (char**) &config_file, (char**) &config_file, 0, GET_STR, REQUIRED_ARG,
    0, 0, 0, 0, 0, 0},
 #ifdef DBUG_OFF
   {"debug", '#', "This is a non-debug version. Catch this and exit",
    0,0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0},
 #else
-  {"debug", '#', "Output debug log", (uchar**) &default_dbug_option,
-   (uchar**) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
+  {"debug", '#', "Output debug log", &default_dbug_option,
+   &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
 #endif
-  {"defaults-file", 'c', "Like --config-file, except: if first option, then read this file only, do not read global or per-user config files; should be the first option",
-   (uchar**) &config_file, (uchar**) &config_file, 0, GET_STR, REQUIRED_ARG,
+  {"defaults-file", 'c', "Like --config-file, except: if first option, "
+   "then read this file only, do not read global or per-user config "
+   "files; should be the first option",
+   (char**) &config_file, (char*) &config_file, 0, GET_STR, REQUIRED_ARG,
    0, 0, 0, 0, 0, 0},
   {"defaults-extra-file", 'e',
-   "Read this file after the global config file and before the config file in the users home directory; should be the first option",
-   (uchar**) &my_defaults_extra_file, (uchar**) &my_defaults_extra_file, 0,
+   "Read this file after the global config file and before the config "
+   "file in the users home directory; should be the first option",
+   &my_defaults_extra_file, &my_defaults_extra_file, 0,
    GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"defaults-group-suffix", 'g',
    "In addition to the given groups, read also groups with this suffix",
-   (uchar**) &my_defaults_group_suffix, (uchar**) &my_defaults_group_suffix,
+   (char**) &my_defaults_group_suffix, (char**) &my_defaults_group_suffix,
    0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"extra-file", 'e',
    "Deprecated. Synonym for --defaults-extra-file.",
-   (uchar**) &my_defaults_extra_file,
-   (uchar**) &my_defaults_extra_file, 0, GET_STR,
+   &my_defaults_extra_file,
+   &my_defaults_extra_file, 0, GET_STR,
    REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"no-defaults", 'n', "Return an empty string (useful for scripts).",
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},

=== modified file 'extra/mysql_waitpid.c'
--- a/extra/mysql_waitpid.c	2007-05-10 09:59:39 +0000
+++ b/extra/mysql_waitpid.c	2010-06-10 20:16:43 +0000
@@ -38,7 +38,7 @@ static struct my_option my_long_options[
    0, 0, 0, 0, 0},
   {"verbose", 'v',
    "Be more verbose. Give a warning, if kill can't handle signal 0.", 
-   (uchar**) &verbose, (uchar**) &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+   &verbose, &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"version", 'V', "Print version information and exit.", 0, 0, 0,
    GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
   { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}

=== modified file 'extra/perror.c'
--- a/extra/perror.c	2009-07-24 06:45:06 +0000
+++ b/extra/perror.c	2010-06-10 20:16:43 +0000
@@ -60,18 +60,18 @@ static struct my_option my_long_options[
   {"info", 'I', "Synonym for --help.",  0, 0, 0, GET_NO_ARG,
    NO_ARG, 0, 0, 0, 0, 0, 0},
 #ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
-  {"ndb", 257, "Ndbcluster storage engine specific error codes.",  (uchar**) &ndb_code,
-   (uchar**) &ndb_code, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+  {"ndb", 257, "Ndbcluster storage engine specific error codes.", &ndb_code,
+   &ndb_code, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
 #endif
 #ifdef HAVE_SYS_ERRLIST
   {"all", 'a', "Print all the error messages and the number.",
-   (uchar**) &print_all_codes, (uchar**) &print_all_codes, 0, GET_BOOL, NO_ARG,
+   &print_all_codes, &print_all_codes, 0, GET_BOOL, NO_ARG,
    0, 0, 0, 0, 0, 0},
 #endif
   {"silent", 's', "Only print the error message.", 0, 0, 0, GET_NO_ARG, NO_ARG,
    0, 0, 0, 0, 0, 0},
-  {"verbose", 'v', "Print error code and message (default).", (uchar**) &verbose,
-   (uchar**) &verbose, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
+  {"verbose", 'v', "Print error code and message (default).", &verbose,
+   &verbose, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
   {"version", 'V', "Displays version information and exits.",
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
   {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}

=== modified file 'extra/resolve_stack_dump.c'
--- a/extra/resolve_stack_dump.c	2008-12-19 10:47:28 +0000
+++ b/extra/resolve_stack_dump.c	2010-06-10 20:16:43 +0000
@@ -53,10 +53,10 @@ static struct my_option my_long_options[
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"version", 'V', "Output version information and exit.",
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"symbols-file", 's', "Use specified symbols file.", (uchar**) &sym_fname,
-   (uchar**) &sym_fname, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+  {"symbols-file", 's', "Use specified symbols file.", &sym_fname,
+   &sym_fname, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"numeric-dump-file", 'n', "Read the dump from specified file.",
-   (uchar**) &dump_fname, (uchar**) &dump_fname, 0, GET_STR, REQUIRED_ARG,
+   &dump_fname, &dump_fname, 0, GET_STR, REQUIRED_ARG,
    0, 0, 0, 0, 0, 0},
   { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
 };

=== modified file 'extra/resolveip.c'
--- a/extra/resolveip.c	2008-02-13 15:58:37 +0000
+++ b/extra/resolveip.c	2010-06-10 20:16:43 +0000
@@ -45,7 +45,7 @@ static struct my_option my_long_options[
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"info", 'I', "Synonym for --help.",
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"silent", 's', "Be more silent.", (uchar**) &silent, (uchar**) &silent,
+  {"silent", 's', "Be more silent.", &silent, &silent,
    0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"version", 'V', "Displays version information and exits.",
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},

=== modified file 'extra/yassl/CMakeLists.txt'
--- a/extra/yassl/CMakeLists.txt	2008-01-30 02:58:57 +0000
+++ b/extra/yassl/CMakeLists.txt	2010-06-08 21:14:18 +0000
@@ -17,7 +17,7 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/
                     ${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/include
                     ${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/mySTL)
 
-ADD_DEFINITIONS("-D_LIB -DYASSL_PREFIX")
+ADD_DEFINITIONS("-D_LIB -DYASSL_PREFIX -DYASSL_THREAD_SAFE")
 
 SET(YASSL_SOURCES  src/buffer.cpp src/cert_wrapper.cpp src/crypto_wrapper.cpp src/handshake.cpp src/lock.cpp 
 				src/log.cpp src/socket_wrapper.cpp src/ssl.cpp src/timer.cpp src/yassl_error.cpp 

=== modified file 'extra/yassl/certs/ca-cert.pem'
--- a/extra/yassl/certs/ca-cert.pem	2006-05-03 11:08:24 +0000
+++ b/extra/yassl/certs/ca-cert.pem	2010-06-08 13:36:47 +0000
@@ -5,49 +5,49 @@ Certificate:
         Signature Algorithm: md5WithRSAEncryption
         Issuer: C=US, ST=Oregon, L=Portland, O=sawtooth, CN=www.sawtooth-consulting.com/emailAddress=info at yassl.com
         Validity
-            Not Before: Jan 18 20:12:32 2005 GMT
-            Not After : Oct 15 20:12:32 2007 GMT
+            Not Before: Mar  7 03:10:11 2005 GMT
+            Not After : Apr  1 03:10:11 2046 GMT
         Subject: C=US, ST=Oregon, L=Portland, O=sawtooth, CN=www.sawtooth-consulting.com/emailAddress=info at yassl.com
         Subject Public Key Info:
             Public Key Algorithm: rsaEncryption
             RSA Public Key: (512 bit)
                 Modulus (512 bit):
-                    00:cf:2b:14:00:b0:3c:df:6f:9e:91:40:ec:c8:f6:
-                    90:b2:5b:b4:70:80:a5:a4:0a:73:c7:44:f3:2a:26:
-                    c4:2f:f1:3a:f1:c3:c4:ac:fc:c3:d2:c3:bf:f5:d7:
-                    6a:38:42:ad:22:ab:c8:c4:4b:4c:1d:16:af:05:34:
-                    7d:79:97:5e:e1
+                    00:ef:c1:e3:9a:3c:6e:6e:cb:26:6f:05:be:e0:cb:
+                    57:a0:4b:68:e6:1b:f9:95:db:01:92:aa:6e:a6:b5:
+                    2d:b1:2b:50:fd:db:13:f2:c5:d8:b8:4f:75:28:53:
+                    72:e8:e5:11:9d:bb:c3:4f:4f:09:fd:4c:e7:46:d5:
+                    1d:bb:35:02:af
                 Exponent: 65537 (0x10001)
         X509v3 extensions:
             X509v3 Subject Key Identifier: 
-                CB:0F:1F:E9:A2:76:71:C9:E6:E8:23:A6:C1:18:B7:CC:44:CF:B9:84
+                1D:EF:A1:B8:81:78:12:47:E8:57:06:08:74:18:F7:D3:AA:D8:F7:BD
             X509v3 Authority Key Identifier: 
-                keyid:CB:0F:1F:E9:A2:76:71:C9:E6:E8:23:A6:C1:18:B7:CC:44:CF:B9:84
+                keyid:1D:EF:A1:B8:81:78:12:47:E8:57:06:08:74:18:F7:D3:AA:D8:F7:BD
                 DirName:/C=US/ST=Oregon/L=Portland/O=sawtooth/CN=www.sawtooth-consulting.com/emailAddress=info at yassl.com
                 serial:00
 
             X509v3 Basic Constraints: 
                 CA:TRUE
     Signature Algorithm: md5WithRSAEncryption
-        27:f7:3d:fb:39:6f:73:a4:86:f3:a0:48:22:60:84:e9:5c:3d:
-        28:36:05:16:44:98:07:87:e1:5d:b5:f3:a7:bc:33:5f:f4:29:
-        a9:5f:87:33:df:e6:8e:bd:e2:f3:0a:c8:00:69:ae:3d:41:47:
-        03:ea:0b:4c:67:45:4b:ab:f3:39
+        d9:77:e3:07:d9:2e:ec:2f:9b:8e:9e:ca:b4:00:0b:ef:c7:74:
+        cb:f4:f6:44:2f:02:75:17:a5:74:3e:26:b2:26:fd:1f:ab:3a:
+        df:d5:e3:05:14:08:d0:8c:1d:c9:3e:e1:59:6f:b3:38:5d:af:
+        78:60:e3:c5:6a:69:96:80:7d:00
 -----BEGIN CERTIFICATE-----
 MIIC7zCCApmgAwIBAgIBADANBgkqhkiG9w0BAQQFADCBiTELMAkGA1UEBhMCVVMx
 DzANBgNVBAgTBk9yZWdvbjERMA8GA1UEBxMIUG9ydGxhbmQxETAPBgNVBAoTCHNh
 d3Rvb3RoMSQwIgYDVQQDExt3d3cuc2F3dG9vdGgtY29uc3VsdGluZy5jb20xHTAb
-BgkqhkiG9w0BCQEWDmluZm9AeWFzc2wuY29tMB4XDTA1MDExODIwMTIzMloXDTA3
-MTAxNTIwMTIzMlowgYkxCzAJBgNVBAYTAlVTMQ8wDQYDVQQIEwZPcmVnb24xETAP
+BgkqhkiG9w0BCQEWDmluZm9AeWFzc2wuY29tMB4XDTA1MDMwNzAzMTAxMVoXDTQ2
+MDQwMTAzMTAxMVowgYkxCzAJBgNVBAYTAlVTMQ8wDQYDVQQIEwZPcmVnb24xETAP
 BgNVBAcTCFBvcnRsYW5kMREwDwYDVQQKEwhzYXd0b290aDEkMCIGA1UEAxMbd3d3
 LnNhd3Rvb3RoLWNvbnN1bHRpbmcuY29tMR0wGwYJKoZIhvcNAQkBFg5pbmZvQHlh
-c3NsLmNvbTBcMA0GCSqGSIb3DQEBAQUAA0sAMEgCQQDPKxQAsDzfb56RQOzI9pCy
-W7RwgKWkCnPHRPMqJsQv8Trxw8Ss/MPSw7/112o4Qq0iq8jES0wdFq8FNH15l17h
-AgMBAAGjgekwgeYwHQYDVR0OBBYEFMsPH+midnHJ5ugjpsEYt8xEz7mEMIG2BgNV
-HSMEga4wgauAFMsPH+midnHJ5ugjpsEYt8xEz7mEoYGPpIGMMIGJMQswCQYDVQQG
+c3NsLmNvbTBcMA0GCSqGSIb3DQEBAQUAA0sAMEgCQQDvweOaPG5uyyZvBb7gy1eg
+S2jmG/mV2wGSqm6mtS2xK1D92xPyxdi4T3UoU3Lo5RGdu8NPTwn9TOdG1R27NQKv
+AgMBAAGjgekwgeYwHQYDVR0OBBYEFB3vobiBeBJH6FcGCHQY99Oq2Pe9MIG2BgNV
+HSMEga4wgauAFB3vobiBeBJH6FcGCHQY99Oq2Pe9oYGPpIGMMIGJMQswCQYDVQQG
 EwJVUzEPMA0GA1UECBMGT3JlZ29uMREwDwYDVQQHEwhQb3J0bGFuZDERMA8GA1UE
 ChMIc2F3dG9vdGgxJDAiBgNVBAMTG3d3dy5zYXd0b290aC1jb25zdWx0aW5nLmNv
 bTEdMBsGCSqGSIb3DQEJARYOaW5mb0B5YXNzbC5jb22CAQAwDAYDVR0TBAUwAwEB
-/zANBgkqhkiG9w0BAQQFAANBACf3Pfs5b3OkhvOgSCJghOlcPSg2BRZEmAeH4V21
-86e8M1/0KalfhzPf5o694vMKyABprj1BRwPqC0xnRUur8zk=
+/zANBgkqhkiG9w0BAQQFAANBANl34wfZLuwvm46eyrQAC+/HdMv09kQvAnUXpXQ+
+JrIm/R+rOt/V4wUUCNCMHck+4Vlvszhdr3hg48VqaZaAfQA=
 -----END CERTIFICATE-----

=== modified file 'extra/yassl/certs/client-cert.der'
Files a/extra/yassl/certs/client-cert.der	2006-05-03 11:20:51 +0000 and b/extra/yassl/certs/client-cert.der	2010-06-08 13:36:47 +0000 differ

=== modified file 'extra/yassl/certs/client-cert.pem'
--- a/extra/yassl/certs/client-cert.pem	2006-05-03 11:08:24 +0000
+++ b/extra/yassl/certs/client-cert.pem	2010-06-08 13:36:47 +0000
@@ -5,8 +5,8 @@ Certificate:
         Signature Algorithm: md5WithRSAEncryption
         Issuer: C=US, ST=Oregon, L=Portland, O=yaSSL, CN=www.yassl.com/emailAddress=info at yassl.com
         Validity
-            Not Before: Jan 18 19:33:15 2005 GMT
-            Not After : Oct 15 19:33:15 2007 GMT
+            Not Before: Mar  7 03:00:31 2005 GMT
+            Not After : Apr  1 03:00:31 2046 GMT
         Subject: C=US, ST=Oregon, L=Portland, O=yaSSL, CN=www.yassl.com/emailAddress=info at yassl.com
         Subject Public Key Info:
             Public Key Algorithm: rsaEncryption
@@ -29,15 +29,15 @@ Certificate:
             X509v3 Basic Constraints: 
                 CA:TRUE
     Signature Algorithm: md5WithRSAEncryption
-        c5:82:26:0c:1f:61:01:14:b0:ce:18:99:64:91:0e:f1:f8:90:
-        3e:a3:0e:be:38:7c:97:ba:05:c9:2a:dc:dd:62:2d:12:61:79:
-        7a:86:b1:97:5d:1e:e8:f7:e8:32:34:f7:8f:b1:08:3d:13:71:
-        a6:3c:15:91:85:12:35:6e:78:87
+        59:19:ae:1b:4e:65:9e:ca:f1:b8:3d:ff:c7:5e:15:86:10:97:
+        8c:3e:22:32:ab:4e:75:a7:70:83:f2:fb:2f:af:fe:26:28:e9:
+        4f:d4:c9:49:7c:6f:51:7e:2a:ff:a0:5b:25:45:2e:66:d9:0d:
+        92:94:e5:b8:60:c6:67:1a:f3:03
 -----BEGIN CERTIFICATE-----
 MIICtzCCAmGgAwIBAgIBADANBgkqhkiG9w0BAQQFADB4MQswCQYDVQQGEwJVUzEP
 MA0GA1UECBMGT3JlZ29uMREwDwYDVQQHEwhQb3J0bGFuZDEOMAwGA1UEChMFeWFT
 U0wxFjAUBgNVBAMTDXd3dy55YXNzbC5jb20xHTAbBgkqhkiG9w0BCQEWDmluZm9A
-eWFzc2wuY29tMB4XDTA1MDExODE5MzMxNVoXDTA3MTAxNTE5MzMxNVoweDELMAkG
+eWFzc2wuY29tMB4XDTA1MDMwNzAzMDAzMVoXDTQ2MDQwMTAzMDAzMVoweDELMAkG
 A1UEBhMCVVMxDzANBgNVBAgTBk9yZWdvbjERMA8GA1UEBxMIUG9ydGxhbmQxDjAM
 BgNVBAoTBXlhU1NMMRYwFAYDVQQDEw13d3cueWFzc2wuY29tMR0wGwYJKoZIhvcN
 AQkBFg5pbmZvQHlhc3NsLmNvbTBcMA0GCSqGSIb3DQEBAQUAA0sAMEgCQQDNH3hH
@@ -47,6 +47,6 @@ wP/OtbStMIGiBgNVHSMEgZowgZeAFK4lXvpNo1sr
 MQswCQYDVQQGEwJVUzEPMA0GA1UECBMGT3JlZ29uMREwDwYDVQQHEwhQb3J0bGFu
 ZDEOMAwGA1UEChMFeWFTU0wxFjAUBgNVBAMTDXd3dy55YXNzbC5jb20xHTAbBgkq
 hkiG9w0BCQEWDmluZm9AeWFzc2wuY29tggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZI
-hvcNAQEEBQADQQDFgiYMH2EBFLDOGJlkkQ7x+JA+ow6+OHyXugXJKtzdYi0SYXl6
-hrGXXR7o9+gyNPePsQg9E3GmPBWRhRI1bniH
+hvcNAQEEBQADQQBZGa4bTmWeyvG4Pf/HXhWGEJeMPiIyq051p3CD8vsvr/4mKOlP
+1MlJfG9Rfir/oFslRS5m2Q2SlOW4YMZnGvMD
 -----END CERTIFICATE-----

=== modified file 'extra/yassl/certs/dsa-cert.pem'
--- a/extra/yassl/certs/dsa-cert.pem	2006-05-03 11:08:24 +0000
+++ b/extra/yassl/certs/dsa-cert.pem	2010-06-08 13:36:47 +0000
@@ -5,8 +5,8 @@ Certificate:
         Signature Algorithm: dsaWithSHA1
         Issuer: C=US, ST=Oregon, L=Portland, O=yaSSL DSA, CN=yaSSL DSA/emailAddress=info at yassl.com
         Validity
-            Not Before: Jan 23 22:54:51 2005 GMT
-            Not After : Oct 20 22:54:51 2007 GMT
+            Not Before: Mar  7 03:22:00 2005 GMT
+            Not After : Apr  1 03:22:00 2046 GMT
         Subject: C=US, ST=Oregon, L=Portland, O=yaSSL DSA, CN=yaSSL DSA/emailAddress=info at yassl.com
         Subject Public Key Info:
             Public Key Algorithm: dsaEncryption
@@ -43,14 +43,14 @@ Certificate:
             X509v3 Basic Constraints: 
                 CA:TRUE
     Signature Algorithm: dsaWithSHA1
-        30:2b:02:14:74:46:9f:91:7b:24:17:3b:ee:0f:10:e3:76:62:
-        f4:dc:81:e6:fd:fe:02:13:08:f4:87:0a:ab:ba:9c:de:3a:69:
-        72:59:b8:ec:e9:57:f4:bf:37
+        30:2c:02:14:7e:5e:94:fc:7f:ca:81:ab:b3:32:f7:21:83:48:
+        48:5f:0a:f1:13:ca:02:14:73:54:32:14:51:22:bf:0b:ec:d7:
+        6a:6a:fa:a7:1d:46:b4:c2:a3:b5
 -----BEGIN CERTIFICATE-----
-MIIDMTCCAvKgAwIBAgIBADAJBgcqhkjOOAQDMHgxCzAJBgNVBAYTAlVTMQ8wDQYD
+MIIDMjCCAvKgAwIBAgIBADAJBgcqhkjOOAQDMHgxCzAJBgNVBAYTAlVTMQ8wDQYD
 VQQIEwZPcmVnb24xETAPBgNVBAcTCFBvcnRsYW5kMRIwEAYDVQQKEwl5YVNTTCBE
 U0ExEjAQBgNVBAMTCXlhU1NMIERTQTEdMBsGCSqGSIb3DQEJARYOaW5mb0B5YXNz
-bC5jb20wHhcNMDUwMTIzMjI1NDUxWhcNMDcxMDIwMjI1NDUxWjB4MQswCQYDVQQG
+bC5jb20wHhcNMDUwMzA3MDMyMjAwWhcNNDYwNDAxMDMyMjAwWjB4MQswCQYDVQQG
 EwJVUzEPMA0GA1UECBMGT3JlZ29uMREwDwYDVQQHEwhQb3J0bGFuZDESMBAGA1UE
 ChMJeWFTU0wgRFNBMRIwEAYDVQQDEwl5YVNTTCBEU0ExHTAbBgkqhkiG9w0BCQEW
 DmluZm9AeWFzc2wuY29tMIHwMIGoBgcqhkjOOAQBMIGcAkEAmSlpgMk8mGhFqYL+
@@ -63,6 +63,6 @@ IeRhRHPp4jCBogYDVR0jBIGaMIGXgBS++Yxd1hy0
 eDELMAkGA1UEBhMCVVMxDzANBgNVBAgTBk9yZWdvbjERMA8GA1UEBxMIUG9ydGxh
 bmQxEjAQBgNVBAoTCXlhU1NMIERTQTESMBAGA1UEAxMJeWFTU0wgRFNBMR0wGwYJ
 KoZIhvcNAQkBFg5pbmZvQHlhc3NsLmNvbYIBADAMBgNVHRMEBTADAQH/MAkGByqG
-SM44BAMDLgAwKwIUdEafkXskFzvuDxDjdmL03IHm/f4CEwj0hwqrupzeOmlyWbjs
-6Vf0vzc=
+SM44BAMDLwAwLAIUfl6U/H/KgauzMvchg0hIXwrxE8oCFHNUMhRRIr8L7Ndqavqn
+HUa0wqO1
 -----END CERTIFICATE-----

=== modified file 'extra/yassl/certs/server-cert.pem'
--- a/extra/yassl/certs/server-cert.pem	2006-05-03 11:08:24 +0000
+++ b/extra/yassl/certs/server-cert.pem	2010-06-08 13:36:47 +0000
@@ -5,8 +5,8 @@ Certificate:
         Signature Algorithm: md5WithRSAEncryption
         Issuer: C=US, ST=Oregon, L=Portland, O=sawtooth, CN=www.sawtooth-consulting.com/emailAddress=info at yassl.com
         Validity
-            Not Before: Jan 18 20:50:59 2005 GMT
-            Not After : Oct 15 20:50:59 2007 GMT
+            Not Before: Mar  8 03:00:47 2005 GMT
+            Not After : Apr  2 03:00:47 2046 GMT
         Subject: C=US, ST=Oregon, L=Portland, O=taoSoftDev, CN=www.taosoftdev.com/emailAddress=info at yassl.com
         Subject Public Key Info:
             Public Key Algorithm: rsaEncryption
@@ -19,20 +19,20 @@ Certificate:
                     f2:25:93:22:e7
                 Exponent: 65537 (0x10001)
     Signature Algorithm: md5WithRSAEncryption
-        08:36:07:8c:3a:7f:f9:91:0a:82:d1:6a:c1:34:be:bc:2d:b2:
-        20:98:dc:45:50:53:9c:66:e6:26:71:bd:fa:d2:b4:91:d3:53:
-        c0:20:05:c0:b6:84:9a:5f:3f:61:75:f5:fd:c6:ec:e2:f6:9f:
-        a2:13:17:a9:b7:83:60:cc:cb:eb
+        36:72:12:3b:ac:e4:58:83:09:86:4f:71:2a:3a:0d:8a:05:27:
+        75:f3:3e:62:4f:ab:b8:70:20:cd:ad:70:ab:91:11:68:f8:82:
+        33:e2:78:85:a8:16:f5:66:bd:68:2c:5a:26:15:12:1e:6e:83:
+        c7:6d:62:b9:c3:ff:e1:86:e4:e6
 -----BEGIN CERTIFICATE-----
 MIIB9zCCAaECAQEwDQYJKoZIhvcNAQEEBQAwgYkxCzAJBgNVBAYTAlVTMQ8wDQYD
 VQQIEwZPcmVnb24xETAPBgNVBAcTCFBvcnRsYW5kMREwDwYDVQQKEwhzYXd0b290
 aDEkMCIGA1UEAxMbd3d3LnNhd3Rvb3RoLWNvbnN1bHRpbmcuY29tMR0wGwYJKoZI
-hvcNAQkBFg5pbmZvQHlhc3NsLmNvbTAeFw0wNTAxMTgyMDUwNTlaFw0wNzEwMTUy
-MDUwNTlaMIGCMQswCQYDVQQGEwJVUzEPMA0GA1UECBMGT3JlZ29uMREwDwYDVQQH
+hvcNAQkBFg5pbmZvQHlhc3NsLmNvbTAeFw0wNTAzMDgwMzAwNDdaFw00NjA0MDIw
+MzAwNDdaMIGCMQswCQYDVQQGEwJVUzEPMA0GA1UECBMGT3JlZ29uMREwDwYDVQQH
 EwhQb3J0bGFuZDETMBEGA1UEChMKdGFvU29mdERldjEbMBkGA1UEAxMSd3d3LnRh
 b3NvZnRkZXYuY29tMR0wGwYJKoZIhvcNAQkBFg5pbmZvQHlhc3NsLmNvbTBcMA0G
 CSqGSIb3DQEBAQUAA0sAMEgCQQCkaLu8tydfPPV4xhqvuZX8fmEfqIEKykOImgPg
 0KZ5cBY0uXx1VMpwGWY4vm4ofqX/azyDLzlCwxXzvfIlkyLnAgMBAAEwDQYJKoZI
-hvcNAQEEBQADQQAINgeMOn/5kQqC0WrBNL68LbIgmNxFUFOcZuYmcb360rSR01PA
-IAXAtoSaXz9hdfX9xuzi9p+iExept4NgzMvr
+hvcNAQEEBQADQQA2chI7rORYgwmGT3EqOg2KBSd18z5iT6u4cCDNrXCrkRFo+IIz
+4niFqBb1Zr1oLFomFRIeboPHbWK5w//hhuTm
 -----END CERTIFICATE-----

=== modified file 'extra/yassl/include/lock.hpp'
--- a/extra/yassl/include/lock.hpp	2007-03-28 16:47:51 +0000
+++ b/extra/yassl/include/lock.hpp	2010-06-10 00:36:20 +0000
@@ -23,13 +23,21 @@
 #ifndef yaSSL_LOCK_HPP
 #define yaSSL_LOCK_HPP
 
+/*
+  Visual Studio Source Annotations header (sourceannotations.h) fails
+  to compile if outside of the global namespace.
+*/
+#ifdef YASSL_THREAD_SAFE
+#ifdef _WIN32
+#include <windows.h>
+#endif
+#endif
 
 namespace yaSSL {
 
 
-#ifdef MULTI_THREADED
+#ifdef YASSL_THREAD_SAFE
     #ifdef _WIN32
-        #include <windows.h>
 
         class Mutex {
             CRITICAL_SECTION cs_;
@@ -69,7 +77,7 @@ namespace yaSSL {
         };
 
     #endif // _WIN32
-#else  // MULTI_THREADED (WE'RE SINGLE)
+#else  // YASSL_THREAD_SAFE (WE'RE SINGLE)
 
     class Mutex {
     public:
@@ -79,7 +87,7 @@ namespace yaSSL {
         };
     };
 
-#endif // MULTI_THREADED
+#endif // YASSL_THREAD_SAFE
 
 
 

=== modified file 'extra/yassl/src/Makefile.am'
--- a/extra/yassl/src/Makefile.am	2006-11-27 22:12:05 +0000
+++ b/extra/yassl/src/Makefile.am	2010-06-08 21:14:18 +0000
@@ -5,7 +5,7 @@ libyassl_la_SOURCES = buffer.cpp cert_wr
 	handshake.cpp lock.cpp log.cpp socket_wrapper.cpp ssl.cpp \
 	template_instnt.cpp timer.cpp yassl_imp.cpp yassl_error.cpp yassl_int.cpp
 EXTRA_DIST = $(wildcard ../include/*.hpp) $(wildcard ../include/openssl/*.h)
-AM_CXXFLAGS = -DYASSL_PURE_C -DYASSL_PREFIX
+AM_CXXFLAGS = -DYASSL_PURE_C -DYASSL_PREFIX @yassl_thread_cxxflags@
 
 # Don't update the files from bitkeeper
 %::SCCS/s.%

=== modified file 'extra/yassl/src/lock.cpp'
--- a/extra/yassl/src/lock.cpp	2007-01-29 15:54:40 +0000
+++ b/extra/yassl/src/lock.cpp	2010-06-08 13:36:47 +0000
@@ -26,7 +26,7 @@
 namespace yaSSL {
 
 
-#ifdef MULTI_THREADED
+#ifdef YASSL_THREAD_SAFE
     #ifdef _WIN32
         
         Mutex::Mutex()
@@ -79,7 +79,7 @@ namespace yaSSL {
          
 
     #endif // _WIN32
-#endif // MULTI_THREADED
+#endif // YASSL_THREAD_SAFE
 
 
 

=== modified file 'extra/yassl/taocrypt/CMakeLists.txt'
--- a/extra/yassl/taocrypt/CMakeLists.txt	2007-08-03 20:57:21 +0000
+++ b/extra/yassl/taocrypt/CMakeLists.txt	2010-06-08 21:14:18 +0000
@@ -16,6 +16,8 @@
 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/mySTL
                     ${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/include)
 
+ADD_DEFINITIONS("-DYASSL_THREAD_SAFE")
+
 SET(TAOCRYPT_SOURCES		src/aes.cpp src/aestables.cpp src/algebra.cpp src/arc4.cpp src/asn.cpp src/coding.cpp 
 				src/des.cpp src/dh.cpp src/dsa.cpp src/file.cpp src/hash.cpp src/integer.cpp src/md2.cpp 
 				src/md4.cpp src/md5.cpp src/misc.cpp src/random.cpp src/ripemd.cpp src/rsa.cpp src/sha.cpp

=== modified file 'extra/yassl/taocrypt/benchmark/Makefile.am'
--- a/extra/yassl/taocrypt/benchmark/Makefile.am	2007-03-22 15:58:46 +0000
+++ b/extra/yassl/taocrypt/benchmark/Makefile.am	2010-06-08 21:14:18 +0000
@@ -2,7 +2,7 @@ INCLUDES = -I$(srcdir)/../include -I$(sr
 noinst_PROGRAMS    = benchmark
 benchmark_SOURCES  = benchmark.cpp
 benchmark_LDADD    = $(top_builddir)/extra/yassl/taocrypt/src/libtaocrypt.la
-benchmark_CXXFLAGS = -DYASSL_PURE_C
+benchmark_CXXFLAGS = -DYASSL_PURE_C @yassl_thread_cxxflags@
 EXTRA_DIST = benchmark.dsp rsa1024.der dh1024.der dsa1024.der make.bat
 
 # Don't update the files from bitkeeper

=== modified file 'extra/yassl/taocrypt/src/Makefile.am'
--- a/extra/yassl/taocrypt/src/Makefile.am	2006-11-27 22:12:05 +0000
+++ b/extra/yassl/taocrypt/src/Makefile.am	2010-06-08 21:14:18 +0000
@@ -8,7 +8,8 @@ libtaocrypt_la_SOURCES  = aes.cpp aestab
         random.cpp ripemd.cpp rsa.cpp sha.cpp template_instnt.cpp \
         tftables.cpp twofish.cpp
 
-libtaocrypt_la_CXXFLAGS = @yassl_taocrypt_extra_cxxflags@ -DYASSL_PURE_C
+libtaocrypt_la_CXXFLAGS = @yassl_taocrypt_extra_cxxflags@ -DYASSL_PURE_C \
+			  @yassl_thread_cxxflags@
 
 EXTRA_DIST = $(wildcard ../include/*.hpp)
 

=== modified file 'extra/yassl/taocrypt/test/Makefile.am'
--- a/extra/yassl/taocrypt/test/Makefile.am	2007-01-29 17:48:20 +0000
+++ b/extra/yassl/taocrypt/test/Makefile.am	2010-06-08 21:14:18 +0000
@@ -2,7 +2,7 @@ INCLUDES = -I$(srcdir)/../include -I$(sr
 noinst_PROGRAMS = test
 test_SOURCES = test.cpp
 test_LDADD    = $(top_builddir)/extra/yassl/taocrypt/src/libtaocrypt.la
-test_CXXFLAGS = -DYASSL_PURE_C
+test_CXXFLAGS = -DYASSL_PURE_C @yassl_thread_cxxflags@
 EXTRA_DIST = make.bat
 
 # Don't update the files from bitkeeper

=== modified file 'extra/yassl/taocrypt/test/memory.cpp'
--- a/extra/yassl/taocrypt/test/memory.cpp	2006-04-07 09:35:12 +0000
+++ b/extra/yassl/taocrypt/test/memory.cpp	2010-06-08 13:36:47 +0000
@@ -13,7 +13,7 @@
 To use MemoryTracker merely add this file to your project
 No need to instantiate anything
 
-If your app is multi threaded define MULTI_THREADED
+If your app is multi threaded define YASSL_THREAD_SAFE
 
 *********************************************************************/
 

=== modified file 'extra/yassl/testsuite/Makefile.am'
--- a/extra/yassl/testsuite/Makefile.am	2007-01-29 17:48:20 +0000
+++ b/extra/yassl/testsuite/Makefile.am	2010-06-08 21:14:18 +0000
@@ -4,7 +4,7 @@ testsuite_SOURCES  = testsuite.cpp ../ta
 	../examples/client/client.cpp ../examples/server/server.cpp \
 	../examples/echoclient/echoclient.cpp \
 	../examples/echoserver/echoserver.cpp
-testsuite_CXXFLAGS = -DYASSL_PURE_C -DYASSL_PREFIX -DNO_MAIN_DRIVER
+testsuite_CXXFLAGS = -DYASSL_PURE_C -DYASSL_PREFIX -DNO_MAIN_DRIVER @yassl_thread_cxxflags@
 testsuite_LDADD    = $(top_builddir)/extra/yassl/src/libyassl.la \
                      $(top_builddir)/extra/yassl/taocrypt/src/libtaocrypt.la
 EXTRA_DIST = testsuite.dsp test.hpp input quit make.bat

=== modified file 'include/m_string.h'
--- a/include/m_string.h	2010-03-04 08:03:07 +0000
+++ b/include/m_string.h	2010-08-02 09:01:24 +0000
@@ -124,9 +124,6 @@ extern	size_t bcmp(const uchar *s1,const
 extern	size_t my_bcmp(const uchar *s1,const uchar *s2,size_t len);
 #undef bcmp
 #define bcmp(A,B,C) my_bcmp((A),(B),(C))
-#define bzero_if_valgrind(A,B) bzero(A,B)
-#else
-#define bzero_if_valgrind(A,B)
 #endif /* HAVE_valgrind */
 
 #if defined(_lint) || defined(FORCE_INIT_OF_VARS)

=== modified file 'include/my_alarm.h'
--- a/include/my_alarm.h	2006-12-23 19:17:15 +0000
+++ b/include/my_alarm.h	2010-07-01 08:02:00 +0000
@@ -36,14 +36,14 @@ extern ulong my_time_to_wait_for_lock;
 #define ALARM_END	VOID(signal(SIGALRM,alarm_signal)); \
 			VOID(alarm(alarm_old));
 #define ALARM_TEST	my_have_got_alarm
-#ifdef DONT_REMEMBER_SIGNAL
+#ifdef SIGNAL_HANDLER_RESET_ON_DELIVERY
 #define ALARM_REINIT	VOID(alarm(MY_HOW_OFTEN_TO_ALARM)); \
 			VOID(signal(SIGALRM,my_set_alarm_variable));\
 			my_have_got_alarm=0;
 #else
 #define ALARM_REINIT	VOID(alarm((uint) MY_HOW_OFTEN_TO_ALARM)); \
 			my_have_got_alarm=0;
-#endif /* DONT_REMEMBER_SIGNAL */
+#endif /* SIGNAL_HANDLER_RESET_ON_DELIVERY */
 #else
 #define ALARM_VARIABLES long alarm_pos=0,alarm_end_pos=MY_HOW_OFTEN_TO_WRITE-1
 #define ALARM_INIT

=== modified file 'include/my_base.h'
--- a/include/my_base.h	2010-02-10 19:06:24 +0000
+++ b/include/my_base.h	2010-08-02 16:39:45 +0000
@@ -272,7 +272,7 @@ enum ha_base_keytype {
 #define HA_USES_PARSER           16384  /* Fulltext index uses [pre]parser */
 #define HA_USES_BLOCK_SIZE	 ((uint) 32768)
 #define HA_SORT_ALLOWS_SAME      512    /* Intern bit when sorting records */
-#if MYSQL_VERSION_ID < 0x50200
+#if MYSQL_VERSION_ID < 50200
 /*
   Key has a part that can have end space.  If this is an unique key
   we have to handle it differently from other unique keys as we can find

=== modified file 'include/my_bitmap.h'
--- a/include/my_bitmap.h	2007-12-12 10:14:59 +0000
+++ b/include/my_bitmap.h	2010-08-04 13:01:13 +0000
@@ -53,6 +53,8 @@ extern my_bool bitmap_is_overlapping(con
 extern my_bool bitmap_test_and_set(MY_BITMAP *map, uint bitmap_bit);
 extern my_bool bitmap_test_and_clear(MY_BITMAP *map, uint bitmap_bit);
 extern my_bool bitmap_fast_test_and_set(MY_BITMAP *map, uint bitmap_bit);
+extern my_bool bitmap_union_is_set_all(const MY_BITMAP *map1,
+                                       const MY_BITMAP *map2);
 extern uint bitmap_set_next(MY_BITMAP *map);
 extern uint bitmap_get_first(const MY_BITMAP *map);
 extern uint bitmap_get_first_set(const MY_BITMAP *map);

=== modified file 'include/my_getopt.h'
--- a/include/my_getopt.h	2008-10-27 09:57:59 +0000
+++ b/include/my_getopt.h	2010-06-10 20:16:43 +0000
@@ -45,10 +45,10 @@ struct my_option
   const char *name;                     /* Name of the option */
   int        id;                        /* unique id or short option */
   const char *comment;                  /* option comment, for autom. --help */
-  uchar      **value;                   /* The variable value */
-  uchar      **u_max_value;             /* The user def. max variable value */
+  void       *value;                    /* The variable value */
+  void       *u_max_value;              /* The user def. max variable value */
   struct st_typelib *typelib;           /* Pointer to possible values */
-  ulong     var_type;
+  ulong      var_type;                  /* Must match the variable type */
   enum get_opt_arg_type arg_type;
   longlong   def_value;                 /* Default value */
   longlong   min_value;                 /* Min allowed value */
@@ -58,8 +58,16 @@ struct my_option
   void       *app_type;                 /* To be used by an application */
 };
 
-typedef my_bool (* my_get_one_option) (int, const struct my_option *, char * );
-typedef void (* my_error_reporter) (enum loglevel level, const char *format, ... );
+typedef my_bool (*my_get_one_option)(int, const struct my_option *, char *);
+typedef void (*my_error_reporter)(enum loglevel level, const char *format, ...);
+/**
+  Used to retrieve a reference to the object (variable) that holds the value
+  for the given option. For example, if var_type is GET_UINT, the function
+  must return a pointer to a variable of type uint. A argument is stored in
+  the location pointed to by the returned pointer.
+*/
+typedef void *(*my_getopt_value)(const char *, uint, const struct my_option *,
+                                 int *);
 
 extern char *disabled_my_option;
 extern my_bool my_getopt_print_errors;
@@ -71,8 +79,7 @@ extern int handle_options (int *argc, ch
 extern void my_cleanup_options(const struct my_option *options);
 extern void my_print_help(const struct my_option *options);
 extern void my_print_variables(const struct my_option *options);
-extern void my_getopt_register_get_addr(uchar ** (*func_addr)(const char *, uint,
-                                        const struct my_option *, int *));
+extern void my_getopt_register_get_addr(my_getopt_value);
 
 ulonglong getopt_ull_limit_value(ulonglong num, const struct my_option *optp,
                                  my_bool *fix);

=== modified file 'include/my_global.h'
--- a/include/my_global.h	2010-06-23 00:48:11 +0000
+++ b/include/my_global.h	2010-08-02 09:01:24 +0000
@@ -55,6 +55,10 @@
 #define USE_PRAGMA_INTERFACE
 #endif
 
+#if defined(__OpenBSD__) && (OpenBSD >= 200411)
+#define HAVE_ERRNO_AS_DEFINE
+#endif
+
 #if defined(i386) && !defined(__i386__)
 #define __i386__
 #endif
@@ -548,8 +552,8 @@ extern "C" int madvise(void *addr, size_
 #endif
 
 /* Does the system remember a signal handler after a signal ? */
-#ifndef HAVE_BSD_SIGNALS
-#define DONT_REMEMBER_SIGNAL
+#if !defined(HAVE_BSD_SIGNALS) && !defined(HAVE_SIGACTION)
+#define SIGNAL_HANDLER_RESET_ON_DELIVERY
 #endif
 
 /* Define void to stop lint from generating "null effekt" comments */

=== modified file 'include/my_sys.h'
--- a/include/my_sys.h	2010-05-26 19:27:01 +0000
+++ b/include/my_sys.h	2010-08-02 09:01:24 +0000
@@ -37,7 +37,7 @@ extern int NEAR my_errno;		/* Last error
 
 #define MYSYS_PROGRAM_USES_CURSES()  { error_handler_hook = my_message_curses;	mysys_uses_curses=1; }
 #define MYSYS_PROGRAM_DONT_USE_CURSES()  { error_handler_hook = my_message_no_curses; mysys_uses_curses=0;}
-#define MY_INIT(name);		{ my_progname= name; my_init(); }
+#define MY_INIT(name)   { my_progname= name; my_init(); }
 
 #define MY_FILE_ERROR	((size_t) -1)
 

=== modified file 'include/my_valgrind.h'
--- a/include/my_valgrind.h	2010-05-26 19:27:01 +0000
+++ b/include/my_valgrind.h	2010-08-02 09:01:24 +0000
@@ -24,15 +24,19 @@
 
 #if defined(HAVE_valgrind)&& defined(HAVE_VALGRIND_MEMCHECK_H)
 #include <valgrind/memcheck.h>
-#else
-#define VALGRIND_MAKE_MEM_DEFINED(addr, size) do { } while(0)
-#define VALGRIND_MAKE_MEM_NOACCESS(addr, size) do { } while(0)
+#define MEM_UNDEFINED(a,len) VALGRIND_MAKE_MEM_UNDEFINED(a,len)
+#define MEM_NOACCESS(a,len) VALGRIND_MAKE_MEM_NOACCESS(a,len)
+#define MEM_CHECK_ADDRESSABLE(a,len) VALGRIND_CHECK_MEM_IS_ADDRESSABLE(a,len)
+#define MEM_CHECK_DEFINED(a,len) VALGRIND_CHECK_MEM_IS_DEFINED(a,len)
+#else /* HAVE_VALGRIND */
+# define MEM_UNDEFINED(a,len) ((void) 0)
+# define MEM_NOACCESS(a,len) ((void) 0)
+# define MEM_CHECK_ADDRESSABLE(a,len) ((void) 0)
+# define MEM_CHECK_DEFINED(a,len) ((void) 0)
+#endif /* HAVE_VALGRIND */
+
 #ifdef SAFEMALLOC
-#define VALGRIND_MAKE_MEM_UNDEFINED(addr, size) bfill(addr, size, 0x8F)
+#define TRASH(A,B) do { bfill(A, B, 0x8F); MEM_UNDEFINED(A, B); } while (0)
 #else
-#define VALGRIND_MAKE_MEM_UNDEFINED(addr, size) do { } while(0)
-#endif /* SAFEMALLOC */
-#endif /* HAVE_valgrind */
-
-/* Compatibility with old source */
-#define TRASH(A,B) VALGRIND_MAKE_MEM_UNDEFINED(A, B)
+#define TRASH(A,B) do{MEM_CHECK_ADDRESSABLE(A,B);MEM_UNDEFINED(A,B);} while (0)
+#endif

=== modified file 'include/myisam.h'
--- a/include/myisam.h	2010-03-04 08:03:07 +0000
+++ b/include/myisam.h	2010-08-02 09:01:24 +0000
@@ -48,8 +48,6 @@ extern "C" {
 
 #define MI_NAME_IEXT	".MYI"
 #define MI_NAME_DEXT	".MYD"
-/* Max extra space to use when sorting keys */
-#define MI_MAX_TEMP_LENGTH	2*1024L*1024L*1024L
 
 /* Possible values for myisam_block_size (must be power of 2) */
 #define MI_KEY_BLOCK_LENGTH	1024	/* default key block length */

=== modified file 'include/sslopt-longopts.h'
--- a/include/sslopt-longopts.h	2007-05-10 09:59:39 +0000
+++ b/include/sslopt-longopts.h	2010-06-10 20:16:43 +0000
@@ -16,30 +16,31 @@
 #ifdef HAVE_OPENSSL
 
   {"ssl", OPT_SSL_SSL,
-   "Enable SSL for connection (automatically enabled with other flags). Disable with --skip-ssl.",
- (uchar **) &opt_use_ssl, (uchar **) &opt_use_ssl, 0, GET_BOOL, NO_ARG, 0, 0, 0,
-   0, 0, 0},
+   "Enable SSL for connection (automatically enabled with other flags)."
+   "Disable with --skip-ssl.", &opt_use_ssl, &opt_use_ssl, 0, GET_BOOL,
+   NO_ARG, 0, 0, 0, 0, 0, 0},
   {"ssl-ca", OPT_SSL_CA,
    "CA file in PEM format (check OpenSSL docs, implies --ssl).",
-   (uchar **) &opt_ssl_ca, (uchar **) &opt_ssl_ca, 0, GET_STR, REQUIRED_ARG,
+   &opt_ssl_ca, &opt_ssl_ca, 0, GET_STR, REQUIRED_ARG,
    0, 0, 0, 0, 0, 0},
   {"ssl-capath", OPT_SSL_CAPATH,
    "CA directory (check OpenSSL docs, implies --ssl).",
-   (uchar **) &opt_ssl_capath, (uchar **) &opt_ssl_capath, 0, GET_STR, REQUIRED_ARG,
+   &opt_ssl_capath, &opt_ssl_capath, 0, GET_STR, REQUIRED_ARG,
    0, 0, 0, 0, 0, 0},
   {"ssl-cert", OPT_SSL_CERT, "X509 cert in PEM format (implies --ssl).",
-   (uchar **) &opt_ssl_cert, (uchar **) &opt_ssl_cert, 0, GET_STR, REQUIRED_ARG,
+   &opt_ssl_cert, &opt_ssl_cert, 0, GET_STR, REQUIRED_ARG,
    0, 0, 0, 0, 0, 0},
   {"ssl-cipher", OPT_SSL_CIPHER, "SSL cipher to use (implies --ssl).",
-   (uchar **) &opt_ssl_cipher, (uchar **) &opt_ssl_cipher, 0, GET_STR, REQUIRED_ARG,
+   &opt_ssl_cipher, &opt_ssl_cipher, 0, GET_STR, REQUIRED_ARG,
    0, 0, 0, 0, 0, 0},
   {"ssl-key", OPT_SSL_KEY, "X509 key in PEM format (implies --ssl).",
-   (uchar **) &opt_ssl_key, (uchar **) &opt_ssl_key, 0, GET_STR, REQUIRED_ARG,
+   &opt_ssl_key, &opt_ssl_key, 0, GET_STR, REQUIRED_ARG,
    0, 0, 0, 0, 0, 0},
 #ifdef MYSQL_CLIENT
   {"ssl-verify-server-cert", OPT_SSL_VERIFY_SERVER_CERT,
-   "Verify server's \"Common Name\" in its cert against hostname used when connecting. This option is disabled by default.",
-   (uchar **) &opt_ssl_verify_server_cert, (uchar **) &opt_ssl_verify_server_cert,
+   "Verify server's \"Common Name\" in its cert against hostname used "
+   "when connecting. This option is disabled by default.",
+   &opt_ssl_verify_server_cert, &opt_ssl_verify_server_cert,
     0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
 #endif
 #endif /* HAVE_OPENSSL */

=== modified file 'libmysql/libmysql.c'
--- a/libmysql/libmysql.c	2010-04-28 12:52:24 +0000
+++ b/libmysql/libmysql.c	2010-08-02 09:01:24 +0000
@@ -328,7 +328,7 @@ sig_handler
 my_pipe_sig_handler(int sig __attribute__((unused)))
 {
   DBUG_PRINT("info",("Hit by signal %d",sig));
-#ifdef DONT_REMEMBER_SIGNAL
+#ifdef SIGNAL_HANDLER_RESET_ON_DELIVERY
   (void) signal(SIGPIPE, my_pipe_sig_handler);
 #endif
 }
@@ -2508,7 +2508,12 @@ static my_bool execute(MYSQL_STMT *stmt,
   stmt->insert_id= mysql->insert_id;
   if (res)
   {
-    set_stmt_errmsg(stmt, net);
+    /* 
+      Don't set stmt error if stmt->mysql is NULL, as the error in this case 
+      has already been set by mysql_prune_stmt_list(). 
+    */
+    if (stmt->mysql)
+      set_stmt_errmsg(stmt, net);
     DBUG_RETURN(1);
   }
   DBUG_RETURN(0);
@@ -2719,7 +2724,12 @@ stmt_read_row_from_cursor(MYSQL_STMT *st
                                             buff, sizeof(buff), (uchar*) 0, 0,
                                             1, stmt))
     {
-      set_stmt_errmsg(stmt, net);
+      /* 
+        Don't set stmt error if stmt->mysql is NULL, as the error in this case 
+        has already been set by mysql_prune_stmt_list(). 
+      */
+      if (stmt->mysql)
+        set_stmt_errmsg(stmt, net);
       return 1;
     }
     if ((*mysql->methods->read_rows_from_cursor)(stmt))
@@ -3400,7 +3410,12 @@ mysql_stmt_send_long_data(MYSQL_STMT *st
                                             buff, sizeof(buff), (uchar*) data,
                                             length, 1, stmt))
     {
-      set_stmt_errmsg(stmt, &mysql->net);
+      /* 
+        Don't set stmt error if stmt->mysql is NULL, as the error in this case 
+        has already been set by mysql_prune_stmt_list(). 
+      */
+      if (stmt->mysql)
+        set_stmt_errmsg(stmt, &mysql->net);
       DBUG_RETURN(1);
     }
   }
@@ -4835,7 +4850,12 @@ int STDCALL mysql_stmt_store_result(MYSQ
     if (cli_advanced_command(mysql, COM_STMT_FETCH, buff, sizeof(buff),
                              (uchar*) 0, 0, 1, stmt))
     {
-      set_stmt_errmsg(stmt, net);
+      /* 
+        Don't set stmt error if stmt->mysql is NULL, as the error in this case 
+        has already been set by mysql_prune_stmt_list(). 
+      */
+      if (stmt->mysql)
+        set_stmt_errmsg(stmt, net);
       DBUG_RETURN(1);
     }
   }

=== modified file 'mysql-test/Makefile.am'
--- a/mysql-test/Makefile.am	2010-04-28 12:52:24 +0000
+++ b/mysql-test/Makefile.am	2010-08-04 10:17:44 +0000
@@ -103,6 +103,8 @@ TEST_DIRS = t r include std_data std_dat
 	suite/parts suite/parts/t suite/parts/r suite/parts/inc \
 	suite/pbxt/t suite/pbxt/r \
 	suite/innodb suite/innodb/t suite/innodb/r suite/innodb/include \
+	suite/innodb_plugin suite/innodb_plugin/t suite/innodb_plugin/r suite/innodb_plugin/include \
+	suite/percona \
 	suite/engines suite/engines/funcs suite/engines/iuds suite/engines/rr_trx \
 	suite/engines/funcs/r suite/engines/funcs/t suite/engines/iuds/r \
 	suite/engines/iuds/t suite/engines/rr_trx/include suite/engines/rr_trx/r \

=== modified file 'mysql-test/collections/default.experimental'
--- a/mysql-test/collections/default.experimental	2010-02-01 12:05:21 +0000
+++ b/mysql-test/collections/default.experimental	2010-06-03 08:31:26 +0000
@@ -13,12 +13,15 @@ funcs_1.ndb*
 funcs_2.ndb_charset                      # joro : NDB tests marked as experimental as agreed with bochklin
 
 main.ctype_gbk_binlog  @solaris          # Bug#46010: main.ctype_gbk_binlog fails sporadically : Table 't2' already exists
+main.func_str  @solaris                  # joro: Bug#40928
 main.plugin_load  @solaris               # Bug#42144
+main.sp @solaris                         # joro : Bug#54138
 main.outfile_loaddata @solaris           # joro : Bug #46895
 
 ndb.*                                    # joro : NDB tests marked as experimental as agreed with bochklin
 
 rpl.rpl_innodb_bug28430*  @solaris       # Bug#46029
+rpl.rpl_row_sp011         @solaris       # Joro : Bug #54138
 
 rpl_ndb.*                                # joro : NDB tests marked as experimental as agreed with bochklin
 rpl_ndb.rpl_ndb_log                      # Bug#38998
@@ -39,3 +42,5 @@ parts.partition_mgm_lc1_ndb
 parts.partition_mgm_lc2_ndb              # joro : NDB tests marked as experimental as agreed with bochklin
 parts.partition_syntax_ndb               # joro : NDB tests marked as experimental as agreed with bochklin
 parts.partition_value_ndb                # joro : NDB tests marked as experimental as agreed with bochklin
+main.mysqlhotcopy_myisam                 # horst: due to bug#54129
+main.mysqlhotcopy_archive                # horst: due to bug#54129

=== modified file 'mysql-test/extra/binlog_tests/binlog.test'
--- a/mysql-test/extra/binlog_tests/binlog.test	2009-10-14 15:46:45 +0000
+++ b/mysql-test/extra/binlog_tests/binlog.test	2010-05-24 13:54:08 +0000
@@ -41,13 +41,10 @@ while ($1)
 --enable_query_log
 commit;
 drop table t1;
---replace_column 2 # 5 #
---replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\//
-show binlog events in 'master-bin.000001' from 106;
---replace_column 2 # 5 #
---replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\//
-show binlog events in 'master-bin.000002' from 106;
-
+--source include/show_binlog_events.inc
+--let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
+--source include/show_binlog_events.inc
+--let $binlog_file=
 
 #
 # Bug#22540 - Incorrect value in column End_log_pos of
@@ -77,8 +74,7 @@ insert into t1 values (2);
 insert into t1 values (3);
 commit;
 drop table t1;
---replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /Server ver: [^,]*,/Server version,/
-show binlog events from 0;
+--source include/show_binlog_events.inc
 
 # now show that nothing breaks if we need to read from the cache more
 # than once, resulting in split event-headers
@@ -100,8 +96,7 @@ while ($1)
 commit;
 enable_query_log;
 
---replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /Server ver: [^,]*,/Server version,/
-show binlog events from 0;
+--source include/show_binlog_events.inc
 
 drop table t1;
 
@@ -122,8 +117,7 @@ set @b= 14632475938453979136;
 execute stmt using @a, @b;
 deallocate prepare stmt;
 drop table t1;
---replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /Server ver: [^,]*,/Server version,/
-show binlog events from 0;
+--source include/show_binlog_events.inc
 
 
 #
@@ -249,14 +243,15 @@ reset master;
 drop table if exists t3;
 --enable_warnings
 create table t3 (a int(11) NOT NULL AUTO_INCREMENT, b text, PRIMARY KEY (a) ) engine=innodb;
-show master status;
+source include/show_master_status.inc;
 let $it=4;
 while ($it)
 {
 insert into t3(b) values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
 dec $it;
 }
-show master status /* must show new binlog index after rotating */;
+# must show new binlog index after rotating;
+source include/show_master_status.inc;
 drop table t3;
 
 --echo #

=== modified file 'mysql-test/extra/binlog_tests/blackhole.test'
--- a/mysql-test/extra/binlog_tests/blackhole.test	2008-10-23 19:27:09 +0000
+++ b/mysql-test/extra/binlog_tests/blackhole.test	2010-05-24 13:54:08 +0000
@@ -125,12 +125,7 @@ select * from t1;
 select * from t2;
 select * from t3;
 
-let $VERSION=`select version()`;
---replace_result $VERSION VERSION
---replace_column 2 # 4 # 5 #
---replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
---replace_regex /file_id=[0-9]+/file_id=#/
-show binlog events;
+--source include/show_binlog_events.inc
 
 drop table t1,t2,t3;
 
@@ -168,18 +163,21 @@ set autocommit=0;
 start transaction;
 insert into t1 values(1);
 commit;
+
+let $master_log_pos_1= query_get_value(SHOW MASTER STATUS, Position, 1);
+
 start transaction;
 insert into t1 values(2);
 rollback;
-set autocommit=1;
 
-let $VERSION=`select version()`;
---replace_result $VERSION VERSION
---replace_column 2 # 4 # 5 #
---replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
---replace_regex /file_id=[0-9]+/file_id=#/
-show binlog events;
+let $master_log_pos_2= query_get_value(SHOW MASTER STATUS, Position, 1);
+if (`SELECT $master_log_pos_2 <> $master_log_pos_1`)
+{
+  echo $master_log_pos_1 $master_log_pos_2;
+  die Rollbacked transaction has been binlogged;
+}
 
+set autocommit=1;
 drop table if exists t1;
 
 #

=== modified file 'mysql-test/extra/binlog_tests/mix_innodb_myisam_side_effects.test'
--- a/mysql-test/extra/binlog_tests/mix_innodb_myisam_side_effects.test	2008-02-28 11:21:44 +0000
+++ b/mysql-test/extra/binlog_tests/mix_innodb_myisam_side_effects.test	2010-05-04 19:31:49 +0000
@@ -214,7 +214,7 @@ CREATE TABLE t5 (a int, PRIMARY KEY (a))
 
 # execute
  --error ER_DUP_ENTRY
- UPDATE t3,t4 SET t3.a=t4.a + bug27417(1);
+ UPDATE t3,t4 SET t3.a = t4.a + bug27417(1) where t3.a = 1;
 
 # check
  select count(*) from t1 /* must be 1 */;

=== modified file 'mysql-test/extra/rpl_tests/rpl_deadlock.test'
--- a/mysql-test/extra/rpl_tests/rpl_deadlock.test	2009-04-03 21:33:13 +0000
+++ b/mysql-test/extra/rpl_tests/rpl_deadlock.test	2010-05-24 13:54:08 +0000
@@ -61,7 +61,7 @@ sync_with_master;
 SELECT * FROM t1;
 SELECT * FROM t3;
 # Check that no error is reported
---source include/show_slave_status2.inc
+source include/check_slave_is_running.inc;
 --echo
 
 # 2) Test lock wait timeout
@@ -89,7 +89,7 @@ sync_with_master;
 SELECT * FROM t1;
 SELECT * FROM t3;
 # Check that no error is reported
---source include/show_slave_status2.inc
+source include/check_slave_is_running.inc;
 --echo
 
 # 3) Test lock wait timeout and purged relay log
@@ -103,6 +103,7 @@ SET global max_relay_log_size=0;
 --source include/stop_slave.inc
 DELETE FROM t2;
 # Set slave position to the BEGIN log event
+--replace_result $master_pos_begin MASTER_POS_BEGIN
 eval CHANGE MASTER TO MASTER_LOG_POS=$master_pos_begin; 
 BEGIN;
 # Hold lock
@@ -119,7 +120,7 @@ sync_with_master;
 SELECT * FROM t1;
 SELECT * FROM t3;
 # Check that no error is reported
---source include/show_slave_status2.inc
+source include/check_slave_is_running.inc;
 --echo
 
 # Clean up

=== modified file 'mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test'
--- a/mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test	2009-02-05 09:49:32 +0000
+++ b/mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test	2010-05-24 13:54:08 +0000
@@ -146,12 +146,7 @@ SELECT COUNT(*) FROM t1;
 --echo
 SELECT * FROM t1 ORDER BY f3 LIMIT 20;
 
---echo
---echo * Show Slave Status *
---echo
---replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
---query_vertical show slave status;
---echo
+--source include/check_slave_is_running.inc
 
 ### Altering table def scenario
 --echo
@@ -431,16 +426,14 @@ connection master;
    delete from t4;
    delete from t31;
 
---echo
---echo ** Check slave status **
---echo
 #connection slave;
    sync_slave_with_master;
    select * from t31;
 
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
---query_vertical show slave status;
+--echo
+--echo ** Check slave status **
+--echo
+--source include/check_slave_is_running.inc
 
 #### Clean Up ####
 
@@ -493,16 +486,15 @@ INSERT INTO t10 () VALUES(1, at b1,DEFAULT,
 
 --echo
 --echo ********************************************
---echo *** Expect slave to fail with Error 1523 ***
+--echo *** Expect slave to fail with Error 1535 ***
 --echo ********************************************
 --echo
 connection slave;
-source include/wait_for_slave_sql_to_stop.inc;
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
---query_vertical SHOW SLAVE STATUS
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-START SLAVE;
+# 1535 = ER_BINLOG_ROW_WRONG_TABLE_DEF
+--let $slave_sql_errno= 1535
+--let $slave_skip_counter= 2
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error_and_skip.inc
 
 --echo
 --echo *** Drop t10  ***
@@ -550,16 +542,15 @@ INSERT INTO t11 () VALUES(1, at b1,'Testing
 
 --echo
 --echo ********************************************
---echo *** Expect slave to fail with Error 1523 ***
+--echo *** Expect slave to fail with Error 1535 ***
 --echo ********************************************
 --echo
 connection slave;
-source include/wait_for_slave_sql_to_stop.inc;
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
---query_vertical SHOW SLAVE STATUS
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-START SLAVE;
+# 1535 = ER_BINLOG_ROW_WRONG_TABLE_DEF
+--let $slave_sql_errno= 1535
+--let $slave_skip_counter= 2
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error_and_skip.inc
 
 --echo
 --echo *** Drop t11  ***
@@ -697,10 +688,10 @@ SELECT c1,c3,hex(c4),c5,c6 FROM t14 ORDE
 # Remove below once fixed
 #***************************
 connection slave;
-source include/wait_for_slave_sql_to_stop.inc;
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
---query_vertical SHOW SLAVE STATUS
+# 1091 = ER_CANT_DROP_FIELD_OR_KEY
+--let $slave_sql_errno= 1091
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error.inc
 #***************************
 
 STOP SLAVE;
@@ -763,10 +754,10 @@ SELECT c1,hex(c4),c5,c6,c7,c2 FROM t15 O
 --echo ********************************************
 --echo
 connection slave;
-source include/wait_for_slave_sql_to_stop.inc;
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
---query_vertical SHOW SLAVE STATUS
+# 1054 = ER_BAD_FIELD_ERROR
+--let $slave_sql_errno= 1054
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error.inc
 STOP SLAVE;
 RESET SLAVE;
 
@@ -840,10 +831,10 @@ SELECT c1,hex(c4),c5,c6,c7 FROM t16 ORDE
 --echo *****************
 --echo
 connection slave;
-source include/wait_for_slave_sql_to_stop.inc;
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
---query_vertical SHOW SLAVE STATUS
+# 1072 = ER_KEY_COLUMN_DOES_NOT_EXITS
+--let $slave_sql_errno= 1072
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error.inc
 STOP SLAVE;
 RESET SLAVE;
 

=== modified file 'mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test'
--- a/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test	2009-10-22 00:21:50 +0000
+++ b/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test	2010-05-25 03:39:45 +0000
@@ -96,10 +96,9 @@ SELECT * FROM t2 ORDER BY a;
 --echo *** Start Slave ***
 connection slave;
 START SLAVE;
-source include/wait_for_slave_sql_to_stop.inc;
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
---query_vertical SHOW SLAVE STATUS
+--let $slave_sql_errno= 1535
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error.inc
 STOP SLAVE;
 RESET SLAVE;
 SELECT * FROM t2 ORDER BY a;
@@ -146,15 +145,13 @@ set @b1 = concat(@b1, at b1);
 INSERT INTO t3 () VALUES(@b1,2,'Kyle, TEX'),(@b1,1,'JOE AUSTIN'),(@b1,4,'QA TESTING');
 
 --echo ********************************************
---echo *** Expect slave to fail with Error 1522 ***
+--echo *** Expect slave to fail with Error 1535 ***
 --echo ********************************************
 connection slave;
---source include/wait_for_slave_sql_to_stop.inc
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
---query_vertical SHOW SLAVE STATUS
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-START SLAVE;
+--let $slave_sql_errno= 1535
+--let $slave_skip_counter= 2
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error_and_skip.inc
 
 --echo *** Drop t3  ***
 connection master;
@@ -191,15 +188,13 @@ INSERT INTO t4 () VALUES(100.22,2,'Kyle,
                         (30000.22,4,'QA TESTING');
 
 --echo ********************************************
---echo *** Expect slave to fail with Error 1522 ***
+--echo *** Expect slave to fail with Error 1535 ***
 --echo ********************************************
 connection slave;
---source include/wait_for_slave_sql_to_stop.inc
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
---query_vertical SHOW SLAVE STATUS
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-START SLAVE;
+--let $slave_sql_errno= 1535
+--let $slave_skip_counter= 2
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error_and_skip.inc
 
 --echo *** Drop t4  ***
 connection master;
@@ -236,15 +231,13 @@ INSERT INTO t5 () VALUES(1,'Kyle',200.23
                         (2,'JOE',300.01,0,'b2b2',1.0000009);
 
 --echo ********************************************
---echo *** Expect slave to fail with Error 1522 ***
+--echo *** Expect slave to fail with Error 1535 ***
 --echo ********************************************
 connection slave;
---source include/wait_for_slave_sql_to_stop.inc
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
---query_vertical SHOW SLAVE STATUS
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-START SLAVE;
+--let $slave_sql_errno= 1535
+--let $slave_skip_counter= 2
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error_and_skip.inc
 
 --echo *** Drop t5  ***
 connection master;
@@ -282,13 +275,12 @@ INSERT INTO t6 () VALUES(1,'Kyle',200.23
                         (2,'JOE',300.01,0);
 
 --echo ********************************************
---echo *** Expect slave to fail with Error 1522 ***
+--echo *** Expect slave to fail with Error 1535 ***
 --echo ********************************************
 connection slave;
---source include/wait_for_slave_sql_to_stop.inc
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
---query_vertical SHOW SLAVE STATUS
+--let $slave_sql_errno= 1535
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error.inc
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3;
 #START SLAVE;
 
@@ -387,12 +379,10 @@ INSERT INTO t8 () VALUES(1, at b1,'Kyle'),(
 ### Uncomment once bug is fixed
 
 #connection slave;
-#wait_for_slave_to_stop;
-#--replace_result $MASTER_MYPORT MASTER_PORT
-#--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
-#--query_vertical SHOW SLAVE STATUS
-#SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-#START SLAVE;
+#--let $slave_sql_errno= SOMETHING
+#--let $slave_skip_counter= 2
+#--let $show_slave_sql_error= 1
+#--source include/wait_for_slave_sql_error_and_skip.inc
 
 --echo *** Drop t8  ***
 connection master;
@@ -451,12 +441,10 @@ if (`SELECT $engine_type != 'NDB'`)
   # todo: fix Bug #43992 slave sql thread can't tune own sql_mode ...
   # and add/restore waiting for stop test
 
-  #--source include/wait_for_slave_sql_to_stop.inc
-  #--replace_result $MASTER_MYPORT MASTER_PORT
-  #--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
-  #--query_vertical SHOW SLAVE STATUS
-  #SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-  #START SLAVE;
+  #--let $slave_sql_errno= SOMETHING
+  #--let $slave_skip_counter= 2
+  #--let $show_slave_sql_error= 1
+  #--source include/wait_for_slave_sql_error_and_skip.inc
 }
 
 #--echo *** Drop t9  ***
@@ -491,15 +479,13 @@ set @b1 = concat(@b1, at b1);
 INSERT INTO t10 () VALUES(1, at b1,'Kyle'),(2, at b1,'JOE'),(3, at b1,'QA');
 
 --echo ********************************************
---echo *** Expect slave to fail with Error 1522 ***
+--echo *** Expect slave to fail with Error 1535 ***
 --echo ********************************************
 connection slave;
---source include/wait_for_slave_sql_to_stop.inc
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
---query_vertical SHOW SLAVE STATUS
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-START SLAVE;
+--let $slave_sql_errno= 1535
+--let $slave_skip_counter= 2
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error_and_skip.inc
 
 --echo *** Drop t10  ***
 connection master;
@@ -535,15 +521,13 @@ set @b1 = concat(@b1, at b1);
 INSERT INTO t11 () VALUES(1, at b1,'Kyle'),(2, at b1,'JOE'),(3, at b1,'QA');
 
 --echo ********************************************
---echo *** Expect slave to fail with Error 1522 ***
+--echo *** Expect slave to fail with Error 1535 ***
 --echo ********************************************
 connection slave;
---source include/wait_for_slave_sql_to_stop.inc
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
---query_vertical SHOW SLAVE STATUS
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-START SLAVE;
+--let $slave_sql_errno= 1535
+--let $slave_skip_counter= 2
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error_and_skip.inc
 
 --echo *** Drop t11  ***
 connection master;
@@ -810,12 +794,10 @@ ALTER TABLE t15 ADD COLUMN c6 INT AFTER
 --echo *** Expect slave to fail with Error 1060 ***
 --echo ********************************************
 connection slave;
---source include/wait_for_slave_sql_to_stop.inc
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
---query_vertical SHOW SLAVE STATUS
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
-START SLAVE;
+--let $slave_sql_errno= 1060
+--let $slave_skip_counter= 1
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error_and_skip.inc
 
 --echo *** Try to insert in master ****
 connection master;
@@ -918,15 +900,13 @@ connection master;
 INSERT INTO t17 () VALUES(9223372036854775807,2,'Kyle, TEX');
 
 --echo ********************************************
---echo *** Expect slave to fail with Error 1522 ***
+--echo *** Expect slave to fail with Error 1535 ***
 --echo ********************************************
 connection slave;
---source include/wait_for_slave_sql_to_stop.inc
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
---query_vertical SHOW SLAVE STATUS
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-START SLAVE;
+--let $slave_sql_errno= 1535
+--let $slave_skip_counter= 2
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error_and_skip.inc
 
 --echo ** DROP table t17 ***
 connection master;

=== modified file 'mysql-test/extra/rpl_tests/rpl_flsh_tbls.test'
--- a/mysql-test/extra/rpl_tests/rpl_flsh_tbls.test	2009-02-19 09:01:25 +0000
+++ b/mysql-test/extra/rpl_tests/rpl_flsh_tbls.test	2010-08-02 09:01:24 +0000
@@ -20,19 +20,15 @@ rename table t1 to t5, t2 to t1;
 # first don't write it to the binlog, to test the NO_WRITE_TO_BINLOG keyword.
 flush no_write_to_binlog tables;
 # Check that it's not in the binlog.
---replace_result $SERVER_VERSION SERVER_VERSION
---replace_column 2 # 5 #
---replace_regex /table_id: [0-9]+/table_id: #/
-eval SHOW BINLOG EVENTS FROM $rename_event_pos ;
+let $binlog_start= $rename_event_pos;
+source include/show_binlog_events.inc;
 # Check that the master is not confused.
 select * from t3;
 # This FLUSH should go into the binlog to not confuse the slave.
 flush tables;
 # Check that it's in the binlog.
---replace_result $SERVER_VERSION SERVER_VERSION
---replace_column 2 # 5 #
---replace_regex /table_id: [0-9]+/table_id: #/
-eval SHOW BINLOG EVENTS FROM $rename_event_pos ;
+let $wait_binlog_event= flush tables;
+source include/wait_for_binlog_event.inc;
 
 sync_slave_with_master;
 # Check that the slave is not confused.

=== modified file 'mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test'
--- a/mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test	2010-04-28 12:52:24 +0000
+++ b/mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test	2010-08-02 09:01:24 +0000
@@ -68,19 +68,15 @@ eval SET DEBUG_SYNC=$debug_sync_action;
 
 # Show slave last IO errno
 connection slave;
-source include/wait_for_slave_io_error.inc;
-let $last_io_errno= query_get_value("show slave status", Last_IO_Errno, 1);
 --echo Check network error happened here
-if (`SELECT '$last_io_errno' = '2013' || # CR_SERVER_LOST
-            '$last_io_errno' = '2003' || # CR_CONN_HOST_ERROR
-            '$last_io_errno' = '2002' || # CR_CONNECTION_ERROR
-            '$last_io_errno' = '2006' || # CR_SERVER_GONE_ERROR
-            '$last_io_errno' = '1040' || # ER_CON_COUNT_ERROR
-            '$last_io_errno' = '1053'    # ER_SERVER_SHUTDOWN
-            `)
-{
-  --echo NETWORK ERROR
-}
+# '2013' CR_SERVER_LOST 
+# '2003' CR_CONN_HOST_ERROR 
+# '2002' CR_CONNECTION_ERROR 
+# '2006' CR_SERVER_GONE_ERROR 
+# '1040' ER_CON_COUNT_ERROR 
+# '1053' ER_SERVER_SHUTDOWN
+let $slave_io_errno= 1040, 1053, 2002, 2003, 2006, 2013;
+source include/wait_for_slave_io_error.inc;
 
 # deactivate the sync point of get_master_version_and_clock()
 # now to avoid restarting IO-thread to re-enter it.

=== modified file 'mysql-test/extra/rpl_tests/rpl_insert_delayed.test'
--- a/mysql-test/extra/rpl_tests/rpl_insert_delayed.test	2007-09-27 14:05:07 +0000
+++ b/mysql-test/extra/rpl_tests/rpl_insert_delayed.test	2010-08-02 09:01:24 +0000
@@ -90,7 +90,7 @@ connection master;
 # Bug #29571: INSERT DELAYED IGNORE written to binary log on the master but
 # on the slave
 #
-if  (`SELECT @@global.binlog_format != 'ROW'`)
+if  ($binlog_format_statement)
 {
   #flush the logs before the test
   connection slave;
@@ -103,22 +103,23 @@ CREATE TABLE t1(a int, UNIQUE(a));
 INSERT DELAYED IGNORE INTO t1 VALUES(1);
 INSERT DELAYED IGNORE INTO t1 VALUES(1);
 flush table t1; # to wait for INSERT DELAYED to be done
-
-if  (`SELECT @@global.binlog_format != 'ROW'`)
+if  ($binlog_format_statement)
 {
   #must show two INSERT DELAYED
-  --replace_column 1 x 2 x 3 x 4 x 5 x
-  show binlog events in 'master-bin.000002' LIMIT 2,2;
+  --let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
+  --let $binlog_limit= 1,2
+  --source include/show_binlog_events.inc
 }
 select * from t1;
 
 sync_slave_with_master;
 echo On slave;
-if  (`SELECT @@global.binlog_format != 'ROW'`)
+if  ($binlog_format_statement)
 {
   #must show two INSERT DELAYED
-  --replace_column 1 x 2 x 3 x 4 x 5 x
-  show binlog events in 'slave-bin.000002' LIMIT 2,2;
+  --let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
+  --let $binlog_limit= 1,2
+  --source include/show_binlog_events.inc
 }
 select * from t1;
 

=== modified file 'mysql-test/extra/rpl_tests/rpl_log.test'
--- a/mysql-test/extra/rpl_tests/rpl_log.test	2009-02-02 11:44:18 +0000
+++ b/mysql-test/extra/rpl_tests/rpl_log.test	2010-05-24 13:54:08 +0000
@@ -11,11 +11,9 @@
 # (otherwise RESET MASTER may come too early).
 sync_slave_with_master;
 source include/stop_slave.inc;
---source include/wait_for_slave_to_stop.inc
 reset master;
 reset slave;
-start slave;
---source include/wait_for_slave_to_start.inc
+source include/start_slave.inc;
 
 let $VERSION=`select version()`;
 
@@ -31,19 +29,17 @@ eval create table t1 (word char(20) not
 --replace_result $LOAD_FILE LOAD_FILE
 eval load data infile '$LOAD_FILE' into table t1 ignore 1 lines;
 select count(*) from t1;
---replace_result $VERSION VERSION
---replace_column 2 # 5 #
---replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
-show binlog events;
---replace_column 2 # 5 #
---replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
-show binlog events from 106 limit 1;
---replace_column 2 # 5 #
---replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
-show binlog events from 106 limit 2;
---replace_column 2 # 5 #
---replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
-show binlog events from 106 limit 2,1;
+source include/show_binlog_events.inc;
+
+let $binlog_limit= 1;
+source include/show_binlog_events.inc;
+
+let $binlog_limit= 2;
+source include/show_binlog_events.inc;
+
+let $binlog_limit= 2,1;
+source include/show_binlog_events.inc;
+let $binlog_limit=;
 flush logs;
 
 # We need an extra update before doing save_master_pos.
@@ -84,27 +80,24 @@ connection master;
 eval create table t2 (n int)ENGINE=$engine_type;
 insert into t2 values (1);
 source include/show_binlog_events.inc;
---replace_result $VERSION VERSION
---replace_regex /file_id=[0-9]+/file_id=#/ /block_len=[0-9]+/block_len=#/ /infile '.+'/infile 'words.dat'/
---replace_column 2 # 5 #
---replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
-show binlog events in 'master-bin.000002';
+
+let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
+source include/show_binlog_events.inc;
+
 --replace_column 2 #
 show binary logs;
 sync_slave_with_master;
---source include/wait_for_slave_to_start.inc
 --replace_column 2 #
 show binary logs;
---replace_result $MASTER_MYPORT MASTER_PORT $VERSION VERSION
---replace_column 2 # 5 #
---replace_regex /file_id=[0-9]+/file_id=#/ /block_len=[0-9]+/block_len=#/ /INFILE '.+'/INFILE 'words.dat'/
---replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
-show binlog events in 'slave-bin.000001' from 4;
---replace_result $MASTER_MYPORT MASTER_PORT $VERSION VERSION
---replace_column 2 # 5 #
---replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
-show binlog events in 'slave-bin.000002' from 4;
-source include/show_slave_status.inc;
+
+let $binlog_file=;
+source include/show_binlog_events.inc;
+
+let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
+source include/show_binlog_events.inc;
+let $binlog_file=;
+
+source include/check_slave_is_running.inc;
 
 # Need to recode the following
 

=== modified file 'mysql-test/extra/rpl_tests/rpl_max_relay_size.test'
--- a/mysql-test/extra/rpl_tests/rpl_max_relay_size.test	2008-01-14 07:38:02 +0000
+++ b/mysql-test/extra/rpl_tests/rpl_max_relay_size.test	2010-05-24 13:54:08 +0000
@@ -43,7 +43,7 @@ set global max_relay_log_size=8192-1; #
 select @@global.max_relay_log_size;
 start slave;
 sync_with_master;
-source include/show_slave_status2.inc;
+--source include/check_slave_is_running.inc
 
 --echo #
 --echo # Test 2
@@ -55,7 +55,7 @@ set global max_relay_log_size=(5*4096);
 query_vertical select @@global.max_relay_log_size;
 start slave;
 sync_with_master;
-source include/show_slave_status2.inc;
+--source include/check_slave_is_running.inc
 
 --echo #
 --echo # Test 3: max_relay_log_size = 0
@@ -67,7 +67,7 @@ set global max_relay_log_size=0;
 query_vertical select @@global.max_relay_log_size;
 start slave;
 sync_with_master;
-source include/show_slave_status2.inc;
+--source include/check_slave_is_running.inc
 
 --echo #
 --echo # Test 4: Tests below are mainly to ensure that we have not coded with wrong assumptions
@@ -78,7 +78,6 @@ reset slave;
 # test of relay log rotation when the slave is stopped
 # (to make sure it does not crash).
 flush logs;
-source include/show_slave_status2.inc;
 
 --echo #
 --echo # Test 5
@@ -93,10 +92,8 @@ flush logs;
 # log we just closed. But a trick to achieve this is do an update on the master.
 connection master;
 create table t1 (a int);
-save_master_pos;
-connection slave;
-sync_with_master;
-source include/show_slave_status2.inc;
+sync_slave_with_master;
+--source include/check_slave_is_running.inc
 
 --echo #
 --echo # Test 6: one more rotation, to be sure Relay_Log_Space is correctly updated
@@ -105,10 +102,8 @@ source include/show_slave_status2.inc;
 flush logs;
 connection master;
 drop table t1;
-save_master_pos;
-connection slave;
-sync_with_master;
-source include/show_slave_status2.inc;
+sync_slave_with_master;
+--source include/check_slave_is_running.inc
 
 connection master;
 # test that the absence of relay logs does not make a master crash

=== modified file 'mysql-test/extra/rpl_tests/rpl_ndb_apply_status.test'
--- a/mysql-test/extra/rpl_tests/rpl_ndb_apply_status.test	2008-02-13 23:02:25 +0000
+++ b/mysql-test/extra/rpl_tests/rpl_ndb_apply_status.test	2010-05-24 13:54:08 +0000
@@ -56,24 +56,23 @@ connection master;
 --echo # since insert is done with transactional engine, expect a BEGIN
 --echo # at <start_pos>
 --echo
---replace_result $start_pos <start_pos>
---replace_column 5 #
---eval show binlog events from $start_pos limit 1
+--let $binlog_start= $start_pos
+--let $binlog_limit= 1
+--source include/show_binlog_events.inc
 
 --echo
 --echo # Now the insert, one step after
 --echo
---replace_result $start_pos <start_pos>
---replace_column 2 # 5 #
---eval show binlog events from $start_pos limit 1,1
+--let $binlog_start= $start_pos
+--let $binlog_limit= 1,1
+--source include/show_binlog_events.inc
 
 --echo
 --echo # and the COMMIT should be at <end_pos>
 --echo
---replace_result $start_pos <start_pos> $end_pos <end_pos>
---replace_column 2 #
---replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
---eval show binlog events from $start_pos limit 2,1
+--let $binlog_start= $start_pos
+--let $binlog_limit= 2,1
+--source include/show_binlog_events.inc
 
 --echo
 
@@ -89,18 +88,17 @@ commit;
 --source include/select_ndb_apply_status.inc
 
 connection master;
---replace_result $start_pos <start_pos>
---replace_column 5 #
---eval show binlog events from $start_pos limit 1
---echo
---replace_result $start_pos <start_pos>
---replace_column 2 # 4 # 5 #
---eval show binlog events from $start_pos limit 1,2
---echo
---replace_result $start_pos <start_pos> $end_pos <end_pos>
---replace_column 2 #
---replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
---eval show binlog events from $start_pos limit 3,1
+--let $binlog_start= $start_pos
+--let $binlog_limit= 1
+--source include/show_binlog_events.inc
+--echo
+--let $binlog_start= $start_pos
+--let $binlog_limit= 1,2
+--source include/show_binlog_events.inc
+--echo
+--let $binlog_start= $start_pos
+--let $binlog_limit= 3,1
+--source include/show_binlog_events.inc
 
 --echo
 

=== added file 'mysql-test/extra/rpl_tests/rpl_record_compare.test'
--- a/mysql-test/extra/rpl_tests/rpl_record_compare.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/extra/rpl_tests/rpl_record_compare.test	2010-04-21 12:47:55 +0000
@@ -0,0 +1,68 @@
+
+#
+# BUG#52868: Wrong handling of NULL value during update, replication out of sync
+#
+-- echo ## case #1 - last_null_bit_pos==0 in record_compare without X bit
+
+-- source include/master-slave-reset.inc
+-- connection master
+
+-- eval CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bigint(20) DEFAULT 0, c3 bigint(20) DEFAULT 0, c4 varchar(1) DEFAULT '', c5 bigint(20) DEFAULT 0, c6 bigint(20) DEFAULT 0, c7 bigint(20) DEFAULT 0, c8 bigint(20) DEFAULT 0) ENGINE=$engine DEFAULT CHARSET=latin1
+
+INSERT INTO t1 ( c5, c6 ) VALUES ( 1   , 35 );
+INSERT INTO t1 ( c5, c6 ) VALUES ( NULL, 35 );
+-- disable_warnings
+UPDATE t1 SET c5 = 'a';
+-- enable_warnings
+-- sync_slave_with_master
+
+-- let $diff_table_1= master:test.t1
+-- let $diff_table_2= slave:test.t1
+-- source include/diff_tables.inc
+
+--connection master
+DROP TABLE t1;
+-- sync_slave_with_master
+
+-- echo ## case #1.1 - last_null_bit_pos==0 in record_compare with X bit
+-- echo ##             (1 column less and no varchar)
+-- source include/master-slave-reset.inc
+-- connection master
+
+-- eval CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bigint(20) DEFAULT 0, c3 bigint(20) DEFAULT 0, c4 bigint(20) DEFAULT 0, c5 bigint(20) DEFAULT 0, c6 bigint(20) DEFAULT 0, c7 bigint(20) DEFAULT 0) ENGINE=$engine DEFAULT CHARSET=latin1
+
+INSERT INTO t1 ( c5, c6 ) VALUES ( 1   , 35 );
+INSERT INTO t1 ( c5, c6 ) VALUES ( NULL, 35 );
+-- disable_warnings
+UPDATE t1 SET c5 = 'a';
+-- enable_warnings
+-- sync_slave_with_master
+
+-- let $diff_table_1= master:test.t1
+-- let $diff_table_2= slave:test.t1
+-- source include/diff_tables.inc
+
+--connection master
+DROP TABLE t1;
+-- sync_slave_with_master
+
+-- echo ## case #2 - X bit is wrongly set.
+
+-- source include/master-slave-reset.inc
+-- connection master
+
+-- eval CREATE TABLE t1 (c1 int, c2 varchar(1) default '') ENGINE=$engine DEFAULT CHARSET= latin1
+INSERT INTO t1(c1) VALUES (10);
+INSERT INTO t1(c1) VALUES (NULL);
+UPDATE t1 SET c1= 0;
+-- sync_slave_with_master
+
+-- let $diff_table_1= master:test.t1
+-- let $diff_table_2= slave:test.t1
+-- source include/diff_tables.inc
+
+-- connection master
+DROP TABLE t1; 
+-- sync_slave_with_master
+
+

=== modified file 'mysql-test/extra/rpl_tests/rpl_reset_slave.test'
--- a/mysql-test/extra/rpl_tests/rpl_reset_slave.test	2009-06-26 11:05:56 +0000
+++ b/mysql-test/extra/rpl_tests/rpl_reset_slave.test	2010-05-24 13:54:08 +0000
@@ -9,36 +9,32 @@
 # RESET SLAVE.
 
 -- source include/master-slave.inc
-connection master;
-save_master_pos;
-connection slave;
-sync_with_master;
-source include/show_slave_status2.inc;
+sync_slave_with_master;
+let $status_items= Master_User, Master_Host;
+source include/show_slave_status.inc;
 
-stop slave;
+source include/stop_slave.inc;
 change master to master_user='test';
-source include/show_slave_status2.inc;
+source include/show_slave_status.inc;
 
 reset slave;
-source include/show_slave_status2.inc;
+source include/show_slave_status.inc;
 
-start slave;
+source include/start_slave.inc;
 sync_with_master;
-source include/show_slave_status2.inc;
+source include/show_slave_status.inc;
 
 # test of crash with temp tables & RESET SLAVE
 # (test to see if RESET SLAVE clears temp tables in memory and disk)
-stop slave;
+source include/stop_slave.inc;
 reset slave;
-start slave;
+source include/start_slave.inc;
 connection master;
 create temporary table t1 (a int);
-save_master_pos;
-connection slave;
-sync_with_master;
-stop slave;
+sync_slave_with_master;
+source include/stop_slave.inc;
 reset slave;
-start slave;
+source include/start_slave.inc;
 sync_with_master;
 show status like 'slave_open_temp_tables';
 
@@ -47,10 +43,9 @@ show status like 'slave_open_temp_tables
 #
 
 # clearing the status
-stop slave;
+source include/stop_slave.inc;
 reset slave;
-let $last_io_errno= query_get_value(SHOW SLAVE STATUS, Last_IO_Errno, 1);
-echo *** errno must be zero: $last_io_errno ***;
+source include/check_slave_no_error.inc;
 
 #
 # verifying start slave resets Last_IO_Error and Last_IO_Errno.
@@ -58,19 +53,13 @@ echo *** errno must be zero: $last_io_er
 
 change master to master_user='impossible_user_name';
 start slave;
+let $slave_io_errno= 1045;
 source include/wait_for_slave_io_error.inc;
-let $last_io_errno= query_get_value(SHOW SLAVE STATUS, Last_IO_Errno, 1);
---disable_query_log
-eval SELECT $last_io_errno > 0 as ONE;
---enable_query_log
 
 source include/stop_slave.inc;
 change master to master_user='root';
 source include/start_slave.inc;
-let $last_io_errno= query_get_value(SHOW SLAVE STATUS, Last_IO_Errno, 1);
-let $last_io_error= query_get_value(SHOW SLAVE STATUS, Last_IO_Error, 1);
---echo *** last errno must be  zero: $last_io_errno ***
---echo *** last error must be blank: $last_io_error ***
+source include/check_slave_no_error.inc;
 
 #
 # verifying reset slave resets Last_{IO,SQL}_Err{or,no}
@@ -79,19 +68,9 @@ let $last_io_error= query_get_value(SHOW
 source include/stop_slave.inc;
 change master to master_user='impossible_user_name';
 start slave;
+let $slave_io_errno= 1045;
 source include/wait_for_slave_io_error.inc;
-let $last_io_errno= query_get_value(SHOW SLAVE STATUS, Last_IO_Errno, 1);
---disable_query_log
-eval SELECT $last_io_errno > 0 as ONE;
---enable_query_log
 
 source include/stop_slave.inc;
 reset slave;
-let $last_io_errno= query_get_value(SHOW SLAVE STATUS, Last_IO_Errno, 1);
-let $last_io_error= query_get_value(SHOW SLAVE STATUS, Last_IO_Error, 1);
-let $last_sql_errno= query_get_value(SHOW SLAVE STATUS, Last_SQL_Errno, 1);
-let $last_sql_error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1);
---echo *** io  last errno must be  zero: $last_io_errno  ***
---echo *** io  last error must be blank: $last_io_error  ***
---echo *** sql last errno must be  zero: $last_sql_errno ***
---echo *** sql last error must be blank: $last_sql_error ***
+source include/check_slave_no_error.inc;

=== modified file 'mysql-test/extra/rpl_tests/rpl_row_basic.test'
--- a/mysql-test/extra/rpl_tests/rpl_row_basic.test	2008-11-06 17:10:09 +0000
+++ b/mysql-test/extra/rpl_tests/rpl_row_basic.test	2010-05-24 13:54:08 +0000
@@ -259,10 +259,7 @@ DELETE FROM t1;
 query_vertical SELECT COUNT(*) FROM t1 ORDER BY c1,c2;
 sync_slave_with_master;
 set @@global.slave_exec_mode= default;
-let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
-disable_query_log;
-eval SELECT "$last_error" AS Last_SQL_Error;
-enable_query_log;
+source include/check_slave_is_running.inc;
 query_vertical SELECT COUNT(*) FROM t1 ORDER BY c1,c2;
 
 # BUG#37076: TIMESTAMP/DATETIME values are not replicated correctly
@@ -376,11 +373,10 @@ INSERT INTO t3 VALUES (1, "", 1);
 INSERT INTO t3 VALUES (2, repeat(_utf8'a', 128), 2);
 
 connection slave;
-source include/wait_for_slave_sql_to_stop.inc;
-let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
-disable_query_log;
-eval SELECT "$last_error" AS Last_SQL_Error;
-enable_query_log;
+# 1535 = ER_BINLOG_ROW_WRONG_TABLE_DEF 
+--let $slave_sql_errno= 1535 
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error.inc
 connection master;
 RESET MASTER;
 connection slave;
@@ -405,11 +401,10 @@ INSERT INTO t5 VALUES (1, "", 1);
 INSERT INTO t5 VALUES (2, repeat(_utf8'a', 255), 2);
 
 connection slave;
-source include/wait_for_slave_sql_to_stop.inc;
-let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
-disable_query_log;
-eval SELECT "$last_error" AS Last_SQL_Error;
-enable_query_log;
+# 1535 = ER_BINLOG_ROW_WRONG_TABLE_DEF 
+--let $slave_sql_errno= 1535 
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error.inc
 connection master;
 RESET MASTER;
 connection slave;
@@ -424,11 +419,10 @@ INSERT INTO t6 VALUES (1, "", 1);
 INSERT INTO t6 VALUES (2, repeat(_utf8'a', 255), 2);
 
 connection slave;
-source include/wait_for_slave_sql_to_stop.inc;
-let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
-disable_query_log;
-eval SELECT "$last_error" AS Last_SQL_Error;
-enable_query_log;
+# 1535 = ER_BINLOG_ROW_WRONG_TABLE_DEF 
+--let $slave_sql_errno= 1535 
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error.inc
 connection master;
 RESET MASTER;
 connection slave;

=== modified file 'mysql-test/extra/rpl_tests/rpl_row_tabledefs.test'
--- a/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test	2009-10-22 00:10:42 +0000
+++ b/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test	2010-05-24 13:54:08 +0000
@@ -138,9 +138,7 @@ SELECT * FROM t2;
 sync_slave_with_master;
 --echo **** On Slave ****
 SELECT * FROM t2;
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 35 <Last_IO_Errno> 36 <Last_IO_Error> 38 <Last_SQL_Error>
---query_vertical SHOW SLAVE STATUS
+--source include/check_slave_is_running.inc
 
 connection master;
 INSERT INTO t9 VALUES (4);
@@ -149,12 +147,10 @@ sync_slave_with_master;
 connection master;
 INSERT INTO t4 VALUES (4);
 connection slave;
---source include/wait_for_slave_sql_to_stop.inc
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 35 <Last_IO_Errno> 36 <Last_IO_Error> 38 <Last_SQL_Error>
---query_vertical SHOW SLAVE STATUS
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-START SLAVE;
+--let $slave_skip_counter= 2
+--let $slave_sql_errno= 1535
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error_and_skip.inc
 
 connection master;
 INSERT INTO t9 VALUES (5);
@@ -163,12 +159,10 @@ sync_slave_with_master;
 connection master;
 INSERT INTO t5 VALUES (5,10,25);
 connection slave;
---source include/wait_for_slave_sql_to_stop.inc
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 35 <Last_IO_Errno> 36 <Last_IO_Error> 38 <Last_SQL_Error>
---query_vertical SHOW SLAVE STATUS
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-START SLAVE;
+--let $slave_skip_counter= 2
+--let $slave_sql_errno= 1535
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error_and_skip.inc
 
 connection master;
 INSERT INTO t9 VALUES (6);
@@ -177,19 +171,15 @@ sync_slave_with_master;
 connection master;
 INSERT INTO t6 VALUES (6,12,36);
 connection slave;
---source include/wait_for_slave_sql_to_stop.inc
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 35 <Last_IO_Errno> 36 <Last_IO_Error> 38 <Last_SQL_Error>
---query_vertical SHOW SLAVE STATUS
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-START SLAVE;
+--let $slave_skip_counter= 2
+--let $slave_sql_errno= 1535
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error_and_skip.inc
 
 connection master;
 INSERT INTO t9 VALUES (6);
 sync_slave_with_master;
---replace_result $SLAVE_MYPORT SLAVE_PORT
---replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 35 <Last_IO_Errno> 36 <Last_IO_Error> 38 <Last_SQL_Error>
---query_vertical SHOW SLAVE STATUS
+--source include/check_slave_is_running.inc
 
 # Testing some tables extra field that can be null and cannot be null
 # (but have default values)

=== added file 'mysql-test/include/check_concurrent_insert.inc'
--- a/mysql-test/include/check_concurrent_insert.inc	1970-01-01 00:00:00 +0000
+++ b/mysql-test/include/check_concurrent_insert.inc	2010-05-27 20:07:40 +0000
@@ -0,0 +1,96 @@
+#
+# SUMMARY
+#   Check if statement reading table '$table' allows concurrent
+#   inserts in it.
+#
+# PARAMETERS 
+#   $table         Table in which concurrent inserts should be allowed.
+#   $con_aux1      Name of the first auxiliary connection to be used by this
+#                  script.
+#   $con_aux2      Name of the second auxiliary connection to be used by this
+#                  script.
+#   $statement     Statement to be checked.
+#   $restore_table Table which might be modified by statement to be checked
+#                  and thus needs backing up before its execution and
+#                  restoring after it (can be empty).
+#
+# EXAMPLE
+#    lock_sync.test
+#
+--disable_result_log
+--disable_query_log
+
+# Reset DEBUG_SYNC facility for safety.
+set debug_sync= "RESET";
+
+if (`SELECT '$restore_table' <> ''`)
+{
+--eval create temporary table t_backup select * from $restore_table;
+}
+
+connection $con_aux1;
+set debug_sync='after_lock_tables_takes_lock SIGNAL parked WAIT_FOR go';
+--send_eval $statement;
+
+connection $con_aux2;
+set debug_sync='now WAIT_FOR parked';
+--send_eval insert into $table (i) values (0);
+
+--enable_result_log
+--enable_query_log
+connection default;
+# Wait until concurrent insert is successfully executed while
+# statement being checked has its tables locked.
+# We use wait_condition.inc instead of simply reaping 
+# concurrent insert here in order to avoid deadlocks if test
+# fails and to time out gracefully instead.
+let $wait_condition=
+  select count(*) = 0 from information_schema.processlist
+  where info = "insert into $table (i) values (0)";
+--source include/wait_condition.inc
+
+--disable_result_log
+--disable_query_log
+
+if ($success)
+{
+# Apparently concurrent insert was successfully executed.
+# To be safe against wait_condition.inc succeeding due to
+# races let us first reap concurrent insert to ensure that
+# it has really been successfully executed.
+connection $con_aux2;
+--reap
+connection default;
+set debug_sync= 'now SIGNAL go';
+connection $con_aux1;
+--reap
+connection default;
+--echo Success: '$statement' allows concurrent inserts into '$table'.
+}
+if (!$success)
+{
+# Waiting has timed out. Apparently concurrent insert was blocked.
+# So to be able to continue we need to end our statement first.
+set debug_sync= 'now SIGNAL go';
+connection $con_aux1;
+--reap
+connection $con_aux2;
+--reap
+connection default;
+--echo Error: '$statement' doesn't allow concurrent inserts into '$table'!
+}
+
+--eval delete from $table where i = 0;
+
+if (`SELECT '$restore_table' <> ''`)
+{
+--eval truncate table $restore_table;
+--eval insert into $restore_table select * from t_backup;
+drop temporary table t_backup;
+}
+
+# Clean-up. Reset DEBUG_SYNC facility after use.
+set debug_sync= "RESET";
+
+--enable_result_log
+--enable_query_log

=== added file 'mysql-test/include/check_no_concurrent_insert.inc'
--- a/mysql-test/include/check_no_concurrent_insert.inc	1970-01-01 00:00:00 +0000
+++ b/mysql-test/include/check_no_concurrent_insert.inc	2010-05-27 20:07:40 +0000
@@ -0,0 +1,81 @@
+#
+# SUMMARY
+#   Check that statement reading table '$table' doesn't allow concurrent
+#   inserts in it.
+#
+# PARAMETERS 
+#   $table         Table in which concurrent inserts should be disallowed.
+#   $con_aux1      Name of the first auxiliary connection to be used by this
+#                  script.
+#   $con_aux2      Name of the second auxiliary connection to be used by this
+#                  script.
+#   $statement     Statement to be checked.
+#   $restore_table Table which might be modified by statement to be checked
+#                  and thus needs backing up before its execution and
+#                  restoring after it (can be empty).
+#
+# EXAMPLE
+#    lock_sync.test
+#
+--disable_result_log
+--disable_query_log
+
+# Reset DEBUG_SYNC facility for safety.
+set debug_sync= "RESET";
+
+if (`SELECT '$restore_table' <> ''`)
+{
+--eval create temporary table t_backup select * from $restore_table;
+}
+
+connection $con_aux1;
+set debug_sync='after_lock_tables_takes_lock SIGNAL parked WAIT_FOR go';
+--send_eval $statement;
+
+connection $con_aux2;
+set debug_sync='now WAIT_FOR parked';
+--send_eval insert into $table (i) values (0);
+
+--enable_result_log
+--enable_query_log
+connection default;
+# Wait until concurrent insert is successfully blocked because
+# of our statement.
+let $wait_condition=
+  select count(*) = 1 from information_schema.processlist
+  where state = "Locked" and info = "insert into $table (i) values (0)";
+--source include/wait_condition.inc
+
+--disable_result_log
+--disable_query_log
+
+set debug_sync= 'now SIGNAL go';
+connection $con_aux1;
+--reap
+connection $con_aux2;
+--reap
+connection default;
+
+if ($success)
+{
+--echo Success: '$statement' doesn't allow concurrent inserts into '$table'.
+}
+if (!$success)
+{
+--echo Error: '$statement' allows concurrent inserts into '$table'!
+}
+
+--eval delete from $table where i = 0;
+
+if (`SELECT '$restore_table' <> ''`)
+{
+--eval truncate table $restore_table;
+--eval insert into $restore_table select * from t_backup;
+drop temporary table t_backup;
+}
+
+# Clean-up. Reset DEBUG_SYNC facility after use.
+set debug_sync= "RESET";
+
+--enable_result_log
+--enable_query_log

=== added file 'mysql-test/include/check_no_row_lock.inc'
--- a/mysql-test/include/check_no_row_lock.inc	1970-01-01 00:00:00 +0000
+++ b/mysql-test/include/check_no_row_lock.inc	2010-05-27 20:07:40 +0000
@@ -0,0 +1,71 @@
+#
+# SUMMARY
+#   Check if statement affecting or reading table '$table' doesn't
+#   take any kind of locks on its rows.
+#
+# PARAMETERS 
+#   $table      Table for which presence of row locks should be checked.
+#   $con_aux    Name of auxiliary connection to be used by this script.
+#   $statement  Statement to be checked.
+#
+# EXAMPLE
+#    innodb_mysql_lock2.test
+#
+--disable_result_log
+--disable_query_log
+
+connection default;
+begin;
+--eval select * from $table for update;
+
+connection $con_aux;
+begin;
+--send_eval $statement;
+
+--enable_result_log
+--enable_query_log
+
+connection default;
+# Wait until statement is successfully executed while
+# all rows in table are X-locked. This means that it
+# does not acquire any row locks.
+# We use wait_condition.inc instead of simply reaping 
+# statement here in order to avoid deadlocks if test
+# fails and to time out gracefully instead.
+let $wait_condition=
+  select count(*) = 0 from information_schema.processlist
+  where info = "$statement";
+--source include/wait_condition.inc
+
+--disable_result_log
+--disable_query_log
+
+if ($success)
+{
+# Apparently statement was successfully executed and thus it
+# has not required any row locks.
+# To be safe against wait_condition.inc succeeding due to
+# races let us first reap the statement being checked to
+# ensure that it has been successfully executed.
+connection $con_aux;
+--reap
+rollback;
+connection default;
+rollback;
+--echo Success: '$statement' doesn't take row locks on '$table'.
+}
+if (!$success)
+{
+# Waiting has timed out. Apparently statement was blocked on
+# some row lock. So to be able to continue we need to unlock
+# rows first.
+rollback;
+connection $con_aux;
+--reap
+rollback;
+connection default;
+--echo Error: '$statement' takes some row locks on '$table'!
+}
+
+--enable_result_log
+--enable_query_log

=== added file 'mysql-test/include/check_shared_row_lock.inc'
--- a/mysql-test/include/check_shared_row_lock.inc	1970-01-01 00:00:00 +0000
+++ b/mysql-test/include/check_shared_row_lock.inc	2010-05-27 20:07:40 +0000
@@ -0,0 +1,61 @@
+#
+# SUMMARY
+#   Check if statement reading table '$table' takes shared locks
+#   on some of its rows.
+#
+# PARAMETERS 
+#   $table          Table for which presence of row locks should be checked.
+#   $con_aux        Name of auxiliary connection to be used by this script.
+#   $statement      Statement to be checked.
+#   $wait_statement Sub-statement which is supposed to acquire locks (should
+#                   be the same as $statement for ordinary statements).
+#
+# EXAMPLE
+#    innodb_mysql_lock2.test
+#
+--disable_result_log
+--disable_query_log
+
+connection default;
+begin;
+--eval select * from $table for update;
+
+connection $con_aux;
+begin;
+--send_eval $statement;
+
+--enable_result_log
+--enable_query_log
+
+connection default;
+# Wait until statement is successfully blocked because
+# all rows in table are X-locked. This means that at
+# least it acquires S-locks on some of rows.
+let $wait_condition=
+  select count(*) = 1 from information_schema.processlist
+  where state in ("Sending data","statistics", "preparing") and
+        info = "$wait_statement";
+--source include/wait_condition.inc
+
+--disable_result_log
+--disable_query_log
+
+rollback;
+
+connection $con_aux;
+--reap
+rollback;
+
+connection default;
+--enable_result_log
+--enable_query_log
+
+if ($success)
+{
+--echo Success: '$statement' takes shared row locks on '$table'.
+}
+
+if (!$success)
+{
+--echo Error: '$statement' hasn't taken shared row locks on '$table'!
+}

=== added file 'mysql-test/include/check_slave_is_running.inc'
--- a/mysql-test/include/check_slave_is_running.inc	1970-01-01 00:00:00 +0000
+++ b/mysql-test/include/check_slave_is_running.inc	2010-05-24 13:54:08 +0000
@@ -0,0 +1,18 @@
+# ==== Purpose ====
+#
+# Assert that the slave threads are running and don't have any errors.
+#
+# ==== Usage ====
+#
+# --source include/check_slave_running.inc
+
+--echo Checking that both slave threads are running.
+
+--let $slave_sql_running = query_get_value(SHOW SLAVE STATUS, Slave_SQL_Running, 1)
+--let $slave_io_running = query_get_value(SHOW SLAVE STATUS, Slave_IO_Running, 1)
+
+if (`SELECT '$slave_sql_running' != 'Yes' OR '$slave_io_running' != 'Yes'`) {
+  --echo Slave not running: Slave_SQL_Running = $slave_sql_running Slave_IO_Running = $slave_io_running
+  --source include/show_rpl_debug_info.inc
+  --die Expected slave to be running, but it was not running.
+}

=== added file 'mysql-test/include/check_slave_no_error.inc'
--- a/mysql-test/include/check_slave_no_error.inc	1970-01-01 00:00:00 +0000
+++ b/mysql-test/include/check_slave_no_error.inc	2010-05-24 13:54:08 +0000
@@ -0,0 +1,17 @@
+# ==== Purpose ====
+#
+# Assert that Slave_SQL_Error and Slave_IO_Error are empty.
+#
+# ==== Usage ====
+#
+# --let $slave_param= Exec_Master_Log_Pos
+# --let $slave_param_value= 4711
+# --source include/check_slave_running.inc
+
+--let $slave_param= Last_SQL_Errno
+--let $slave_param_value= 0
+--source include/check_slave_param.inc
+
+--let $slave_param= Last_IO_Errno
+--let $slave_param_value= 0
+--source include/check_slave_param.inc

=== added file 'mysql-test/include/check_slave_param.inc'
--- a/mysql-test/include/check_slave_param.inc	1970-01-01 00:00:00 +0000
+++ b/mysql-test/include/check_slave_param.inc	2010-05-24 13:54:08 +0000
@@ -0,0 +1,16 @@
+# ==== Purpose ====
+#
+# Assert that a given column in SHOW SLAVE STATUS has a given value.
+#
+# ==== Usage ====
+#
+# --let $slave_param= Exec_Master_Log_Pos
+# --let $slave_param_value= 4711
+# --source include/check_slave_param.inc
+
+--let $_param_value= query_get_value(SHOW SLAVE STATUS, $slave_param, 1)
+if (`SELECT '$_param_value' != '$slave_param_value'`) {
+  --echo Wrong value for $slave_param. Expected '$slave_param_value', got '$_param_value'
+  --source include/show_rpl_debug_info.inc
+  --die Wrong value for slave parameter
+}

=== added file 'mysql-test/include/get_relay_log_pos.inc'
--- a/mysql-test/include/get_relay_log_pos.inc	1970-01-01 00:00:00 +0000
+++ b/mysql-test/include/get_relay_log_pos.inc	2010-05-24 13:54:08 +0000
@@ -0,0 +1,70 @@
+# For a given event which is at position $master_log_pos in the the master's
+# binary log, returns its position in the slave's relay log file
+# $relay_log_file.  
+# The position is stored in the variable $relay_log_pos.
+
+# Usage:
+#   let $relay_log_file= 'relay-log-bin.000001'; 
+#   let $master_log_pos= 106; 
+#   source include/get_relay_log_pos.inc; 
+#   # at this point, get_relay_log_pos.inc sets $relay_log_pos. echo position
+#   # in $relay_log_file: $relay_log_pos. 
+
+if (`SELECT '$relay_log_file' = ''`)
+{
+  --die 'variable $relay_log_file is null'
+}
+
+if (`SELECT '$master_log_pos' = ''`)
+{
+  --die 'variable $master_log_pos is null'
+}
+
+let $MYSQLD_DATADIR= `select @@datadir`;
+let $_suffix= `SELECT UUID()`;
+let $_tmp_file= $MYSQLTEST_VARDIR/tmp/mysqlbinlog.$_suffix;
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/$relay_log_file > $_tmp_file
+
+# All queries in this file should not be logged.
+--disable_query_log
+
+--disable_warnings
+DROP TEMPORARY TABLE IF EXISTS mysqlbinlog_events;
+DROP TEMPORARY TABLE IF EXISTS events_at;
+DROP TEMPORARY TABLE IF EXISTS events_pos;
+CREATE TEMPORARY TABLE mysqlbinlog_events(c1 INT AUTO_INCREMENT KEY, c2 varchar(256));
+
+# Event position is in the comments output by mysqlbinlog, we load this
+# comments into the table 
+# '# at 106' 
+# '# ....  end_log_pos 46'
+eval LOAD DATA LOCAL INFILE '$_tmp_file' INTO TABLE mysqlbinlog_events
+  LINES STARTING BY '#' (c2) SET c1 = NULL;
+--enable_warnings
+
+# Event pos in relay log file is inserted into table events_at
+CREATE TEMPORARY TABLE events_at(c1 INT AUTO_INCREMENT KEY, c2 varchar(256))
+  SELECT c2 FROM mysqlbinlog_events WHERE c2 LIKE ' at%' ORDER BY c1;
+
+# Event pos in master log file is inserted into table events_pos
+CREATE TEMPORARY TABLE events_pos(c1 INT AUTO_INCREMENT KEY, c2 varchar(256))
+  SELECT c2 FROM mysqlbinlog_events WHERE c2 LIKE '% end_log_pos %' ORDER BY c1;
+
+#  events_at                                events_pos
+#  c1------c2--------------------------     c1------c2------------------------
+#  1       ev1's begin pos in relay log     1      ev1's end pos in master log
+#  2       ev2's begin pos in relay log     2      ev2's end pos in master log
+#  3       ev3's begin pos in relay log     3      ev3's end pos in master log
+#  events always keep the same sequence.  
+#  Because event[N]'s end pos is equal to event[N+1]'s begin pos we want to
+#  find event's end pos in relay log, we can find the right relay_log_pos
+#  using the relationship that 'events_pos.c1 = events_at.c1 + 1'
+# 
+# There is a fault that we can't get the relay log position of the last event,
+# as it is not output by mysqlbinlog
+let $relay_log_pos= `SELECT SUBSTRING(a.c2, 5)
+  FROM events_at a, events_pos b
+  WHERE a.c1=b.c1+1 and b.c2 LIKE '% $master_log_pos%'`;
+DROP TEMPORARY TABLE mysqlbinlog_events, events_at, events_pos;
+--remove_file $_tmp_file
+--enable_query_log

=== modified file 'mysql-test/include/have_innodb_plugin.inc'
--- a/mysql-test/include/have_innodb_plugin.inc	2010-04-09 12:56:51 +0000
+++ b/mysql-test/include/have_innodb_plugin.inc	2010-08-03 21:26:17 +0000
@@ -1,4 +1,4 @@
 disable_query_log;
 --require r/true.require
-SELECT (plugin_library LIKE 'ha_innodb_plugin%') AS `TRUE` FROM information_schema.plugins WHERE LOWER(plugin_name) = 'innodb' AND LOWER(plugin_status) = 'active';
+SELECT (plugin_library LIKE 'ha_innodb_plugin%' OR plugin_description LIKE '%xtradb%') AS `TRUE` FROM information_schema.plugins WHERE LOWER(plugin_name) = 'innodb' AND LOWER(plugin_status) = 'active';
 enable_query_log;

=== added file 'mysql-test/include/have_real_innodb_plugin.inc'
--- a/mysql-test/include/have_real_innodb_plugin.inc	1970-01-01 00:00:00 +0000
+++ b/mysql-test/include/have_real_innodb_plugin.inc	2010-08-03 21:26:17 +0000
@@ -0,0 +1,4 @@
+disable_query_log;
+--require r/true.require
+SELECT (plugin_library LIKE 'ha_innodb_plugin%') AS `TRUE` FROM information_schema.plugins WHERE LOWER(plugin_name) = 'innodb' AND LOWER(plugin_status) = 'active';
+enable_query_log;

=== added file 'mysql-test/include/have_xtradb.inc'
--- a/mysql-test/include/have_xtradb.inc	1970-01-01 00:00:00 +0000
+++ b/mysql-test/include/have_xtradb.inc	2010-08-03 21:26:17 +0000
@@ -0,0 +1,4 @@
+disable_query_log;
+--require r/true.require
+SELECT (plugin_description LIKE '%xtradb%') AS `TRUE` FROM information_schema.plugins WHERE LOWER(plugin_name) = 'innodb' AND LOWER(plugin_status) = 'active';
+enable_query_log;

=== added file 'mysql-test/include/mysqlhotcopy.inc'
--- a/mysql-test/include/mysqlhotcopy.inc	1970-01-01 00:00:00 +0000
+++ b/mysql-test/include/mysqlhotcopy.inc	2010-06-04 08:53:18 +0000
@@ -0,0 +1,121 @@
+# Test of mysqlhotcopy (perl script)
+# Author: Horst Hunger
+# Created: 2010-05-10
+
+--source include/not_windows.inc
+--source include/not_embedded.inc
+
+if ($MYSQLHOTCOPY)
+{
+  die due to missing mysqlhotcopy tool;
+}
+
+let $MYSQLD_DATADIR= `SELECT @@datadir`;
+--disable_warnings
+DROP DATABASE IF EXISTS hotcopy_test;
+--enable_warnings
+CREATE DATABASE hotcopy_test;
+USE hotcopy_test;
+eval CREATE TABLE t1 (c1 int, c2 varchar(20)) ENGINE=$engine;
+eval CREATE TABLE t2 (c1 int, c2 varchar(20)) ENGINE=$engine;
+eval CREATE TABLE t3 (c1 int, c2 varchar(20)) ENGINE=$engine;
+
+INSERT INTO t1 VALUES (1,'aaaaaaaaaaaaaaaaaaaa'),(2, 'bbbbbbbbbbbbbbbbbbbbbbb');
+INSERT INTO t2 VALUES (1,'aaaaaaaaaaaaaaaaaaaa'),(2, 'bbbbbbbbbbbbbbbbbbbbbbb');
+INSERT INTO t3 VALUES (1,'aaaaaaaaaaaaaaaaaaaa'),(2, 'bbbbbbbbbbbbbbbbbbbbbbb');
+
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+--list_files $MYSQLD_DATADIR/hotcopy_test
+
+# backup into another database in the same directory
+--replace_result $MASTER_MYSOCK MASTER_MYSOCK
+--exec $MYSQLHOTCOPY --quiet -S $MASTER_MYSOCK -u root hotcopy_test hotcopy_save
+
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+--list_files $MYSQLD_DATADIR/hotcopy_save
+
+USE hotcopy_save;
+SELECT * FROM t1;
+SELECT * FROM t2;
+SELECT * FROM t3;
+
+# restore data into the original database with mysqlhotcopy
+if(`SELECT engine= 'MyISAM' FROM information_schema.tables WHERE table_name='t1'`)
+{
+USE hotcopy_test;
+DELETE FROM t1;
+SELECT * FROM t1;
+
+--replace_result $MASTER_MYSOCK MASTER_MYSOCK
+--exec $MYSQLHOTCOPY --quiet --addtodest -S $MASTER_MYSOCK -u root hotcopy_save hotcopy_test
+
+USE hotcopy_save;
+SELECT * FROM t1;
+SELECT * FROM t2;
+SELECT * FROM t3;
+}
+
+USE hotcopy_test;
+DROP TABLE t2;
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+--list_files $MYSQLD_DATADIR/hotcopy_test
+
+--replace_result $MASTER_MYSOCK MASTER_MYSOCK
+--exec $MYSQLHOTCOPY --quiet --addtodest -S $MASTER_MYSOCK -u root hotcopy_save hotcopy_test
+
+FLUSH TABLES;
+SELECT * FROM t1;
+SELECT * FROM t2;
+SELECT * FROM t3;
+
+# backup of db into a directory
+USE hotcopy_test;
+--replace_result $MASTER_MYSOCK MASTER_MYSOCK $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--exec $MYSQLHOTCOPY --quiet -S $MASTER_MYSOCK -u root hotcopy_test $MYSQLTEST_VARDIR/tmp
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--list_files $MYSQLTEST_VARDIR/tmp/hotcopy_test
+#--exec rm -rf $MYSQLTEST_VARDIR/tmp/hotcopy_test
+--remove_files_wildcard $MYSQLTEST_VARDIR/tmp/hotcopy_test *
+--rmdir $MYSQLTEST_VARDIR/tmp/hotcopy_test
+
+# backup without full index files
+# reproduction of bug#53556, "--list_files" shows MYI files, which is wrong.
+DROP DATABASE hotcopy_save;
+--replace_result $MASTER_MYSOCK MASTER_MYSOCK
+--exec $MYSQLHOTCOPY --quiet --noindices -S $MASTER_MYSOCK -u root hotcopy_test hotcopy_save
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+--list_files $MYSQLD_DATADIR/hotcopy_save
+
+# test of option "allowold"
+DROP DATABASE hotcopy_save;
+--replace_result $MASTER_MYSOCK MASTER_MYSOCK
+--exec $MYSQLHOTCOPY --quiet -S $MASTER_MYSOCK -u root hotcopy_test hotcopy_save
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+--list_files $MYSQLD_DATADIR/hotcopy_save
+--replace_result $MASTER_MYSOCK MASTER_MYSOCK
+--error 9,2304
+--exec $MYSQLHOTCOPY --quiet -S $MASTER_MYSOCK -u root hotcopy_test hotcopy_save
+--replace_result $MASTER_MYSOCK MASTER_MYSOCK
+--exec $MYSQLHOTCOPY --quiet --allowold -S $MASTER_MYSOCK -u root hotcopy_test hotcopy_save
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+--list_files $MYSQLD_DATADIR/hotcopy_save
+
+# test of option "keepold"
+--replace_result $MASTER_MYSOCK MASTER_MYSOCK
+--exec $MYSQLHOTCOPY --quiet --keepold -S $MASTER_MYSOCK -u root hotcopy_test hotcopy_save
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+--list_files $MYSQLD_DATADIR/hotcopy_save_old
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+--list_files $MYSQLD_DATADIR/hotcopy_save
+
+# test of option "suffix"
+--replace_result $MASTER_MYSOCK MASTER_MYSOCK
+--exec $MYSQLHOTCOPY --quiet --suffix=_cpy -S $MASTER_MYSOCK -u root hotcopy_test
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+--list_files $MYSQLD_DATADIR/hotcopy_test_cpy
+DROP DATABASE hotcopy_test_cpy;
+
+DROP DATABASE hotcopy_test;
+DROP DATABASE hotcopy_save;
+DROP DATABASE hotcopy_save_old;
+

=== added file 'mysql-test/include/percona_query_cache_with_comments.inc'
--- a/mysql-test/include/percona_query_cache_with_comments.inc	1970-01-01 00:00:00 +0000
+++ b/mysql-test/include/percona_query_cache_with_comments.inc	2010-08-04 08:39:53 +0000
@@ -0,0 +1,95 @@
+--source include/percona_query_cache_with_comments_clear.inc
+let $query=/* with comment first */select * from t1;
+eval $query;
+--source include/percona_query_cache_with_comments_eval.inc
+
+let $query=# with comment first
+select * from t1;
+--source include/percona_query_cache_with_comments_eval.inc
+
+let $query=-- with comment first
+select * from t1;
+--source include/percona_query_cache_with_comments_eval.inc
+
+let $query=/* with comment first and "quote" */select * from t1;
+--source include/percona_query_cache_with_comments_eval.inc
+
+let $query=# with comment first and "quote"
+select * from t1;
+--source include/percona_query_cache_with_comments_eval.inc
+
+let $query=-- with comment first and "quote" 
+select * from t1;
+--source include/percona_query_cache_with_comments_eval.inc
+
+let $query=
+    /* with comment and whitespaces first */select * from t1;
+--source include/percona_query_cache_with_comments_eval.inc
+
+let $query= 
+    # with comment and whitespaces first
+select * from t1;
+--source include/percona_query_cache_with_comments_eval.inc
+
+let $query=
+    -- with comment and whitespaces first
+select * from t1;
+--source include/percona_query_cache_with_comments_eval.inc
+
+let $internal=* internal comment *;
+
+let $query=select * /$internal/ from t1;
+--source include/percona_query_cache_with_comments_eval.inc
+let $query=select */$internal/ from t1;
+--source include/percona_query_cache_with_comments_eval.inc
+let $query=select */$internal/from t1;
+--source include/percona_query_cache_with_comments_eval.inc
+
+let $internal=* internal comment with "quote" *;
+
+let $query=select * /$internal/ from t1;
+--source include/percona_query_cache_with_comments_eval.inc
+let $query=select */$internal/ from t1;
+--source include/percona_query_cache_with_comments_eval.inc
+let $query=select */$internal/from t1;
+--source include/percona_query_cache_with_comments_eval.inc
+
+let $query=select * from t1
+;
+--source include/percona_query_cache_with_comments_eval.inc
+
+let $query=select * from t1 ;
+--source include/percona_query_cache_with_comments_eval.inc
+
+let $query=select * from t1	;
+--source include/percona_query_cache_with_comments_eval.inc
+
+let $query=select * from t1
+/* comment in the end */;
+--source include/percona_query_cache_with_comments_eval.inc
+
+let $query=select * from t1
+/* *\/ */;
+--source include/percona_query_cache_with_comments_eval.inc
+
+let $query=select * from t1
+/* comment in the end */
+;
+--source include/percona_query_cache_with_comments_eval.inc
+
+let $query=select * from t1 #comment in the end;
+--source include/percona_query_cache_with_comments_eval.inc
+
+let $query=select * from t1 #comment in the end
+;
+--source include/percona_query_cache_with_comments_eval.inc
+
+let $query=select * from t1 -- comment in the end;
+--source include/percona_query_cache_with_comments_eval.inc
+
+let $query=select * from t1 -- comment in the end
+;
+--source include/percona_query_cache_with_comments_eval.inc
+
+let $query=select ' \'  ' from t1;
+--source include/percona_query_cache_with_comments_eval.inc

=== added file 'mysql-test/include/percona_query_cache_with_comments_begin.inc'
--- a/mysql-test/include/percona_query_cache_with_comments_begin.inc	1970-01-01 00:00:00 +0000
+++ b/mysql-test/include/percona_query_cache_with_comments_begin.inc	2010-08-04 08:39:53 +0000
@@ -0,0 +1,12 @@
+-- source include/have_query_cache.inc
+
+set GLOBAL query_cache_size=1355776;
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+create table t1 (a int not null);
+insert into t1 values (1),(2),(3);
+
+--source include/percona_query_cache_with_comments_clear.inc

=== added file 'mysql-test/include/percona_query_cache_with_comments_clear.inc'
--- a/mysql-test/include/percona_query_cache_with_comments_clear.inc	1970-01-01 00:00:00 +0000
+++ b/mysql-test/include/percona_query_cache_with_comments_clear.inc	2010-08-04 08:39:53 +0000
@@ -0,0 +1,5 @@
+# Reset query cache variables.
+flush query cache; # This crashed in some versions
+flush query cache; # This crashed in some versions
+reset query cache;
+flush status;

=== added file 'mysql-test/include/percona_query_cache_with_comments_end.inc'
--- a/mysql-test/include/percona_query_cache_with_comments_end.inc	1970-01-01 00:00:00 +0000
+++ b/mysql-test/include/percona_query_cache_with_comments_end.inc	2010-08-04 08:39:53 +0000
@@ -0,0 +1,3 @@
+DROP TABLE t1;
+SET GLOBAL query_cache_size=default;
+set global query_cache_strip_comments=OFF;

=== added file 'mysql-test/include/percona_query_cache_with_comments_eval.inc'
--- a/mysql-test/include/percona_query_cache_with_comments_eval.inc	1970-01-01 00:00:00 +0000
+++ b/mysql-test/include/percona_query_cache_with_comments_eval.inc	2010-08-04 08:39:53 +0000
@@ -0,0 +1,7 @@
+echo -----------------------------------------------------;
+echo $query;
+echo -----------------------------------------------------;
+--source include/percona_query_cache_with_comments_show.inc
+eval $query;
+eval $query;
+--source include/percona_query_cache_with_comments_show.inc

=== added file 'mysql-test/include/percona_query_cache_with_comments_show.inc'
--- a/mysql-test/include/percona_query_cache_with_comments_show.inc	1970-01-01 00:00:00 +0000
+++ b/mysql-test/include/percona_query_cache_with_comments_show.inc	2010-08-04 08:39:53 +0000
@@ -0,0 +1,8 @@
+let $show=show status like "Qcache_queries_in_cache";
+eval $show;
+let $show=show status like "Qcache_inserts";
+eval $show;
+let $show=show status like "Qcache_hits";
+eval $show;
+
+

=== modified file 'mysql-test/include/rpl_stmt_seq.inc'
--- a/mysql-test/include/rpl_stmt_seq.inc	2007-03-06 17:15:31 +0000
+++ b/mysql-test/include/rpl_stmt_seq.inc	2010-05-24 13:54:08 +0000
@@ -80,9 +80,8 @@ eval INSERT INTO t1 SET f1= $MAX + 1;
 SELECT MAX(f1) FROM t1;
 if ($show_binlog)
 {
---replace_result $VERSION VERSION
---replace_column 2 # 5 #
-eval SHOW BINLOG EVENTS IN 'master-bin.$_log_num_s';
+  --let $binlog_file= master-bin.$_log_num_s
+  --source include/show_binlog_events.inc
 }
 sync_slave_with_master;
 
@@ -93,9 +92,8 @@ connection slave;
 SELECT MAX(f1) FROM t1;
 if ($show_binlog)
 {
---replace_result $VERSION VERSION
---replace_column 2 # 5 #
-eval SHOW BINLOG EVENTS IN 'slave-bin.$_log_num_s';
+  --let $binlog_file= slave-bin.$_log_num_s
+  --source include/show_binlog_events.inc
 }
 
 ###############################################################
@@ -111,9 +109,8 @@ let $my_stmt= ERROR: YOU FORGOT TO FILL
 SELECT MAX(f1) FROM t1;
 if ($show_binlog)
 {
---replace_result $VERSION VERSION
---replace_column 2 # 5 #
-eval SHOW BINLOG EVENTS IN 'master-bin.$_log_num_s';
+  --let $binlog_file= master-bin.$_log_num_s
+  --source include/show_binlog_events.inc
 }
 sync_slave_with_master;
 
@@ -124,9 +121,8 @@ connection slave;
 SELECT MAX(f1) FROM t1;
 if ($show_binlog)
 {
---replace_result $VERSION VERSION
---replace_column 2 # 5 #
-eval SHOW BINLOG EVENTS IN 'slave-bin.$_log_num_s';
+  --let $binlog_file= slave-bin.$_log_num_s
+  --source include/show_binlog_events.inc
 }
 
 ###############################################################
@@ -150,9 +146,8 @@ eval SELECT CONCAT(CONCAT('TEST-INFO: MA
 --enable_query_log
 if ($show_binlog)
 {
---replace_result $VERSION VERSION
---replace_column 2 # 5 #
-eval SHOW BINLOG EVENTS IN 'master-bin.$_log_num_s';
+  --let $binlog_file= master-bin.$_log_num_s
+  --source include/show_binlog_events.inc
 }
 sync_slave_with_master;
 
@@ -171,9 +166,8 @@ eval SELECT CONCAT(CONCAT('TEST-INFO: SL
 --enable_query_log
 if ($show_binlog)
 {
---replace_result $VERSION VERSION
---replace_column 2 # 5 #
-eval SHOW BINLOG EVENTS IN 'slave-bin.$_log_num_s';
+  --let $binlog_file= slave-bin.$_log_num_s
+  --source include/show_binlog_events.inc
 }
 
 ###############################################################

=== modified file 'mysql-test/include/show_binlog_events.inc'
--- a/mysql-test/include/show_binlog_events.inc	2008-07-18 11:34:19 +0000
+++ b/mysql-test/include/show_binlog_events.inc	2010-05-24 13:54:08 +0000
@@ -1,10 +1,45 @@
-# $binlog_start can be set by caller or take a default value
+##############################################################################
+# Show binary log events 
+#
+# Useage: 
+# let $binlog_file= master-bin.000002; 
+# let $binlog_start= 106; 
+# let $binlog_limit= 1, 3; 
+# source include/show_binlog_events.inc;
+#
+# It shows the first binary log file if $binlog_file is not given. 
+#
+# It shows events from the end position of the description event if
+# $binlog_start is not given.
+#
+# It shows all of the events if $binlog_limit is not given. 
+# $binlog_format has the same semantic with 'LIMIT' option.
+#
+##############################################################################
 
 if (!$binlog_start)
 {
-  let $binlog_start=106;
+  # If $binlog_start is not set, we will set it as the second event's position.
+  # The first event(Description Event) is always ignored. For description
+  # event's length might be changed because of adding new events, 'SHOW BINLOG
+  # EVENTS LIMIT 1' is used to get the right value.
+  --let $binlog_start= query_get_value(SHOW BINLOG EVENTS LIMIT 1, End_log_pos, 1)
 }
+
+--let $_statement=show binlog events
+if (`SELECT '$binlog_file' <> ''`)
+{
+  --let $_statement= $_statement in '$binlog_file'
+}
+
+--let $_statement= $_statement from $binlog_start
+
+if (`SELECT '$binlog_limit' <> ''`)
+{
+  --let $_statement= $_statement limit $binlog_limit
+}
+
 --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR $binlog_start <binlog_start>
 --replace_column 2 # 4 # 5 #
 --replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /file_id=[0-9]+/file_id=#/ /block_len=[0-9]+/block_len=#/
---eval show binlog events from $binlog_start
+--eval $_statement

=== modified file 'mysql-test/include/show_rpl_debug_info.inc'
--- a/mysql-test/include/show_rpl_debug_info.inc	2009-01-09 14:12:31 +0000
+++ b/mysql-test/include/show_rpl_debug_info.inc	2010-05-24 13:54:08 +0000
@@ -36,6 +36,7 @@ let $_con= $CURRENT_CONNECTION;
 --echo
 --echo [on $_con]
 --echo
+SELECT NOW();
 --echo **** SHOW SLAVE STATUS on $_con ****
 query_vertical SHOW SLAVE STATUS;
 --echo
@@ -70,6 +71,7 @@ if (`SELECT '$_master_con' != ''`)
   --echo [on $_master_con]
   connection $_master_con;
   --echo
+  SELECT NOW();
   --echo **** SHOW MASTER STATUS on $_master_con ****
   query_vertical SHOW MASTER STATUS;
   --echo

=== modified file 'mysql-test/include/show_slave_status.inc'
--- a/mysql-test/include/show_slave_status.inc	2007-06-11 20:15:39 +0000
+++ b/mysql-test/include/show_slave_status.inc	2010-05-24 13:54:08 +0000
@@ -1,6 +1,25 @@
 # Include file to show the slave status, masking out some information
 # that varies depending on where the test is executed.
 
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 16 # 23 # 33 # 35 # 36 #
-query_vertical SHOW SLAVE STATUS;
+--let $_items=$status_items
+if (`SELECT "XX$status_items" = "XX"`)
+{
+  --die 'Variable status_items is NULL' 
+}
+
+--disable_query_log
+--vertical_results
+
+while (`SELECT "XX$_items" <> "XX"`) 
+{
+  --let $_name= `SELECT SUBSTRING_INDEX('$_items', ',', 1)`
+  --let $_items= `SELECT LTRIM(SUBSTRING('$_items', LENGTH('$_name') + 2))`
+
+  --let $_value= query_get_value(SHOW SLAVE STATUS, $_name, 1)
+
+  --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+  --eval SELECT "$_value" AS $_name
+}
+
+--horizontal_results
+--enable_query_log

=== removed file 'mysql-test/include/show_slave_status2.inc'
--- a/mysql-test/include/show_slave_status2.inc	2008-01-14 07:38:02 +0000
+++ b/mysql-test/include/show_slave_status2.inc	1970-01-01 00:00:00 +0000
@@ -1,8 +0,0 @@
-# Include file to show the slave status, masking out some information
-# that varies depending on where the test is executed.
-
-# masked out log positions
-
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
-query_vertical SHOW SLAVE STATUS;

=== modified file 'mysql-test/include/test_fieldsize.inc'
--- a/mysql-test/include/test_fieldsize.inc	2010-02-25 10:39:43 +0000
+++ b/mysql-test/include/test_fieldsize.inc	2010-05-24 13:54:08 +0000
@@ -22,10 +22,9 @@ eval $test_insert;
 
 connection slave;
 START SLAVE;
---source include/wait_for_slave_sql_to_stop.inc
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
---query_vertical SHOW SLAVE STATUS
+--let $slave_sql_errno= 1535
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error.inc
 
 # The following should be 0
 SELECT COUNT(*) FROM t1;

=== modified file 'mysql-test/include/wait_for_binlog_event.inc'
--- a/mysql-test/include/wait_for_binlog_event.inc	2008-02-28 11:36:14 +0000
+++ b/mysql-test/include/wait_for_binlog_event.inc	2010-05-24 13:54:08 +0000
@@ -18,7 +18,7 @@ while (`SELECT INSTR("$_last_event","$wa
   dec $_loop_count;
   if (!$_loop_count)
   {
-    SHOW BINLOG EVENTS;
+    --source include/show_rpl_debug_info.inc
     --die ERROR: failed while waiting for $wait_binlog_event in binlog 
   }
   real_sleep 0.1;

=== modified file 'mysql-test/include/wait_for_slave_io_error.inc'
--- a/mysql-test/include/wait_for_slave_io_error.inc	2009-06-26 11:05:56 +0000
+++ b/mysql-test/include/wait_for_slave_io_error.inc	2010-05-28 02:57:45 +0000
@@ -1,23 +1,59 @@
 # ==== Purpose ====
 #
 # Waits until the IO thread of the current connection has got an
-# error, or until a timeout is reached.
+# error, or until a timeout is reached. Also waits until the IO
+# thread has completely stopped.
 #
 # ==== Usage ====
 #
+# # Wait several errors.  
+# let $slave_io_errno= 1, 2, 3; 
 # source include/wait_for_slave_io_error.inc;
 #
-# Parameters to this macro are $slave_timeout and
-# $slave_keep_connection. See wait_for_slave_param.inc for
-# descriptions.
+# # Print error message 
+# let $slave_io_errno= 1; 
+# let $show_slave_io_error= 1; 
+# source include/wait_for_slave_io_error.inc;
+#
+# Parameters:
+#
+# $slave_io_errno
+#   The expected IO error numbers.  This is required.
+#   (After BUG#41956 has been fixed, this will be required to be a
+#   symbolic name instead of a numbers.)
+#
+# $show_slave_io_error
+#   If set, will print the error to the query log.
+# 
+# $slave_timeout
+#   See wait_for_slave_param.inc for description.
+# 
+# $master_connection
+#   See wait_for_slave_param.inc for description.
 
-let $old_slave_param_comparison= $slave_param_comparison;
+if (`SELECT '$slave_io_errno' = ''`) {
+  --die !!!ERROR IN TEST: you must set \$slave_io_errno before sourcing wait_for_slave_io_error.inc
+}
 
+let $old_slave_param_comparison= $slave_param_comparison;
 let $slave_param= Last_IO_Errno;
 let $slave_param_comparison= !=;
 let $slave_param_value= 0;
 let $slave_error_message= Failed while waiting for slave to produce an error in its sql thread;
 source include/wait_for_slave_param.inc;
 let $slave_error_message= ;
-
 let $slave_param_comparison= $old_slave_param_comparison;
+
+let $_error= query_get_value(SHOW SLAVE STATUS, Last_IO_Errno, 1);
+if (`SELECT $_error NOT IN ($slave_io_errno)`) {
+  --echo **** Slave stopped with wrong error code: $_error (expected $slave_io_errno) ****
+  source include/show_rpl_debug_info.inc;
+  --echo **** Slave stopped with wrong error code: $_error (expected $slave_io_errno) ****
+  --die Slave stopped with wrong error code
+}
+
+if ($show_slave_io_error)
+{
+  let $error= query_get_value("SHOW SLAVE STATUS", Last_IO_Error, 1);
+  echo Last_IO_Error = $error;
+}

=== modified file 'mysql-test/include/wait_for_slave_param.inc'
--- a/mysql-test/include/wait_for_slave_param.inc	2009-01-09 14:12:31 +0000
+++ b/mysql-test/include/wait_for_slave_param.inc	2010-05-24 13:54:08 +0000
@@ -78,5 +78,5 @@ if (!$_slave_timeout_counter)
   --echo Current connection is '$CURRENT_CONNECTION'
   echo Note: the following output may have changed since the failure was detected;
   source include/show_rpl_debug_info.inc;
-  exit;
+  die;
 }

=== modified file 'mysql-test/include/wait_for_slave_sql_error.inc'
--- a/mysql-test/include/wait_for_slave_sql_error.inc	2009-01-09 14:12:31 +0000
+++ b/mysql-test/include/wait_for_slave_sql_error.inc	2010-05-24 13:54:08 +0000
@@ -14,6 +14,9 @@
 #   The expected SQL error number.  This is required.
 #   (After BUG#41956 has been fixed, this will be required to be a
 #   symbolic name instead of a number.)
+#
+# $show_slave_sql_error
+#   If set, will print the error to the query log.
 # 
 # $slave_timeout
 #   See wait_for_slave_param.inc for description.
@@ -22,8 +25,7 @@
 #   See wait_for_slave_param.inc for description.
 
 if (`SELECT '$slave_sql_errno' = ''`) {
-  --echo !!!ERROR IN TEST: you must set \$slave_sql_errno before sourcing wait_fro_slave_sql_error.inc
-  exit;
+  --die !!!ERROR IN TEST: you must set \$slave_sql_errno before sourcing wait_for_slave_sql_error.inc
 }
 
 let $slave_param= Slave_SQL_Running;
@@ -33,7 +35,14 @@ source include/wait_for_slave_param.inc;
 
 let $_error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Errno, 1);
 if (`SELECT '$_error' != '$slave_sql_errno'`) {
-  --echo Slave stopped with wrong error code: $_error (expected $slave_sql_errno)
+  --echo **** Slave stopped with wrong error code: $_error (expected $slave_sql_errno) ****
   source include/show_rpl_debug_info.inc;
-  exit;
+  --echo **** Slave stopped with wrong error code: $_error (expected $slave_sql_errno) ****
+  --die Slave stopped with wrong error code
+}
+
+if ($show_slave_sql_error)
+{
+  let $error= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
+  echo Last_SQL_Error = $error;
 }

=== modified file 'mysql-test/include/wait_for_slave_sql_error_and_skip.inc'
--- a/mysql-test/include/wait_for_slave_sql_error_and_skip.inc	2009-01-09 14:12:31 +0000
+++ b/mysql-test/include/wait_for_slave_sql_error_and_skip.inc	2010-05-24 13:54:08 +0000
@@ -22,17 +22,30 @@
 # 
 # $master_connection
 #   See wait_for_slave_param.inc for description.
+#
+# $slave_skip_counter
+#   If set, skip this number of events. If not set, skip one event.
+#
+# $not_switch_connection If set, don't switch to slave and don't switch back
+# master.
+#
 
 echo --source include/wait_for_slave_sql_error_and_skip.inc;
-connection slave;
-source include/wait_for_slave_sql_error.inc;
-if ($show_sql_error)
+if (!$not_switch_connection)
 {
-  let $error= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
-  echo Last_SQL_Error = $error;
+  connection slave;
 }
+source include/wait_for_slave_sql_error.inc;
 
 # skip the erroneous statement
-set global sql_slave_skip_counter=1;
+if ($slave_skip_counter) {
+  eval SET GLOBAL SQL_SLAVE_SKIP_COUNTER= $slave_skip_counter;
+}
+if (!$slave_skip_counter) {
+  SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
+}
 source include/start_slave.inc;
-connection master;
+if (!$not_switch_connection)
+{
+  connection master;
+}

=== modified file 'mysql-test/include/wait_for_status_var.inc'
--- a/mysql-test/include/wait_for_status_var.inc	2009-10-13 12:47:17 +0000
+++ b/mysql-test/include/wait_for_status_var.inc	2010-08-02 09:01:24 +0000
@@ -35,7 +35,7 @@
 if (`SELECT STRCMP('$status_type', '') * STRCMP(UPPER('$status_type'), 'SESSION') * STRCMP(UPPER('$status_type'), 'GLOBAL')`)
 {
   --echo **** ERROR: Unknown type of variable status_type: allowed values are: SESSION or GLOBAL ****
-  exit;
+  die;
 }
 
 let $_status_timeout_counter= $status_timeout;
@@ -61,7 +61,7 @@ while (`SELECT NOT('$_show_status_value'
     --echo **** Showing STATUS, PROCESSLIST ****
     eval SHOW $status_type STATUS LIKE '$status_var';
     SHOW PROCESSLIST;
-    exit;
+    die;
   }
   dec $_status_timeout_counter;
   sleep 0.1;

=== modified file 'mysql-test/include/wait_until_count_sessions.inc'
--- a/mysql-test/include/wait_until_count_sessions.inc	2009-06-11 16:21:32 +0000
+++ b/mysql-test/include/wait_until_count_sessions.inc	2010-05-24 13:54:08 +0000
@@ -122,5 +122,6 @@ if (!$success)
    --echo # Timeout in wait_until_count_sessions.inc
    --echo # Number of sessions   expected: <= $count_sessions   found: $current_sessions
    SHOW PROCESSLIST;
+   --die Timeout in wait_until_count_sessions.inc
 }
 

=== modified file 'mysql-test/lib/mtr_cases.pm'
--- a/mysql-test/lib/mtr_cases.pm	2010-06-10 09:11:52 +0000
+++ b/mysql-test/lib/mtr_cases.pm	2010-08-03 21:26:17 +0000
@@ -68,9 +68,22 @@ require "mtr_misc.pl";
 my $do_test_reg;
 my $skip_test_reg;
 
+# Related to adding InnoDB plugin combinations
+my $lib_innodb_plugin;
+
 # If "Quick collect", set to 1 once a test to run has been found.
 my $some_test_found;
 
+sub find_innodb_plugin {
+  $lib_innodb_plugin=
+    my_find_file($::basedir,
+		 ["storage/innodb_plugin", "storage/innodb_plugin/.libs",
+		  "lib/mysql/plugin", "lib/plugin"],
+		 ["ha_innodb_plugin.dll", "ha_innodb_plugin.so",
+		  "ha_innodb_plugin.sl"],
+		 NOT_REQUIRED);
+}
+
 sub init_pattern {
   my ($from, $what)= @_;
   return undef unless defined $from;
@@ -103,6 +116,8 @@ sub collect_test_cases ($$$) {
   $do_test_reg= init_pattern($do_test, "--do-test");
   $skip_test_reg= init_pattern($skip_test, "--skip-test");
 
+  &find_innodb_plugin;
+
   # If not reordering, we also shouldn't group by suites, unless
   # no test cases were named.
   # This also effects some logic in the loop following this.
@@ -775,11 +790,13 @@ sub collect_one_test_case {
   # Check for disabled tests
   # ----------------------------------------------------------------------
   my $marked_as_disabled= 0;
-  if ( $disabled->{$tname} )
+  if ( $disabled->{$tname} or $disabled->{"$suitename.$tname"} )
   {
     # Test was marked as disabled in suites disabled.def file
     $marked_as_disabled= 1;
-    $tinfo->{'comment'}= $disabled->{$tname};
+    # Test name may have been disabled with or without suite name part
+    $tinfo->{'comment'}= $disabled->{$tname} || 
+                         $disabled->{"$suitename.$tname"};
   }
 
   my $disabled_file= "$testdir/$tname.disabled";
@@ -951,6 +968,30 @@ sub collect_one_test_case {
       return $tinfo;
     }
   }
+  elsif ( $tinfo->{'innodb_plugin_test'} )
+  {
+    # This is a test that needs the innodb plugin
+    if (&find_innodb_plugin)
+    {
+      my $sep= (IS_WINDOWS) ? ';' : ':';
+      my $plugin_filename= basename($lib_innodb_plugin);
+      my $plugin_list=
+        "innodb=$plugin_filename$sep" .
+        "innodb_trx=$plugin_filename$sep" .
+        "innodb_locks=$plugin_filename$sep" .
+        "innodb_lock_waits=$plugin_filename$sep" .
+        "innodb_cmp=$plugin_filename$sep" .
+        "innodb_cmp_reset=$plugin_filename$sep" .
+        "innodb_cmpmem=$plugin_filename$sep" .
+        "innodb_cmpmem_reset=$plugin_filename";
+
+      foreach my $k ('master_opt', 'slave_opt') {
+        push(@{$tinfo->{$k}}, '--ignore-builtin-innodb');
+        push(@{$tinfo->{$k}}, '--plugin-dir=' . dirname($lib_innodb_plugin));
+        push(@{$tinfo->{$k}}, "--plugin-load=$plugin_list");
+      }
+    }
+  }
   else
   {
     push(@{$tinfo->{'master_opt'}}, "--loose-skip-innodb");
@@ -1119,8 +1160,11 @@ my @tags=
  ["include/have_log_bin.inc", "need_binlog", 1],
 
  ["include/have_innodb.inc", "innodb_test", 1],
+ ["include/have_innodb_plugin.inc", "innodb_plugin_test", 1],
+ ["include/have_real.inc", "innodb_test", 1],
+ ["include/have_real_innodb_plugin.inc", "innodb_plugin_test", 1],
+ ["include/have_xtradb.inc", "innodb_test", 1],
  ["include/have_pbxt.inc", "pbxt_test", 1],
- ["include/have_innodb_plugin.inc", "innodb_test", 1],
  ["include/big_test.inc", "big_test", 1],
  ["include/have_debug.inc", "need_debug", 1],
  ["include/have_ndb.inc", "ndb_test", 1],

=== modified file 'mysql-test/lib/mtr_misc.pl'
--- a/mysql-test/lib/mtr_misc.pl	2010-04-28 12:52:24 +0000
+++ b/mysql-test/lib/mtr_misc.pl	2010-08-02 09:01:24 +0000
@@ -149,6 +149,28 @@ sub mtr_exe_maybe_exists (@) {
 
 #
 # NOTE! More specific paths should be given before less specific.
+#
+sub mtr_pl_maybe_exists (@) {
+  my @path= @_;
+
+  map {$_.= ".pl"} @path if IS_WINDOWS;
+  foreach my $path ( @path )
+  {
+    if(IS_WINDOWS)
+    {
+      return $path if -f $path;
+    }
+    else
+    {
+      return $path if -x $path;
+    }
+  }
+  return "";
+}
+
+
+#
+# NOTE! More specific paths should be given before less specific.
 # For example /client/debug should be listed before /client
 #
 sub mtr_exe_exists (@) {

=== modified file 'mysql-test/lib/v1/mtr_process.pl'
--- a/mysql-test/lib/v1/mtr_process.pl	2009-02-15 10:58:34 +0000
+++ b/mysql-test/lib/v1/mtr_process.pl	2010-08-02 09:01:24 +0000
@@ -264,8 +264,9 @@ sub spawn_parent_impl {
           if ( $timer_name eq "suite" )
           {
             # We give up here
-            # FIXME we should only give up the suite, not all of the run?
             print STDERR "\n";
+            kill(9, $pid); # Kill mysqltest
+            mtr_kill_leftovers(); # Kill servers the hard way
             mtr_error("Test suite timeout");
           }
           elsif ( $timer_name eq "testcase" )

=== modified file 'mysql-test/mysql-test-run.pl'
--- a/mysql-test/mysql-test-run.pl	2010-06-14 16:57:30 +0000
+++ b/mysql-test/mysql-test-run.pl	2010-08-05 11:40:54 +0000
@@ -130,7 +130,7 @@ my $path_config_file;           # The ge
 # executables will be used by the test suite.
 our $opt_vs_config = $ENV{'MTR_VS_CONFIG'};
 
-my $DEFAULT_SUITES= "main,binlog,federated,rpl,maria,parts,innodb";
+my $DEFAULT_SUITES= "main,binlog,federated,rpl,maria,parts,innodb,innodb_plugin,percona";
 my $opt_suites;
 
 our $opt_verbose= 0;  # Verbose output, enable with --verbose
@@ -234,10 +234,12 @@ my $opt_strace_client;
 our $opt_user = "root";
 
 my $opt_valgrind= 0;
-our $opt_valgrind_mysqld= 0;
-my $opt_valgrind_mysqltest= 0;
 my @default_valgrind_args= ("--show-reachable=yes");
 my @valgrind_args;
+our $opt_valgrind_mysqld= 0;
+my $opt_valgrind_mysqltest= 0;
+my $opt_strace= 0;
+my @strace_args;
 my $opt_valgrind_path;
 my $opt_callgrind;
 my %mysqld_logs;
@@ -929,7 +931,9 @@ sub command_line_setup {
              'manual-ddd'               => \$opt_manual_ddd,
 	     'debugger=s'               => \$opt_debugger,
 	     'client-debugger=s'        => \$opt_client_debugger,
+             'strace'			=> \$opt_strace,
              'strace-client:s'          => \$opt_strace_client,
+             'strace-option=s'          => \@strace_args,
              'max-save-core=i'          => \$opt_max_save_core,
              'max-save-datadir=i'       => \$opt_max_save_datadir,
              'max-test-fail=i'          => \$opt_max_test_fail,
@@ -1473,6 +1477,11 @@ sub command_line_setup {
 	       join(" ", @valgrind_args), "\"");
   }
 
+  if (@strace_args)
+  {
+    $opt_strace=1;
+  }
+
   # InnoDB does not bother to do individual de-allocations at exit. Instead it
   # relies on a custom allocator to track every allocation, and frees all at
   # once during exit.
@@ -1601,7 +1610,7 @@ sub collect_mysqld_features {
 	#print "Major: $1 Minor: $2 Build: $3\n";
 	$mysql_version_id= $1*10000 + $2*100 + $3;
 	#print "mysql_version_id: $mysql_version_id\n";
-	mtr_report("MySQL Version $1.$2.$3");
+	mtr_report("MariaDB Version $1.$2.$3");
       }
     }
     else
@@ -1724,9 +1733,9 @@ sub executable_setup () {
   if ( -x "../libtool")
   {
     $exe_libtool= "../libtool";
-    if ($opt_valgrind or $glob_debugger)
+    if ($opt_valgrind or $glob_debugger or $opt_strace)
     {
-      mtr_report("Using \"$exe_libtool\" when running valgrind or debugger");
+      mtr_report("Using \"$exe_libtool\" when running valgrind, strace or debugger");
     }
   }
 
@@ -2122,6 +2131,15 @@ sub environment_setup {
   }
 
   # ----------------------------------------------------
+  # mysqlhotcopy
+  # ----------------------------------------------------
+  my $mysqlhotcopy=
+    mtr_pl_maybe_exists("$basedir/scripts/mysqlhotcopy");
+  # Since mysqltest interprets the real path as "false" in an if,
+  # use 1 ("true") to indicate "not exists" so it can be tested for
+  $ENV{'MYSQLHOTCOPY'}= $mysqlhotcopy || 1;
+
+  # ----------------------------------------------------
   # perror
   # ----------------------------------------------------
   my $exe_perror= mtr_exe_exists("$basedir/extra$opt_vs_config/perror",
@@ -4035,6 +4053,7 @@ sub extract_warning_lines ($) {
      qr/Slave: Can't drop database.* database doesn't exist/,
      qr/Slave: Operation DROP USER failed for 'create_rout_db'/,
      qr|Checking table:   '\./mtr/test_suppressions'|,
+     qr|Table \./test/bug53592 has a primary key in InnoDB data dictionary, but not in MySQL|,
      qr|mysqld: Table '\./mtr/test_suppressions' is marked as crashed and should be repaired|
     );
 
@@ -4626,6 +4645,10 @@ sub mysqld_start ($$) {
   {
     valgrind_arguments($args, \$exe);
   }
+  if ( $opt_strace)
+  {
+    strace_arguments($args, \$exe, $mysqld->name());
+  }
 
   mtr_add_arg($args, "--defaults-group-suffix=%s", $mysqld->after('mysqld'));
   mysqld_arguments($args,$mysqld,$extra_opts);
@@ -5565,6 +5588,33 @@ sub valgrind_arguments {
   }
 }
 
+#
+# Modify the exe and args so that program is run in strace
+#
+sub strace_arguments {
+  my $args= shift;
+  my $exe=  shift;
+  my $mysqld_name= shift;
+
+  mtr_add_arg($args, "-f");
+  mtr_add_arg($args, "-o%s/var/log/%s.strace", $glob_mysql_test_dir, $mysqld_name);
+
+  # Add strace options, can be overriden by user
+  mtr_add_arg($args, '%s', $_) for (@strace_args);
+
+  mtr_add_arg($args, $$exe);
+
+  $$exe= "strace";
+
+  if ($exe_libtool)
+  {
+    # Add "libtool --mode-execute" before the test to execute
+    # if running in valgrind(to avoid valgrinding bash)
+    unshift(@$args, "--mode=execute", $$exe);
+    $$exe= $exe_libtool;
+  }
+}
+
 
 #
 # Usage
@@ -5692,9 +5742,6 @@ Options for debugging the product
                         test(s)
   manual-ddd            Let user manually start mysqld in ddd, before running
                         test(s)
-  strace-client=[path]  Create strace output for mysqltest client, optionally
-                        specifying name and path to the trace program to use.
-                        Example: $0 --strace-client=ktrace
   max-save-core         Limit the number of core files saved (to avoid filling
                         up disks for heavily crashing server). Defaults to
                         $opt_max_save_core, set to 0 for no limit. Set
@@ -5722,6 +5769,15 @@ Options for valgrind
   valgrind-path=<EXE>   Path to the valgrind executable
   callgrind             Instruct valgrind to use callgrind
 
+Options for strace
+
+  strace                Run the "mysqld" executables using strace. Default
+                        options are -f -o var/log/'mysqld-name'.strace
+  strace-option=ARGS    Option to give strace, replaces default option(s),
+  strace-client=[path]  Create strace output for mysqltest client, optionally
+                        specifying name and path to the trace program to use.
+                        Example: $0 --strace-client=ktrace
+
 Misc options
   user=USER             User for connecting to mysqld(default: $opt_user)
   comment=STR           Write STR to the output

=== modified file 'mysql-test/r/alter_table-big.result'
--- a/mysql-test/r/alter_table-big.result	2007-05-19 06:49:56 +0000
+++ b/mysql-test/r/alter_table-big.result	2010-05-24 13:54:08 +0000
@@ -12,11 +12,11 @@ alter table t1 enable keys;;
 insert into t2 values (1);
 insert into t1 values (1, 1, 1);
 set session debug="-d,sleep_alter_enable_indexes";
-show binlog events in 'master-bin.000001' from 106;
+show binlog events from <binlog_start>;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	1	#	use `test`; insert into t2 values (1)
-master-bin.000001	#	Query	1	#	use `test`; alter table t1 enable keys
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values (1, 1, 1)
+master-bin.000001	#	Query	#	#	use `test`; insert into t2 values (1)
+master-bin.000001	#	Query	#	#	use `test`; alter table t1 enable keys
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values (1, 1, 1)
 drop tables t1, t2;
 End of 5.0 tests
 drop table if exists t1, t2, t3;
@@ -41,17 +41,17 @@ alter table t2 change c vc varchar(100)
 rename table t1 to t3;
 drop table t3;
 set session debug="-d,sleep_alter_before_main_binlog";
-show binlog events in 'master-bin.000001' from 106;
+show binlog events from <binlog_start>;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	1	#	use `test`; alter table t1 change i c char(10) default 'Test1'
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values ()
-master-bin.000001	#	Query	1	#	use `test`; alter table t1 change c vc varchar(100) default 'Test2'
-master-bin.000001	#	Query	1	#	use `test`; rename table t1 to t2
-master-bin.000001	#	Query	1	#	use `test`; drop table t2
-master-bin.000001	#	Query	1	#	use `test`; create table t1 (i int)
-master-bin.000001	#	Query	1	#	use `test`; alter table t1 change i c char(10) default 'Test3', rename to t2
-master-bin.000001	#	Query	1	#	use `test`; insert into t2 values ()
-master-bin.000001	#	Query	1	#	use `test`; alter table t2 change c vc varchar(100) default 'Test2', rename to t1
-master-bin.000001	#	Query	1	#	use `test`; rename table t1 to t3
-master-bin.000001	#	Query	1	#	use `test`; drop table t3
+master-bin.000001	#	Query	#	#	use `test`; alter table t1 change i c char(10) default 'Test1'
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values ()
+master-bin.000001	#	Query	#	#	use `test`; alter table t1 change c vc varchar(100) default 'Test2'
+master-bin.000001	#	Query	#	#	use `test`; rename table t1 to t2
+master-bin.000001	#	Query	#	#	use `test`; drop table t2
+master-bin.000001	#	Query	#	#	use `test`; create table t1 (i int)
+master-bin.000001	#	Query	#	#	use `test`; alter table t1 change i c char(10) default 'Test3', rename to t2
+master-bin.000001	#	Query	#	#	use `test`; insert into t2 values ()
+master-bin.000001	#	Query	#	#	use `test`; alter table t2 change c vc varchar(100) default 'Test2', rename to t1
+master-bin.000001	#	Query	#	#	use `test`; rename table t1 to t3
+master-bin.000001	#	Query	#	#	use `test`; drop table t3
 End of 5.1 tests

=== modified file 'mysql-test/r/bug39022.result'
--- a/mysql-test/r/bug39022.result	2010-02-18 08:48:15 +0000
+++ b/mysql-test/r/bug39022.result	2010-05-27 20:07:40 +0000
@@ -12,7 +12,7 @@ INSERT INTO t2 VALUES (0),(1),(2),(3),(4
 START TRANSACTION;
 # in thread2
 REPLACE INTO t2 VALUES (-17);
-SELECT d FROM t2,t1 WHERE d=(SELECT MAX(a) FROM t1 WHERE t1.a > t2.d);
+SELECT d FROM t2,t1 WHERE d=(SELECT MAX(a) FROM t1 WHERE t1.a > t2.d) LOCK IN SHARE MODE;
 d
 # in thread1
 REPLACE INTO t1(a,b) VALUES (67,20);
@@ -21,10 +21,10 @@ COMMIT;
 START TRANSACTION;
 REPLACE INTO t1(a,b) VALUES (65,-50);
 REPLACE INTO t2 VALUES (-91);
-SELECT d FROM t2,t1 WHERE d=(SELECT MAX(a) FROM t1 WHERE t1.a > t2.d);
+SELECT d FROM t2,t1 WHERE d=(SELECT MAX(a) FROM t1 WHERE t1.a > t2.d) LOCK IN SHARE MODE;
 # in thread1
 # should not crash
-SELECT d FROM t2,t1 WHERE d=(SELECT MAX(a) FROM t1 WHERE t1.a > t2.d);
+SELECT d FROM t2,t1 WHERE d=(SELECT MAX(a) FROM t1 WHERE t1.a > t2.d) LOCK IN SHARE MODE;
 ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
 # in thread2
 d

=== modified file 'mysql-test/r/create-big.result'
--- a/mysql-test/r/create-big.result	2007-05-23 11:26:16 +0000
+++ b/mysql-test/r/create-big.result	2010-05-24 13:54:08 +0000
@@ -175,12 +175,12 @@ t2	CREATE TABLE `t2` (
   `i` int(11) DEFAULT NULL
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
 drop table t2;
-show binlog events in 'master-bin.000001' from 106;
+show binlog events from <binlog_start>;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values (1)
-master-bin.000001	#	Query	1	#	use `test`; create table t2 like t1
-master-bin.000001	#	Query	1	#	use `test`; drop table t1
-master-bin.000001	#	Query	1	#	use `test`; drop table t2
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values (1)
+master-bin.000001	#	Query	#	#	use `test`; create table t2 like t1
+master-bin.000001	#	Query	#	#	use `test`; drop table t1
+master-bin.000001	#	Query	#	#	use `test`; drop table t2
 create table t1 (i int);
 set session debug="-d,sleep_create_like_before_check_if_exists:+d,sleep_create_like_before_copy";
 create table t2 like t1;;
@@ -197,11 +197,11 @@ reset master;
 create table t2 like t1;;
 drop table t1;
 drop table t2;
-show binlog events in 'master-bin.000001' from 106;
+show binlog events from <binlog_start>;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	1	#	use `test`; create table t2 like t1
-master-bin.000001	#	Query	1	#	use `test`; drop table t1
-master-bin.000001	#	Query	1	#	use `test`; drop table t2
+master-bin.000001	#	Query	#	#	use `test`; create table t2 like t1
+master-bin.000001	#	Query	#	#	use `test`; drop table t1
+master-bin.000001	#	Query	#	#	use `test`; drop table t2
 create table t1 (i int);
 set session debug="-d,sleep_create_like_before_copy:+d,sleep_create_like_before_ha_create";
 reset master;
@@ -213,16 +213,16 @@ drop table t2;
 create table t2 like t1;;
 drop table t1;
 drop table t2;
-show binlog events in 'master-bin.000001' from 106;
+show binlog events from <binlog_start>;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	1	#	use `test`; create table t2 like t1
-master-bin.000001	#	Query	1	#	use `test`; insert into t2 values (1)
-master-bin.000001	#	Query	1	#	use `test`; drop table t2
-master-bin.000001	#	Query	1	#	use `test`; create table t2 like t1
-master-bin.000001	#	Query	1	#	use `test`; drop table t2
-master-bin.000001	#	Query	1	#	use `test`; create table t2 like t1
-master-bin.000001	#	Query	1	#	use `test`; drop table t1
-master-bin.000001	#	Query	1	#	use `test`; drop table t2
+master-bin.000001	#	Query	#	#	use `test`; create table t2 like t1
+master-bin.000001	#	Query	#	#	use `test`; insert into t2 values (1)
+master-bin.000001	#	Query	#	#	use `test`; drop table t2
+master-bin.000001	#	Query	#	#	use `test`; create table t2 like t1
+master-bin.000001	#	Query	#	#	use `test`; drop table t2
+master-bin.000001	#	Query	#	#	use `test`; create table t2 like t1
+master-bin.000001	#	Query	#	#	use `test`; drop table t1
+master-bin.000001	#	Query	#	#	use `test`; drop table t2
 create table t1 (i int);
 set session debug="-d,sleep_create_like_before_ha_create:+d,sleep_create_like_before_binlogging";
 reset master;
@@ -234,14 +234,14 @@ drop table t2;
 create table t2 like t1;;
 drop table t1;
 drop table t2;
-show binlog events in 'master-bin.000001' from 106;
+show binlog events from <binlog_start>;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	1	#	use `test`; create table t2 like t1
-master-bin.000001	#	Query	1	#	use `test`; insert into t2 values (1)
-master-bin.000001	#	Query	1	#	use `test`; drop table t2
-master-bin.000001	#	Query	1	#	use `test`; create table t2 like t1
-master-bin.000001	#	Query	1	#	use `test`; drop table t2
-master-bin.000001	#	Query	1	#	use `test`; create table t2 like t1
-master-bin.000001	#	Query	1	#	use `test`; drop table t1
-master-bin.000001	#	Query	1	#	use `test`; drop table t2
+master-bin.000001	#	Query	#	#	use `test`; create table t2 like t1
+master-bin.000001	#	Query	#	#	use `test`; insert into t2 values (1)
+master-bin.000001	#	Query	#	#	use `test`; drop table t2
+master-bin.000001	#	Query	#	#	use `test`; create table t2 like t1
+master-bin.000001	#	Query	#	#	use `test`; drop table t2
+master-bin.000001	#	Query	#	#	use `test`; create table t2 like t1
+master-bin.000001	#	Query	#	#	use `test`; drop table t1
+master-bin.000001	#	Query	#	#	use `test`; drop table t2
 set session debug="-d,sleep_create_like_before_binlogging";

=== modified file 'mysql-test/r/ctype_cp932_binlog_stm.result'
--- a/mysql-test/r/ctype_cp932_binlog_stm.result	2009-06-25 08:44:50 +0000
+++ b/mysql-test/r/ctype_cp932_binlog_stm.result	2010-05-24 13:54:08 +0000
@@ -29,20 +29,20 @@ HEX(s1)	HEX(s2)	d
 466F6F2773206120426172	ED40ED41ED42	47.93
 DROP PROCEDURE bug18293|
 DROP TABLE t4|
-SHOW BINLOG EVENTS FROM 370|
+show binlog events from <binlog_start>|
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	370	Query	1	536	use `test`; CREATE TABLE t4 (s1 CHAR(50) CHARACTER SET latin1,
+master-bin.000001	#	Query	#	#	use `test`; CREATE TABLE t4 (s1 CHAR(50) CHARACTER SET latin1,
 s2 CHAR(50) CHARACTER SET cp932,
 d DECIMAL(10,2))
-master-bin.000001	536	Query	1	785	use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE `bug18293`(IN ins1 CHAR(50),
+master-bin.000001	#	Query	#	#	use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE `bug18293`(IN ins1 CHAR(50),
 IN ins2 CHAR(50) CHARACTER SET cp932,
 IN ind DECIMAL(10,2))
 BEGIN
 INSERT INTO t4 VALUES (ins1, ins2, ind);
 END
-master-bin.000001	785	Query	1	1049	use `test`; INSERT INTO t4 VALUES ( NAME_CONST('ins1',_latin1 0x466F6F2773206120426172 COLLATE 'latin1_swedish_ci'),  NAME_CONST('ins2',_cp932 0xED40ED41ED42 COLLATE 'cp932_japanese_ci'),  NAME_CONST('ind',47.93))
-master-bin.000001	1049	Query	1	1138	use `test`; DROP PROCEDURE bug18293
-master-bin.000001	1138	Query	1	1217	use `test`; DROP TABLE t4
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO t4 VALUES ( NAME_CONST('ins1',_latin1 0x466F6F2773206120426172 COLLATE 'latin1_swedish_ci'),  NAME_CONST('ins2',_cp932 0xED40ED41ED42 COLLATE 'cp932_japanese_ci'),  NAME_CONST('ind',47.93))
+master-bin.000001	#	Query	#	#	use `test`; DROP PROCEDURE bug18293
+master-bin.000001	#	Query	#	#	use `test`; DROP TABLE t4
 End of 5.0 tests
 SHOW BINLOG EVENTS FROM 365;
 ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Wrong offset or I/O error

=== modified file 'mysql-test/r/delete.result'
--- a/mysql-test/r/delete.result	2010-04-12 10:12:20 +0000
+++ b/mysql-test/r/delete.result	2010-05-14 11:36:27 +0000
@@ -349,4 +349,13 @@ END |
 DELETE IGNORE FROM t1;
 ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
 DROP TABLE t1;
+#
+# Bug #53450: Crash/assertion
+#    "virtual int ha_myisam::index_first(uchar*)") at assert.c:81
+#
+CREATE TABLE t1 (a INT,    b INT,    c INT,
+INDEX(a), INDEX(b), INDEX(c));
+INSERT INTO t1 VALUES (1,2,3), (4,5,6), (7,8,9);
+DELETE FROM t1 WHERE a = 10 OR b = 20 ORDER BY c LIMIT 1;
+DROP TABLE t1;
 End of 5.1 tests

=== modified file 'mysql-test/r/error_simulation.result'
--- a/mysql-test/r/error_simulation.result	2010-04-25 11:06:40 +0000
+++ b/mysql-test/r/error_simulation.result	2010-06-24 13:21:23 +0000
@@ -39,5 +39,49 @@ a
 2
 DROP TABLE t1;
 #
+# Bug#42064: low memory crash when importing hex strings, in Item_hex_string::Item_hex_string
+#
+CREATE TABLE t1(a BLOB);
+SET SESSION debug="+d,bug42064_simulate_oom";
+INSERT INTO t1 VALUES("");
+Got one of the listed errors
+SET SESSION debug=DEFAULT;
+DROP TABLE t1;
+#
+# Bug#41660: Sort-index_merge for non-first join table may require 
+# O(#scans) memory
+#
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (0), (1), (2), (3), (4), (5), (6), (7), (8), (9);
+CREATE TABLE t2 (a INT, b INT, filler CHAR(100), KEY(a), KEY(b));
+INSERT INTO t2 SELECT 1000, 1000, 'filler' FROM t1 A, t1 B, t1 C;
+INSERT INTO t2 VALUES (1, 1, 'data');
+# the example query uses LEFT JOIN only for the sake of being able to
+# demonstrate the issue with a very small dataset. (left outer join 
+# disables the use of join buffering, so we get the second table 
+# re-scanned for every record in the outer table. if we used inner join,
+# we would need to have thousands of records and/or more columns in both
+# tables so that the join buffer is filled and re-scans are triggered).
+SET SESSION debug = '+d,only_one_Unique_may_be_created';
+EXPLAIN
+SELECT * FROM t1 LEFT JOIN t2 ON ( t2.a < 10 OR t2.b < 10 );
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+x	x	x	x	x	x	x	x	x	
+x	x	x	x	x	x	x	x	x	Using sort_union(a,b); Using where
+SELECT * FROM t1 LEFT JOIN t2 ON ( t2.a < 10 OR t2.b < 10 );
+a	a	b	filler
+0	1	1	data
+1	1	1	data
+2	1	1	data
+3	1	1	data
+4	1	1	data
+5	1	1	data
+6	1	1	data
+7	1	1	data
+8	1	1	data
+9	1	1	data
+SET SESSION debug = DEFAULT;
+DROP TABLE t1, t2;
+#
 # End of 5.1 tests
 #

=== modified file 'mysql-test/r/events_scheduling.result'
--- a/mysql-test/r/events_scheduling.result	2008-12-16 18:09:09 +0000
+++ b/mysql-test/r/events_scheduling.result	2010-05-19 09:18:59 +0000
@@ -82,5 +82,24 @@ DROP TABLE table_1;
 DROP TABLE table_2;
 DROP TABLE table_3;
 DROP TABLE table_4;
+
+Bug #50087 Interval arithmetic for Event_queue_element is not portable.
+
+CREATE TABLE t1(a int);
+CREATE EVENT e1 ON SCHEDULE EVERY 1 MONTH
+STARTS NOW() - INTERVAL 1 MONTH
+ENDS NOW() + INTERVAL 2 MONTH
+ON COMPLETION PRESERVE
+DO
+INSERT INTO t1 VALUES (1);
+CREATE EVENT e2 ON SCHEDULE EVERY 1 MONTH
+STARTS NOW()
+ENDS NOW() + INTERVAL 11 MONTH
+ON COMPLETION PRESERVE
+DO
+INSERT INTO t1 VALUES (1);
+DROP TABLE t1;
+DROP EVENT e1;
+DROP EVENT e2;
 DROP DATABASE events_test;
 SET GLOBAL event_scheduler=@event_scheduler;

=== modified file 'mysql-test/r/explain.result'
--- a/mysql-test/r/explain.result	2010-04-30 11:10:48 +0000
+++ b/mysql-test/r/explain.result	2010-05-29 18:16:45 +0000
@@ -238,4 +238,17 @@ id	select_type	table	type	possible_keys
 1	PRIMARY	NULL	NULL	NULL	NULL	NULL	NULL	NULL	Impossible WHERE noticed after reading const tables
 2	SUBQUERY	NULL	NULL	NULL	NULL	NULL	NULL	NULL	Impossible WHERE noticed after reading const tables
 DROP TABLE t1, t2;
+#
+# Bug #48573: difference of index selection between rpm binary and
+#             .tar.gz, windows vs linux..
+#
+CREATE TABLE t1(c1 INT, c2 INT, c4 INT, c5 INT, KEY(c2, c5), KEY(c2, c4, c5));
+INSERT INTO t1 VALUES(4, 1, 1, 1);
+INSERT INTO t1 VALUES(3, 1, 1, 1);
+INSERT INTO t1 VALUES(2, 1, 1, 1);
+INSERT INTO t1 VALUES(1, 1, 1, 1);
+EXPLAIN SELECT c1 FROM t1 WHERE c2 = 1 AND c4 = 1 AND c5 = 1;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ref	c2,c2_2	c2	10	const,const	3	Using where
+DROP TABLE t1;
 End of 5.1 tests.

=== modified file 'mysql-test/r/flush_block_commit_notembedded.result'
--- a/mysql-test/r/flush_block_commit_notembedded.result	2009-03-06 14:56:17 +0000
+++ b/mysql-test/r/flush_block_commit_notembedded.result	2010-05-24 13:54:08 +0000
@@ -7,15 +7,13 @@ SET AUTOCOMMIT=0;
 INSERT t1 VALUES (1);
 # Switch to connection con2
 FLUSH TABLES WITH READ LOCK;
-SHOW MASTER STATUS;
-File	Position	Binlog_Do_DB	Binlog_Ignore_DB
-master-bin.000001	106		
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 # Switch to connection con1
 COMMIT;
 # Switch to connection con2
-SHOW MASTER STATUS;
-File	Position	Binlog_Do_DB	Binlog_Ignore_DB
-master-bin.000001	106		
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 UNLOCK TABLES;
 # Switch to connection con1
 DROP TABLE t1;

=== modified file 'mysql-test/r/func_in.result'
--- a/mysql-test/r/func_in.result	2009-10-05 05:27:36 +0000
+++ b/mysql-test/r/func_in.result	2010-06-22 18:53:08 +0000
@@ -750,4 +750,24 @@ id	select_type	table	type	possible_keys
 1	SIMPLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	Impossible WHERE noticed after reading const tables
 DROP TABLE t1;
 #
+# Bug#54477: Crash on IN / CASE with NULL arguments
+#
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1), (2);
+SELECT 1 IN (NULL, a) FROM t1;
+1 IN (NULL, a)
+1
+NULL
+SELECT a IN (a, a) FROM t1 GROUP BY a WITH ROLLUP;
+a IN (a, a)
+1
+1
+NULL
+SELECT CASE a WHEN a THEN a END FROM t1 GROUP BY a WITH ROLLUP;
+CASE a WHEN a THEN a END
+1
+2
+NULL
+DROP TABLE t1;
+#
 End of 5.1 tests

=== modified file 'mysql-test/r/func_isnull.result'
--- a/mysql-test/r/func_isnull.result	2002-05-16 20:35:09 +0000
+++ b/mysql-test/r/func_isnull.result	2010-06-08 06:22:40 +0000
@@ -5,3 +5,17 @@ flush tables;
 select * from t1 where isnull(to_days(mydate));
 id	mydate
 drop table t1;
+#
+# Bug#53933 crash when using uncacheable subquery in the having clause of outer query
+#
+CREATE TABLE t1 (f1 INT);
+INSERT INTO t1 VALUES (0),(0);
+SELECT ISNULL((SELECT GET_LOCK('Bug#53933', 0) FROM t1 GROUP BY f1)) AS f2
+FROM t1 GROUP BY f1 HAVING f2 = f2;
+f2
+0
+SELECT RELEASE_LOCK('Bug#53933');
+RELEASE_LOCK('Bug#53933')
+1
+DROP TABLE t1;
+End of 5.0 tests

=== modified file 'mysql-test/r/func_like.result'
--- a/mysql-test/r/func_like.result	2008-02-12 19:09:16 +0000
+++ b/mysql-test/r/func_like.result	2010-06-19 22:02:58 +0000
@@ -169,3 +169,17 @@ select 'andre%' like 'andre�%' escape '�
 select _cp1251'andre%' like convert('andre�%' using cp1251)  escape '�';
 _cp1251'andre%' like convert('andre�%' using cp1251)  escape '�'
 1
+End of 4.1 tests
+#
+# Bug #54575: crash when joining tables with unique set column
+#
+CREATE TABLE t1(a SET('a') NOT NULL, UNIQUE KEY(a));
+CREATE TABLE t2(b INT PRIMARY KEY);
+INSERT INTO t1 VALUES ();
+Warnings:
+Warning	1364	Field 'a' doesn't have a default value
+INSERT INTO t2 VALUES (1), (2), (3);
+SELECT 1 FROM t2 JOIN t1 ON 1 LIKE a GROUP BY a;
+1
+DROP TABLE t1, t2;
+End of 5.1 tests

=== modified file 'mysql-test/r/group_by.result'
--- a/mysql-test/r/group_by.result	2010-03-09 10:36:26 +0000
+++ b/mysql-test/r/group_by.result	2010-05-12 16:10:33 +0000
@@ -1790,4 +1790,24 @@ aa	b	COUNT(         b)
 1	10	1
 DROP TABLE t1, t2;
 #
+# Bug#52051: Aggregate functions incorrectly returns NULL from outer
+# join query
+#
+CREATE TABLE t1 (a INT PRIMARY KEY);
+CREATE TABLE t2 (a INT PRIMARY KEY);
+INSERT INTO t2 VALUES (1), (2);
+EXPLAIN SELECT MIN(t2.a) FROM t2 LEFT JOIN t1 ON t2.a = t1.a;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	Select tables optimized away
+SELECT MIN(t2.a) FROM t2 LEFT JOIN t1 ON t2.a = t1.a;
+MIN(t2.a)
+1
+EXPLAIN SELECT MAX(t2.a) FROM t2 LEFT JOIN t1 ON t2.a = t1.a;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	Select tables optimized away
+SELECT MAX(t2.a) FROM t2 LEFT JOIN t1 ON t2.a = t1.a;
+MAX(t2.a)
+2
+DROP TABLE t1, t2;
+#
 # End of 5.1 tests

=== modified file 'mysql-test/r/group_min_max.result'
--- a/mysql-test/r/group_min_max.result	2010-03-19 08:23:44 +0000
+++ b/mysql-test/r/group_min_max.result	2010-06-11 07:38:29 +0000
@@ -2767,4 +2767,17 @@ SELECT MIN( a ) FROM t1 WHERE a IS NULL;
 MIN( a )
 NULL
 DROP TABLE t1;
+#
+# Bug#53859: Valgrind: opt_sum_query(TABLE_LIST*, List<Item>&, Item*) at
+# opt_sum.cc:305
+#
+CREATE TABLE t1 ( a INT, KEY (a) );
+INSERT INTO t1 VALUES (1), (2), (3);
+SELECT MIN( a ) AS min_a
+FROM t1
+WHERE a > 1 AND a IS NULL
+ORDER BY min_a;
+min_a
+NULL
+DROP TABLE t1;
 End of 5.1 tests

=== modified file 'mysql-test/r/handler_myisam.result'
--- a/mysql-test/r/handler_myisam.result	2010-03-25 11:49:01 +0000
+++ b/mysql-test/r/handler_myisam.result	2010-06-09 10:45:04 +0000
@@ -769,4 +769,97 @@ a
 1
 HANDLER t1 CLOSE;
 DROP TABLE t1;
+#
+# Bug #54007: assert in ha_myisam::index_next , HANDLER
+#
+CREATE TABLE t1(a INT, b INT, PRIMARY KEY(a), KEY b(b), KEY ab(a, b));
+HANDLER t1 OPEN;
+HANDLER t1 READ FIRST;
+a	b
+HANDLER t1 READ `PRIMARY` NEXT;
+a	b
+HANDLER t1 READ ab NEXT;
+a	b
+HANDLER t1 READ b NEXT;
+a	b
+HANDLER t1 READ NEXT;
+a	b
+HANDLER t1 CLOSE;
+INSERT INTO t1 VALUES (2, 20), (1, 10), (4, 40), (3, 30);
+HANDLER t1 OPEN;
+HANDLER t1 READ FIRST;
+a	b
+2	20
+HANDLER t1 READ NEXT;
+a	b
+1	10
+HANDLER t1 READ `PRIMARY` NEXT;
+a	b
+1	10
+HANDLER t1 READ `PRIMARY` NEXT;
+a	b
+2	20
+HANDLER t1 READ ab NEXT;
+a	b
+1	10
+HANDLER t1 READ ab NEXT;
+a	b
+2	20
+HANDLER t1 READ b NEXT;
+a	b
+1	10
+HANDLER t1 READ b NEXT;
+a	b
+2	20
+HANDLER t1 READ b NEXT;
+a	b
+3	30
+HANDLER t1 READ b NEXT;
+a	b
+4	40
+HANDLER t1 READ b NEXT;
+a	b
+HANDLER t1 READ NEXT;
+a	b
+4	40
+HANDLER t1 READ NEXT;
+a	b
+3	30
+HANDLER t1 READ NEXT;
+a	b
+HANDLER t1 CLOSE;
+HANDLER t1 OPEN;
+HANDLER t1 READ FIRST;
+a	b
+2	20
+HANDLER t1 READ `PRIMARY` PREV;
+a	b
+4	40
+HANDLER t1 READ `PRIMARY` PREV;
+a	b
+3	30
+HANDLER t1 READ b PREV;
+a	b
+4	40
+HANDLER t1 READ b PREV;
+a	b
+3	30
+HANDLER t1 CLOSE;
+HANDLER t1 OPEN;
+HANDLER t1 READ FIRST;
+a	b
+2	20
+HANDLER t1 READ `PRIMARY` PREV LIMIT 3;
+a	b
+4	40
+3	30
+2	20
+HANDLER t1 READ b NEXT LIMIT 5;
+a	b
+1	10
+2	20
+3	30
+4	40
+HANDLER t1 CLOSE;
+DROP TABLE t1;
 End of 5.1 tests

=== modified file 'mysql-test/r/information_schema.result'
--- a/mysql-test/r/information_schema.result	2010-06-10 09:11:52 +0000
+++ b/mysql-test/r/information_schema.result	2010-08-02 09:01:24 +0000
@@ -1641,4 +1641,14 @@ COUNT(*)
 DROP USER nonpriv;
 DROP TABLE db1.t1;
 DROP DATABASE db1;
+
+Bug#54422 query with = 'variables'
+
+CREATE TABLE variables(f1 INT);
+SELECT COLUMN_DEFAULT, TABLE_NAME
+FROM INFORMATION_SCHEMA.COLUMNS
+WHERE INFORMATION_SCHEMA.COLUMNS.TABLE_NAME = 'variables';
+COLUMN_DEFAULT	TABLE_NAME
+NULL	variables
+DROP TABLE variables;
 End of 5.1 tests.

=== modified file 'mysql-test/r/information_schema_all_engines.result'
--- a/mysql-test/r/information_schema_all_engines.result	2010-04-28 14:35:00 +0000
+++ b/mysql-test/r/information_schema_all_engines.result	2010-08-04 08:39:53 +0000
@@ -98,7 +98,7 @@ XTRADB_ENHANCEMENTS	name
 INNODB_BUFFER_POOL_PAGES_INDEX	schema_name
 XTRADB_ADMIN_COMMAND	result_message
 INNODB_TRX	trx_id
-INNODB_SYS_TABLES	NAME
+INNODB_SYS_TABLES	SCHEMA
 INNODB_LOCK_WAITS	requesting_trx_id
 INNODB_CMPMEM_RESET	page_size
 INNODB_LOCKS	lock_id
@@ -159,7 +159,7 @@ XTRADB_ENHANCEMENTS	name
 INNODB_BUFFER_POOL_PAGES_INDEX	schema_name
 XTRADB_ADMIN_COMMAND	result_message
 INNODB_TRX	trx_id
-INNODB_SYS_TABLES	NAME
+INNODB_SYS_TABLES	SCHEMA
 INNODB_LOCK_WAITS	requesting_trx_id
 INNODB_CMPMEM_RESET	page_size
 INNODB_LOCKS	lock_id

=== removed file 'mysql-test/r/innodb-index.result'
--- a/mysql-test/r/innodb-index.result	2010-01-15 15:58:25 +0000
+++ b/mysql-test/r/innodb-index.result	1970-01-01 00:00:00 +0000
@@ -1,1173 +0,0 @@
-create table t1(a int not null, b int, c char(10) not null, d varchar(20)) engine = innodb;
-insert into t1 values (5,5,'oo','oo'),(4,4,'tr','tr'),(3,4,'ad','ad'),(2,3,'ak','ak');
-commit;
-alter table t1 add index b (b), add index b (b);
-ERROR 42000: Duplicate key name 'b'
-alter table t1 add index (b,b);
-ERROR 42S21: Duplicate column name 'b'
-alter table t1 add index d2 (d);
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` int(11) NOT NULL,
-  `b` int(11) DEFAULT NULL,
-  `c` char(10) NOT NULL,
-  `d` varchar(20) DEFAULT NULL,
-  KEY `d2` (`d`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-explain select * from t1 force index(d2) order by d;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	index	NULL	d2	23	NULL	4	
-select * from t1 force index (d2) order by d;
-a	b	c	d
-3	4	ad	ad
-2	3	ak	ak
-5	5	oo	oo
-4	4	tr	tr
-alter table t1 add unique index (b);
-ERROR 23000: Duplicate entry '4' for key 'b'
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` int(11) NOT NULL,
-  `b` int(11) DEFAULT NULL,
-  `c` char(10) NOT NULL,
-  `d` varchar(20) DEFAULT NULL,
-  KEY `d2` (`d`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-alter table t1 add index (b);
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` int(11) NOT NULL,
-  `b` int(11) DEFAULT NULL,
-  `c` char(10) NOT NULL,
-  `d` varchar(20) DEFAULT NULL,
-  KEY `d2` (`d`),
-  KEY `b` (`b`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-CREATE TABLE `t1#1`(a INT PRIMARY KEY) ENGINE=InnoDB;
-call mtr.add_suppression(" table `test`\\.`t1#[12]` already exists in InnoDB internal");
-alter table t1 add unique index (c), add index (d);
-ERROR HY000: Table 'test.t1#1' already exists
-rename table `t1#1` to `t1#2`;
-alter table t1 add unique index (c), add index (d);
-ERROR HY000: Table 'test.t1#2' already exists
-drop table `t1#2`;
-alter table t1 add unique index (c), add index (d);
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` int(11) NOT NULL,
-  `b` int(11) DEFAULT NULL,
-  `c` char(10) NOT NULL,
-  `d` varchar(20) DEFAULT NULL,
-  UNIQUE KEY `c` (`c`),
-  KEY `d2` (`d`),
-  KEY `b` (`b`),
-  KEY `d` (`d`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-explain select * from t1 force index(c) order by c;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	index	NULL	c	10	NULL	4	
-alter table t1 add primary key (a), drop index c;
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` int(11) NOT NULL,
-  `b` int(11) DEFAULT NULL,
-  `c` char(10) NOT NULL,
-  `d` varchar(20) DEFAULT NULL,
-  PRIMARY KEY (`a`),
-  KEY `d2` (`d`),
-  KEY `b` (`b`),
-  KEY `d` (`d`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-alter table t1 add primary key (c);
-ERROR 42000: Multiple primary key defined
-alter table t1 drop primary key, add primary key (b);
-ERROR 23000: Duplicate entry '4' for key 'PRIMARY'
-create unique index c on t1 (c);
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` int(11) NOT NULL,
-  `b` int(11) DEFAULT NULL,
-  `c` char(10) NOT NULL,
-  `d` varchar(20) DEFAULT NULL,
-  PRIMARY KEY (`a`),
-  UNIQUE KEY `c` (`c`),
-  KEY `d2` (`d`),
-  KEY `b` (`b`),
-  KEY `d` (`d`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-explain select * from t1 force index(c) order by c;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	index	NULL	c	10	NULL	4	
-select * from t1 force index(c) order by c;
-a	b	c	d
-3	4	ad	ad
-2	3	ak	ak
-5	5	oo	oo
-4	4	tr	tr
-alter table t1 drop index b, add index (b);
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` int(11) NOT NULL,
-  `b` int(11) DEFAULT NULL,
-  `c` char(10) NOT NULL,
-  `d` varchar(20) DEFAULT NULL,
-  PRIMARY KEY (`a`),
-  UNIQUE KEY `c` (`c`),
-  KEY `d2` (`d`),
-  KEY `d` (`d`),
-  KEY `b` (`b`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-insert into t1 values(6,1,'ggg','ggg');
-select * from t1;
-a	b	c	d
-2	3	ak	ak
-3	4	ad	ad
-4	4	tr	tr
-5	5	oo	oo
-6	1	ggg	ggg
-select * from t1 force index(b) order by b;
-a	b	c	d
-6	1	ggg	ggg
-2	3	ak	ak
-3	4	ad	ad
-4	4	tr	tr
-5	5	oo	oo
-select * from t1 force index(c) order by c;
-a	b	c	d
-3	4	ad	ad
-2	3	ak	ak
-6	1	ggg	ggg
-5	5	oo	oo
-4	4	tr	tr
-select * from t1 force index(d) order by d;
-a	b	c	d
-3	4	ad	ad
-2	3	ak	ak
-6	1	ggg	ggg
-5	5	oo	oo
-4	4	tr	tr
-explain select * from t1 force index(b) order by b;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	index	NULL	b	5	NULL	5	
-explain select * from t1 force index(c) order by c;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	index	NULL	c	10	NULL	5	
-explain select * from t1 force index(d) order by d;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	index	NULL	d	23	NULL	5	
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` int(11) NOT NULL,
-  `b` int(11) DEFAULT NULL,
-  `c` char(10) NOT NULL,
-  `d` varchar(20) DEFAULT NULL,
-  PRIMARY KEY (`a`),
-  UNIQUE KEY `c` (`c`),
-  KEY `d2` (`d`),
-  KEY `d` (`d`),
-  KEY `b` (`b`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-drop table t1;
-create table t1(a int not null, b int, c char(10), d varchar(20), primary key (a)) engine = innodb;
-insert into t1 values (1,1,'ab','ab'),(2,2,'ac','ac'),(3,3,'ad','ad'),(4,4,'afe','afe');
-commit;
-alter table t1 add index (c(2));
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` int(11) NOT NULL,
-  `b` int(11) DEFAULT NULL,
-  `c` char(10) DEFAULT NULL,
-  `d` varchar(20) DEFAULT NULL,
-  PRIMARY KEY (`a`),
-  KEY `c` (`c`(2))
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-alter table t1 add unique index (d(10));
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` int(11) NOT NULL,
-  `b` int(11) DEFAULT NULL,
-  `c` char(10) DEFAULT NULL,
-  `d` varchar(20) DEFAULT NULL,
-  PRIMARY KEY (`a`),
-  UNIQUE KEY `d` (`d`(10)),
-  KEY `c` (`c`(2))
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-insert into t1 values(5,1,'ggg','ggg');
-select * from t1;
-a	b	c	d
-1	1	ab	ab
-2	2	ac	ac
-3	3	ad	ad
-4	4	afe	afe
-5	1	ggg	ggg
-select * from t1 force index(c) order by c;
-a	b	c	d
-1	1	ab	ab
-2	2	ac	ac
-3	3	ad	ad
-4	4	afe	afe
-5	1	ggg	ggg
-select * from t1 force index(d) order by d;
-a	b	c	d
-1	1	ab	ab
-2	2	ac	ac
-3	3	ad	ad
-4	4	afe	afe
-5	1	ggg	ggg
-explain select * from t1 order by b;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	5	Using filesort
-explain select * from t1 force index(c) order by c;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	5	Using filesort
-explain select * from t1 force index(d) order by d;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	5	Using filesort
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` int(11) NOT NULL,
-  `b` int(11) DEFAULT NULL,
-  `c` char(10) DEFAULT NULL,
-  `d` varchar(20) DEFAULT NULL,
-  PRIMARY KEY (`a`),
-  UNIQUE KEY `d` (`d`(10)),
-  KEY `c` (`c`(2))
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-alter table t1 drop index d;
-insert into t1 values(8,9,'fff','fff');
-select * from t1;
-a	b	c	d
-1	1	ab	ab
-2	2	ac	ac
-3	3	ad	ad
-4	4	afe	afe
-5	1	ggg	ggg
-8	9	fff	fff
-select * from t1 force index(c) order by c;
-a	b	c	d
-1	1	ab	ab
-2	2	ac	ac
-3	3	ad	ad
-4	4	afe	afe
-8	9	fff	fff
-5	1	ggg	ggg
-explain select * from t1 order by b;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	6	Using filesort
-explain select * from t1 force index(c) order by c;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	6	Using filesort
-explain select * from t1 order by d;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	6	Using filesort
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` int(11) NOT NULL,
-  `b` int(11) DEFAULT NULL,
-  `c` char(10) DEFAULT NULL,
-  `d` varchar(20) DEFAULT NULL,
-  PRIMARY KEY (`a`),
-  KEY `c` (`c`(2))
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-drop table t1;
-create table t1(a int not null, b int, c char(10), d varchar(20), primary key (a)) engine = innodb;
-insert into t1 values (1,1,'ab','ab'),(2,2,'ac','ac'),(3,2,'ad','ad'),(4,4,'afe','afe');
-commit;
-alter table t1 add unique index (b,c);
-insert into t1 values(8,9,'fff','fff');
-select * from t1;
-a	b	c	d
-1	1	ab	ab
-2	2	ac	ac
-3	2	ad	ad
-4	4	afe	afe
-8	9	fff	fff
-select * from t1 force index(b) order by b;
-a	b	c	d
-1	1	ab	ab
-2	2	ac	ac
-3	2	ad	ad
-4	4	afe	afe
-8	9	fff	fff
-explain select * from t1 force index(b) order by b;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	index	NULL	b	16	NULL	5	
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` int(11) NOT NULL,
-  `b` int(11) DEFAULT NULL,
-  `c` char(10) DEFAULT NULL,
-  `d` varchar(20) DEFAULT NULL,
-  PRIMARY KEY (`a`),
-  UNIQUE KEY `b` (`b`,`c`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-alter table t1 add index (b,c);
-insert into t1 values(11,11,'kkk','kkk');
-select * from t1;
-a	b	c	d
-1	1	ab	ab
-2	2	ac	ac
-3	2	ad	ad
-4	4	afe	afe
-8	9	fff	fff
-11	11	kkk	kkk
-select * from t1 force index(b) order by b;
-a	b	c	d
-1	1	ab	ab
-2	2	ac	ac
-3	2	ad	ad
-4	4	afe	afe
-8	9	fff	fff
-11	11	kkk	kkk
-explain select * from t1 force index(b) order by b;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	index	NULL	b	16	NULL	6	
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` int(11) NOT NULL,
-  `b` int(11) DEFAULT NULL,
-  `c` char(10) DEFAULT NULL,
-  `d` varchar(20) DEFAULT NULL,
-  PRIMARY KEY (`a`),
-  UNIQUE KEY `b` (`b`,`c`),
-  KEY `b_2` (`b`,`c`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-alter table t1 add unique index (c,d);
-insert into t1 values(13,13,'yyy','aaa');
-select * from t1;
-a	b	c	d
-1	1	ab	ab
-2	2	ac	ac
-3	2	ad	ad
-4	4	afe	afe
-8	9	fff	fff
-11	11	kkk	kkk
-13	13	yyy	aaa
-select * from t1 force index(b) order by b;
-a	b	c	d
-1	1	ab	ab
-2	2	ac	ac
-3	2	ad	ad
-4	4	afe	afe
-8	9	fff	fff
-11	11	kkk	kkk
-13	13	yyy	aaa
-select * from t1 force index(c) order by c;
-a	b	c	d
-1	1	ab	ab
-2	2	ac	ac
-3	2	ad	ad
-4	4	afe	afe
-8	9	fff	fff
-11	11	kkk	kkk
-13	13	yyy	aaa
-explain select * from t1 force index(b) order by b;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	index	NULL	b	16	NULL	7	
-explain select * from t1 force index(c) order by c;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	index	NULL	c	34	NULL	7	
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` int(11) NOT NULL,
-  `b` int(11) DEFAULT NULL,
-  `c` char(10) DEFAULT NULL,
-  `d` varchar(20) DEFAULT NULL,
-  PRIMARY KEY (`a`),
-  UNIQUE KEY `b` (`b`,`c`),
-  UNIQUE KEY `c` (`c`,`d`),
-  KEY `b_2` (`b`,`c`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-drop table t1;
-create table t1(a int not null, b int not null, c int, primary key (a), key (b)) engine = innodb;
-create table t3(a int not null, c int not null, d int, primary key (a), key (c)) engine = innodb;
-create table t4(a int not null, d int not null, e int, primary key (a), key (d)) engine = innodb;
-create table t2(a int not null, b int not null, c int not null, d int not null, e int,
-foreign key (b) references t1(b) on delete cascade,
-foreign key (c) references t3(c), foreign key (d) references t4(d))
-engine = innodb;
-alter table t1 drop index b;
-ERROR HY000: Cannot drop index 'b': needed in a foreign key constraint
-alter table t3 drop index c;
-ERROR HY000: Cannot drop index 'c': needed in a foreign key constraint
-alter table t4 drop index d;
-ERROR HY000: Cannot drop index 'd': needed in a foreign key constraint
-alter table t2 drop index b;
-ERROR HY000: Cannot drop index 'b': needed in a foreign key constraint
-alter table t2 drop index b, drop index c, drop index d;
-ERROR HY000: Cannot drop index 'b': needed in a foreign key constraint
-create unique index dc on t2 (d,c);
-create index dc on t1 (b,c);
-alter table t2 add primary key (a);
-insert into t1 values (1,1,1);
-insert into t3 values (1,1,1);
-insert into t4 values (1,1,1);
-insert into t2 values (1,1,1,1,1);
-commit;
-alter table t4 add constraint dc foreign key (a) references t1(a);
-show create table t4;
-Table	Create Table
-t4	CREATE TABLE `t4` (
-  `a` int(11) NOT NULL,
-  `d` int(11) NOT NULL,
-  `e` int(11) DEFAULT NULL,
-  PRIMARY KEY (`a`),
-  KEY `d` (`d`),
-  CONSTRAINT `dc` FOREIGN KEY (`a`) REFERENCES `t1` (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-alter table t3 add constraint dc foreign key (a) references t1(a);
-ERROR HY000: Can't create table '#sql-temporary' (errno: 121)
-show create table t3;
-Table	Create Table
-t3	CREATE TABLE `t3` (
-  `a` int(11) NOT NULL,
-  `c` int(11) NOT NULL,
-  `d` int(11) DEFAULT NULL,
-  PRIMARY KEY (`a`),
-  KEY `c` (`c`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-alter table t2 drop index b, add index (b);
-show create table t2;
-Table	Create Table
-t2	CREATE TABLE `t2` (
-  `a` int(11) NOT NULL,
-  `b` int(11) NOT NULL,
-  `c` int(11) NOT NULL,
-  `d` int(11) NOT NULL,
-  `e` int(11) DEFAULT NULL,
-  PRIMARY KEY (`a`),
-  UNIQUE KEY `dc` (`d`,`c`),
-  KEY `c` (`c`),
-  KEY `b` (`b`),
-  CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`b`) REFERENCES `t1` (`b`) ON DELETE CASCADE,
-  CONSTRAINT `t2_ibfk_2` FOREIGN KEY (`c`) REFERENCES `t3` (`c`),
-  CONSTRAINT `t2_ibfk_3` FOREIGN KEY (`d`) REFERENCES `t4` (`d`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-delete from t1;
-ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t4`, CONSTRAINT `dc` FOREIGN KEY (`a`) REFERENCES `t1` (`a`))
-drop index dc on t4;
-ERROR 42000: Can't DROP 'dc'; check that column/key exists
-alter table t3 drop foreign key dc;
-ERROR HY000: Error on rename of './test/t3' to './#sql2-temporary' (errno: 152)
-alter table t4 drop foreign key dc;
-select * from t2;
-a	b	c	d	e
-1	1	1	1	1
-delete from t1;
-select * from t2;
-a	b	c	d	e
-drop table t2,t4,t3,t1;
-create table t1(a int not null, b int, c char(10), d varchar(20), primary key (a)) engine = innodb default charset=utf8;
-insert into t1 values (1,1,'ab','ab'),(2,2,'ac','ac'),(3,2,'ad','ad'),(4,4,'afe','afe');
-commit;
-alter table t1 add unique index (b);
-ERROR 23000: Duplicate entry '2' for key 'b'
-insert into t1 values(8,9,'fff','fff');
-select * from t1;
-a	b	c	d
-1	1	ab	ab
-2	2	ac	ac
-3	2	ad	ad
-4	4	afe	afe
-8	9	fff	fff
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` int(11) NOT NULL,
-  `b` int(11) DEFAULT NULL,
-  `c` char(10) DEFAULT NULL,
-  `d` varchar(20) DEFAULT NULL,
-  PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8
-alter table t1 add index (b);
-insert into t1 values(10,10,'kkk','iii');
-select * from t1;
-a	b	c	d
-1	1	ab	ab
-2	2	ac	ac
-3	2	ad	ad
-4	4	afe	afe
-8	9	fff	fff
-10	10	kkk	iii
-select * from t1 force index(b) order by b;
-a	b	c	d
-1	1	ab	ab
-2	2	ac	ac
-3	2	ad	ad
-4	4	afe	afe
-8	9	fff	fff
-10	10	kkk	iii
-explain select * from t1 force index(b) order by b;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	index	NULL	b	5	NULL	6	
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` int(11) NOT NULL,
-  `b` int(11) DEFAULT NULL,
-  `c` char(10) DEFAULT NULL,
-  `d` varchar(20) DEFAULT NULL,
-  PRIMARY KEY (`a`),
-  KEY `b` (`b`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8
-alter table t1 add unique index (c), add index (d);
-insert into t1 values(11,11,'aaa','mmm');
-select * from t1;
-a	b	c	d
-1	1	ab	ab
-2	2	ac	ac
-3	2	ad	ad
-4	4	afe	afe
-8	9	fff	fff
-10	10	kkk	iii
-11	11	aaa	mmm
-select * from t1 force index(b) order by b;
-a	b	c	d
-1	1	ab	ab
-2	2	ac	ac
-3	2	ad	ad
-4	4	afe	afe
-8	9	fff	fff
-10	10	kkk	iii
-11	11	aaa	mmm
-select * from t1 force index(c) order by c;
-a	b	c	d
-11	11	aaa	mmm
-1	1	ab	ab
-2	2	ac	ac
-3	2	ad	ad
-4	4	afe	afe
-8	9	fff	fff
-10	10	kkk	iii
-select * from t1 force index(d) order by d;
-a	b	c	d
-1	1	ab	ab
-2	2	ac	ac
-3	2	ad	ad
-4	4	afe	afe
-8	9	fff	fff
-10	10	kkk	iii
-11	11	aaa	mmm
-explain select * from t1 force index(b) order by b;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	index	NULL	b	5	NULL	7	
-explain select * from t1 force index(c) order by c;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	index	NULL	c	31	NULL	7	
-explain select * from t1 force index(d) order by d;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	index	NULL	d	63	NULL	7	
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` int(11) NOT NULL,
-  `b` int(11) DEFAULT NULL,
-  `c` char(10) DEFAULT NULL,
-  `d` varchar(20) DEFAULT NULL,
-  PRIMARY KEY (`a`),
-  UNIQUE KEY `c` (`c`),
-  KEY `b` (`b`),
-  KEY `d` (`d`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8
-check table t1;
-Table	Op	Msg_type	Msg_text
-test.t1	check	status	OK
-drop table t1;
-create table t1(a int not null, b int) engine = innodb;
-insert into t1 values (1,1),(1,1),(1,1),(1,1);
-alter table t1 add unique index (a);
-ERROR 23000: Duplicate entry '1' for key 'a'
-alter table t1 add unique index (b);
-ERROR 23000: Duplicate entry '1' for key 'b'
-alter table t1 add unique index (a), add unique index(b);
-ERROR 23000: Duplicate entry '1' for key 'a'
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` int(11) NOT NULL,
-  `b` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-drop table t1;
-create table t1(a int not null, c int not null,b int, primary key(a), unique key(c), key(b)) engine = innodb;
-alter table t1 drop index c, drop index b;
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` int(11) NOT NULL,
-  `c` int(11) NOT NULL,
-  `b` int(11) DEFAULT NULL,
-  PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-drop table t1;
-create table t1(a int not null, b int, primary key(a)) engine = innodb;
-alter table t1 add index (b);
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` int(11) NOT NULL,
-  `b` int(11) DEFAULT NULL,
-  PRIMARY KEY (`a`),
-  KEY `b` (`b`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-drop table t1;
-create table t1(a int not null, b int, c char(10), d varchar(20), primary key (a)) engine = innodb;
-insert into t1 values (1,1,'ab','ab'),(2,2,'ac','ac'),(3,3,'ac','ac'),(4,4,'afe','afe'),(5,4,'affe','affe');
-alter table t1 add unique index (b), add unique index (c), add unique index (d);
-ERROR 23000: Duplicate entry 'ac' for key 'c'
-alter table t1 add unique index (c), add unique index (b), add index (d);
-ERROR 23000: Duplicate entry 'ac' for key 'c'
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` int(11) NOT NULL,
-  `b` int(11) DEFAULT NULL,
-  `c` char(10) DEFAULT NULL,
-  `d` varchar(20) DEFAULT NULL,
-  PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-drop table t1;
-create table t1(a int not null, b int not null, c int, primary key (a), key(c)) engine=innodb;
-insert into t1 values (5,1,5),(4,2,4),(3,3,3),(2,4,2),(1,5,1);
-alter table t1 add unique index (b);
-insert into t1 values (10,20,20),(11,19,19),(12,18,18),(13,17,17);
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` int(11) NOT NULL,
-  `b` int(11) NOT NULL,
-  `c` int(11) DEFAULT NULL,
-  PRIMARY KEY (`a`),
-  UNIQUE KEY `b` (`b`),
-  KEY `c` (`c`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-check table t1;
-Table	Op	Msg_type	Msg_text
-test.t1	check	status	OK
-explain select * from t1 force index(c) order by c;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	index	NULL	c	5	NULL	9	
-explain select * from t1 order by a;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	index	NULL	PRIMARY	4	NULL	9	
-explain select * from t1 force index(b) order by b;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	index	NULL	b	4	NULL	9	
-select * from t1 order by a;
-a	b	c
-1	5	1
-2	4	2
-3	3	3
-4	2	4
-5	1	5
-10	20	20
-11	19	19
-12	18	18
-13	17	17
-select * from t1 force index(b) order by b;
-a	b	c
-5	1	5
-4	2	4
-3	3	3
-2	4	2
-1	5	1
-13	17	17
-12	18	18
-11	19	19
-10	20	20
-select * from t1 force index(c) order by c;
-a	b	c
-1	5	1
-2	4	2
-3	3	3
-4	2	4
-5	1	5
-13	17	17
-12	18	18
-11	19	19
-10	20	20
-drop table t1;
-create table t1(a int not null, b int not null) engine=innodb;
-insert into t1 values (1,1);
-alter table t1 add primary key(b);
-insert into t1 values (2,2);
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` int(11) NOT NULL,
-  `b` int(11) NOT NULL,
-  PRIMARY KEY (`b`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-check table t1;
-Table	Op	Msg_type	Msg_text
-test.t1	check	status	OK
-select * from t1;
-a	b
-1	1
-2	2
-explain select * from t1;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	2	
-explain select * from t1 order by a;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	2	Using filesort
-explain select * from t1 order by b;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	index	NULL	PRIMARY	4	NULL	2	
-checksum table t1;
-Table	Checksum
-test.t1	582702641
-drop table t1;
-create table t1(a int not null) engine=innodb;
-insert into t1 values (1);
-alter table t1 add primary key(a);
-insert into t1 values (2);
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` int(11) NOT NULL,
-  PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-check table t1;
-Table	Op	Msg_type	Msg_text
-test.t1	check	status	OK
-commit;
-select * from t1;
-a
-1
-2
-explain select * from t1;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	index	NULL	PRIMARY	4	NULL	2	Using index
-explain select * from t1 order by a;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	index	NULL	PRIMARY	4	NULL	2	Using index
-drop table t1;
-create table t2(d varchar(17) primary key) engine=innodb default charset=utf8;
-create table t3(a int primary key) engine=innodb;
-insert into t3 values(22),(44),(33),(55),(66);
-insert into t2 values ('jejdkrun87'),('adfd72nh9k'),
-('adfdpplkeock'),('adfdijnmnb78k'),('adfdijn0loKNHJik');
-create table t1(a int, b blob, c text, d text not null)
-engine=innodb default charset = utf8;
-insert into t1
-select a,left(repeat(d,100*a),65535),repeat(d,20*a),d from t2,t3;
-drop table t2, t3;
-select count(*) from t1 where a=44;
-count(*)
-5
-select a,
-length(b),b=left(repeat(d,100*a),65535),length(c),c=repeat(d,20*a),d from t1;
-a	length(b)	b=left(repeat(d,100*a),65535)	length(c)	c=repeat(d,20*a)	d
-22	22000	1	4400	1	adfd72nh9k
-22	35200	1	7040	1	adfdijn0loKNHJik
-22	28600	1	5720	1	adfdijnmnb78k
-22	26400	1	5280	1	adfdpplkeock
-22	22000	1	4400	1	jejdkrun87
-33	33000	1	6600	1	adfd72nh9k
-33	52800	1	10560	1	adfdijn0loKNHJik
-33	42900	1	8580	1	adfdijnmnb78k
-33	39600	1	7920	1	adfdpplkeock
-33	33000	1	6600	1	jejdkrun87
-44	44000	1	8800	1	adfd72nh9k
-44	65535	1	14080	1	adfdijn0loKNHJik
-44	57200	1	11440	1	adfdijnmnb78k
-44	52800	1	10560	1	adfdpplkeock
-44	44000	1	8800	1	jejdkrun87
-55	55000	1	11000	1	adfd72nh9k
-55	65535	1	17600	1	adfdijn0loKNHJik
-55	65535	1	14300	1	adfdijnmnb78k
-55	65535	1	13200	1	adfdpplkeock
-55	55000	1	11000	1	jejdkrun87
-66	65535	1	13200	1	adfd72nh9k
-66	65535	1	21120	1	adfdijn0loKNHJik
-66	65535	1	17160	1	adfdijnmnb78k
-66	65535	1	15840	1	adfdpplkeock
-66	65535	1	13200	1	jejdkrun87
-alter table t1 add primary key (a), add key (b(20));
-ERROR 23000: Duplicate entry '22' for key 'PRIMARY'
-delete from t1 where a%2;
-check table t1;
-Table	Op	Msg_type	Msg_text
-test.t1	check	status	OK
-alter table t1 add primary key (a,b(255),c(255)), add key (b(767));
-select count(*) from t1 where a=44;
-count(*)
-5
-select a,
-length(b),b=left(repeat(d,100*a),65535),length(c),c=repeat(d,20*a),d from t1;
-a	length(b)	b=left(repeat(d,100*a),65535)	length(c)	c=repeat(d,20*a)	d
-22	22000	1	4400	1	adfd72nh9k
-22	35200	1	7040	1	adfdijn0loKNHJik
-22	28600	1	5720	1	adfdijnmnb78k
-22	26400	1	5280	1	adfdpplkeock
-22	22000	1	4400	1	jejdkrun87
-44	44000	1	8800	1	adfd72nh9k
-44	65535	1	14080	1	adfdijn0loKNHJik
-44	57200	1	11440	1	adfdijnmnb78k
-44	52800	1	10560	1	adfdpplkeock
-44	44000	1	8800	1	jejdkrun87
-66	65535	1	13200	1	adfd72nh9k
-66	65535	1	21120	1	adfdijn0loKNHJik
-66	65535	1	17160	1	adfdijnmnb78k
-66	65535	1	15840	1	adfdpplkeock
-66	65535	1	13200	1	jejdkrun87
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` int(11) NOT NULL DEFAULT '0',
-  `b` blob NOT NULL,
-  `c` text NOT NULL,
-  `d` text NOT NULL,
-  PRIMARY KEY (`a`,`b`(255),`c`(255)),
-  KEY `b` (`b`(767))
-) ENGINE=InnoDB DEFAULT CHARSET=utf8
-check table t1;
-Table	Op	Msg_type	Msg_text
-test.t1	check	status	OK
-explain select * from t1 where b like 'adfd%';
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	ALL	b	NULL	NULL	NULL	15	Using where
-create table t2(a int, b varchar(255), primary key(a,b)) engine=innodb;
-insert into t2 select a,left(b,255) from t1;
-drop table t1;
-rename table t2 to t1;
-set innodb_lock_wait_timeout=1;
-begin;
-select a from t1 limit 1 for update;
-a
-22
-set innodb_lock_wait_timeout=1;
-create index t1ba on t1 (b,a);
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-commit;
-begin;
-select a from t1 limit 1 lock in share mode;
-a
-22
-create index t1ba on t1 (b,a);
-drop index t1ba on t1;
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-commit;
-explain select a from t1 order by b;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	index	NULL	t1ba	261	NULL	15	Using index
-select a,sleep(2+a/100) from t1 order by b limit 3;
-select sleep(1);
-sleep(1)
-0
-drop index t1ba on t1;
-a	sleep(2+a/100)
-22	0
-44	0
-66	0
-explain select a from t1 order by b;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	index	NULL	PRIMARY	261	NULL	15	Using index; Using filesort
-select a from t1 order by b limit 3;
-a
-22
-66
-44
-commit;
-drop table t1;
-set global innodb_file_per_table=on;
-set global innodb_file_format='Barracuda';
-create table t1(a blob,b blob,c blob,d blob,e blob,f blob,g blob,h blob,
-i blob,j blob,k blob,l blob,m blob,n blob,o blob,p blob,
-q blob,r blob,s blob,t blob,u blob)
-engine=innodb row_format=dynamic;
-create index t1a on t1 (a(1));
-create index t1b on t1 (b(1));
-create index t1c on t1 (c(1));
-create index t1d on t1 (d(1));
-create index t1e on t1 (e(1));
-create index t1f on t1 (f(1));
-create index t1g on t1 (g(1));
-create index t1h on t1 (h(1));
-create index t1i on t1 (i(1));
-create index t1j on t1 (j(1));
-create index t1k on t1 (k(1));
-create index t1l on t1 (l(1));
-create index t1m on t1 (m(1));
-create index t1n on t1 (n(1));
-create index t1o on t1 (o(1));
-create index t1p on t1 (p(1));
-create index t1q on t1 (q(1));
-create index t1r on t1 (r(1));
-create index t1s on t1 (s(1));
-create index t1t on t1 (t(1));
-create index t1u on t1 (u(1));
-ERROR HY000: Too big row
-create index t1ut on t1 (u(1), t(1));
-ERROR HY000: Too big row
-create index t1st on t1 (s(1), t(1));
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` blob,
-  `b` blob,
-  `c` blob,
-  `d` blob,
-  `e` blob,
-  `f` blob,
-  `g` blob,
-  `h` blob,
-  `i` blob,
-  `j` blob,
-  `k` blob,
-  `l` blob,
-  `m` blob,
-  `n` blob,
-  `o` blob,
-  `p` blob,
-  `q` blob,
-  `r` blob,
-  `s` blob,
-  `t` blob,
-  `u` blob,
-  KEY `t1a` (`a`(1)),
-  KEY `t1b` (`b`(1)),
-  KEY `t1c` (`c`(1)),
-  KEY `t1d` (`d`(1)),
-  KEY `t1e` (`e`(1)),
-  KEY `t1f` (`f`(1)),
-  KEY `t1g` (`g`(1)),
-  KEY `t1h` (`h`(1)),
-  KEY `t1i` (`i`(1)),
-  KEY `t1j` (`j`(1)),
-  KEY `t1k` (`k`(1)),
-  KEY `t1l` (`l`(1)),
-  KEY `t1m` (`m`(1)),
-  KEY `t1n` (`n`(1)),
-  KEY `t1o` (`o`(1)),
-  KEY `t1p` (`p`(1)),
-  KEY `t1q` (`q`(1)),
-  KEY `t1r` (`r`(1)),
-  KEY `t1s` (`s`(1)),
-  KEY `t1t` (`t`(1)),
-  KEY `t1st` (`s`(1),`t`(1))
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
-create index t1u on t1 (u(1));
-ERROR HY000: Too big row
-alter table t1 row_format=compact;
-create index t1u on t1 (u(1));
-drop table t1;
-set global innodb_file_per_table=0;
-set global innodb_file_format=Antelope;
-set global innodb_file_format_check=Antelope;
-SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
-SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
-CREATE TABLE t1(
-c1	BIGINT(12) NOT NULL,
-PRIMARY KEY (c1)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-CREATE TABLE t2(
-c1	BIGINT(16) NOT NULL,
-c2	BIGINT(12) NOT NULL,
-c3	BIGINT(12) NOT NULL,
-PRIMARY KEY (c1)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca
-FOREIGN KEY (c3) REFERENCES t1(c1);
-SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
-SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
-SHOW CREATE TABLE t2;
-Table	Create Table
-t2	CREATE TABLE `t2` (
-  `c1` bigint(16) NOT NULL,
-  `c2` bigint(12) NOT NULL,
-  `c3` bigint(12) NOT NULL,
-  PRIMARY KEY (`c1`),
-  KEY `fk_t2_ca` (`c3`),
-  CONSTRAINT `fk_t2_ca` FOREIGN KEY (`c3`) REFERENCES `t1` (`c1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-CREATE INDEX i_t2_c3_c2 ON t2(c3, c2);
-SHOW CREATE TABLE t2;
-Table	Create Table
-t2	CREATE TABLE `t2` (
-  `c1` bigint(16) NOT NULL,
-  `c2` bigint(12) NOT NULL,
-  `c3` bigint(12) NOT NULL,
-  PRIMARY KEY (`c1`),
-  KEY `i_t2_c3_c2` (`c3`,`c2`),
-  CONSTRAINT `fk_t2_ca` FOREIGN KEY (`c3`) REFERENCES `t1` (`c1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
-SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
-INSERT INTO t2 VALUES(0,0,0);
-ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `fk_t2_ca` FOREIGN KEY (`c3`) REFERENCES `t1` (`c1`))
-INSERT INTO t1 VALUES(0);
-INSERT INTO t2 VALUES(0,0,0);
-DROP TABLE t2;
-CREATE TABLE t2(
-c1	BIGINT(16) NOT NULL,
-c2	BIGINT(12) NOT NULL,
-c3	BIGINT(12) NOT NULL,
-PRIMARY KEY (c1,c2,c3)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca
-FOREIGN KEY (c3) REFERENCES t1(c1);
-SHOW CREATE TABLE t2;
-Table	Create Table
-t2	CREATE TABLE `t2` (
-  `c1` bigint(16) NOT NULL,
-  `c2` bigint(12) NOT NULL,
-  `c3` bigint(12) NOT NULL,
-  PRIMARY KEY (`c1`,`c2`,`c3`),
-  KEY `fk_t2_ca` (`c3`),
-  CONSTRAINT `fk_t2_ca` FOREIGN KEY (`c3`) REFERENCES `t1` (`c1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-CREATE INDEX i_t2_c3_c2 ON t2(c3, c2);
-SHOW CREATE TABLE t2;
-Table	Create Table
-t2	CREATE TABLE `t2` (
-  `c1` bigint(16) NOT NULL,
-  `c2` bigint(12) NOT NULL,
-  `c3` bigint(12) NOT NULL,
-  PRIMARY KEY (`c1`,`c2`,`c3`),
-  KEY `i_t2_c3_c2` (`c3`,`c2`),
-  CONSTRAINT `fk_t2_ca` FOREIGN KEY (`c3`) REFERENCES `t1` (`c1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-INSERT INTO t2 VALUES(0,0,1);
-ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `fk_t2_ca` FOREIGN KEY (`c3`) REFERENCES `t1` (`c1`))
-INSERT INTO t2 VALUES(0,0,0);
-DELETE FROM t1;
-ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `fk_t2_ca` FOREIGN KEY (`c3`) REFERENCES `t1` (`c1`))
-DELETE FROM t2;
-DROP TABLE t2;
-DROP TABLE t1;
-CREATE TABLE t1(
-c1	BIGINT(12) NOT NULL,
-c2	INT(4) NOT NULL,
-PRIMARY KEY (c2,c1)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-CREATE TABLE t2(
-c1	BIGINT(16) NOT NULL,
-c2	BIGINT(12) NOT NULL,
-c3	BIGINT(12) NOT NULL,
-PRIMARY KEY (c1)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca
-FOREIGN KEY (c3,c2) REFERENCES t1(c1,c1);
-ERROR HY000: Can't create table '#sql-temporary' (errno: 150)
-ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca
-FOREIGN KEY (c3,c2) REFERENCES t1(c1,c2);
-ERROR HY000: Can't create table '#sql-temporary' (errno: 150)
-ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca
-FOREIGN KEY (c3,c2) REFERENCES t1(c2,c1);
-ERROR HY000: Can't create table '#sql-temporary' (errno: 150)
-ALTER TABLE t1 MODIFY COLUMN c2 BIGINT(12) NOT NULL;
-ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca
-FOREIGN KEY (c3,c2) REFERENCES t1(c1,c2);
-ERROR HY000: Can't create table '#sql-temporary' (errno: 150)
-ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca
-FOREIGN KEY (c3,c2) REFERENCES t1(c2,c1);
-SHOW CREATE TABLE t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `c1` bigint(12) NOT NULL,
-  `c2` bigint(12) NOT NULL,
-  PRIMARY KEY (`c2`,`c1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-SHOW CREATE TABLE t2;
-Table	Create Table
-t2	CREATE TABLE `t2` (
-  `c1` bigint(16) NOT NULL,
-  `c2` bigint(12) NOT NULL,
-  `c3` bigint(12) NOT NULL,
-  PRIMARY KEY (`c1`),
-  KEY `fk_t2_ca` (`c3`,`c2`),
-  CONSTRAINT `fk_t2_ca` FOREIGN KEY (`c3`, `c2`) REFERENCES `t1` (`c2`, `c1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-CREATE INDEX i_t2_c2_c1 ON t2(c2, c1);
-SHOW CREATE TABLE t2;
-Table	Create Table
-t2	CREATE TABLE `t2` (
-  `c1` bigint(16) NOT NULL,
-  `c2` bigint(12) NOT NULL,
-  `c3` bigint(12) NOT NULL,
-  PRIMARY KEY (`c1`),
-  KEY `fk_t2_ca` (`c3`,`c2`),
-  KEY `i_t2_c2_c1` (`c2`,`c1`),
-  CONSTRAINT `fk_t2_ca` FOREIGN KEY (`c3`, `c2`) REFERENCES `t1` (`c2`, `c1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-CREATE INDEX i_t2_c3_c1_c2 ON t2(c3, c1, c2);
-SHOW CREATE TABLE t2;
-Table	Create Table
-t2	CREATE TABLE `t2` (
-  `c1` bigint(16) NOT NULL,
-  `c2` bigint(12) NOT NULL,
-  `c3` bigint(12) NOT NULL,
-  PRIMARY KEY (`c1`),
-  KEY `fk_t2_ca` (`c3`,`c2`),
-  KEY `i_t2_c2_c1` (`c2`,`c1`),
-  KEY `i_t2_c3_c1_c2` (`c3`,`c1`,`c2`),
-  CONSTRAINT `fk_t2_ca` FOREIGN KEY (`c3`, `c2`) REFERENCES `t1` (`c2`, `c1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-CREATE INDEX i_t2_c3_c2 ON t2(c3, c2);
-SHOW CREATE TABLE t2;
-Table	Create Table
-t2	CREATE TABLE `t2` (
-  `c1` bigint(16) NOT NULL,
-  `c2` bigint(12) NOT NULL,
-  `c3` bigint(12) NOT NULL,
-  PRIMARY KEY (`c1`),
-  KEY `i_t2_c2_c1` (`c2`,`c1`),
-  KEY `i_t2_c3_c1_c2` (`c3`,`c1`,`c2`),
-  KEY `i_t2_c3_c2` (`c3`,`c2`),
-  CONSTRAINT `fk_t2_ca` FOREIGN KEY (`c3`, `c2`) REFERENCES `t1` (`c2`, `c1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-DROP TABLE t2;
-DROP TABLE t1;
-call mtr.add_suppression("InnoDB: insufficient history for index");
-CREATE TABLE t1 (a INT, b CHAR(1)) ENGINE=InnoDB;
-INSERT INTO t1 VALUES (3,'a'),(3,'b'),(1,'c'),(0,'d'),(1,'e');
-BEGIN;
-SELECT * FROM t1;
-a	b
-3	a
-3	b
-1	c
-0	d
-1	e
-CREATE INDEX t1a ON t1(a);
-SELECT * FROM t1;
-a	b
-3	a
-3	b
-1	c
-0	d
-1	e
-SELECT * FROM t1 FORCE INDEX(t1a) ORDER BY a;
-ERROR HY000: Table definition has changed, please retry transaction
-SELECT * FROM t1;
-a	b
-3	a
-3	b
-1	c
-0	d
-1	e
-COMMIT;
-SELECT * FROM t1 FORCE INDEX(t1a) ORDER BY a;
-a	b
-0	d
-1	c
-1	e
-3	a
-3	b
-DROP TABLE t1;

=== removed file 'mysql-test/r/innodb-use-sys-malloc.result'
--- a/mysql-test/r/innodb-use-sys-malloc.result	2009-06-09 13:19:13 +0000
+++ b/mysql-test/r/innodb-use-sys-malloc.result	1970-01-01 00:00:00 +0000
@@ -1,48 +0,0 @@
-SELECT @@GLOBAL.innodb_use_sys_malloc;
-@@GLOBAL.innodb_use_sys_malloc
-1
-1 Expected
-SET @@GLOBAL.innodb_use_sys_malloc=0;
-ERROR HY000: Variable 'innodb_use_sys_malloc' is a read only variable
-Expected error 'Read only variable'
-SELECT @@GLOBAL.innodb_use_sys_malloc;
-@@GLOBAL.innodb_use_sys_malloc
-1
-1 Expected
-drop table if exists t1;
-create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
-insert into t1 values (1),(2),(3),(4),(5),(6),(7);
-select * from t1;
-a
-1
-2
-3
-4
-5
-6
-7
-drop table t1;
-SELECT @@GLOBAL.innodb_use_sys_malloc;
-@@GLOBAL.innodb_use_sys_malloc
-1
-1 Expected
-SET @@GLOBAL.innodb_use_sys_malloc=0;
-ERROR HY000: Variable 'innodb_use_sys_malloc' is a read only variable
-Expected error 'Read only variable'
-SELECT @@GLOBAL.innodb_use_sys_malloc;
-@@GLOBAL.innodb_use_sys_malloc
-1
-1 Expected
-drop table if exists t1;
-create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
-insert into t1 values (1),(2),(3),(4),(5),(6),(7);
-select * from t1;
-a
-1
-2
-3
-4
-5
-6
-7
-drop table t1;

=== modified file 'mysql-test/r/innodb.result'
--- a/mysql-test/r/innodb.result	2010-01-15 15:58:25 +0000
+++ b/mysql-test/r/innodb.result	2010-08-04 08:39:53 +0000
@@ -691,14 +691,16 @@ count(*)
 select count(*) from t1 where sca_pic is null;
 count(*)
 2
-alter table t1 drop index sca_pic, add index sca_pic (cat_code, sca_pic);
+alter table t1 drop index sca_pic;
+alter table t1 add index sca_pic (cat_code, sca_pic);
 select count(*) from t1 where sca_code='PD' and sca_pic is null;
 count(*)
 1
 select count(*) from t1 where cat_code='E';
 count(*)
 0
-alter table t1 drop index sca_pic, add index (sca_pic, cat_code);
+alter table t1 drop index sca_pic;
+alter table t1 add index (sca_pic, cat_code);
 select count(*) from t1 where sca_code='PD' and sca_pic is null;
 count(*)
 1
@@ -1508,7 +1510,7 @@ t2	CREATE TABLE `t2` (
 ) ENGINE=InnoDB DEFAULT CHARSET=latin1
 drop index id2 on t2;
 drop index id on t2;
-Got one of the listed errors
+ERROR HY000: Cannot drop index 'id': needed in a foreign key constraint
 show create table t2;
 Table	Create Table
 t2	CREATE TABLE `t2` (

=== added file 'mysql-test/r/innodb_mysql_lock2.result'
--- a/mysql-test/r/innodb_mysql_lock2.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/r/innodb_mysql_lock2.result	2010-05-27 20:07:40 +0000
@@ -0,0 +1,601 @@
+#
+# Test how do we handle locking in various cases when
+# we read data from InnoDB tables.
+#
+# In fact by performing this test we check two things:
+# 1) That SQL-layer correctly determine type of thr_lock.c
+#    lock to be acquired/passed to InnoDB engine.
+# 2) That InnoDB engine correctly interprets this lock
+#    type and takes necessary row locks or does not
+#    take them if they are not necessary.
+#
+# This test makes sense only in REPEATABLE-READ mode as
+# in SERIALIZABLE mode all statements that read data take
+# shared lock on them to enforce its semantics.
+select @@session.tx_isolation;
+@@session.tx_isolation
+REPEATABLE-READ
+# Prepare playground by creating tables, views,
+# routines and triggers used in tests.
+drop table if exists t0, t1, t2, t3, t4, t5, te;
+drop view if exists v1, v2;
+drop procedure if exists p1;
+drop procedure if exists p2;
+drop function if exists f1;
+drop function if exists f2;
+drop function if exists f3;
+drop function if exists f4;
+drop function if exists f5;
+drop function if exists f6;
+drop function if exists f7;
+drop function if exists f8;
+drop function if exists f9;
+drop function if exists f10;
+drop function if exists f11;
+drop function if exists f12;
+drop function if exists f13;
+drop function if exists f14;
+drop function if exists f15;
+create table t1 (i int primary key) engine=innodb;
+insert into t1 values (1), (2), (3), (4), (5);
+create table t2 (j int primary key) engine=innodb;
+insert into t2 values (1), (2), (3), (4), (5);
+create table t3 (k int primary key) engine=innodb;
+insert into t3 values (1), (2), (3);
+create table t4 (l int primary key) engine=innodb;
+insert into t4 values (1);
+create table t5 (l int primary key) engine=innodb;
+insert into t5 values (1);
+create table te(e int primary key);
+insert into te values (1);
+create view v1 as select i from t1;
+create view v2 as select j from t2 where j in (select i from t1);
+create procedure p1(k int) insert into t2 values (k);
+create function f1() returns int
+begin
+declare j int;
+select i from t1 where i = 1 into j;
+return j;
+end|
+create function f2() returns int
+begin
+declare k int;
+select i from t1 where i = 1 into k;
+insert into t2 values (k + 5);
+return 0;
+end|
+create function f3() returns int
+begin
+return (select i from t1 where i = 3);
+end|
+create function f4() returns int
+begin
+if (select i from t1 where i = 3) then
+return 1;
+else
+return 0;
+end if;
+end|
+create function f5() returns int
+begin
+insert into t2 values ((select i from t1 where i = 1) + 5);
+return 0;
+end|
+create function f6() returns int
+begin
+declare k int;
+select i from v1 where i = 1 into k;
+return k;
+end|
+create function f7() returns int
+begin
+declare k int;
+select j from v2 where j = 1 into k;
+return k;
+end|
+create function f8() returns int
+begin
+declare k int;
+select i from v1 where i = 1 into k;
+insert into t2 values (k+5);
+return k;
+end|
+create function f9() returns int
+begin
+update v2 set j=j+10 where j=1;
+return 1;
+end|
+create function f10() returns int
+begin
+return f1();
+end|
+create function f11() returns int
+begin
+declare k int;
+set k= f1();
+insert into t2 values (k+5);
+return k;
+end|
+create function f12(p int) returns int
+begin
+insert into t2 values (p);
+return p;
+end|
+create function f13(p int) returns int
+begin
+return p;
+end|
+create procedure p2(inout p int)
+begin
+select i from t1 where i = 1 into p;
+end|
+create function f14() returns int
+begin
+declare k int;
+call p2(k);
+insert into t2 values (k+5);
+return k;
+end|
+create function f15() returns int
+begin
+declare k int;
+call p2(k);
+return k;
+end|
+create trigger t4_bi before insert on t4 for each row
+begin
+declare k int;
+select i from t1 where i=1 into k;
+set new.l= k+1;
+end|
+create trigger t4_bu before update on t4 for each row
+begin
+if (select i from t1 where i=1) then
+set new.l= 2;
+end if;
+end|
+# Trigger below uses insertion of duplicate key in 'te'
+# table as a way to abort delete operation.
+create trigger t4_bd before delete on t4 for each row
+begin
+if !(select i from v1 where i=1) then
+insert into te values (1);
+end if;
+end|
+create trigger t5_bi before insert on t5 for each row
+begin
+set new.l= f1()+1;
+end|
+create trigger t5_bu before update on t5 for each row
+begin
+declare j int;
+call p2(j);
+set new.l= j + 1;
+end|
+#
+# Set common variables to be used by scripts called below.
+#
+#
+# 1. Statements that read tables and do not use subqueries.
+#
+#
+# 1.1 Simple SELECT statement.
+#
+# No locks are necessary as this statement won't be written
+# to the binary log and InnoDB supports snapshots.
+Success: 'select * from t1' doesn't take row locks on 't1'.
+#
+# 1.2 Multi-UPDATE statement.
+#
+# Has to take shared locks on rows in the table being read as this
+# statement will be written to the binary log and therefore should
+# be serialized with concurrent statements.
+Success: 'update t2, t1 set j= j - 1 where i = j' takes shared row locks on 't1'.
+#
+# 1.3 Multi-DELETE statement.
+#
+# The above is true for this statement as well.
+Success: 'delete t2 from t1, t2 where i = j' takes shared row locks on 't1'.
+#
+# 1.4 DESCRIBE statement.
+#
+# This statement does not really read data from the
+# target table and thus does not take any lock on it.
+# We check this for completeness of coverage.
+Success: 'describe t1' doesn't take row locks on 't1'.
+#
+# 1.5 SHOW statements.
+# 
+# The above is true for SHOW statements as well.
+Success: 'show create table t1' doesn't take row locks on 't1'.
+Success: 'show keys from t1' doesn't take row locks on 't1'.
+#
+# 2. Statements which read tables through subqueries.
+#
+#
+# 2.1 CALL with a subquery.
+# 
+# A strong lock is not necessary as this statement is not
+# written to the binary log as a whole (it is written
+# statement-by-statement) and thanks to MVCC we can always get
+# versions of rows prior to the update that has locked them.
+# But in practice InnoDB does locking reads for all statements
+# other than SELECT (unless it is a READ-COMITTED mode or
+# innodb_locks_unsafe_for_binlog is ON).
+Success: 'call p1((select i + 5 from t1 where i = 1))' takes shared row locks on 't1'.
+#
+# 2.2 CREATE TABLE with a subquery.
+#
+# Has to take shared locks on rows in the table being read as
+# this statement is written to the binary log and therefore
+# should be serialized with concurrent statements.
+Success: 'create table t0 engine=innodb select * from t1' takes shared row locks on 't1'.
+drop table t0;
+Success: 'create table t0 engine=innodb select j from t2 where j in (select i from t1)' takes shared row locks on 't1'.
+drop table t0;
+#
+# 2.3 DELETE with a subquery.
+#
+# The above is true for this statement as well.
+Success: 'delete from t2 where j in (select i from t1)' takes shared row locks on 't1'.
+#
+# 2.4 MULTI-DELETE with a subquery.
+#
+# Same is true for this statement as well.
+Success: 'delete t2 from t3, t2 where k = j and j in (select i from t1)' takes shared row locks on 't1'.
+#
+# 2.5 DO with a subquery.
+#
+# In theory should not take row locks as it is not logged.
+# In practice InnoDB takes shared row locks.
+Success: 'do (select i from t1 where i = 1)' takes shared row locks on 't1'.
+#
+# 2.6 INSERT with a subquery.
+#
+# Has to take shared locks on rows in the table being read as
+# this statement is written to the binary log and therefore
+# should be serialized with concurrent statements.
+Success: 'insert into t2 select i+5 from t1' takes shared row locks on 't1'.
+Success: 'insert into t2 values ((select i+5 from t1 where i = 4))' takes shared row locks on 't1'.
+#
+# 2.7 LOAD DATA with a subquery.
+# 
+# The above is true for this statement as well.
+Success: 'load data infile '../../std_data/rpl_loaddata.dat' into table t2 (@a, @b) set j= @b + (select i from t1 where i = 1)' takes shared row locks on 't1'.
+#
+# 2.8 REPLACE with a subquery.
+# 
+# Same is true for this statement as well.
+Success: 'replace into t2 select i+5 from t1' takes shared row locks on 't1'.
+Success: 'replace into t2 values ((select i+5 from t1 where i = 4))' takes shared row locks on 't1'.
+#
+# 2.9 SELECT with a subquery.
+#
+# Locks are not necessary as this statement is not written
+# to the binary log and thanks to MVCC we can always get
+# versions of rows prior to the update that has locked them.
+#
+# Also serves as a test case for bug #46947 "Embedded SELECT
+# without FOR UPDATE is causing a lock".
+Success: 'select * from t2 where j in (select i from t1)' doesn't take row locks on 't1'.
+#
+# 2.10 SET with a subquery.
+#
+# In theory should not require locking as it is not written
+# to the binary log. In practice InnoDB acquires shared row
+# locks.
+Success: 'set @a:= (select i from t1 where i = 1)' takes shared row locks on 't1'.
+#
+# 2.11 SHOW with a subquery.
+# 
+# Similarly to the previous case, in theory should not require locking
+# as it is not written to the binary log. In practice InnoDB
+# acquires shared row locks.
+Success: 'show tables from test where Tables_in_test = 't2' and (select i from t1 where i = 1)' takes shared row locks on 't1'.
+Success: 'show columns from t2 where (select i from t1 where i = 1)' takes shared row locks on 't1'.
+#
+# 2.12 UPDATE with a subquery.
+#
+# Has to take shared locks on rows in the table being read as
+# this statement is written to the binary log and therefore
+# should be serialized with concurrent statements.
+Success: 'update t2 set j= j-10 where j in (select i from t1)' takes shared row locks on 't1'.
+#
+# 2.13 MULTI-UPDATE with a subquery.
+#
+# Same is true for this statement as well.
+Success: 'update t2, t3 set j= j -10 where j=k and j in (select i from t1)' takes shared row locks on 't1'.
+#
+# 3. Statements which read tables through a view.
+#
+#
+# 3.1 SELECT statement which uses some table through a view.
+#
+# Since this statement is not written to the binary log
+# and old version of rows are accessible thanks to MVCC,
+# no locking is necessary.
+Success: 'select * from v1' doesn't take row locks on 't1'.
+Success: 'select * from v2' doesn't take row locks on 't1'.
+Success: 'select * from t2 where j in (select i from v1)' doesn't take row locks on 't1'.
+Success: 'select * from t3 where k in (select j from v2)' doesn't take row locks on 't1'.
+#
+# 3.2 Statements which modify a table and use views.
+#
+# Since such statements are going to be written to the binary
+# log they need to be serialized against concurrent statements
+# and therefore should take shared row locks on data read.
+Success: 'update t2 set j= j-10 where j in (select i from v1)' takes shared row locks on 't1'.
+Success: 'update t3 set k= k-10 where k in (select j from v2)' takes shared row locks on 't1'.
+Success: 'update t2, v1 set j= j-10 where j = i' takes shared row locks on 't1'.
+Success: 'update v2 set j= j-10 where j = 3' takes shared row locks on 't1'.
+#
+# 4. Statements which read tables through stored functions.
+#
+#
+# 4.1 SELECT/SET with a stored function which does not 
+#     modify data and uses SELECT in its turn.
+#
+# Calls to such functions won't get into the binary log and
+# thus don't need to acquire strong locks.
+# In 5.5 due to fix for bug #53921 "Wrong locks for SELECTs
+# used stored functions may lead to broken SBR" strong locks
+# are taken (we accepted it as a trade-off for this fix).
+Success: 'select f1()' doesn't take row locks on 't1'.
+Success: 'set @a:= f1()' doesn't take row locks on 't1'.
+#
+# 4.2 INSERT (or other statement which modifies data) with
+#     a stored function which does not modify data and uses
+#     SELECT.
+#
+# Since such statement is written to the binary log it should
+# be serialized with concurrent statements affecting the data
+# it uses. Therefore it should take row locks on the data
+# it reads.
+# But due to bug #53921 "Wrong locks for SELECTs used stored
+# functions may lead to broken SBR" no lock is taken.
+Success: 'insert into t2 values (f1() + 5)' doesn't take row locks on 't1'.
+#
+# 4.3 SELECT/SET with a stored function which
+#     reads and modifies data.
+#
+# Since a call to such function is written to the binary log,
+# it should be serialized with concurrent statements affecting
+# the data it uses. Hence, row locks on the data read
+# should be taken.
+# But due to bug #53921 "Wrong locks for SELECTs used stored
+# functions may lead to broken SBR" no lock is taken.
+Success: 'select f2()' doesn't take row locks on 't1'.
+Success: 'set @a:= f2()' doesn't take row locks on 't1'.
+#
+# 4.4. SELECT/SET with a stored function which does not
+#      modify data and reads a table through subselect
+#      in a control construct.
+#
+# Again, in theory a call to this function won't get to the
+# binary log and thus no locking is needed. But in practice
+# we don't detect this fact early enough (get_lock_type_for_table())
+# to avoid taking row locks.
+Success: 'select f3()' takes shared row locks on 't1'.
+Success: 'set @a:= f3()' takes shared row locks on 't1'.
+Success: 'select f4()' takes shared row locks on 't1'.
+Success: 'set @a:= f4()' takes shared row locks on 't1'.
+#
+# 4.5. INSERT (or other statement which modifies data) with
+#      a stored function which does not modify data and reads
+#      the table through a subselect in one of its control
+#      constructs.
+#
+# Since such statement is written to the binary log it should
+# be serialized with concurrent statements affecting data it
+# uses. Therefore it should take row locks on the data
+# it reads.
+Success: 'insert into t2 values (f3() + 5)' takes shared row locks on 't1'.
+Success: 'insert into t2 values (f4() + 6)' takes shared row locks on 't1'.
+#
+# 4.6 SELECT/SET which uses a stored function with
+#      DML which reads a table via a subquery.
+#
+# Since call to such function is written to the binary log
+# it should be serialized with concurrent statements.
+# Hence reads should take row locks.
+Success: 'select f5()' takes shared row locks on 't1'.
+Success: 'set @a:= f5()' takes shared row locks on 't1'.
+#
+# 4.7 SELECT/SET which uses a stored function which
+#     doesn't modify data and reads tables through
+#     a view.
+#
+# Once again, in theory, calls to such functions won't
+# get into the binary log and thus don't need row
+# locks. In practice this fact is discovered
+# too late to have any effect.
+# But due to bug #53921 "Wrong locks for SELECTs used stored
+# functions may lead to broken SBR" no lock is taken
+# in case of simple SELECT.
+Success: 'select f6()' doesn't take row locks on 't1'.
+Success: 'set @a:= f6()' doesn't take row locks on 't1'.
+Success: 'select f7()' takes shared row locks on 't1'.
+Success: 'set @a:= f7()' takes shared row locks on 't1'.
+#
+# 4.8 INSERT which uses stored function which
+#     doesn't modify data and reads a table
+#     through a view.
+#
+# Since such statement is written to the binary log and
+# should be serialized with concurrent statements affecting
+# the data it uses. Therefore it should take row locks on
+# the rows it reads.
+# But due to bug #53921 "Wrong locks for SELECTs used stored
+# functions may lead to broken SBR" no lock is taken
+# in case of simple SELECT.
+Success: 'insert into t3 values (f6() + 5)' doesn't take row locks on 't1'.
+Success: 'insert into t3 values (f7() + 5)' takes shared row locks on 't1'.
+#
+# 4.9 SELECT which uses a stored function which
+#     modifies data and reads tables through a view.
+#
+# Since a call to such function is written to the binary log
+# it should be serialized with concurrent statements.
+# Hence, reads should take row locks.
+# But due to bug #53921 "Wrong locks for SELECTs used stored
+# functions may lead to broken SBR" no lock is taken
+# in case of simple SELECT.
+Success: 'select f8()' doesn't take row locks on 't1'.
+Success: 'select f9()' takes shared row locks on 't1'.
+#
+# 4.10 SELECT which uses stored function which doesn't modify
+#      data and reads a table indirectly, by calling another
+#      function.
+#
+# Calls to such functions won't get into the binary log and
+# thus don't need to acquire strong locks.
+# In 5.5 due to fix for bug #53921 "Wrong locks for SELECTs
+# used stored functions may lead to broken SBR" strong locks
+# are taken (we accepted it as a trade-off for this fix).
+Success: 'select f10()' doesn't take row locks on 't1'.
+#
+# 4.11 INSERT which uses a stored function which doesn't modify
+#      data and reads a table indirectly, by calling another
+#      function. 
+#
+# Since such statement is written to the binary log, it should
+# be serialized with concurrent statements affecting the data it
+# uses. Therefore it should take row locks on data it reads.
+# But due to bug #53921 "Wrong locks for SELECTs used stored
+# functions may lead to broken SBR" no lock is taken.
+Success: 'insert into t2 values (f10() + 5)' doesn't take row locks on 't1'.
+#
+# 4.12 SELECT which uses a stored function which modifies
+#      data and reads a table indirectly, by calling another
+#      function. 
+#
+# Since a call to such function is written to the binary log
+# it should be serialized from concurrent statements.
+# Hence, reads should take row locks.
+# But due to bug #53921 "Wrong locks for SELECTs used stored
+# functions may lead to broken SBR" no lock is taken.
+Success: 'select f11()' doesn't take row locks on 't1'.
+#
+# 4.13 SELECT that reads a table through a subquery passed
+#      as a parameter to a stored function which modifies
+#      data.
+#
+# Even though a call to this function is written to the
+# binary log, values of its parameters are written as literals.
+# So there is no need to acquire row locks on rows used in 
+# the subquery.
+# But due to the fact that in 5.1 for prelocked statements
+# THD::in_lock_tables is set to TRUE we acquire strong locks
+# (see also bug#44613 "SELECT statement inside FUNCTION takes
+# a shared lock" [sic!!!]).
+Success: 'select f12((select i+10 from t1 where i=1))' takes shared row locks on 't1'.
+#
+# 4.14 INSERT that reads a table via a subquery passed
+#      as a parameter to a stored function which doesn't
+#      modify data.
+#
+# Since this statement is written to the binary log it should
+# be serialized with concurrent statements affecting the data it
+# uses. Therefore it should take row locks on the data it reads.
+Success: 'insert into t2 values (f13((select i+10 from t1 where i=1)))' takes shared row locks on 't1'.
+#
+# 5. Statements that read tables through stored procedures.
+#
+#
+# 5.1 CALL statement which reads a table via SELECT.
+#
+# Since neither this statement nor its components are
+# written to the binary log, there is no need to take
+# row locks on the data it reads.
+Success: 'call p2(@a)' doesn't take row locks on 't1'.
+#
+# 5.2 Function that modifies data and uses CALL, 
+#     which reads a table through SELECT.
+#
+# Since a call to such function is written to the binary
+# log, it should be serialized with concurrent statements.
+# Hence, in this case reads should take row locks on data.
+# But due to bug #53921 "Wrong locks for SELECTs used stored
+# functions may lead to broken SBR" no lock is taken.
+Success: 'select f14()' doesn't take row locks on 't1'.
+#
+# 5.3 SELECT that calls a function that doesn't modify data and
+#     uses a CALL statement that reads a table via SELECT.
+#
+# Calls to such functions won't get into the binary log and
+# thus don't need to acquire strong locks.
+# In 5.5 due to fix for bug #53921 "Wrong locks for SELECTs
+# used stored functions may lead to broken SBR" strong locks
+# are taken (we accepted it as a trade-off for this fix).
+Success: 'select f15()' doesn't take row locks on 't1'.
+#
+# 5.4 INSERT which calls function which doesn't modify data and
+#     uses CALL statement which reads table through SELECT.
+#
+# Since such statement is written to the binary log it should
+# be serialized with concurrent statements affecting data it
+# uses. Therefore it should take row locks on data it reads.
+# But due to bug #53921 "Wrong locks for SELECTs used stored
+# functions may lead to broken SBR" no lock is taken.
+Success: 'insert into t2 values (f15()+5)' doesn't take row locks on 't1'.
+#
+# 6. Statements that use triggers.
+#
+#
+# 6.1 Statement invoking a trigger that reads table via SELECT.
+#
+# Since this statement is written to the binary log it should
+# be serialized with concurrent statements affecting the data
+# it uses. Therefore, it should take row locks on the data
+# it reads.
+# But due to bug #53921 "Wrong locks for SELECTs used stored
+# functions may lead to broken SBR" no lock is taken.
+Success: 'insert into t4 values (2)' doesn't take row locks on 't1'.
+#
+# 6.2 Statement invoking a trigger that reads table through
+#     a subquery in a control construct.
+#
+# The above is true for this statement as well.
+Success: 'update t4 set l= 2 where l = 1' takes shared row locks on 't1'.
+#
+# 6.3 Statement invoking a trigger that reads a table through
+#     a view.
+#
+# And for this statement.
+Success: 'delete from t4 where l = 1' takes shared row locks on 't1'.
+#
+# 6.4 Statement invoking a trigger that reads a table through
+#     a stored function.
+#
+# And for this statement.
+# But due to bug #53921 "Wrong locks for SELECTs used stored
+# functions may lead to broken SBR" no lock is taken.
+Success: 'insert into t5 values (2)' doesn't take row locks on 't1'.
+#
+# 6.5 Statement invoking a trigger that reads a table through
+#     stored procedure.
+#
+# And for this statement.
+# But due to bug #53921 "Wrong locks for SELECTs used stored
+# functions may lead to broken SBR" no lock is taken.
+Success: 'update t5 set l= 2 where l = 1' doesn't take row locks on 't1'.
+# Clean-up.
+drop function f1;
+drop function f2;
+drop function f3;
+drop function f4;
+drop function f5;
+drop function f6;
+drop function f7;
+drop function f8;
+drop function f9;
+drop function f10;
+drop function f11;
+drop function f12;
+drop function f13;
+drop function f14;
+drop function f15;
+drop view v1, v2;
+drop procedure p1;
+drop procedure p2;
+drop table t1, t2, t3, t4, t5, te;

=== removed file 'mysql-test/r/innodb_xtradb_bug317074.result'
--- a/mysql-test/r/innodb_xtradb_bug317074.result	2010-01-15 15:58:25 +0000
+++ b/mysql-test/r/innodb_xtradb_bug317074.result	1970-01-01 00:00:00 +0000
@@ -1,31 +0,0 @@
-SET @old_innodb_file_format=@@innodb_file_format;
-SET @old_innodb_file_per_table=@@innodb_file_per_table;
-SET GLOBAL innodb_file_format='Barracuda';
-SET GLOBAL innodb_file_per_table=ON;
-DROP TABLE IF EXISTS `test1`;
-CREATE TABLE IF NOT EXISTS `test1` (
-`a` int primary key auto_increment,
-`b` int default 0,
-`c` char(100) default 'testtest'
-) ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8;
-set autocommit=0;
-CREATE PROCEDURE insert_many(p1 int)
-BEGIN
-SET @x = 0;
-SET @y = 0;
-REPEAT
-insert into test1 set b=1;
-SET @x = @x + 1;
-SET @y = @y + 1;
-IF @y >= 1000 THEN
-commit;
-SET @y = 0;
-END IF;
-UNTIL @x >= p1 END REPEAT;
-END|
-DROP PROCEDURE insert_many;
-ALTER TABLE test1 ENGINE=MyISAM;
-DROP TABLE test1;
-SET GLOBAL innodb_file_format=@old_innodb_file_format;
-SET GLOBAL innodb_file_per_table=@old_innodb_file_per_table;
-set global innodb_file_format_check=Antelope;

=== modified file 'mysql-test/r/join_outer.result'
--- a/mysql-test/r/join_outer.result	2010-03-19 06:21:37 +0000
+++ b/mysql-test/r/join_outer.result	2010-06-01 07:54:06 +0000
@@ -1308,4 +1308,93 @@ WHERE (COALESCE(t1.f1, t2.f1), f3) IN ((
 f1	f2	f3	f1	f2
 1	NULL	3	NULL	NULL
 DROP TABLE t1, t2;
+#
+# Bug#52357: Assertion failed: join->best_read in greedy_search 
+# optimizer_search_depth=0
+#
+CREATE TABLE t1( a INT );
+INSERT INTO t1 VALUES (1),(2);
+SET optimizer_search_depth = 0;
+# Should not core dump on query preparation
+EXPLAIN
+SELECT 1
+FROM t1 tt3 LEFT  OUTER JOIN t1 tt4 ON 1
+LEFT  OUTER JOIN t1 tt5 ON 1
+LEFT  OUTER JOIN t1 tt6 ON 1
+LEFT  OUTER JOIN t1 tt7 ON 1
+LEFT  OUTER JOIN t1 tt8 ON 1
+RIGHT OUTER JOIN t1 tt2 ON 1
+RIGHT OUTER JOIN t1 tt1 ON 1
+STRAIGHT_JOIN    t1 tt9 ON 1;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	tt1	ALL	NULL	NULL	NULL	NULL	2	
+1	SIMPLE	tt2	ALL	NULL	NULL	NULL	NULL	2	
+1	SIMPLE	tt3	ALL	NULL	NULL	NULL	NULL	2	
+1	SIMPLE	tt4	ALL	NULL	NULL	NULL	NULL	2	
+1	SIMPLE	tt5	ALL	NULL	NULL	NULL	NULL	2	
+1	SIMPLE	tt6	ALL	NULL	NULL	NULL	NULL	2	
+1	SIMPLE	tt7	ALL	NULL	NULL	NULL	NULL	2	
+1	SIMPLE	tt8	ALL	NULL	NULL	NULL	NULL	2	
+1	SIMPLE	tt9	ALL	NULL	NULL	NULL	NULL	2	Using join buffer
+SET optimizer_search_depth = DEFAULT;
+DROP TABLE t1;
+#
+# Bug#46091 STRAIGHT_JOIN + RIGHT JOIN returns different result
+#
+CREATE TABLE t1 (f1 INT NOT NULL);
+INSERT INTO t1 VALUES (9),(0);
+CREATE TABLE t2 (f1 INT NOT NULL);
+INSERT INTO t2 VALUES
+(5),(3),(0),(3),(1),(0),(1),(7),(1),(0),(0),(8),(4),(9),(0),(2),(0),(8),(5),(1);
+SELECT STRAIGHT_JOIN COUNT(*) FROM t1 TA1
+RIGHT JOIN t2 TA2 JOIN t2 TA3 ON TA2.f1 ON TA3.f1;
+COUNT(*)
+476
+EXPLAIN SELECT STRAIGHT_JOIN COUNT(*) FROM t1 TA1
+RIGHT JOIN t2 TA2 JOIN t2 TA3 ON TA2.f1 ON TA3.f1;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	TA2	ALL	NULL	NULL	NULL	NULL	20	Using where
+1	SIMPLE	TA3	ALL	NULL	NULL	NULL	NULL	20	Using join buffer
+1	SIMPLE	TA1	ALL	NULL	NULL	NULL	NULL	2	
+DROP TABLE t1, t2;
+#
+# Bug#48971 Segfault in add_found_match_trig_cond () at sql_select.cc:5990
+#
+CREATE TABLE t1(f1 INT, PRIMARY KEY (f1));
+INSERT INTO t1 VALUES (1),(2);
+EXPLAIN EXTENDED SELECT STRAIGHT_JOIN jt1.f1 FROM t1 AS jt1
+LEFT JOIN t1 AS jt2
+RIGHT JOIN t1 AS jt3
+JOIN t1 AS jt4 ON 1
+LEFT JOIN t1 AS jt5 ON 1
+ON 1
+RIGHT JOIN t1 AS jt6 ON jt6.f1
+ON 1;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
+1	SIMPLE	jt1	index	NULL	PRIMARY	4	NULL	2	100.00	Using index
+1	SIMPLE	jt6	index	NULL	PRIMARY	4	NULL	2	100.00	Using index
+1	SIMPLE	jt3	index	NULL	PRIMARY	4	NULL	2	100.00	Using index
+1	SIMPLE	jt4	index	NULL	PRIMARY	4	NULL	2	100.00	Using index
+1	SIMPLE	jt5	index	NULL	PRIMARY	4	NULL	2	100.00	Using index
+1	SIMPLE	jt2	index	NULL	PRIMARY	4	NULL	2	100.00	Using index
+Warnings:
+Note	1003	select straight_join `test`.`jt1`.`f1` AS `f1` from `test`.`t1` `jt1` left join (`test`.`t1` `jt6` left join (`test`.`t1` `jt3` join `test`.`t1` `jt4` left join `test`.`t1` `jt5` on(1) left join `test`.`t1` `jt2` on(1)) on((`test`.`jt6`.`f1` and 1))) on(1) where 1
+EXPLAIN EXTENDED SELECT STRAIGHT_JOIN jt1.f1 FROM t1 AS jt1
+RIGHT JOIN t1 AS jt2
+RIGHT JOIN t1 AS jt3
+JOIN t1 AS jt4 ON 1
+LEFT JOIN t1 AS jt5 ON 1
+ON 1
+RIGHT JOIN t1 AS jt6 ON jt6.f1
+ON 1;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
+1	SIMPLE	jt6	index	NULL	PRIMARY	4	NULL	2	100.00	Using index
+1	SIMPLE	jt3	index	NULL	PRIMARY	4	NULL	2	100.00	Using index
+1	SIMPLE	jt4	index	NULL	PRIMARY	4	NULL	2	100.00	Using index
+1	SIMPLE	jt5	index	NULL	PRIMARY	4	NULL	2	100.00	Using index
+1	SIMPLE	jt2	index	NULL	PRIMARY	4	NULL	2	100.00	Using index
+1	SIMPLE	jt1	index	NULL	PRIMARY	4	NULL	2	100.00	Using index
+Warnings:
+Note	1003	select straight_join `test`.`jt1`.`f1` AS `f1` from `test`.`t1` `jt6` left join (`test`.`t1` `jt3` join `test`.`t1` `jt4` left join `test`.`t1` `jt5` on(1) left join `test`.`t1` `jt2` on(1)) on((`test`.`jt6`.`f1` and 1)) left join `test`.`t1` `jt1` on(1) where 1
+DROP TABLE t1;
 End of 5.1 tests

=== modified file 'mysql-test/r/loaddata.result'
--- a/mysql-test/r/loaddata.result	2010-05-03 16:14:39 +0000
+++ b/mysql-test/r/loaddata.result	2010-06-09 08:29:27 +0000
@@ -496,4 +496,11 @@ SELECT * FROM t1;
 col0
 test
 DROP TABLE t1;
+#
+# Bug #52512 : Assertion `! is_set()' in 
+#  Diagnostics_area::set_ok_status on LOAD DATA
+#
+CREATE TABLE t1 (id INT NOT NULL);
+LOAD DATA LOCAL INFILE 'tb.txt' INTO TABLE t1;
+DROP TABLE t1;
 End of 5.1 tests

=== added file 'mysql-test/r/lock_sync.result'
--- a/mysql-test/r/lock_sync.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/r/lock_sync.result	2010-05-27 20:07:40 +0000
@@ -0,0 +1,631 @@
+#
+# Test how we handle locking in various cases when
+# we read data from MyISAM tables.
+#
+# In this test we mostly check that the SQL-layer correctly
+# determines the type of thr_lock.c lock for a table being
+# read.
+# I.e. that it disallows concurrent inserts when the statement
+# is going to be written to the binary log and therefore
+# should be serialized, and allows concurrent inserts when
+# such serialization is not necessary (e.g. when 
+# the statement is not written to binary log).
+#
+# Force concurrent inserts to be performed even if the table
+# has gaps. This allows to simplify clean up in scripts
+# used below (instead of backing up table being inserted
+# into and then restoring it from backup at the end of the
+# script we can simply delete rows which were inserted).
+set @old_concurrent_insert= @@global.concurrent_insert;
+set @@global.concurrent_insert= 2;
+select @@global.concurrent_insert;
+@@global.concurrent_insert
+2
+# Prepare playground by creating tables, views,
+# routines and triggers used in tests.
+drop table if exists t0, t1, t2, t3, t4, t5, te;
+drop view if exists v1, v2;
+drop procedure if exists p1;
+drop procedure if exists p2;
+drop function if exists f1;
+drop function if exists f2;
+drop function if exists f3;
+drop function if exists f4;
+drop function if exists f5;
+drop function if exists f6;
+drop function if exists f7;
+drop function if exists f8;
+drop function if exists f9;
+drop function if exists f10;
+drop function if exists f11;
+drop function if exists f12;
+drop function if exists f13;
+drop function if exists f14;
+drop function if exists f15;
+create table t1 (i int primary key);
+insert into t1 values (1), (2), (3), (4), (5);
+create table t2 (j int primary key);
+insert into t2 values (1), (2), (3), (4), (5);
+create table t3 (k int primary key);
+insert into t3 values (1), (2), (3);
+create table t4 (l int primary key);
+insert into t4 values (1);
+create table t5 (l int primary key);
+insert into t5 values (1);
+create table te(e int primary key);
+insert into te values (1);
+create view v1 as select i from t1;
+create view v2 as select j from t2 where j in (select i from t1);
+create procedure p1(k int) insert into t2 values (k);
+create function f1() returns int
+begin
+declare j int;
+select i from t1 where i = 1 into j;
+return j;
+end|
+create function f2() returns int
+begin
+declare k int;
+select i from t1 where i = 1 into k;
+insert into t2 values (k + 5);
+return 0;
+end|
+create function f3() returns int
+begin
+return (select i from t1 where i = 3);
+end|
+create function f4() returns int
+begin
+if (select i from t1 where i = 3) then
+return 1;
+else
+return 0;
+end if;
+end|
+create function f5() returns int
+begin
+insert into t2 values ((select i from t1 where i = 1) + 5);
+return 0;
+end|
+create function f6() returns int
+begin
+declare k int;
+select i from v1 where i = 1 into k;
+return k;
+end|
+create function f7() returns int
+begin
+declare k int;
+select j from v2 where j = 1 into k;
+return k;
+end|
+create function f8() returns int
+begin
+declare k int;
+select i from v1 where i = 1 into k;
+insert into t2 values (k+5);
+return k;
+end|
+create function f9() returns int
+begin
+update v2 set j=j+10 where j=1;
+return 1;
+end|
+create function f10() returns int
+begin
+return f1();
+end|
+create function f11() returns int
+begin
+declare k int;
+set k= f1();
+insert into t2 values (k+5);
+return k;
+end|
+create function f12(p int) returns int
+begin
+insert into t2 values (p);
+return p;
+end|
+create function f13(p int) returns int
+begin
+return p;
+end|
+create procedure p2(inout p int)
+begin
+select i from t1 where i = 1 into p;
+end|
+create function f14() returns int
+begin
+declare k int;
+call p2(k);
+insert into t2 values (k+5);
+return k;
+end|
+create function f15() returns int
+begin
+declare k int;
+call p2(k);
+return k;
+end|
+create trigger t4_bi before insert on t4 for each row
+begin
+declare k int;
+select i from t1 where i=1 into k;
+set new.l= k+1;
+end|
+create trigger t4_bu before update on t4 for each row
+begin
+if (select i from t1 where i=1) then
+set new.l= 2;
+end if;
+end|
+# Trigger below uses insertion of duplicate key in 'te'
+# table as a way to abort delete operation.
+create trigger t4_bd before delete on t4 for each row
+begin
+if !(select i from v1 where i=1) then
+insert into te values (1);
+end if;
+end|
+create trigger t5_bi before insert on t5 for each row
+begin
+set new.l= f1()+1;
+end|
+create trigger t5_bu before update on t5 for each row
+begin
+declare j int;
+call p2(j);
+set new.l= j + 1;
+end|
+#
+# Set common variables to be used by the scripts
+# called below.
+#
+# Switch to connection 'con1'.
+# Cache all functions used in the tests below so statements
+# calling them won't need to open and lock mysql.proc table
+# and we can assume that each statement locks its tables
+# once during its execution.
+show create procedure p1;
+show create procedure p2;
+show create function f1;
+show create function f2;
+show create function f3;
+show create function f4;
+show create function f5;
+show create function f6;
+show create function f7;
+show create function f8;
+show create function f9;
+show create function f10;
+show create function f11;
+show create function f12;
+show create function f13;
+show create function f14;
+show create function f15;
+# Switch back to connection 'default'.
+#
+# 1. Statements that read tables and do not use subqueries.
+#
+#
+# 1.1 Simple SELECT statement.
+#
+# No locks are necessary as this statement won't be written
+# to the binary log and thanks to how MyISAM works SELECT
+# will see version of the table prior to concurrent insert.
+Success: 'select * from t1' allows concurrent inserts into 't1'.
+#
+# 1.2 Multi-UPDATE statement.
+#
+# Has to take shared locks on rows in the table being read as this
+# statement will be written to the binary log and therefore should
+# be serialized with concurrent statements.
+Success: 'update t2, t1 set j= j - 1 where i = j' doesn't allow concurrent inserts into 't1'.
+#
+# 1.3 Multi-DELETE statement.
+#
+# The above is true for this statement as well.
+Success: 'delete t2 from t1, t2 where i = j' doesn't allow concurrent inserts into 't1'.
+#
+# 1.4 DESCRIBE statement.
+#
+# This statement does not really read data from the
+# target table and thus does not take any lock on it.
+# We check this for completeness of coverage.
+lock table t1 write;
+# Switching to connection 'con1'.
+# This statement should not be blocked.
+describe t1;
+# Switching to connection 'default'.
+unlock tables;
+#
+# 1.5 SHOW statements.
+# 
+# The above is true for SHOW statements as well.
+lock table t1 write;
+# Switching to connection 'con1'.
+# These statements should not be blocked.
+show keys from t1;
+# Switching to connection 'default'.
+unlock tables;
+#
+# 2. Statements which read tables through subqueries.
+#
+#
+# 2.1 CALL with a subquery.
+# 
+# In theory strong lock is not necessary as this statement
+# is not written to the binary log as a whole (it is written
+# statement-by-statement). But in practice in 5.1 for
+# almost everything except SELECT we take strong lock.
+Success: 'call p1((select i + 5 from t1 where i = 1))' doesn't allow concurrent inserts into 't1'.
+#
+# 2.2 CREATE TABLE with a subquery.
+#
+# Has to take a strong lock on the table being read as
+# this statement is written to the binary log and therefore
+# should be serialized with concurrent statements.
+Success: 'create table t0 select * from t1' doesn't allow concurrent inserts into 't1'.
+drop table t0;
+Success: 'create table t0 select j from t2 where j in (select i from t1)' doesn't allow concurrent inserts into 't1'.
+drop table t0;
+#
+# 2.3 DELETE with a subquery.
+#
+# The above is true for this statement as well.
+Success: 'delete from t2 where j in (select i from t1)' doesn't allow concurrent inserts into 't1'.
+#
+# 2.4 MULTI-DELETE with a subquery.
+#
+# Same is true for this statement as well.
+Success: 'delete t2 from t3, t2 where k = j and j in (select i from t1)' doesn't allow concurrent inserts into 't1'.
+#
+# 2.5 DO with a subquery.
+#
+# In theory strong lock is not necessary as it is not logged.
+# But in practice in 5.1 for almost everything except SELECT
+# we take strong lock.
+Success: 'do (select i from t1 where i = 1)' doesn't allow concurrent inserts into 't1'.
+#
+# 2.6 INSERT with a subquery.
+#
+# Has to take a strong lock on the table being read as
+# this statement is written to the binary log and therefore
+# should be serialized with concurrent inserts.
+Success: 'insert into t2 select i+5 from t1' doesn't allow concurrent inserts into 't1'.
+Success: 'insert into t2 values ((select i+5 from t1 where i = 4))' doesn't allow concurrent inserts into 't1'.
+#
+# 2.7 LOAD DATA with a subquery.
+# 
+# The above is true for this statement as well.
+Success: 'load data infile '../../std_data/rpl_loaddata.dat' into table t2 (@a, @b) set j= @b + (select i from t1 where i = 1)' doesn't allow concurrent inserts into 't1'.
+#
+# 2.8 REPLACE with a subquery.
+# 
+# Same is true for this statement as well.
+Success: 'replace into t2 select i+5 from t1' doesn't allow concurrent inserts into 't1'.
+Success: 'replace into t2 values ((select i+5 from t1 where i = 4))' doesn't allow concurrent inserts into 't1'.
+#
+# 2.9 SELECT with a subquery.
+#
+# Strong locks are not necessary as this statement is not written
+# to the binary log and thanks to how MyISAM works this statement
+# sees a version of the table prior to the concurrent insert.
+Success: 'select * from t2 where j in (select i from t1)' allows concurrent inserts into 't1'.
+#
+# 2.10 SET with a subquery.
+#
+# In theory the same is true for this statement as well.
+# But in practice in 5.1 we acquire strong lock in this
+# case as well.
+Success: 'set @a:= (select i from t1 where i = 1)' doesn't allow concurrent inserts into 't1'.
+#
+# 2.11 SHOW with a subquery.
+# 
+# The same is true for this statement too.
+Success: 'show tables from test where Tables_in_test = 't2' and (select i from t1 where i = 1)' doesn't allow concurrent inserts into 't1'.
+Success: 'show columns from t2 where (select i from t1 where i = 1)' doesn't allow concurrent inserts into 't1'.
+#
+# 2.12 UPDATE with a subquery.
+#
+# Has to take a strong lock on the table being read as
+# this statement is written to the binary log and therefore
+# should be serialized with concurrent inserts.
+Success: 'update t2 set j= j-10 where j in (select i from t1)' doesn't allow concurrent inserts into 't1'.
+#
+# 2.13 MULTI-UPDATE with a subquery.
+#
+# Same is true for this statement as well.
+Success: 'update t2, t3 set j= j -10 where j=k and j in (select i from t1)' doesn't allow concurrent inserts into 't1'.
+#
+# 3. Statements which read tables through a view.
+#
+#
+# 3.1 SELECT statement which uses some table through a view.
+#
+# Since this statement is not written to the binary log and
+# an old version of the table is accessible thanks to how MyISAM
+# handles concurrent insert, no locking is necessary.
+Success: 'select * from v1' allows concurrent inserts into 't1'.
+Success: 'select * from v2' allows concurrent inserts into 't1'.
+Success: 'select * from t2 where j in (select i from v1)' allows concurrent inserts into 't1'.
+Success: 'select * from t3 where k in (select j from v2)' allows concurrent inserts into 't1'.
+#
+# 3.2 Statements which modify a table and use views.
+#
+# Since such statements are going to be written to the binary
+# log they need to be serialized against concurrent statements
+# and therefore should take strong locks on the data read.
+Success: 'update t2 set j= j-10 where j in (select i from v1)' doesn't allow concurrent inserts into 't1'.
+Success: 'update t3 set k= k-10 where k in (select j from v2)' doesn't allow concurrent inserts into 't1'.
+Success: 'update t2, v1 set j= j-10 where j = i' doesn't allow concurrent inserts into 't1'.
+Success: 'update v2 set j= j-10 where j = 3' doesn't allow concurrent inserts into 't1'.
+#
+# 4. Statements which read tables through stored functions.
+#
+#
+# 4.1 SELECT/SET with a stored function which does not 
+#     modify data and uses SELECT in its turn.
+#
+# Calls to such functions won't get into the binary log and
+# thus don't need to acquire strong locks.
+# In 5.5 due to fix for bug #53921 "Wrong locks for SELECTs
+# used stored functions may lead to broken SBR" strong locks
+# are taken (we accepted it as a trade-off for this fix).
+Success: 'select f1()' allows concurrent inserts into 't1'.
+Success: 'set @a:= f1()' allows concurrent inserts into 't1'.
+#
+# 4.2 INSERT (or other statement which modifies data) with
+#     a stored function which does not modify data and uses
+#     SELECT.
+#
+# Since such statement is written to the binary log it should
+# be serialized with concurrent statements affecting the data
+# it uses. Therefore it should take strong lock on the data
+# it reads.
+# But due to bug #53921 "Wrong locks for SELECTs used stored
+# functions may lead to broken SBR" weak locks are taken.
+Success: 'insert into t2 values (f1() + 5)' allows concurrent inserts into 't1'.
+#
+# 4.3 SELECT/SET with a stored function which
+#     reads and modifies data.
+#
+# Since a call to such function is written to the binary log,
+# it should be serialized with concurrent statements affecting
+# the data it uses. Hence, a strong lock on the data read
+# should be taken.
+# But due to bug #53921 "Wrong locks for SELECTs used stored
+# functions may lead to broken SBR" weak locks are taken.
+Success: 'select f2()' allows concurrent inserts into 't1'.
+Success: 'set @a:= f2()' allows concurrent inserts into 't1'.
+#
+# 4.4. SELECT/SET with a stored function which does not
+#      modify data and reads a table through subselect
+#      in a control construct.
+#
+# Again, in theory a call to this function won't get to the
+# binary log and thus no strong lock is needed. But in practice
+# we don't detect this fact early enough (get_lock_type_for_table())
+# to avoid taking a strong lock.
+Success: 'select f3()' doesn't allow concurrent inserts into 't1'.
+Success: 'set @a:= f3()' doesn't allow concurrent inserts into 't1'.
+Success: 'select f4()' doesn't allow concurrent inserts into 't1'.
+Success: 'set @a:= f4()' doesn't allow concurrent inserts into 't1'.
+#
+# 4.5. INSERT (or other statement which modifies data) with
+#      a stored function which does not modify data and reads
+#      the table through a subselect in one of its control
+#      constructs.
+#
+# Since such statement is written to the binary log it should
+# be serialized with concurrent statements affecting data it
+# uses. Therefore it should take a strong lock on the data
+# it reads.
+Success: 'insert into t2 values (f3() + 5)' doesn't allow concurrent inserts into 't1'.
+Success: 'insert into t2 values (f4() + 6)' doesn't allow concurrent inserts into 't1'.
+#
+# 4.6 SELECT/SET which uses a stored function with
+#      DML which reads a table via a subquery.
+#
+# Since call to such function is written to the binary log
+# it should be serialized with concurrent statements.
+# Hence reads should take a strong lock.
+Success: 'select f5()' doesn't allow concurrent inserts into 't1'.
+Success: 'set @a:= f5()' doesn't allow concurrent inserts into 't1'.
+#
+# 4.7 SELECT/SET which uses a stored function which
+#     doesn't modify data and reads tables through
+#     a view.
+#
+# Once again, in theory, calls to such functions won't
+# get into the binary log and thus don't need strong
+# locks. In practice this fact is discovered
+# too late to have any effect.
+# But due to bug #53921 "Wrong locks for SELECTs used stored
+# functions may lead to broken SBR" weak locks are taken
+# in case when simple SELECT is used.
+Success: 'select f6()' allows concurrent inserts into 't1'.
+Success: 'set @a:= f6()' allows concurrent inserts into 't1'.
+Success: 'select f7()' doesn't allow concurrent inserts into 't1'.
+Success: 'set @a:= f7()' doesn't allow concurrent inserts into 't1'.
+#
+# 4.8 INSERT which uses stored function which
+#     doesn't modify data and reads a table
+#     through a view.
+#
+# Since such statement is written to the binary log and
+# should be serialized with concurrent statements affecting
+# the data it uses. Therefore it should take a strong lock on
+# the table it reads.
+# But due to bug #53921 "Wrong locks for SELECTs used stored
+# functions may lead to broken SBR" weak locks are taken
+# in case when simple SELECT is used.
+Success: 'insert into t3 values (f6() + 5)' allows concurrent inserts into 't1'.
+Success: 'insert into t3 values (f7() + 5)' doesn't allow concurrent inserts into 't1'.
+#
+# 4.9 SELECT which uses a stored function which
+#     modifies data and reads tables through a view.
+#
+# Since a call to such function is written to the binary log
+# it should be serialized with concurrent statements.
+# Hence, reads should take strong locks.
+# But due to bug #53921 "Wrong locks for SELECTs used stored
+# functions may lead to broken SBR" weak locks are taken
+# in case when simple SELECT is used.
+Success: 'select f8()' allows concurrent inserts into 't1'.
+Success: 'select f9()' doesn't allow concurrent inserts into 't1'.
+#
+# 4.10 SELECT which uses a stored function which doesn't modify
+#      data and reads a table indirectly, by calling another
+#      function.
+#
+# Calls to such functions won't get into the binary log and
+# thus don't need to acquire strong locks.
+# In 5.5 due to fix for bug #53921 "Wrong locks for SELECTs
+# used stored functions may lead to broken SBR" strong locks
+# are taken (we accepted it as a trade-off for this fix).
+Success: 'select f10()' allows concurrent inserts into 't1'.
+#
+# 4.11 INSERT which uses a stored function which doesn't modify
+#      data and reads a table indirectly, by calling another
+#      function. 
+#
+# Since such statement is written to the binary log, it should
+# be serialized with concurrent statements affecting the data it
+# uses. Therefore it should take strong locks on data it reads.
+# But due to bug #53921 "Wrong locks for SELECTs used stored
+# functions may lead to broken SBR" weak locks are taken.
+Success: 'insert into t2 values (f10() + 5)' allows concurrent inserts into 't1'.
+#
+# 4.12 SELECT which uses a stored function which modifies
+#      data and reads a table indirectly, by calling another
+#      function. 
+#
+# Since a call to such function is written to the binary log
+# it should be serialized from concurrent statements.
+# Hence, read should take a strong lock.
+# But due to bug #53921 "Wrong locks for SELECTs used stored
+# functions may lead to broken SBR" weak locks are taken.
+Success: 'select f11()' allows concurrent inserts into 't1'.
+#
+# 4.13 SELECT that reads a table through a subquery passed
+#      as a parameter to a stored function which modifies
+#      data.
+#
+# Even though a call to this function is written to the
+# binary log, values of its parameters are written as literals.
+# So there is no need to acquire strong locks for tables used in
+# the subquery.
+Success: 'select f12((select i+10 from t1 where i=1))' allows concurrent inserts into 't1'.
+#
+# 4.14 INSERT that reads a table via a subquery passed
+#      as a parameter to a stored function which doesn't
+#      modify data.
+#
+# Since this statement is written to the binary log it should
+# be serialized with concurrent statements affecting the data it
+# uses. Therefore it should take strong locks on the data it reads.
+Success: 'insert into t2 values (f13((select i+10 from t1 where i=1)))' doesn't allow concurrent inserts into 't1'.
+#
+# 5. Statements that read tables through stored procedures.
+#
+#
+# 5.1 CALL statement which reads a table via SELECT.
+#
+# Since neither this statement nor its components are
+# written to the binary log, there is no need to take
+# strong locks on the data it reads.
+Success: 'call p2(@a)' allows concurrent inserts into 't1'.
+#
+# 5.2 Function that modifies data and uses CALL, 
+#     which reads a table through SELECT.
+#
+# Since a call to such function is written to the binary
+# log, it should be serialized with concurrent statements.
+# Hence, in this case reads should take strong locks on data.
+# But due to bug #53921 "Wrong locks for SELECTs used stored
+# functions may lead to broken SBR" weak locks are taken.
+Success: 'select f14()' allows concurrent inserts into 't1'.
+#
+# 5.3 SELECT that calls a function that doesn't modify data and
+#     uses a CALL statement that reads a table via SELECT.
+#
+# Calls to such functions won't get into the binary log and
+# thus don't need to acquire strong locks.
+# In 5.5 due to fix for bug #53921 "Wrong locks for SELECTs
+# used stored functions may lead to broken SBR" strong locks
+# are taken (we accepted it as a trade-off for this fix).
+Success: 'select f15()' allows concurrent inserts into 't1'.
+#
+# 5.4 INSERT which calls function which doesn't modify data and
+#     uses CALL statement which reads table through SELECT.
+#
+# Since such statement is written to the binary log it should
+# be serialized with concurrent statements affecting data it
+# uses. Therefore it should take strong locks on data it reads.
+# But due to bug #53921 "Wrong locks for SELECTs used stored
+# functions may lead to broken SBR" weak locks are taken.
+Success: 'insert into t2 values (f15()+5)' allows concurrent inserts into 't1'.
+#
+# 6. Statements that use triggers.
+#
+#
+# 6.1 Statement invoking a trigger that reads table via SELECT.
+#
+# Since this statement is written to the binary log it should
+# be serialized with concurrent statements affecting the data
+# it uses. Therefore, it should take strong locks on the data
+# it reads.
+# But due to bug #53921 "Wrong locks for SELECTs used stored
+# functions may lead to broken SBR" weak locks are taken.
+Success: 'insert into t4 values (2)' allows concurrent inserts into 't1'.
+#
+# 6.2 Statement invoking a trigger that reads table through
+#     a subquery in a control construct.
+#
+# The above is true for this statement as well.
+Success: 'update t4 set l= 2 where l = 1' doesn't allow concurrent inserts into 't1'.
+#
+# 6.3 Statement invoking a trigger that reads a table through
+#     a view.
+#
+# And for this statement.
+Success: 'delete from t4 where l = 1' doesn't allow concurrent inserts into 't1'.
+#
+# 6.4 Statement invoking a trigger that reads a table through
+#     a stored function.
+#
+# And for this statement.
+# But due to bug #53921 "Wrong locks for SELECTs used stored
+# functions may lead to broken SBR" weak locks are taken.
+Success: 'insert into t5 values (2)' allows concurrent inserts into 't1'.
+#
+# 6.5 Statement invoking a trigger that reads a table through
+#     stored procedure.
+#
+# And for this statement.
+# But due to bug #53921 "Wrong locks for SELECTs used stored
+# functions may lead to broken SBR" weak locks are taken.
+Success: 'update t5 set l= 2 where l = 1' allows concurrent inserts into 't1'.
+# Clean-up.
+drop function f1;
+drop function f2;
+drop function f3;
+drop function f4;
+drop function f5;
+drop function f6;
+drop function f7;
+drop function f8;
+drop function f9;
+drop function f10;
+drop function f11;
+drop function f12;
+drop function f13;
+drop function f14;
+drop function f15;
+drop view v1, v2;
+drop procedure p1;
+drop procedure p2;
+drop table t1, t2, t3, t4, t5, te;
+set @@global.concurrent_insert= @old_concurrent_insert;

=== modified file 'mysql-test/r/log_state.result'
--- a/mysql-test/r/log_state.result	2010-02-09 10:30:50 +0000
+++ b/mysql-test/r/log_state.result	2010-05-12 11:19:12 +0000
@@ -308,8 +308,41 @@ SET @@global.general_log = @old_general_
 SET @@global.general_log_file = @old_general_log_file;
 SET @@global.slow_query_log = @old_slow_query_log;
 SET @@global.slow_query_log_file = @old_slow_query_log_file;
+#
+# Bug #49756 Rows_examined is always 0 in the slow query log 
+# for update statements
+#
+SET @old_log_output = @@global.log_output;
+SET GLOBAL log_output = "TABLE";
+SET GLOBAL slow_query_log = ON;
+SET GLOBAL long_query_time = 0.001;
+TRUNCATE TABLE mysql.slow_log;
+CREATE TABLE t1 (a INT);
+CREATE TABLE t2 (b INT, PRIMARY KEY (b));
+INSERT INTO t2 VALUES (3),(4);
+INSERT INTO t1 VALUES (1+sleep(.01)),(2);
+INSERT INTO t1 SELECT b+sleep(.01) from t2;
+UPDATE t1 SET a=a+sleep(.01) WHERE a>2;
+UPDATE t1 SET a=a+sleep(.01) ORDER BY a DESC;
+UPDATE t2 set b=b+sleep(.01) limit 1;
+UPDATE t1 SET a=a+sleep(.01) WHERE a in (SELECT b from t2);
+DELETE FROM t1 WHERE a=a+sleep(.01) ORDER BY a LIMIT 2;
+SELECT rows_examined,sql_text FROM mysql.slow_log;
+rows_examined	sql_text
+0	INSERT INTO t1 VALUES (1+sleep(.01)),(2)
+2	INSERT INTO t1 SELECT b+sleep(.01) from t2
+4	UPDATE t1 SET a=a+sleep(.01) WHERE a>2
+8	UPDATE t1 SET a=a+sleep(.01) ORDER BY a DESC
+2	UPDATE t2 set b=b+sleep(.01) limit 1
+4	UPDATE t1 SET a=a+sleep(.01) WHERE a in (SELECT b from t2)
+6	DELETE FROM t1 WHERE a=a+sleep(.01) ORDER BY a LIMIT 2
+DROP TABLE t1,t2;
+TRUNCATE TABLE mysql.slow_log;
+# end of bug#49756
 End of 5.1 tests
 # Close connection con1
+SET GLOBAL long_query_time = DEFAULT;
+SET GLOBAL log_output = @old_log_output;
 SET global general_log = @old_general_log;
 SET global general_log_file = @old_general_log_file;
 SET global slow_query_log = @old_slow_query_log;

=== modified file 'mysql-test/r/multi_update.result'
--- a/mysql-test/r/multi_update.result	2010-02-10 14:37:34 +0000
+++ b/mysql-test/r/multi_update.result	2010-05-24 13:54:08 +0000
@@ -602,9 +602,6 @@ select * from t2 /* must be (3,1), (4,4)
 a	b
 3	1
 4	4
-show master status /* there must be the UPDATE query event */;
-File	Position	Binlog_Do_DB	Binlog_Ignore_DB
-master-bin.000001	206		
 delete from t1;
 delete from t2;
 insert into t1 values (1,2),(3,4),(4,4);
@@ -612,9 +609,6 @@ insert into t2 values (1,2),(3,4),(4,4);
 reset master;
 UPDATE t2,t1  SET t2.a=t2.b where t2.a=t1.a;
 ERROR 23000: Duplicate entry '4' for key 'PRIMARY'
-show master status /* there must be the UPDATE query event */;
-File	Position	Binlog_Do_DB	Binlog_Ignore_DB
-master-bin.000001	221		
 drop table t1, t2;
 set @@session.binlog_format= @sav_binlog_format;
 drop table if exists t1, t2, t3;

=== modified file 'mysql-test/r/mysqldump.result'
--- a/mysql-test/r/mysqldump.result	2010-06-13 22:13:32 +0000
+++ b/mysql-test/r/mysqldump.result	2010-08-02 09:01:24 +0000
@@ -4561,5 +4561,20 @@ a	b	c
 SET NAMES default;
 DROP TABLE t1, t2;
 #
+# Bug #53088: mysqldump with -T & --default-character-set set
+#             truncates text/blob to 766 chars
+#
+# Also see outfile_loaddata.test
+#
+CREATE TABLE t1 (a BLOB) CHARSET latin1;
+CREATE TABLE t2 LIKE t1;
+INSERT INTO t1 VALUES (REPEAT('.', 800));
+LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/t1.txt' INTO TABLE t2 CHARACTER SET latin1;
+# should be 800
+SELECT LENGTH(a) FROM t2;
+LENGTH(a)
+800
+DROP TABLE t1, t2;
+#
 # End of 5.1 tests
 #

=== added file 'mysql-test/r/mysqlhotcopy_archive.result'
--- a/mysql-test/r/mysqlhotcopy_archive.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/r/mysqlhotcopy_archive.result	2010-06-03 08:31:26 +0000
@@ -0,0 +1,118 @@
+DROP DATABASE IF EXISTS hotcopy_test;
+CREATE DATABASE hotcopy_test;
+USE hotcopy_test;
+CREATE TABLE t1 (c1 int, c2 varchar(20)) ENGINE=archive;
+CREATE TABLE t2 (c1 int, c2 varchar(20)) ENGINE=archive;
+CREATE TABLE t3 (c1 int, c2 varchar(20)) ENGINE=archive;
+INSERT INTO t1 VALUES (1,'aaaaaaaaaaaaaaaaaaaa'),(2, 'bbbbbbbbbbbbbbbbbbbbbbb');
+Warnings:
+Warning	1265	Data truncated for column 'c2' at row 2
+INSERT INTO t2 VALUES (1,'aaaaaaaaaaaaaaaaaaaa'),(2, 'bbbbbbbbbbbbbbbbbbbbbbb');
+Warnings:
+Warning	1265	Data truncated for column 'c2' at row 2
+INSERT INTO t3 VALUES (1,'aaaaaaaaaaaaaaaaaaaa'),(2, 'bbbbbbbbbbbbbbbbbbbbbbb');
+Warnings:
+Warning	1265	Data truncated for column 'c2' at row 2
+db.opt
+t1.ARZ
+t1.frm
+t2.ARZ
+t2.frm
+t3.ARZ
+t3.frm
+db.opt
+t1.ARZ
+t1.frm
+t2.ARZ
+t2.frm
+t3.ARZ
+t3.frm
+USE hotcopy_save;
+SELECT * FROM t1;
+c1	c2
+1	aaaaaaaaaaaaaaaaaaaa
+2	bbbbbbbbbbbbbbbbbbbb
+SELECT * FROM t2;
+c1	c2
+1	aaaaaaaaaaaaaaaaaaaa
+2	bbbbbbbbbbbbbbbbbbbb
+SELECT * FROM t3;
+c1	c2
+1	aaaaaaaaaaaaaaaaaaaa
+2	bbbbbbbbbbbbbbbbbbbb
+USE hotcopy_test;
+DROP TABLE t2;
+db.opt
+t1.ARZ
+t1.frm
+t3.ARZ
+t3.frm
+FLUSH TABLES;
+SELECT * FROM t1;
+c1	c2
+1	aaaaaaaaaaaaaaaaaaaa
+2	bbbbbbbbbbbbbbbbbbbb
+SELECT * FROM t2;
+c1	c2
+1	aaaaaaaaaaaaaaaaaaaa
+2	bbbbbbbbbbbbbbbbbbbb
+SELECT * FROM t3;
+c1	c2
+1	aaaaaaaaaaaaaaaaaaaa
+2	bbbbbbbbbbbbbbbbbbbb
+USE hotcopy_test;
+db.opt
+t1.ARZ
+t1.frm
+t2.ARZ
+t2.frm
+t3.ARZ
+t3.frm
+DROP DATABASE hotcopy_save;
+db.opt
+t1.ARZ
+t1.frm
+t2.ARZ
+t2.frm
+t3.ARZ
+t3.frm
+DROP DATABASE hotcopy_save;
+db.opt
+t1.ARZ
+t1.frm
+t2.ARZ
+t2.frm
+t3.ARZ
+t3.frm
+db.opt
+t1.ARZ
+t1.frm
+t2.ARZ
+t2.frm
+t3.ARZ
+t3.frm
+db.opt
+t1.ARZ
+t1.frm
+t2.ARZ
+t2.frm
+t3.ARZ
+t3.frm
+db.opt
+t1.ARZ
+t1.frm
+t2.ARZ
+t2.frm
+t3.ARZ
+t3.frm
+db.opt
+t1.ARZ
+t1.frm
+t2.ARZ
+t2.frm
+t3.ARZ
+t3.frm
+DROP DATABASE hotcopy_test_cpy;
+DROP DATABASE hotcopy_test;
+DROP DATABASE hotcopy_save;
+DROP DATABASE hotcopy_save_old;

=== added file 'mysql-test/r/mysqlhotcopy_myisam.result'
--- a/mysql-test/r/mysqlhotcopy_myisam.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/r/mysqlhotcopy_myisam.result	2010-06-03 08:31:26 +0000
@@ -0,0 +1,164 @@
+DROP DATABASE IF EXISTS hotcopy_test;
+CREATE DATABASE hotcopy_test;
+USE hotcopy_test;
+CREATE TABLE t1 (c1 int, c2 varchar(20)) ENGINE=MyISAM;
+CREATE TABLE t2 (c1 int, c2 varchar(20)) ENGINE=MyISAM;
+CREATE TABLE t3 (c1 int, c2 varchar(20)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1,'aaaaaaaaaaaaaaaaaaaa'),(2, 'bbbbbbbbbbbbbbbbbbbbbbb');
+Warnings:
+Warning	1265	Data truncated for column 'c2' at row 2
+INSERT INTO t2 VALUES (1,'aaaaaaaaaaaaaaaaaaaa'),(2, 'bbbbbbbbbbbbbbbbbbbbbbb');
+Warnings:
+Warning	1265	Data truncated for column 'c2' at row 2
+INSERT INTO t3 VALUES (1,'aaaaaaaaaaaaaaaaaaaa'),(2, 'bbbbbbbbbbbbbbbbbbbbbbb');
+Warnings:
+Warning	1265	Data truncated for column 'c2' at row 2
+db.opt
+t1.MYD
+t1.MYI
+t1.frm
+t2.MYD
+t2.MYI
+t2.frm
+t3.MYD
+t3.MYI
+t3.frm
+db.opt
+t1.MYD
+t1.MYI
+t1.frm
+t2.MYD
+t2.MYI
+t2.frm
+t3.MYD
+t3.MYI
+t3.frm
+USE hotcopy_save;
+SELECT * FROM t1;
+c1	c2
+1	aaaaaaaaaaaaaaaaaaaa
+2	bbbbbbbbbbbbbbbbbbbb
+SELECT * FROM t2;
+c1	c2
+1	aaaaaaaaaaaaaaaaaaaa
+2	bbbbbbbbbbbbbbbbbbbb
+SELECT * FROM t3;
+c1	c2
+1	aaaaaaaaaaaaaaaaaaaa
+2	bbbbbbbbbbbbbbbbbbbb
+USE hotcopy_test;
+DELETE FROM t1;
+SELECT * FROM t1;
+c1	c2
+USE hotcopy_save;
+SELECT * FROM t1;
+c1	c2
+1	aaaaaaaaaaaaaaaaaaaa
+2	bbbbbbbbbbbbbbbbbbbb
+SELECT * FROM t2;
+c1	c2
+1	aaaaaaaaaaaaaaaaaaaa
+2	bbbbbbbbbbbbbbbbbbbb
+SELECT * FROM t3;
+c1	c2
+1	aaaaaaaaaaaaaaaaaaaa
+2	bbbbbbbbbbbbbbbbbbbb
+USE hotcopy_test;
+DROP TABLE t2;
+db.opt
+t1.MYD
+t1.MYI
+t1.frm
+t3.MYD
+t3.MYI
+t3.frm
+FLUSH TABLES;
+SELECT * FROM t1;
+c1	c2
+1	aaaaaaaaaaaaaaaaaaaa
+2	bbbbbbbbbbbbbbbbbbbb
+SELECT * FROM t2;
+c1	c2
+1	aaaaaaaaaaaaaaaaaaaa
+2	bbbbbbbbbbbbbbbbbbbb
+SELECT * FROM t3;
+c1	c2
+1	aaaaaaaaaaaaaaaaaaaa
+2	bbbbbbbbbbbbbbbbbbbb
+USE hotcopy_test;
+db.opt
+t1.MYD
+t1.MYI
+t1.frm
+t2.MYD
+t2.MYI
+t2.frm
+t3.MYD
+t3.MYI
+t3.frm
+DROP DATABASE hotcopy_save;
+db.opt
+t1.MYD
+t1.MYI
+t1.frm
+t2.MYD
+t2.MYI
+t2.frm
+t3.MYD
+t3.MYI
+t3.frm
+DROP DATABASE hotcopy_save;
+db.opt
+t1.MYD
+t1.MYI
+t1.frm
+t2.MYD
+t2.MYI
+t2.frm
+t3.MYD
+t3.MYI
+t3.frm
+db.opt
+t1.MYD
+t1.MYI
+t1.frm
+t2.MYD
+t2.MYI
+t2.frm
+t3.MYD
+t3.MYI
+t3.frm
+db.opt
+t1.MYD
+t1.MYI
+t1.frm
+t2.MYD
+t2.MYI
+t2.frm
+t3.MYD
+t3.MYI
+t3.frm
+db.opt
+t1.MYD
+t1.MYI
+t1.frm
+t2.MYD
+t2.MYI
+t2.frm
+t3.MYD
+t3.MYI
+t3.frm
+db.opt
+t1.MYD
+t1.MYI
+t1.frm
+t2.MYD
+t2.MYI
+t2.frm
+t3.MYD
+t3.MYI
+t3.frm
+DROP DATABASE hotcopy_test_cpy;
+DROP DATABASE hotcopy_test;
+DROP DATABASE hotcopy_save;
+DROP DATABASE hotcopy_save_old;

=== modified file 'mysql-test/r/outfile_loaddata.result'
--- a/mysql-test/r/outfile_loaddata.result	2009-07-31 17:14:52 +0000
+++ b/mysql-test/r/outfile_loaddata.result	2010-05-06 20:41:37 +0000
@@ -239,4 +239,24 @@ a	b	c
 2	NULL	NULL
 SET NAMES default;
 DROP TABLE t1, t2;
+#
+# Bug #53088: mysqldump with -T & --default-character-set set
+#             truncates text/blob to 766 chars
+#
+# Also see mysqldump.test
+#
+CREATE TABLE t1 (a BLOB) CHARSET latin1;
+CREATE TABLE t2 LIKE t1;
+INSERT INTO t1 VALUES (REPEAT('.', 800));
+SELECT * INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug53088.txt' CHARACTER SET latin1 FROM t1;
+# should be greater than 800
+SELECT LENGTH(LOAD_FILE('MYSQLTEST_VARDIR/tmp/bug53088.txt'));
+LENGTH(LOAD_FILE('MYSQLTEST_VARDIR/tmp/bug53088.txt'))
+801
+LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug53088.txt' INTO TABLE t2;
+# should be 800
+SELECT LENGTH(a) FROM t2;
+LENGTH(a)
+800
+DROP TABLE t1, t2;
 # End of 5.1 tests.

=== modified file 'mysql-test/r/partition_error.result'
--- a/mysql-test/r/partition_error.result	2010-03-04 17:16:10 +0000
+++ b/mysql-test/r/partition_error.result	2010-05-25 13:41:00 +0000
@@ -1,5 +1,29 @@
 drop table if exists t1;
 #
+# Bug#49161: Out of memory; restart server and try again (needed 2 bytes)
+#
+CREATE TABLE t1 (a INT) PARTITION BY HASH (a);
+FLUSH TABLES;
+CHECK TABLE t1;
+Table	Op	Msg_type	Msg_text
+test.t1	check	Error	Failed to read from the .par file
+test.t1	check	Error	Incorrect information in file: './test/t1.frm'
+test.t1	check	error	Corrupt
+SELECT * FROM t1;
+ERROR HY000: Failed to read from the .par file
+# Note that it is currently impossible to drop a partitioned table
+# without the .par file
+DROP TABLE t1;
+ERROR 42S02: Unknown table 't1'
+#
+# Bug#49477: Assertion `0' failed in ha_partition.cc:5530
+# with temporary table and partitions
+#
+CREATE TABLE t1 (a INT) PARTITION BY HASH(a);
+CREATE TEMPORARY TABLE tmp_t1 LIKE t1;
+ERROR HY000: Cannot create temporary table with partitions
+DROP TABLE t1;
+#
 # Bug#50392: insert_id is not reset for partitioned tables
 #            auto_increment on duplicate entry
 CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY);

=== modified file 'mysql-test/r/renamedb.result'
--- a/mysql-test/r/renamedb.result	2007-09-10 22:10:37 +0000
+++ b/mysql-test/r/renamedb.result	2010-05-21 18:47:32 +0000
@@ -7,6 +7,6 @@ ERROR HY000: Incorrect usage of ALTER DA
 ALTER DATABASE `#mysql51#not-yet` UPGRADE DATA DIRECTORY NAME;
 ERROR HY000: Incorrect usage of ALTER DATABASE UPGRADE DATA DIRECTORY NAME and name
 ALTER DATABASE `#mysql50#` UPGRADE DATA DIRECTORY NAME;
-ERROR HY000: Incorrect usage of ALTER DATABASE UPGRADE DATA DIRECTORY NAME and name
+ERROR 42000: Incorrect database name '#mysql50#'
 ALTER DATABASE `#mysql50#upgrade-me` UPGRADE DATA DIRECTORY NAME;
 ERROR 42000: Unknown database '#mysql50#upgrade-me'

=== modified file 'mysql-test/r/schema.result'
--- a/mysql-test/r/schema.result	2008-04-02 08:06:36 +0000
+++ b/mysql-test/r/schema.result	2010-06-26 17:36:00 +0000
@@ -11,3 +11,22 @@ mtr
 mysql
 test
 drop schema foo;
+#
+# Bug#54360 Deadlock DROP/ALTER/CREATE DATABASE with open HANDLER
+#
+CREATE DATABASE db1;
+CREATE TABLE db1.t1 (a INT);
+INSERT INTO db1.t1 VALUES (1), (2);
+# Connection con1
+HANDLER db1.t1 OPEN;
+# Connection default
+# Sending:
+DROP DATABASE db1;
+# Connection con2
+# Waiting for 'DROP DATABASE db1' to sync in.
+# Connection con1
+CREATE DATABASE db2;
+ALTER DATABASE db2 DEFAULT CHARACTER SET utf8;
+DROP DATABASE db2;
+# Connection default
+# Reaping: DROP DATABASE db1

=== modified file 'mysql-test/r/select.result'
--- a/mysql-test/r/select.result	2010-05-26 18:55:40 +0000
+++ b/mysql-test/r/select.result	2010-08-02 09:01:24 +0000
@@ -4781,4 +4781,19 @@ a	b	c
 SELECT * FROM t1 WHERE 102 < c;
 a	b	c
 DROP TABLE t1;
+#
+# Bug #54459: Assertion failed: param.sort_length, 
+# file .\filesort.cc, line 149 (part II)
+#
+CREATE TABLE t1(a ENUM('') NOT NULL);
+INSERT INTO t1 VALUES (), (), ();
+EXPLAIN SELECT 1 FROM t1 ORDER BY a COLLATE latin1_german2_ci;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	3	
+SELECT 1 FROM t1 ORDER BY a COLLATE latin1_german2_ci;
+1
+1
+1
+1
+DROP TABLE t1;
 End of 5.1 tests

=== modified file 'mysql-test/r/sp_trans_log.result'
--- a/mysql-test/r/sp_trans_log.result	2007-12-14 13:40:45 +0000
+++ b/mysql-test/r/sp_trans_log.result	2010-05-24 13:54:08 +0000
@@ -14,13 +14,13 @@ end|
 reset master|
 insert into t2 values (bug23333(),1)|
 ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
-show binlog events from 106 /* with fixes for #23333 will show there is the query */|
+show binlog events from <binlog_start>|
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	1	#	#
-master-bin.000001	#	Table_map	1	#	#
-master-bin.000001	#	Table_map	1	#	#
-master-bin.000001	#	Write_rows	1	#	#
-master-bin.000001	#	Query	1	#	#
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t2)
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	ROLLBACK
 select count(*), at a from t1 /* must be 1,1 */|
 count(*)	@a
 1	1

=== modified file 'mysql-test/r/subselect.result'
--- a/mysql-test/r/subselect.result	2010-05-26 18:55:40 +0000
+++ b/mysql-test/r/subselect.result	2010-08-02 09:01:24 +0000
@@ -4714,3 +4714,20 @@ t1_id	total_amount
 DROP TABLE t3;
 DROP TABLE t2;
 DROP TABLE t1;
+#
+# Bug #52711: Segfault when doing EXPLAIN SELECT with 
+#  union...order by (select... where...)
+#
+CREATE TABLE t1 (a VARCHAR(10), FULLTEXT KEY a (a));
+INSERT INTO t1 VALUES (1),(2);
+CREATE TABLE t2 (b INT);
+INSERT INTO t2 VALUES (1),(2);
+# Should not crash
+EXPLAIN
+SELECT * FROM t2 UNION SELECT * FROM t2
+ORDER BY (SELECT * FROM t1 WHERE MATCH(a) AGAINST ('+abc' IN BOOLEAN MODE));
+# Should not crash
+SELECT * FROM t2 UNION SELECT * FROM t2
+ORDER BY (SELECT * FROM t1 WHERE MATCH(a) AGAINST ('+abc' IN BOOLEAN MODE));
+DROP TABLE t1,t2;
+End of 5.1 tests

=== modified file 'mysql-test/r/type_time.result'
--- a/mysql-test/r/type_time.result	2009-05-15 08:42:57 +0000
+++ b/mysql-test/r/type_time.result	2010-05-31 09:25:11 +0000
@@ -138,3 +138,13 @@ CAST(c AS TIME)
 00:00:00
 DROP TABLE t1;
 End of 5.0 tests
+#
+# Bug#53942 valgrind warnings with timestamp() function and incomplete datetime values
+#
+CREATE TABLE t1(f1 TIME);
+INSERT INTO t1 VALUES ('23:38:57');
+SELECT TIMESTAMP(f1,'1') FROM t1;
+TIMESTAMP(f1,'1')
+NULL
+DROP TABLE t1;
+End of 5.1 tests

=== modified file 'mysql-test/r/upgrade.result'
--- a/mysql-test/r/upgrade.result	2009-08-25 13:56:50 +0000
+++ b/mysql-test/r/upgrade.result	2010-05-21 18:47:32 +0000
@@ -112,3 +112,31 @@ select * from `a-b-c`.v1;
 f1
 drop database `a-b-c`;
 use test;
+# End of 5.0 tests
+#
+# Bug #53804: serious flaws in the alter database .. upgrade data
+#             directory name command
+#
+ALTER DATABASE `#mysql50#:` UPGRADE DATA DIRECTORY NAME;
+ERROR 42000: Unknown database '#mysql50#:'
+ALTER DATABASE `#mysql50#.` UPGRADE DATA DIRECTORY NAME;
+ERROR 42000: Incorrect database name '#mysql50#.'
+ALTER DATABASE `#mysql50#../` UPGRADE DATA DIRECTORY NAME;
+ERROR 42000: Incorrect database name '#mysql50#../'
+ALTER DATABASE `#mysql50#../..` UPGRADE DATA DIRECTORY NAME;
+ERROR 42000: Incorrect database name '#mysql50#../..'
+ALTER DATABASE `#mysql50#../../` UPGRADE DATA DIRECTORY NAME;
+ERROR 42000: Incorrect database name '#mysql50#../../'
+ALTER DATABASE `#mysql50#./blablabla` UPGRADE DATA DIRECTORY NAME;
+ERROR 42000: Incorrect database name '#mysql50#./blablabla'
+ALTER DATABASE `#mysql50#../blablabla` UPGRADE DATA DIRECTORY NAME;
+ERROR 42000: Incorrect database name '#mysql50#../blablabla'
+ALTER DATABASE `#mysql50#/` UPGRADE DATA DIRECTORY NAME;
+ERROR 42000: Incorrect database name '#mysql50#/'
+ALTER DATABASE `#mysql50#/.` UPGRADE DATA DIRECTORY NAME;
+ERROR 42000: Incorrect database name '#mysql50#/.'
+USE `#mysql50#.`;
+ERROR 42000: Incorrect database name '#mysql50#.'
+USE `#mysql50#../blablabla`;
+ERROR 42000: Incorrect database name '#mysql50#../blablabla'
+# End of 5.1 tests

=== modified file 'mysql-test/r/variables.result'
--- a/mysql-test/r/variables.result	2010-04-28 12:52:24 +0000
+++ b/mysql-test/r/variables.result	2010-08-02 09:01:24 +0000
@@ -576,7 +576,7 @@ set global table_open_cache=100;
 set storage_engine=myisam;
 set global thread_cache_size=100;
 set timestamp=1, timestamp=default;
-set tmp_table_size=100;
+set tmp_table_size=1024;
 set tx_isolation="READ-COMMITTED";
 set wait_timeout=100;
 set log_warnings=1;
@@ -1017,6 +1017,13 @@ hostname	#
 # Test 'myisam_mmap_size' option is not dynamic
 SET @@myisam_mmap_size= 500M;
 ERROR HY000: Variable 'myisam_mmap_size' is a read only variable
+#
+# Bug #52315: utc_date() crashes when system time > year 2037
+#
+SET TIMESTAMP=2*1024*1024*1024;
+#Should not crash
+SELECT UTC_DATE();
+SET TIMESTAMP=DEFAULT;
 End of 5.0 tests
 set join_buffer_size=1;
 Warnings:

=== modified file 'mysql-test/r/variables_debug.result'
--- a/mysql-test/r/variables_debug.result	2010-05-26 18:55:40 +0000
+++ b/mysql-test/r/variables_debug.result	2010-08-02 09:01:24 +0000
@@ -1,3 +1,4 @@
+SET @old_debug = @@GLOBAL.debug;
 set debug= 'T';
 select @@debug;
 @@debug
@@ -22,4 +23,5 @@ SET GLOBAL debug='';
 SELECT @@global.debug;
 @@global.debug
 
+SET GLOBAL debug=@old_debug;
 End of 5.1 tests

=== added file 'mysql-test/std_data/intersect-bug50389.tsv'
--- a/mysql-test/std_data/intersect-bug50389.tsv	1970-01-01 00:00:00 +0000
+++ b/mysql-test/std_data/intersect-bug50389.tsv	2010-06-21 11:09:58 +0000
@@ -0,0 +1,441 @@
+3304605	1221256	0	0	abcdefghijklmnopwrst
+3304606	1221259	0	0	abcdefghijklmnopwrst
+3304607	1221260	0	0	asdfghjklzxcvbnm
+3304629	1221273	0	0	asdfghjklzxcvbnm
+3304630	1221273	0	0	asdfghjklzxcvbnm
+3304634	1221259	0	0	asdfghjklzxcvbnm
+3304644	1221278	0	0	abcdefghijklmnopwrst
+3304648	1221278	0	0	abcdefghijklmnopwrst
+3304649	1221278	0	1	asdfghjklzxcvbnm
+3304650	1221278	0	0	asdfghjklzxcvbnm
+3304651	1221282	0	0	abcdefghijklmnopwrst
+3304660	1221287	0	0	asdfghjklzxcvbnm
+3304662	1221288	0	0	abcdefghijklmnopwrst
+3304663	1221288	0	0	abcdefghijklmnopwrst
+3304664	1221290	0	0	abcdefghijklmnopwrst
+3304670	1221290	0	0	asdfghjklzxcvbnm
+3304671	1221292	0	0	abcdefghijklmnopwrst
+3304672	1221287	0	0	asdfghjklzxcvbnm
+3304673	1221294	0	0	asdfghjklzxcvbnm
+3304674	1221287	0	0	asdfghjklzxcvbnm
+3304676	1221296	0	0	abcdefghijklmnopwrst
+3304677	1221287	0	0	abcdefghijklmnopwrst
+3304678	1221287	0	0	abcdefghijklmnopwrst
+3304679	1221297	0	0	asdfghjklzxcvbnm
+3304680	1221290	0	0	abcdefghijklmnopwrst
+3304681	1221290	0	0	abcdefghijklmnopwrst
+3304685	1221300	0	0	asdfghjklzxcvbnm
+3304687	1221302	0	0	abcdefghijklmnopwrst
+3304688	1221296	1221298	0	abcdefghijklmnopwrst
+3304692	1221309	0	0	asdfghjklzxcvbnm
+3304694	1221309	0	0	asdfghjklzxcvbnm
+3304695	1221290	0	0	abcdefghijklmnopwrst
+3304696	1221313	0	0	asdfghjklzxcvbnm
+3304701	1221314	0	0	asdfghjklzxcvbnm
+3304703	1221313	0	0	abcdefghijklmnopwrst
+3304707	1221313	0	0	asdfghjklzxcvbnm
+3304709	1221313	0	0	abcdefghijklmnopwrst
+3304713	1221314	0	0	abcdefghijklmnopwrst
+3304715	1221317	0	0	abcdefghijklmnopwrst
+3304717	1221319	0	0	asdfghjklzxcvbnm
+3304718	1221320	0	0	abcdefghijklmnopwrst
+3304723	1221314	0	0	abcdefghijklmnopwrst
+3304724	1221314	0	0	asdfghjklzxcvbnm
+3304725	1221300	0	0	asdfghjklzxcvbnm
+3304726	1221314	0	0	asdfghjklzxcvbnm
+3304730	1221326	0	0	asdfghjklzxcvbnm
+3304732	1221328	0	0	asdfghjklzxcvbnm
+3304733	1221329	0	0	asdfghjklzxcvbnm
+3304745	1221331	0	0	abcdefghijklmnopwrst
+3304747	1221300	0	0	abcdefghijklmnopwrst
+3304752	1221332	0	0	asdfghjklzxcvbnm
+3304756	1221333	0	0	asdfghjklzxcvbnm
+3304765	1221336	0	0	asdfghjklzxcvbnm
+3304767	1221338	0	0	abcdefghijklmnopwrst
+3304769	1221340	0	0	asdfghjklzxcvbnm
+3304770	1221328	0	0	asdfghjklzxcvbnm
+3304771	1221328	0	0	abcdefghijklmnopwrst
+3304773	1221340	0	0	asdfghjklzxcvbnm
+3304774	1221340	0	0	abcdefghijklmnopwrst
+3304775	1221338	1221342	1	asdfghjklzxcvbnm
+3304778	1221345	0	0	asdfghjklzxcvbnm
+3304786	1221332	0	0	asdfghjklzxcvbnm
+3304787	1221347	0	0	abcdefghijklmnopwrst
+3304789	1221347	0	0	asdfghjklzxcvbnm
+3304793	1221349	0	0	abcdefghijklmnopwrst
+3304794	1221350	0	0	asdfghjklzxcvbnm
+3304800	1221290	0	0	asdfghjklzxcvbnm
+3304802	1221290	0	0	asdfghjklzxcvbnm
+3304803	1221290	0	0	asdfghjklzxcvbnm
+3304810	1221356	0	0	asdfghjklzxcvbnm
+3304811	1221356	0	0	asdfghjklzxcvbnm
+3304821	1221364	0	0	asdfghjklzxcvbnm
+3304823	1221365	0	0	asdfghjklzxcvbnm
+3304824	1221366	0	0	abcdefghijklmnopwrst
+3304825	1221365	0	0	asdfghjklzxcvbnm
+3304826	1221367	0	0	asdfghjklzxcvbnm
+3304828	1221369	0	0	abcdefghijklmnopwrst
+3304829	1221366	1221368	0	asdfghjklzxcvbnm
+3304831	1221372	0	0	abcdefghijklmnopwrst
+3304832	1221364	1221373	0	abcdefghijklmnopwrst
+3304833	1221364	1221371	0	asdfghjklzxcvbnm
+3304834	1221364	0	0	abcdefghijklmnopwrst
+3304836	1221375	0	0	abcdefghijklmnopwrst
+3304837	1221364	0	0	abcdefghijklmnopwrst
+3304838	1221364	1221376	0	asdfghjklzxcvbnm
+3304840	1221372	0	0	asdfghjklzxcvbnm
+3304842	1221372	0	1	abcdefghijklmnopwrst
+3304844	1221372	0	0	asdfghjklzxcvbnm
+3304845	1221372	0	0	abcdefghijklmnopwrst
+3304847	1221382	0	0	abcdefghijklmnopwrst
+3304848	1221372	0	0	abcdefghijklmnopwrst
+3304849	1221372	0	0	asdfghjklzxcvbnm
+3304852	1221364	1221378	0	asdfghjklzxcvbnm
+3304853	1221383	0	0	abcdefghijklmnopwrst
+3304854	1221384	0	0	asdfghjklzxcvbnm
+3304855	1221347	0	0	asdfghjklzxcvbnm
+3304858	1221383	0	0	abcdefghijklmnopwrst
+3304862	1221386	0	0	abcdefghijklmnopwrst
+3304864	1221387	0	0	abcdefghijklmnopwrst
+3304867	1221389	0	0	abcdefghijklmnopwrst
+3304868	1221390	0	0	asdfghjklzxcvbnm
+3304869	1221391	0	0	asdfghjklzxcvbnm
+3304871	1221393	0	0	asdfghjklzxcvbnm
+3304874	1221395	0	0	abcdefghijklmnopwrst
+3304877	1221396	0	0	abcdefghijklmnopwrst
+3304879	1221396	0	0	asdfghjklzxcvbnm
+3304882	1221398	0	0	abcdefghijklmnopwrst
+3304883	1221399	0	0	abcdefghijklmnopwrst
+3304884	1221400	0	0	abcdefghijklmnopwrst
+3304889	1221405	0	0	abcdefghijklmnopwrst
+3304895	1221409	0	0	asdfghjklzxcvbnm
+3304899	1221395	0	0	asdfghjklzxcvbnm
+3304900	1221395	0	0	asdfghjklzxcvbnm
+3304902	1221395	0	0	abcdefghijklmnopwrst
+3304903	1221395	0	0	asdfghjklzxcvbnm
+3304924	1221414	0	0	abcdefghijklmnopwrst
+3304925	1221415	0	0	asdfghjklzxcvbnm
+3304935	1221416	0	0	asdfghjklzxcvbnm
+3304936	1221418	0	0	asdfghjklzxcvbnm
+3304944	1221419	0	0	abcdefghijklmnopwrst
+3304959	1221427	0	0	asdfghjklzxcvbnm
+3304963	1221415	0	0	asdfghjklzxcvbnm
+3304964	1221428	0	0	asdfghjklzxcvbnm
+3304965	1221429	0	0	abcdefghijklmnopwrst
+3304978	1221433	0	0	abcdefghijklmnopwrst
+3304986	1221437	0	0	asdfghjklzxcvbnm
+3304988	1221439	0	0	asdfghjklzxcvbnm
+3304994	1221441	0	0	asdfghjklzxcvbnm
+3304996	1221442	0	0	asdfghjklzxcvbnm
+3304998	1221443	0	0	asdfghjklzxcvbnm
+3305003	1221446	0	0	abcdefghijklmnopwrst
+3305008	1221433	0	0	abcdefghijklmnopwrst
+3305009	1221447	0	0	asdfghjklzxcvbnm
+3305012	1221447	0	0	asdfghjklzxcvbnm
+3305013	1221449	0	0	abcdefghijklmnopwrst
+3305015	1221451	0	0	asdfghjklzxcvbnm
+3305019	1221453	0	0	asdfghjklzxcvbnm
+3305023	1221449	0	0	asdfghjklzxcvbnm
+3305026	1221456	0	0	abcdefghijklmnopwrst
+3305028	1221457	0	0	asdfghjklzxcvbnm
+3305032	1221449	0	0	asdfghjklzxcvbnm
+3305037	1221453	0	0	asdfghjklzxcvbnm
+3305040	1221451	0	0	asdfghjklzxcvbnm
+3305061	1221446	0	0	abcdefghijklmnopwrst
+3305175	1221457	0	0	abcdefghijklmnopwrst
+3305304	1221453	0	0	abcdefghijklmnopwrst
+3305308	1221453	0	1	abcdefghijklmnopwrst
+3305333	1221457	1221577	0	asdfghjklzxcvbnm
+3305335	1221453	0	0	asdfghjklzxcvbnm
+3305354	1221457	0	1	asdfghjklzxcvbnm
+3306089	1221442	0	0	abcdefghijklmnopwrst
+3306090	1221442	0	0	abcdefghijklmnopwrst
+3306092	1221442	0	0	asdfghjklzxcvbnm
+3306345	1221366	0	0	asdfghjklzxcvbnm
+3306349	1221366	0	0	asdfghjklzxcvbnm
+3306419	1221364	1221371	0	asdfghjklzxcvbnm
+3307390	1221453	0	0	abcdefghijklmnopwrst
+3308002	1221416	1221417	0	abcdefghijklmnopwrst
+3308331	1221366	1222821	0	abcdefghijklmnopwrst
+3309991	1221347	0	0	asdfghjklzxcvbnm
+3311917	1221287	0	0	abcdefghijklmnopwrst
+3311937	1221287	0	0	abcdefghijklmnopwrst
+3311945	1221287	0	0	asdfghjklzxcvbnm
+3311955	1221287	0	0	abcdefghijklmnopwrst
+3311961	1221287	0	0	asdfghjklzxcvbnm
+3311963	1221287	0	1	asdfghjklzxcvbnm
+3311968	1221287	0	0	asdfghjklzxcvbnm
+3311974	1221287	0	1	abcdefghijklmnopwrst
+3311976	1221287	0	1	abcdefghijklmnopwrst
+3311981	1221287	0	1	abcdefghijklmnopwrst
+3311985	1221287	0	1	asdfghjklzxcvbnm
+3312014	1221287	0	0	abcdefghijklmnopwrst
+3312018	1221287	0	1	abcdefghijklmnopwrst
+3312025	1221287	0	0	abcdefghijklmnopwrst
+3312027	1221287	0	0	abcdefghijklmnopwrst
+3312030	1221287	0	0	abcdefghijklmnopwrst
+3313755	1221288	0	0	abcdefghijklmnopwrst
+3313767	1221288	0	0	asdfghjklzxcvbnm
+3314668	1221290	0	0	asdfghjklzxcvbnm
+3314670	1221290	0	0	abcdefghijklmnopwrst
+3323440	1221338	0	0	abcdefghijklmnopwrst
+3323736	1221338	0	0	asdfghjklzxcvbnm
+3323739	1221338	0	0	asdfghjklzxcvbnm
+3324077	1221290	0	0	asdfghjklzxcvbnm
+3324081	1221290	0	0	abcdefghijklmnopwrst
+3324082	1221290	0	0	abcdefghijklmnopwrst
+3324639	1221457	1221563	1	asdfghjklzxcvbnm
+3326180	1221287	0	0	abcdefghijklmnopwrst
+3326204	1221287	0	0	asdfghjklzxcvbnm
+3326945	1221457	1221563	1	asdfghjklzxcvbnm
+3328393	1221364	1221373	0	asdfghjklzxcvbnm
+3328966	1221287	0	0	abcdefghijklmnopwrst
+3329875	1221457	1382427	0	abcdefghijklmnopwrst
+3333449	1221278	1231113	0	abcdefghijklmnopwrst
+3336022	1221457	0	0	abcdefghijklmnopwrst
+3340069	1221364	1221373	0	abcdefghijklmnopwrst
+3340073	1221364	1221373	0	abcdefghijklmnopwrst
+3340563	1221290	0	0	asdfghjklzxcvbnm
+3341553	1221453	0	0	abcdefghijklmnopwrst
+3345868	1221287	0	0	asdfghjklzxcvbnm
+3345873	1221287	0	0	abcdefghijklmnopwrst
+3345879	1221287	0	0	asdfghjklzxcvbnm
+3346860	1221457	0	0	abcdefghijklmnopwrst
+3347053	1221287	0	0	asdfghjklzxcvbnm
+3347109	1221287	0	1	abcdefghijklmnopwrst
+3350589	1221372	1236415	0	abcdefghijklmnopwrst
+3350594	1221372	1236415	1	asdfghjklzxcvbnm
+3353871	1221457	0	0	asdfghjklzxcvbnm
+3354727	1221364	1221373	0	abcdefghijklmnopwrst
+3355270	1221393	0	1	abcdefghijklmnopwrst
+3357638	1221287	0	0	asdfghjklzxcvbnm
+3357644	1221287	0	0	abcdefghijklmnopwrst
+3357648	1221287	0	0	abcdefghijklmnopwrst
+3357651	1221287	0	0	asdfghjklzxcvbnm
+3357661	1221287	0	0	abcdefghijklmnopwrst
+3357678	1221287	0	0	abcdefghijklmnopwrst
+3357697	1221287	0	0	asdfghjklzxcvbnm
+3357737	1221287	0	0	asdfghjklzxcvbnm
+3357744	1221287	0	0	abcdefghijklmnopwrst
+3357754	1221287	0	1	asdfghjklzxcvbnm
+3357760	1221287	0	1	abcdefghijklmnopwrst
+3357774	1221287	0	1	abcdefghijklmnopwrst
+3357779	1221287	0	0	abcdefghijklmnopwrst
+3357796	1221287	0	0	asdfghjklzxcvbnm
+3357814	1221287	0	0	asdfghjklzxcvbnm
+3357833	1221287	0	1	asdfghjklzxcvbnm
+3357835	1221287	0	0	abcdefghijklmnopwrst
+3357840	1221287	0	1	asdfghjklzxcvbnm
+3357842	1221287	0	0	abcdefghijklmnopwrst
+3357845	1221287	0	1	abcdefghijklmnopwrst
+3357849	1221287	0	1	abcdefghijklmnopwrst
+3357852	1221287	0	0	abcdefghijklmnopwrst
+3358935	1221443	0	1	abcdefghijklmnopwrst
+3358967	1221443	0	1	abcdefghijklmnopwrst
+3359181	1221256	0	0	abcdefghijklmnopwrst
+3360512	1221319	0	0	asdfghjklzxcvbnm
+3362004	1221287	0	0	abcdefghijklmnopwrst
+3362009	1221287	0	1	abcdefghijklmnopwrst
+3362358	1221287	0	0	asdfghjklzxcvbnm
+3363214	1221287	0	0	abcdefghijklmnopwrst
+3363238	1221287	0	1	asdfghjklzxcvbnm
+3363616	1221287	0	1	asdfghjklzxcvbnm
+3363631	1221287	0	0	asdfghjklzxcvbnm
+3364281	1221287	0	0	abcdefghijklmnopwrst
+3365900	1221347	0	0	asdfghjklzxcvbnm
+3365901	1221347	0	0	asdfghjklzxcvbnm
+3365906	1221347	0	0	asdfghjklzxcvbnm
+3365907	1221347	0	0	asdfghjklzxcvbnm
+3365910	1221347	0	0	abcdefghijklmnopwrst
+3365936	1221347	0	0	abcdefghijklmnopwrst
+3367846	1221287	0	0	abcdefghijklmnopwrst
+3368011	1221428	0	0	abcdefghijklmnopwrst
+3369882	1221300	0	0	asdfghjklzxcvbnm
+3370856	1221443	0	0	asdfghjklzxcvbnm
+3370861	1221443	1221445	0	abcdefghijklmnopwrst
+3375327	1221443	0	0	abcdefghijklmnopwrst
+3375333	1221443	1221445	0	abcdefghijklmnopwrst
+3376219	1221453	0	1	abcdefghijklmnopwrst
+3376228	1221453	0	0	abcdefghijklmnopwrst
+3376238	1221453	0	0	asdfghjklzxcvbnm
+3376243	1221453	0	0	abcdefghijklmnopwrst
+3376248	1221453	0	1	abcdefghijklmnopwrst
+3376254	1221453	0	0	abcdefghijklmnopwrst
+3376263	1221453	0	0	abcdefghijklmnopwrst
+3376272	1221453	0	1	asdfghjklzxcvbnm
+3376281	1221453	0	0	asdfghjklzxcvbnm
+3376290	1221453	0	0	abcdefghijklmnopwrst
+3376296	1221453	0	1	abcdefghijklmnopwrst
+3376301	1221453	0	0	asdfghjklzxcvbnm
+3376350	1221453	0	0	asdfghjklzxcvbnm
+3379002	1221453	0	0	abcdefghijklmnopwrst
+3379015	1221453	0	0	asdfghjklzxcvbnm
+3379025	1221453	0	0	abcdefghijklmnopwrst
+3379032	1221453	0	0	asdfghjklzxcvbnm
+3380181	1221372	1245650	0	asdfghjklzxcvbnm
+3380186	1221372	1245650	0	abcdefghijklmnopwrst
+3380190	1221372	1245650	0	asdfghjklzxcvbnm
+3380195	1221372	1245650	0	abcdefghijklmnopwrst
+3380202	1221372	1245650	0	asdfghjklzxcvbnm
+3380683	1221287	0	0	asdfghjklzxcvbnm
+3382317	1221453	0	0	abcdefghijklmnopwrst
+3382417	1221287	0	0	asdfghjklzxcvbnm
+3383523	1221338	0	1	abcdefghijklmnopwrst
+3387213	1221287	0	0	abcdefghijklmnopwrst
+3388139	1221453	0	0	asdfghjklzxcvbnm
+3398039	1221443	1251164	0	abcdefghijklmnopwrst
+3401835	1221453	0	0	asdfghjklzxcvbnm
+3412582	1221443	1255886	0	asdfghjklzxcvbnm
+3412583	1221443	1255886	0	asdfghjklzxcvbnm
+3413795	1221443	1255886	0	asdfghjklzxcvbnm
+3413813	1221443	1256258	0	asdfghjklzxcvbnm
+3420306	1221453	0	0	asdfghjklzxcvbnm
+3420354	1221453	0	0	asdfghjklzxcvbnm
+3425653	1221443	0	0	abcdefghijklmnopwrst
+3425658	1221443	0	0	asdfghjklzxcvbnm
+3431409	1221453	0	0	asdfghjklzxcvbnm
+3432510	1221443	1262320	0	asdfghjklzxcvbnm
+3432513	1221443	1262320	0	asdfghjklzxcvbnm
+3444444	1221443	1262320	0	abcdefghijklmnopwrst
+3445447	1221287	0	1	asdfghjklzxcvbnm
+3448662	1221338	0	0	asdfghjklzxcvbnm
+3450032	1221347	0	0	abcdefghijklmnopwrst
+3450259	1221453	0	0	abcdefghijklmnopwrst
+3452176	1221453	0	0	asdfghjklzxcvbnm
+3459239	1221347	0	0	asdfghjklzxcvbnm
+3463196	1221347	0	0	abcdefghijklmnopwrst
+3468759	1221453	0	0	abcdefghijklmnopwrst
+3470988	1221457	0	0	asdfghjklzxcvbnm
+3477116	1221287	0	0	asdfghjklzxcvbnm
+3477639	1221372	1277136	0	abcdefghijklmnopwrst
+3477656	1221372	1277136	0	asdfghjklzxcvbnm
+3488071	1221256	1238964	0	abcdefghijklmnopwrst
+3488079	1221256	0	0	asdfghjklzxcvbnm
+3488108	1221256	0	1	asdfghjklzxcvbnm
+3507126	1221287	0	1	asdfghjklzxcvbnm
+3511898	1221347	0	0	asdfghjklzxcvbnm
+3521780	1221453	0	0	abcdefghijklmnopwrst
+3536908	1221287	0	0	abcdefghijklmnopwrst
+3544231	1221329	0	1	asdfghjklzxcvbnm
+3545379	1221329	1298955	0	abcdefghijklmnopwrst
+3545384	1221329	1298955	0	abcdefghijklmnopwrst
+3545387	1221329	1298955	0	abcdefghijklmnopwrst
+3545389	1221329	1298955	1	abcdefghijklmnopwrst
+3545398	1221329	1298955	1	abcdefghijklmnopwrst
+3555715	1221287	0	0	asdfghjklzxcvbnm
+3563557	1221329	1298955	0	abcdefghijklmnopwrst
+3564322	1221338	0	0	asdfghjklzxcvbnm
+3565475	1221453	0	0	abcdefghijklmnopwrst
+3577588	1221287	0	0	asdfghjklzxcvbnm
+3600047	1221453	0	0	abcdefghijklmnopwrst
+3600062	1221453	0	0	asdfghjklzxcvbnm
+3600071	1221453	0	0	abcdefghijklmnopwrst
+3600080	1221453	0	1	abcdefghijklmnopwrst
+3600086	1221453	0	0	asdfghjklzxcvbnm
+3600091	1221453	0	1	abcdefghijklmnopwrst
+3600097	1221453	0	0	asdfghjklzxcvbnm
+3600103	1221453	0	0	asdfghjklzxcvbnm
+3600106	1221453	0	0	abcdefghijklmnopwrst
+3600113	1221453	0	0	abcdefghijklmnopwrst
+3600119	1221453	0	0	asdfghjklzxcvbnm
+3600124	1221453	0	0	abcdefghijklmnopwrst
+3600144	1221453	0	0	asdfghjklzxcvbnm
+3600152	1221453	0	0	asdfghjklzxcvbnm
+3600165	1221453	0	0	asdfghjklzxcvbnm
+3610561	1221287	0	0	abcdefghijklmnopwrst
+3617030	1221329	0	0	asdfghjklzxcvbnm
+3628347	1221443	1327098	0	abcdefghijklmnopwrst
+3628348	1221443	1327098	0	abcdefghijklmnopwrst
+3628646	1221443	0	0	asdfghjklzxcvbnm
+3633673	1221372	1328838	0	abcdefghijklmnopwrst
+3648489	1221443	0	0	asdfghjklzxcvbnm
+3648490	1221443	0	0	asdfghjklzxcvbnm
+3648534	1221443	1333827	0	asdfghjklzxcvbnm
+3653046	1221329	1298955	0	asdfghjklzxcvbnm
+3662680	1221287	0	0	asdfghjklzxcvbnm
+3699529	1221288	0	0	asdfghjklzxcvbnm
+3706659	1221453	0	0	asdfghjklzxcvbnm
+3723399	1221287	0	1	asdfghjklzxcvbnm
+3749934	1221278	0	0	abcdefghijklmnopwrst
+3761370	1221443	1371176	0	asdfghjklzxcvbnm
+3765884	1221443	1333827	0	abcdefghijklmnopwrst
+3772880	1221457	0	0	abcdefghijklmnopwrst
+3779574	1221457	1372998	1	abcdefghijklmnopwrst
+3784656	1221457	1372998	1	abcdefghijklmnopwrst
+3784700	1221457	1372998	1	abcdefghijklmnopwrst
+3784744	1221457	1382427	0	abcdefghijklmnopwrst
+3796187	1221457	1382427	1	abcdefghijklmnopwrst
+3796193	1221457	0	0	abcdefghijklmnopwrst
+3817277	1221457	1382427	0	asdfghjklzxcvbnm
+3828282	1221457	0	0	abcdefghijklmnopwrst
+3828297	1221457	0	0	abcdefghijklmnopwrst
+3828300	1221457	0	0	abcdefghijklmnopwrst
+3833022	1221287	0	0	asdfghjklzxcvbnm
+3856380	1221457	1395359	0	asdfghjklzxcvbnm
+3856391	1221457	0	0	asdfghjklzxcvbnm
+3861413	1221256	0	0	abcdefghijklmnopwrst
+3864734	1221393	0	1	abcdefghijklmnopwrst
+3868051	1221329	0	0	abcdefghijklmnopwrst
+3868059	1221329	0	0	abcdefghijklmnopwrst
+3869088	1221329	0	0	abcdefghijklmnopwrst
+3878669	1221329	1298955	0	asdfghjklzxcvbnm
+3878684	1221329	1298955	0	asdfghjklzxcvbnm
+3881785	1221287	0	0	abcdefghijklmnopwrst
+3882333	1221287	0	0	asdfghjklzxcvbnm
+3882389	1221287	0	0	abcdefghijklmnopwrst
+3908680	1221372	1245650	0	asdfghjklzxcvbnm
+3908690	1221372	1245650	0	asdfghjklzxcvbnm
+3908697	1221372	1245650	0	abcdefghijklmnopwrst
+3911434	1221453	0	0	abcdefghijklmnopwrst
+3911446	1221453	0	0	asdfghjklzxcvbnm
+3911448	1221453	0	0	abcdefghijklmnopwrst
+3911489	1221453	0	0	abcdefghijklmnopwrst
+3917384	1221453	0	0	abcdefghijklmnopwrst
+3939602	1221457	0	1	asdfghjklzxcvbnm
+3962210	1221453	0	0	asdfghjklzxcvbnm
+3963734	1221457	0	0	asdfghjklzxcvbnm
+3977364	1221287	0	0	asdfghjklzxcvbnm
+3981725	1221453	0	0	abcdefghijklmnopwrst
+4042952	1221453	0	0	abcdefghijklmnopwrst
+4042953	1221453	0	0	abcdefghijklmnopwrst
+4042958	1221453	0	0	abcdefghijklmnopwrst
+4042960	1221453	0	1	abcdefghijklmnopwrst
+4042965	1221453	0	0	asdfghjklzxcvbnm
+4066893	1221453	0	1	abcdefghijklmnopwrst
+4066896	1221453	0	0	abcdefghijklmnopwrst
+4066900	1221453	0	0	abcdefghijklmnopwrst
+4066908	1221453	0	0	abcdefghijklmnopwrst
+4066912	1221453	0	0	asdfghjklzxcvbnm
+4066915	1221453	0	0	asdfghjklzxcvbnm
+4066919	1221453	0	0	abcdefghijklmnopwrst
+4066924	1221453	0	0	asdfghjklzxcvbnm
+4066929	1221453	0	0	abcdefghijklmnopwrst
+4066934	1221453	0	0	asdfghjklzxcvbnm
+4066941	1221453	0	0	abcdefghijklmnopwrst
+4066946	1221453	0	0	asdfghjklzxcvbnm
+4066955	1221453	0	0	abcdefghijklmnopwrst
+4116291	1221433	1487238	0	asdfghjklzxcvbnm
+4116295	1221433	1487238	0	abcdefghijklmnopwrst
+4116450	1221433	1487238	0	abcdefghijklmnopwrst
+4121149	1221287	0	0	asdfghjklzxcvbnm
+4137325	1221453	0	0	abcdefghijklmnopwrst
+4149051	1221287	0	0	abcdefghijklmnopwrst
+4162347	1221287	0	0	abcdefghijklmnopwrst
+4164485	1221457	0	1	asdfghjklzxcvbnm
+4174706	1221457	0	0	abcdefghijklmnopwrst
+4178645	1221457	0	0	abcdefghijklmnopwrst
+4180122	1221457	1382427	0	asdfghjklzxcvbnm
+4180925	1221457	1382427	0	asdfghjklzxcvbnm
+4186417	1221457	0	0	abcdefghijklmnopwrst
+4189624	1221457	0	1	asdfghjklzxcvbnm
+4203132	1221453	0	0	asdfghjklzxcvbnm
+4228206	1221457	0	0	abcdefghijklmnopwrst
+4278829	1221453	0	0	abcdefghijklmnopwrst
+4326422	1221453	0	0	abcdefghijklmnopwrst
+4337061	1221287	0	0	abcdefghijklmnopwrst
+4379354	1221287	0	0	abcdefghijklmnopwrst
+4404901	1221457	0	0	abcdefghijklmnopwrst
+4494153	1221457	0	0	abcdefghijklmnopwrst
+4535721	1221287	0	0	asdfghjklzxcvbnm
+4559596	1221457	0	0	abcdefghijklmnopwrst
+4617751	1221393	0	0	abcdefghijklmnopwrst

=== modified file 'mysql-test/suite/binlog/r/binlog_base64_flag.result'
--- a/mysql-test/suite/binlog/r/binlog_base64_flag.result	2008-08-04 05:04:47 +0000
+++ b/mysql-test/suite/binlog/r/binlog_base64_flag.result	2010-06-18 17:32:23 +0000
@@ -91,3 +91,14 @@ iONkSBcBAAAAKwAAAMQBAAAQABAAAAAAAAEAA//4
 ';
 ERROR HY000: master may suffer from http://bugs.mysql.com/bug.php?id=37426 so slave stops; check error log on slave for more info
 drop table t1, char63_utf8, char128_utf8;
+#
+# Bug #54393: crash and/or valgrind errors in 
+# mysql_client_binlog_statement
+#
+BINLOG '';
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use
+BINLOG '123';
+BINLOG '-2079193929';
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use
+BINLOG 'x�����%~���D��������';
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use

=== modified file 'mysql-test/suite/binlog/r/binlog_innodb.result'
--- a/mysql-test/suite/binlog/r/binlog_innodb.result	2009-05-31 05:44:41 +0000
+++ b/mysql-test/suite/binlog/r/binlog_innodb.result	2010-05-24 13:54:08 +0000
@@ -156,9 +156,9 @@ select * from t2 /* must be (3,1), (4,4)
 a	b
 1	1
 4	4
-show master status /* there must no UPDATE in binlog */;
-File	Position	Binlog_Do_DB	Binlog_Ignore_DB
-master-bin.000001	106		
+# There must no UPDATE in binlog;
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 delete from t1;
 delete from t2;
 insert into t1 values (1,2),(3,4),(4,4);
@@ -166,8 +166,8 @@ insert into t2 values (1,2),(3,4),(4,4);
 reset master;
 UPDATE t2,t1  SET t2.a=t2.b where t2.a=t1.a;
 ERROR 23000: Duplicate entry '4' for key 'PRIMARY'
-show master status /* there must be no UPDATE query event */;
-File	Position	Binlog_Do_DB	Binlog_Ignore_DB
-master-bin.000001	106		
+# There must be no UPDATE query event;
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 drop table t1, t2;
 End of tests

=== modified file 'mysql-test/suite/binlog/r/binlog_row_binlog.result'
--- a/mysql-test/suite/binlog/r/binlog_row_binlog.result	2009-10-14 15:46:45 +0000
+++ b/mysql-test/suite/binlog/r/binlog_row_binlog.result	2010-05-24 13:54:08 +0000
@@ -26,215 +26,215 @@ create table t1 (n int) engine=innodb;
 begin;
 commit;
 drop table t1;
-show binlog events in 'master-bin.000001' from 106;
+show binlog events from <binlog_start>;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	1	#	use `test`; create table t1 (n int) engine=innodb
-master-bin.000001	#	Query	1	#	BEGIN
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
-master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
-master-bin.000001	#	Xid	1	#	COMMIT /* xid= */
-master-bin.000001	#	Rotate	1	#	master-bin.000002;pos=4
-show binlog events in 'master-bin.000002' from 106;
+master-bin.000001	#	Query	#	#	use `test`; create table t1 (n int) engine=innodb
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Rotate	#	#	master-bin.000002;pos=4
+show binlog events in 'master-bin.000002' from <binlog_start>;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000002	#	Query	1	#	use `test`; drop table t1
+master-bin.000002	#	Query	#	#	use `test`; drop table t1
 set @ac = @@autocommit;
 set autocommit= 0;
 reset master;
@@ -245,830 +245,828 @@ insert into t1 values (2);
 insert into t1 values (3);
 commit;
 drop table t1;
-show binlog events from 0;
+show binlog events from <binlog_start>;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	4	Format_desc	1	106	Server version, Binlog ver: 4
-master-bin.000001	106	Query	1	205	use `test`; create table t1(n int) engine=innodb
-master-bin.000001	205	Query	1	273	BEGIN
-master-bin.000001	273	Table_map	1	314	table_id: # (test.t1)
-master-bin.000001	314	Write_rows	1	348	table_id: # flags: STMT_END_F
-master-bin.000001	348	Table_map	1	389	table_id: # (test.t1)
-master-bin.000001	389	Write_rows	1	423	table_id: # flags: STMT_END_F
-master-bin.000001	423	Table_map	1	464	table_id: # (test.t1)
-master-bin.000001	464	Write_rows	1	498	table_id: # flags: STMT_END_F
-master-bin.000001	498	Xid	1	525	COMMIT /* XID */
-master-bin.000001	525	Query	1	601	use `test`; drop table t1
+master-bin.000001	#	Query	#	#	use `test`; create table t1(n int) engine=innodb
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	use `test`; drop table t1
 set @bcs = @@binlog_cache_size;
 set global binlog_cache_size=4096;
 reset master;
 create table t1 (a int) engine=innodb;
-show binlog events from 0;
+show binlog events from <binlog_start>;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	4	Format_desc	1	106	Server version, Binlog ver: 4
-master-bin.000001	106	Query	1	206	use `test`; create table t1 (a int) engine=innodb
-master-bin.000001	206	Query	1	274	BEGIN
-master-bin.000001	274	Table_map	1	315	table_id: # (test.t1)
-master-bin.000001	315	Write_rows	1	349	table_id: # flags: STMT_END_F
-master-bin.000001	349	Table_map	1	390	table_id: # (test.t1)
-master-bin.000001	390	Write_rows	1	424	table_id: # flags: STMT_END_F
-master-bin.000001	424	Table_map	1	465	table_id: # (test.t1)
-master-bin.000001	465	Write_rows	1	499	table_id: # flags: STMT_END_F
-master-bin.000001	499	Table_map	1	540	table_id: # (test.t1)
-master-bin.000001	540	Write_rows	1	574	table_id: # flags: STMT_END_F
-master-bin.000001	574	Table_map	1	615	table_id: # (test.t1)
-master-bin.000001	615	Write_rows	1	649	table_id: # flags: STMT_END_F
-master-bin.000001	649	Table_map	1	690	table_id: # (test.t1)
-master-bin.000001	690	Write_rows	1	724	table_id: # flags: STMT_END_F
-master-bin.000001	724	Table_map	1	765	table_id: # (test.t1)
-master-bin.000001	765	Write_rows	1	799	table_id: # flags: STMT_END_F
-master-bin.000001	799	Table_map	1	840	table_id: # (test.t1)
-master-bin.000001	840	Write_rows	1	874	table_id: # flags: STMT_END_F
-master-bin.000001	874	Table_map	1	915	table_id: # (test.t1)
-master-bin.000001	915	Write_rows	1	949	table_id: # flags: STMT_END_F
-master-bin.000001	949	Table_map	1	990	table_id: # (test.t1)
-master-bin.000001	990	Write_rows	1	1024	table_id: # flags: STMT_END_F
-master-bin.000001	1024	Table_map	1	1065	table_id: # (test.t1)
-master-bin.000001	1065	Write_rows	1	1099	table_id: # flags: STMT_END_F
-master-bin.000001	1099	Table_map	1	1140	table_id: # (test.t1)
-master-bin.000001	1140	Write_rows	1	1174	table_id: # flags: STMT_END_F
-master-bin.000001	1174	Table_map	1	1215	table_id: # (test.t1)
-master-bin.000001	1215	Write_rows	1	1249	table_id: # flags: STMT_END_F
-master-bin.000001	1249	Table_map	1	1290	table_id: # (test.t1)
-master-bin.000001	1290	Write_rows	1	1324	table_id: # flags: STMT_END_F
-master-bin.000001	1324	Table_map	1	1365	table_id: # (test.t1)
-master-bin.000001	1365	Write_rows	1	1399	table_id: # flags: STMT_END_F
-master-bin.000001	1399	Table_map	1	1440	table_id: # (test.t1)
-master-bin.000001	1440	Write_rows	1	1474	table_id: # flags: STMT_END_F
-master-bin.000001	1474	Table_map	1	1515	table_id: # (test.t1)
-master-bin.000001	1515	Write_rows	1	1549	table_id: # flags: STMT_END_F
-master-bin.000001	1549	Table_map	1	1590	table_id: # (test.t1)
-master-bin.000001	1590	Write_rows	1	1624	table_id: # flags: STMT_END_F
-master-bin.000001	1624	Table_map	1	1665	table_id: # (test.t1)
-master-bin.000001	1665	Write_rows	1	1699	table_id: # flags: STMT_END_F
-master-bin.000001	1699	Table_map	1	1740	table_id: # (test.t1)
-master-bin.000001	1740	Write_rows	1	1774	table_id: # flags: STMT_END_F
-master-bin.000001	1774	Table_map	1	1815	table_id: # (test.t1)
-master-bin.000001	1815	Write_rows	1	1849	table_id: # flags: STMT_END_F
-master-bin.000001	1849	Table_map	1	1890	table_id: # (test.t1)
-master-bin.000001	1890	Write_rows	1	1924	table_id: # flags: STMT_END_F
-master-bin.000001	1924	Table_map	1	1965	table_id: # (test.t1)
-master-bin.000001	1965	Write_rows	1	1999	table_id: # flags: STMT_END_F
-master-bin.000001	1999	Table_map	1	2040	table_id: # (test.t1)
-master-bin.000001	2040	Write_rows	1	2074	table_id: # flags: STMT_END_F
-master-bin.000001	2074	Table_map	1	2115	table_id: # (test.t1)
-master-bin.000001	2115	Write_rows	1	2149	table_id: # flags: STMT_END_F
-master-bin.000001	2149	Table_map	1	2190	table_id: # (test.t1)
-master-bin.000001	2190	Write_rows	1	2224	table_id: # flags: STMT_END_F
-master-bin.000001	2224	Table_map	1	2265	table_id: # (test.t1)
-master-bin.000001	2265	Write_rows	1	2299	table_id: # flags: STMT_END_F
-master-bin.000001	2299	Table_map	1	2340	table_id: # (test.t1)
-master-bin.000001	2340	Write_rows	1	2374	table_id: # flags: STMT_END_F
-master-bin.000001	2374	Table_map	1	2415	table_id: # (test.t1)
-master-bin.000001	2415	Write_rows	1	2449	table_id: # flags: STMT_END_F
-master-bin.000001	2449	Table_map	1	2490	table_id: # (test.t1)
-master-bin.000001	2490	Write_rows	1	2524	table_id: # flags: STMT_END_F
-master-bin.000001	2524	Table_map	1	2565	table_id: # (test.t1)
-master-bin.000001	2565	Write_rows	1	2599	table_id: # flags: STMT_END_F
-master-bin.000001	2599	Table_map	1	2640	table_id: # (test.t1)
-master-bin.000001	2640	Write_rows	1	2674	table_id: # flags: STMT_END_F
-master-bin.000001	2674	Table_map	1	2715	table_id: # (test.t1)
-master-bin.000001	2715	Write_rows	1	2749	table_id: # flags: STMT_END_F
-master-bin.000001	2749	Table_map	1	2790	table_id: # (test.t1)
-master-bin.000001	2790	Write_rows	1	2824	table_id: # flags: STMT_END_F
-master-bin.000001	2824	Table_map	1	2865	table_id: # (test.t1)
-master-bin.000001	2865	Write_rows	1	2899	table_id: # flags: STMT_END_F
-master-bin.000001	2899	Table_map	1	2940	table_id: # (test.t1)
-master-bin.000001	2940	Write_rows	1	2974	table_id: # flags: STMT_END_F
-master-bin.000001	2974	Table_map	1	3015	table_id: # (test.t1)
-master-bin.000001	3015	Write_rows	1	3049	table_id: # flags: STMT_END_F
-master-bin.000001	3049	Table_map	1	3090	table_id: # (test.t1)
-master-bin.000001	3090	Write_rows	1	3124	table_id: # flags: STMT_END_F
-master-bin.000001	3124	Table_map	1	3165	table_id: # (test.t1)
-master-bin.000001	3165	Write_rows	1	3199	table_id: # flags: STMT_END_F
-master-bin.000001	3199	Table_map	1	3240	table_id: # (test.t1)
-master-bin.000001	3240	Write_rows	1	3274	table_id: # flags: STMT_END_F
-master-bin.000001	3274	Table_map	1	3315	table_id: # (test.t1)
-master-bin.000001	3315	Write_rows	1	3349	table_id: # flags: STMT_END_F
-master-bin.000001	3349	Table_map	1	3390	table_id: # (test.t1)
-master-bin.000001	3390	Write_rows	1	3424	table_id: # flags: STMT_END_F
-master-bin.000001	3424	Table_map	1	3465	table_id: # (test.t1)
-master-bin.000001	3465	Write_rows	1	3499	table_id: # flags: STMT_END_F
-master-bin.000001	3499	Table_map	1	3540	table_id: # (test.t1)
-master-bin.000001	3540	Write_rows	1	3574	table_id: # flags: STMT_END_F
-master-bin.000001	3574	Table_map	1	3615	table_id: # (test.t1)
-master-bin.000001	3615	Write_rows	1	3649	table_id: # flags: STMT_END_F
-master-bin.000001	3649	Table_map	1	3690	table_id: # (test.t1)
-master-bin.000001	3690	Write_rows	1	3724	table_id: # flags: STMT_END_F
-master-bin.000001	3724	Table_map	1	3765	table_id: # (test.t1)
-master-bin.000001	3765	Write_rows	1	3799	table_id: # flags: STMT_END_F
-master-bin.000001	3799	Table_map	1	3840	table_id: # (test.t1)
-master-bin.000001	3840	Write_rows	1	3874	table_id: # flags: STMT_END_F
-master-bin.000001	3874	Table_map	1	3915	table_id: # (test.t1)
-master-bin.000001	3915	Write_rows	1	3949	table_id: # flags: STMT_END_F
-master-bin.000001	3949	Table_map	1	3990	table_id: # (test.t1)
-master-bin.000001	3990	Write_rows	1	4024	table_id: # flags: STMT_END_F
-master-bin.000001	4024	Table_map	1	4065	table_id: # (test.t1)
-master-bin.000001	4065	Write_rows	1	4099	table_id: # flags: STMT_END_F
-master-bin.000001	4099	Table_map	1	4140	table_id: # (test.t1)
-master-bin.000001	4140	Write_rows	1	4174	table_id: # flags: STMT_END_F
-master-bin.000001	4174	Table_map	1	4215	table_id: # (test.t1)
-master-bin.000001	4215	Write_rows	1	4249	table_id: # flags: STMT_END_F
-master-bin.000001	4249	Table_map	1	4290	table_id: # (test.t1)
-master-bin.000001	4290	Write_rows	1	4324	table_id: # flags: STMT_END_F
-master-bin.000001	4324	Table_map	1	4365	table_id: # (test.t1)
-master-bin.000001	4365	Write_rows	1	4399	table_id: # flags: STMT_END_F
-master-bin.000001	4399	Table_map	1	4440	table_id: # (test.t1)
-master-bin.000001	4440	Write_rows	1	4474	table_id: # flags: STMT_END_F
-master-bin.000001	4474	Table_map	1	4515	table_id: # (test.t1)
-master-bin.000001	4515	Write_rows	1	4549	table_id: # flags: STMT_END_F
-master-bin.000001	4549	Table_map	1	4590	table_id: # (test.t1)
-master-bin.000001	4590	Write_rows	1	4624	table_id: # flags: STMT_END_F
-master-bin.000001	4624	Table_map	1	4665	table_id: # (test.t1)
-master-bin.000001	4665	Write_rows	1	4699	table_id: # flags: STMT_END_F
-master-bin.000001	4699	Table_map	1	4740	table_id: # (test.t1)
-master-bin.000001	4740	Write_rows	1	4774	table_id: # flags: STMT_END_F
-master-bin.000001	4774	Table_map	1	4815	table_id: # (test.t1)
-master-bin.000001	4815	Write_rows	1	4849	table_id: # flags: STMT_END_F
-master-bin.000001	4849	Table_map	1	4890	table_id: # (test.t1)
-master-bin.000001	4890	Write_rows	1	4924	table_id: # flags: STMT_END_F
-master-bin.000001	4924	Table_map	1	4965	table_id: # (test.t1)
-master-bin.000001	4965	Write_rows	1	4999	table_id: # flags: STMT_END_F
-master-bin.000001	4999	Table_map	1	5040	table_id: # (test.t1)
-master-bin.000001	5040	Write_rows	1	5074	table_id: # flags: STMT_END_F
-master-bin.000001	5074	Table_map	1	5115	table_id: # (test.t1)
-master-bin.000001	5115	Write_rows	1	5149	table_id: # flags: STMT_END_F
-master-bin.000001	5149	Table_map	1	5190	table_id: # (test.t1)
-master-bin.000001	5190	Write_rows	1	5224	table_id: # flags: STMT_END_F
-master-bin.000001	5224	Table_map	1	5265	table_id: # (test.t1)
-master-bin.000001	5265	Write_rows	1	5299	table_id: # flags: STMT_END_F
-master-bin.000001	5299	Table_map	1	5340	table_id: # (test.t1)
-master-bin.000001	5340	Write_rows	1	5374	table_id: # flags: STMT_END_F
-master-bin.000001	5374	Table_map	1	5415	table_id: # (test.t1)
-master-bin.000001	5415	Write_rows	1	5449	table_id: # flags: STMT_END_F
-master-bin.000001	5449	Table_map	1	5490	table_id: # (test.t1)
-master-bin.000001	5490	Write_rows	1	5524	table_id: # flags: STMT_END_F
-master-bin.000001	5524	Table_map	1	5565	table_id: # (test.t1)
-master-bin.000001	5565	Write_rows	1	5599	table_id: # flags: STMT_END_F
-master-bin.000001	5599	Table_map	1	5640	table_id: # (test.t1)
-master-bin.000001	5640	Write_rows	1	5674	table_id: # flags: STMT_END_F
-master-bin.000001	5674	Table_map	1	5715	table_id: # (test.t1)
-master-bin.000001	5715	Write_rows	1	5749	table_id: # flags: STMT_END_F
-master-bin.000001	5749	Table_map	1	5790	table_id: # (test.t1)
-master-bin.000001	5790	Write_rows	1	5824	table_id: # flags: STMT_END_F
-master-bin.000001	5824	Table_map	1	5865	table_id: # (test.t1)
-master-bin.000001	5865	Write_rows	1	5899	table_id: # flags: STMT_END_F
-master-bin.000001	5899	Table_map	1	5940	table_id: # (test.t1)
-master-bin.000001	5940	Write_rows	1	5974	table_id: # flags: STMT_END_F
-master-bin.000001	5974	Table_map	1	6015	table_id: # (test.t1)
-master-bin.000001	6015	Write_rows	1	6049	table_id: # flags: STMT_END_F
-master-bin.000001	6049	Table_map	1	6090	table_id: # (test.t1)
-master-bin.000001	6090	Write_rows	1	6124	table_id: # flags: STMT_END_F
-master-bin.000001	6124	Table_map	1	6165	table_id: # (test.t1)
-master-bin.000001	6165	Write_rows	1	6199	table_id: # flags: STMT_END_F
-master-bin.000001	6199	Table_map	1	6240	table_id: # (test.t1)
-master-bin.000001	6240	Write_rows	1	6274	table_id: # flags: STMT_END_F
-master-bin.000001	6274	Table_map	1	6315	table_id: # (test.t1)
-master-bin.000001	6315	Write_rows	1	6349	table_id: # flags: STMT_END_F
-master-bin.000001	6349	Table_map	1	6390	table_id: # (test.t1)
-master-bin.000001	6390	Write_rows	1	6424	table_id: # flags: STMT_END_F
-master-bin.000001	6424	Table_map	1	6465	table_id: # (test.t1)
-master-bin.000001	6465	Write_rows	1	6499	table_id: # flags: STMT_END_F
-master-bin.000001	6499	Table_map	1	6540	table_id: # (test.t1)
-master-bin.000001	6540	Write_rows	1	6574	table_id: # flags: STMT_END_F
-master-bin.000001	6574	Table_map	1	6615	table_id: # (test.t1)
-master-bin.000001	6615	Write_rows	1	6649	table_id: # flags: STMT_END_F
-master-bin.000001	6649	Table_map	1	6690	table_id: # (test.t1)
-master-bin.000001	6690	Write_rows	1	6724	table_id: # flags: STMT_END_F
-master-bin.000001	6724	Table_map	1	6765	table_id: # (test.t1)
-master-bin.000001	6765	Write_rows	1	6799	table_id: # flags: STMT_END_F
-master-bin.000001	6799	Table_map	1	6840	table_id: # (test.t1)
-master-bin.000001	6840	Write_rows	1	6874	table_id: # flags: STMT_END_F
-master-bin.000001	6874	Table_map	1	6915	table_id: # (test.t1)
-master-bin.000001	6915	Write_rows	1	6949	table_id: # flags: STMT_END_F
-master-bin.000001	6949	Table_map	1	6990	table_id: # (test.t1)
-master-bin.000001	6990	Write_rows	1	7024	table_id: # flags: STMT_END_F
-master-bin.000001	7024	Table_map	1	7065	table_id: # (test.t1)
-master-bin.000001	7065	Write_rows	1	7099	table_id: # flags: STMT_END_F
-master-bin.000001	7099	Table_map	1	7140	table_id: # (test.t1)
-master-bin.000001	7140	Write_rows	1	7174	table_id: # flags: STMT_END_F
-master-bin.000001	7174	Table_map	1	7215	table_id: # (test.t1)
-master-bin.000001	7215	Write_rows	1	7249	table_id: # flags: STMT_END_F
-master-bin.000001	7249	Table_map	1	7290	table_id: # (test.t1)
-master-bin.000001	7290	Write_rows	1	7324	table_id: # flags: STMT_END_F
-master-bin.000001	7324	Table_map	1	7365	table_id: # (test.t1)
-master-bin.000001	7365	Write_rows	1	7399	table_id: # flags: STMT_END_F
-master-bin.000001	7399	Table_map	1	7440	table_id: # (test.t1)
-master-bin.000001	7440	Write_rows	1	7474	table_id: # flags: STMT_END_F
-master-bin.000001	7474	Table_map	1	7515	table_id: # (test.t1)
-master-bin.000001	7515	Write_rows	1	7549	table_id: # flags: STMT_END_F
-master-bin.000001	7549	Table_map	1	7590	table_id: # (test.t1)
-master-bin.000001	7590	Write_rows	1	7624	table_id: # flags: STMT_END_F
-master-bin.000001	7624	Table_map	1	7665	table_id: # (test.t1)
-master-bin.000001	7665	Write_rows	1	7699	table_id: # flags: STMT_END_F
-master-bin.000001	7699	Table_map	1	7740	table_id: # (test.t1)
-master-bin.000001	7740	Write_rows	1	7774	table_id: # flags: STMT_END_F
-master-bin.000001	7774	Table_map	1	7815	table_id: # (test.t1)
-master-bin.000001	7815	Write_rows	1	7849	table_id: # flags: STMT_END_F
-master-bin.000001	7849	Table_map	1	7890	table_id: # (test.t1)
-master-bin.000001	7890	Write_rows	1	7924	table_id: # flags: STMT_END_F
-master-bin.000001	7924	Table_map	1	7965	table_id: # (test.t1)
-master-bin.000001	7965	Write_rows	1	7999	table_id: # flags: STMT_END_F
-master-bin.000001	7999	Table_map	1	8040	table_id: # (test.t1)
-master-bin.000001	8040	Write_rows	1	8074	table_id: # flags: STMT_END_F
-master-bin.000001	8074	Table_map	1	8115	table_id: # (test.t1)
-master-bin.000001	8115	Write_rows	1	8149	table_id: # flags: STMT_END_F
-master-bin.000001	8149	Table_map	1	8190	table_id: # (test.t1)
-master-bin.000001	8190	Write_rows	1	8224	table_id: # flags: STMT_END_F
-master-bin.000001	8224	Table_map	1	8265	table_id: # (test.t1)
-master-bin.000001	8265	Write_rows	1	8299	table_id: # flags: STMT_END_F
-master-bin.000001	8299	Table_map	1	8340	table_id: # (test.t1)
-master-bin.000001	8340	Write_rows	1	8374	table_id: # flags: STMT_END_F
-master-bin.000001	8374	Table_map	1	8415	table_id: # (test.t1)
-master-bin.000001	8415	Write_rows	1	8449	table_id: # flags: STMT_END_F
-master-bin.000001	8449	Table_map	1	8490	table_id: # (test.t1)
-master-bin.000001	8490	Write_rows	1	8524	table_id: # flags: STMT_END_F
-master-bin.000001	8524	Table_map	1	8565	table_id: # (test.t1)
-master-bin.000001	8565	Write_rows	1	8599	table_id: # flags: STMT_END_F
-master-bin.000001	8599	Table_map	1	8640	table_id: # (test.t1)
-master-bin.000001	8640	Write_rows	1	8674	table_id: # flags: STMT_END_F
-master-bin.000001	8674	Table_map	1	8715	table_id: # (test.t1)
-master-bin.000001	8715	Write_rows	1	8749	table_id: # flags: STMT_END_F
-master-bin.000001	8749	Table_map	1	8790	table_id: # (test.t1)
-master-bin.000001	8790	Write_rows	1	8824	table_id: # flags: STMT_END_F
-master-bin.000001	8824	Table_map	1	8865	table_id: # (test.t1)
-master-bin.000001	8865	Write_rows	1	8899	table_id: # flags: STMT_END_F
-master-bin.000001	8899	Table_map	1	8940	table_id: # (test.t1)
-master-bin.000001	8940	Write_rows	1	8974	table_id: # flags: STMT_END_F
-master-bin.000001	8974	Table_map	1	9015	table_id: # (test.t1)
-master-bin.000001	9015	Write_rows	1	9049	table_id: # flags: STMT_END_F
-master-bin.000001	9049	Table_map	1	9090	table_id: # (test.t1)
-master-bin.000001	9090	Write_rows	1	9124	table_id: # flags: STMT_END_F
-master-bin.000001	9124	Table_map	1	9165	table_id: # (test.t1)
-master-bin.000001	9165	Write_rows	1	9199	table_id: # flags: STMT_END_F
-master-bin.000001	9199	Table_map	1	9240	table_id: # (test.t1)
-master-bin.000001	9240	Write_rows	1	9274	table_id: # flags: STMT_END_F
-master-bin.000001	9274	Table_map	1	9315	table_id: # (test.t1)
-master-bin.000001	9315	Write_rows	1	9349	table_id: # flags: STMT_END_F
-master-bin.000001	9349	Table_map	1	9390	table_id: # (test.t1)
-master-bin.000001	9390	Write_rows	1	9424	table_id: # flags: STMT_END_F
-master-bin.000001	9424	Table_map	1	9465	table_id: # (test.t1)
-master-bin.000001	9465	Write_rows	1	9499	table_id: # flags: STMT_END_F
-master-bin.000001	9499	Table_map	1	9540	table_id: # (test.t1)
-master-bin.000001	9540	Write_rows	1	9574	table_id: # flags: STMT_END_F
-master-bin.000001	9574	Table_map	1	9615	table_id: # (test.t1)
-master-bin.000001	9615	Write_rows	1	9649	table_id: # flags: STMT_END_F
-master-bin.000001	9649	Table_map	1	9690	table_id: # (test.t1)
-master-bin.000001	9690	Write_rows	1	9724	table_id: # flags: STMT_END_F
-master-bin.000001	9724	Table_map	1	9765	table_id: # (test.t1)
-master-bin.000001	9765	Write_rows	1	9799	table_id: # flags: STMT_END_F
-master-bin.000001	9799	Table_map	1	9840	table_id: # (test.t1)
-master-bin.000001	9840	Write_rows	1	9874	table_id: # flags: STMT_END_F
-master-bin.000001	9874	Table_map	1	9915	table_id: # (test.t1)
-master-bin.000001	9915	Write_rows	1	9949	table_id: # flags: STMT_END_F
-master-bin.000001	9949	Table_map	1	9990	table_id: # (test.t1)
-master-bin.000001	9990	Write_rows	1	10024	table_id: # flags: STMT_END_F
-master-bin.000001	10024	Table_map	1	10065	table_id: # (test.t1)
-master-bin.000001	10065	Write_rows	1	10099	table_id: # flags: STMT_END_F
-master-bin.000001	10099	Table_map	1	10140	table_id: # (test.t1)
-master-bin.000001	10140	Write_rows	1	10174	table_id: # flags: STMT_END_F
-master-bin.000001	10174	Table_map	1	10215	table_id: # (test.t1)
-master-bin.000001	10215	Write_rows	1	10249	table_id: # flags: STMT_END_F
-master-bin.000001	10249	Table_map	1	10290	table_id: # (test.t1)
-master-bin.000001	10290	Write_rows	1	10324	table_id: # flags: STMT_END_F
-master-bin.000001	10324	Table_map	1	10365	table_id: # (test.t1)
-master-bin.000001	10365	Write_rows	1	10399	table_id: # flags: STMT_END_F
-master-bin.000001	10399	Table_map	1	10440	table_id: # (test.t1)
-master-bin.000001	10440	Write_rows	1	10474	table_id: # flags: STMT_END_F
-master-bin.000001	10474	Table_map	1	10515	table_id: # (test.t1)
-master-bin.000001	10515	Write_rows	1	10549	table_id: # flags: STMT_END_F
-master-bin.000001	10549	Table_map	1	10590	table_id: # (test.t1)
-master-bin.000001	10590	Write_rows	1	10624	table_id: # flags: STMT_END_F
-master-bin.000001	10624	Table_map	1	10665	table_id: # (test.t1)
-master-bin.000001	10665	Write_rows	1	10699	table_id: # flags: STMT_END_F
-master-bin.000001	10699	Table_map	1	10740	table_id: # (test.t1)
-master-bin.000001	10740	Write_rows	1	10774	table_id: # flags: STMT_END_F
-master-bin.000001	10774	Table_map	1	10815	table_id: # (test.t1)
-master-bin.000001	10815	Write_rows	1	10849	table_id: # flags: STMT_END_F
-master-bin.000001	10849	Table_map	1	10890	table_id: # (test.t1)
-master-bin.000001	10890	Write_rows	1	10924	table_id: # flags: STMT_END_F
-master-bin.000001	10924	Table_map	1	10965	table_id: # (test.t1)
-master-bin.000001	10965	Write_rows	1	10999	table_id: # flags: STMT_END_F
-master-bin.000001	10999	Table_map	1	11040	table_id: # (test.t1)
-master-bin.000001	11040	Write_rows	1	11074	table_id: # flags: STMT_END_F
-master-bin.000001	11074	Table_map	1	11115	table_id: # (test.t1)
-master-bin.000001	11115	Write_rows	1	11149	table_id: # flags: STMT_END_F
-master-bin.000001	11149	Table_map	1	11190	table_id: # (test.t1)
-master-bin.000001	11190	Write_rows	1	11224	table_id: # flags: STMT_END_F
-master-bin.000001	11224	Table_map	1	11265	table_id: # (test.t1)
-master-bin.000001	11265	Write_rows	1	11299	table_id: # flags: STMT_END_F
-master-bin.000001	11299	Table_map	1	11340	table_id: # (test.t1)
-master-bin.000001	11340	Write_rows	1	11374	table_id: # flags: STMT_END_F
-master-bin.000001	11374	Table_map	1	11415	table_id: # (test.t1)
-master-bin.000001	11415	Write_rows	1	11449	table_id: # flags: STMT_END_F
-master-bin.000001	11449	Table_map	1	11490	table_id: # (test.t1)
-master-bin.000001	11490	Write_rows	1	11524	table_id: # flags: STMT_END_F
-master-bin.000001	11524	Table_map	1	11565	table_id: # (test.t1)
-master-bin.000001	11565	Write_rows	1	11599	table_id: # flags: STMT_END_F
-master-bin.000001	11599	Table_map	1	11640	table_id: # (test.t1)
-master-bin.000001	11640	Write_rows	1	11674	table_id: # flags: STMT_END_F
-master-bin.000001	11674	Table_map	1	11715	table_id: # (test.t1)
-master-bin.000001	11715	Write_rows	1	11749	table_id: # flags: STMT_END_F
-master-bin.000001	11749	Table_map	1	11790	table_id: # (test.t1)
-master-bin.000001	11790	Write_rows	1	11824	table_id: # flags: STMT_END_F
-master-bin.000001	11824	Table_map	1	11865	table_id: # (test.t1)
-master-bin.000001	11865	Write_rows	1	11899	table_id: # flags: STMT_END_F
-master-bin.000001	11899	Table_map	1	11940	table_id: # (test.t1)
-master-bin.000001	11940	Write_rows	1	11974	table_id: # flags: STMT_END_F
-master-bin.000001	11974	Table_map	1	12015	table_id: # (test.t1)
-master-bin.000001	12015	Write_rows	1	12049	table_id: # flags: STMT_END_F
-master-bin.000001	12049	Table_map	1	12090	table_id: # (test.t1)
-master-bin.000001	12090	Write_rows	1	12124	table_id: # flags: STMT_END_F
-master-bin.000001	12124	Table_map	1	12165	table_id: # (test.t1)
-master-bin.000001	12165	Write_rows	1	12199	table_id: # flags: STMT_END_F
-master-bin.000001	12199	Table_map	1	12240	table_id: # (test.t1)
-master-bin.000001	12240	Write_rows	1	12274	table_id: # flags: STMT_END_F
-master-bin.000001	12274	Table_map	1	12315	table_id: # (test.t1)
-master-bin.000001	12315	Write_rows	1	12349	table_id: # flags: STMT_END_F
-master-bin.000001	12349	Table_map	1	12390	table_id: # (test.t1)
-master-bin.000001	12390	Write_rows	1	12424	table_id: # flags: STMT_END_F
-master-bin.000001	12424	Table_map	1	12465	table_id: # (test.t1)
-master-bin.000001	12465	Write_rows	1	12499	table_id: # flags: STMT_END_F
-master-bin.000001	12499	Table_map	1	12540	table_id: # (test.t1)
-master-bin.000001	12540	Write_rows	1	12574	table_id: # flags: STMT_END_F
-master-bin.000001	12574	Table_map	1	12615	table_id: # (test.t1)
-master-bin.000001	12615	Write_rows	1	12649	table_id: # flags: STMT_END_F
-master-bin.000001	12649	Table_map	1	12690	table_id: # (test.t1)
-master-bin.000001	12690	Write_rows	1	12724	table_id: # flags: STMT_END_F
-master-bin.000001	12724	Table_map	1	12765	table_id: # (test.t1)
-master-bin.000001	12765	Write_rows	1	12799	table_id: # flags: STMT_END_F
-master-bin.000001	12799	Table_map	1	12840	table_id: # (test.t1)
-master-bin.000001	12840	Write_rows	1	12874	table_id: # flags: STMT_END_F
-master-bin.000001	12874	Table_map	1	12915	table_id: # (test.t1)
-master-bin.000001	12915	Write_rows	1	12949	table_id: # flags: STMT_END_F
-master-bin.000001	12949	Table_map	1	12990	table_id: # (test.t1)
-master-bin.000001	12990	Write_rows	1	13024	table_id: # flags: STMT_END_F
-master-bin.000001	13024	Table_map	1	13065	table_id: # (test.t1)
-master-bin.000001	13065	Write_rows	1	13099	table_id: # flags: STMT_END_F
-master-bin.000001	13099	Table_map	1	13140	table_id: # (test.t1)
-master-bin.000001	13140	Write_rows	1	13174	table_id: # flags: STMT_END_F
-master-bin.000001	13174	Table_map	1	13215	table_id: # (test.t1)
-master-bin.000001	13215	Write_rows	1	13249	table_id: # flags: STMT_END_F
-master-bin.000001	13249	Table_map	1	13290	table_id: # (test.t1)
-master-bin.000001	13290	Write_rows	1	13324	table_id: # flags: STMT_END_F
-master-bin.000001	13324	Table_map	1	13365	table_id: # (test.t1)
-master-bin.000001	13365	Write_rows	1	13399	table_id: # flags: STMT_END_F
-master-bin.000001	13399	Table_map	1	13440	table_id: # (test.t1)
-master-bin.000001	13440	Write_rows	1	13474	table_id: # flags: STMT_END_F
-master-bin.000001	13474	Table_map	1	13515	table_id: # (test.t1)
-master-bin.000001	13515	Write_rows	1	13549	table_id: # flags: STMT_END_F
-master-bin.000001	13549	Table_map	1	13590	table_id: # (test.t1)
-master-bin.000001	13590	Write_rows	1	13624	table_id: # flags: STMT_END_F
-master-bin.000001	13624	Table_map	1	13665	table_id: # (test.t1)
-master-bin.000001	13665	Write_rows	1	13699	table_id: # flags: STMT_END_F
-master-bin.000001	13699	Table_map	1	13740	table_id: # (test.t1)
-master-bin.000001	13740	Write_rows	1	13774	table_id: # flags: STMT_END_F
-master-bin.000001	13774	Table_map	1	13815	table_id: # (test.t1)
-master-bin.000001	13815	Write_rows	1	13849	table_id: # flags: STMT_END_F
-master-bin.000001	13849	Table_map	1	13890	table_id: # (test.t1)
-master-bin.000001	13890	Write_rows	1	13924	table_id: # flags: STMT_END_F
-master-bin.000001	13924	Table_map	1	13965	table_id: # (test.t1)
-master-bin.000001	13965	Write_rows	1	13999	table_id: # flags: STMT_END_F
-master-bin.000001	13999	Table_map	1	14040	table_id: # (test.t1)
-master-bin.000001	14040	Write_rows	1	14074	table_id: # flags: STMT_END_F
-master-bin.000001	14074	Table_map	1	14115	table_id: # (test.t1)
-master-bin.000001	14115	Write_rows	1	14149	table_id: # flags: STMT_END_F
-master-bin.000001	14149	Table_map	1	14190	table_id: # (test.t1)
-master-bin.000001	14190	Write_rows	1	14224	table_id: # flags: STMT_END_F
-master-bin.000001	14224	Table_map	1	14265	table_id: # (test.t1)
-master-bin.000001	14265	Write_rows	1	14299	table_id: # flags: STMT_END_F
-master-bin.000001	14299	Table_map	1	14340	table_id: # (test.t1)
-master-bin.000001	14340	Write_rows	1	14374	table_id: # flags: STMT_END_F
-master-bin.000001	14374	Table_map	1	14415	table_id: # (test.t1)
-master-bin.000001	14415	Write_rows	1	14449	table_id: # flags: STMT_END_F
-master-bin.000001	14449	Table_map	1	14490	table_id: # (test.t1)
-master-bin.000001	14490	Write_rows	1	14524	table_id: # flags: STMT_END_F
-master-bin.000001	14524	Table_map	1	14565	table_id: # (test.t1)
-master-bin.000001	14565	Write_rows	1	14599	table_id: # flags: STMT_END_F
-master-bin.000001	14599	Table_map	1	14640	table_id: # (test.t1)
-master-bin.000001	14640	Write_rows	1	14674	table_id: # flags: STMT_END_F
-master-bin.000001	14674	Table_map	1	14715	table_id: # (test.t1)
-master-bin.000001	14715	Write_rows	1	14749	table_id: # flags: STMT_END_F
-master-bin.000001	14749	Table_map	1	14790	table_id: # (test.t1)
-master-bin.000001	14790	Write_rows	1	14824	table_id: # flags: STMT_END_F
-master-bin.000001	14824	Table_map	1	14865	table_id: # (test.t1)
-master-bin.000001	14865	Write_rows	1	14899	table_id: # flags: STMT_END_F
-master-bin.000001	14899	Table_map	1	14940	table_id: # (test.t1)
-master-bin.000001	14940	Write_rows	1	14974	table_id: # flags: STMT_END_F
-master-bin.000001	14974	Table_map	1	15015	table_id: # (test.t1)
-master-bin.000001	15015	Write_rows	1	15049	table_id: # flags: STMT_END_F
-master-bin.000001	15049	Table_map	1	15090	table_id: # (test.t1)
-master-bin.000001	15090	Write_rows	1	15124	table_id: # flags: STMT_END_F
-master-bin.000001	15124	Table_map	1	15165	table_id: # (test.t1)
-master-bin.000001	15165	Write_rows	1	15199	table_id: # flags: STMT_END_F
-master-bin.000001	15199	Table_map	1	15240	table_id: # (test.t1)
-master-bin.000001	15240	Write_rows	1	15274	table_id: # flags: STMT_END_F
-master-bin.000001	15274	Table_map	1	15315	table_id: # (test.t1)
-master-bin.000001	15315	Write_rows	1	15349	table_id: # flags: STMT_END_F
-master-bin.000001	15349	Table_map	1	15390	table_id: # (test.t1)
-master-bin.000001	15390	Write_rows	1	15424	table_id: # flags: STMT_END_F
-master-bin.000001	15424	Table_map	1	15465	table_id: # (test.t1)
-master-bin.000001	15465	Write_rows	1	15499	table_id: # flags: STMT_END_F
-master-bin.000001	15499	Table_map	1	15540	table_id: # (test.t1)
-master-bin.000001	15540	Write_rows	1	15574	table_id: # flags: STMT_END_F
-master-bin.000001	15574	Table_map	1	15615	table_id: # (test.t1)
-master-bin.000001	15615	Write_rows	1	15649	table_id: # flags: STMT_END_F
-master-bin.000001	15649	Table_map	1	15690	table_id: # (test.t1)
-master-bin.000001	15690	Write_rows	1	15724	table_id: # flags: STMT_END_F
-master-bin.000001	15724	Table_map	1	15765	table_id: # (test.t1)
-master-bin.000001	15765	Write_rows	1	15799	table_id: # flags: STMT_END_F
-master-bin.000001	15799	Table_map	1	15840	table_id: # (test.t1)
-master-bin.000001	15840	Write_rows	1	15874	table_id: # flags: STMT_END_F
-master-bin.000001	15874	Table_map	1	15915	table_id: # (test.t1)
-master-bin.000001	15915	Write_rows	1	15949	table_id: # flags: STMT_END_F
-master-bin.000001	15949	Table_map	1	15990	table_id: # (test.t1)
-master-bin.000001	15990	Write_rows	1	16024	table_id: # flags: STMT_END_F
-master-bin.000001	16024	Table_map	1	16065	table_id: # (test.t1)
-master-bin.000001	16065	Write_rows	1	16099	table_id: # flags: STMT_END_F
-master-bin.000001	16099	Table_map	1	16140	table_id: # (test.t1)
-master-bin.000001	16140	Write_rows	1	16174	table_id: # flags: STMT_END_F
-master-bin.000001	16174	Table_map	1	16215	table_id: # (test.t1)
-master-bin.000001	16215	Write_rows	1	16249	table_id: # flags: STMT_END_F
-master-bin.000001	16249	Table_map	1	16290	table_id: # (test.t1)
-master-bin.000001	16290	Write_rows	1	16324	table_id: # flags: STMT_END_F
-master-bin.000001	16324	Table_map	1	16365	table_id: # (test.t1)
-master-bin.000001	16365	Write_rows	1	16399	table_id: # flags: STMT_END_F
-master-bin.000001	16399	Table_map	1	16440	table_id: # (test.t1)
-master-bin.000001	16440	Write_rows	1	16474	table_id: # flags: STMT_END_F
-master-bin.000001	16474	Table_map	1	16515	table_id: # (test.t1)
-master-bin.000001	16515	Write_rows	1	16549	table_id: # flags: STMT_END_F
-master-bin.000001	16549	Table_map	1	16590	table_id: # (test.t1)
-master-bin.000001	16590	Write_rows	1	16624	table_id: # flags: STMT_END_F
-master-bin.000001	16624	Table_map	1	16665	table_id: # (test.t1)
-master-bin.000001	16665	Write_rows	1	16699	table_id: # flags: STMT_END_F
-master-bin.000001	16699	Table_map	1	16740	table_id: # (test.t1)
-master-bin.000001	16740	Write_rows	1	16774	table_id: # flags: STMT_END_F
-master-bin.000001	16774	Table_map	1	16815	table_id: # (test.t1)
-master-bin.000001	16815	Write_rows	1	16849	table_id: # flags: STMT_END_F
-master-bin.000001	16849	Table_map	1	16890	table_id: # (test.t1)
-master-bin.000001	16890	Write_rows	1	16924	table_id: # flags: STMT_END_F
-master-bin.000001	16924	Table_map	1	16965	table_id: # (test.t1)
-master-bin.000001	16965	Write_rows	1	16999	table_id: # flags: STMT_END_F
-master-bin.000001	16999	Table_map	1	17040	table_id: # (test.t1)
-master-bin.000001	17040	Write_rows	1	17074	table_id: # flags: STMT_END_F
-master-bin.000001	17074	Table_map	1	17115	table_id: # (test.t1)
-master-bin.000001	17115	Write_rows	1	17149	table_id: # flags: STMT_END_F
-master-bin.000001	17149	Table_map	1	17190	table_id: # (test.t1)
-master-bin.000001	17190	Write_rows	1	17224	table_id: # flags: STMT_END_F
-master-bin.000001	17224	Table_map	1	17265	table_id: # (test.t1)
-master-bin.000001	17265	Write_rows	1	17299	table_id: # flags: STMT_END_F
-master-bin.000001	17299	Table_map	1	17340	table_id: # (test.t1)
-master-bin.000001	17340	Write_rows	1	17374	table_id: # flags: STMT_END_F
-master-bin.000001	17374	Table_map	1	17415	table_id: # (test.t1)
-master-bin.000001	17415	Write_rows	1	17449	table_id: # flags: STMT_END_F
-master-bin.000001	17449	Table_map	1	17490	table_id: # (test.t1)
-master-bin.000001	17490	Write_rows	1	17524	table_id: # flags: STMT_END_F
-master-bin.000001	17524	Table_map	1	17565	table_id: # (test.t1)
-master-bin.000001	17565	Write_rows	1	17599	table_id: # flags: STMT_END_F
-master-bin.000001	17599	Table_map	1	17640	table_id: # (test.t1)
-master-bin.000001	17640	Write_rows	1	17674	table_id: # flags: STMT_END_F
-master-bin.000001	17674	Table_map	1	17715	table_id: # (test.t1)
-master-bin.000001	17715	Write_rows	1	17749	table_id: # flags: STMT_END_F
-master-bin.000001	17749	Table_map	1	17790	table_id: # (test.t1)
-master-bin.000001	17790	Write_rows	1	17824	table_id: # flags: STMT_END_F
-master-bin.000001	17824	Table_map	1	17865	table_id: # (test.t1)
-master-bin.000001	17865	Write_rows	1	17899	table_id: # flags: STMT_END_F
-master-bin.000001	17899	Table_map	1	17940	table_id: # (test.t1)
-master-bin.000001	17940	Write_rows	1	17974	table_id: # flags: STMT_END_F
-master-bin.000001	17974	Table_map	1	18015	table_id: # (test.t1)
-master-bin.000001	18015	Write_rows	1	18049	table_id: # flags: STMT_END_F
-master-bin.000001	18049	Table_map	1	18090	table_id: # (test.t1)
-master-bin.000001	18090	Write_rows	1	18124	table_id: # flags: STMT_END_F
-master-bin.000001	18124	Table_map	1	18165	table_id: # (test.t1)
-master-bin.000001	18165	Write_rows	1	18199	table_id: # flags: STMT_END_F
-master-bin.000001	18199	Table_map	1	18240	table_id: # (test.t1)
-master-bin.000001	18240	Write_rows	1	18274	table_id: # flags: STMT_END_F
-master-bin.000001	18274	Table_map	1	18315	table_id: # (test.t1)
-master-bin.000001	18315	Write_rows	1	18349	table_id: # flags: STMT_END_F
-master-bin.000001	18349	Table_map	1	18390	table_id: # (test.t1)
-master-bin.000001	18390	Write_rows	1	18424	table_id: # flags: STMT_END_F
-master-bin.000001	18424	Table_map	1	18465	table_id: # (test.t1)
-master-bin.000001	18465	Write_rows	1	18499	table_id: # flags: STMT_END_F
-master-bin.000001	18499	Table_map	1	18540	table_id: # (test.t1)
-master-bin.000001	18540	Write_rows	1	18574	table_id: # flags: STMT_END_F
-master-bin.000001	18574	Table_map	1	18615	table_id: # (test.t1)
-master-bin.000001	18615	Write_rows	1	18649	table_id: # flags: STMT_END_F
-master-bin.000001	18649	Table_map	1	18690	table_id: # (test.t1)
-master-bin.000001	18690	Write_rows	1	18724	table_id: # flags: STMT_END_F
-master-bin.000001	18724	Table_map	1	18765	table_id: # (test.t1)
-master-bin.000001	18765	Write_rows	1	18799	table_id: # flags: STMT_END_F
-master-bin.000001	18799	Table_map	1	18840	table_id: # (test.t1)
-master-bin.000001	18840	Write_rows	1	18874	table_id: # flags: STMT_END_F
-master-bin.000001	18874	Table_map	1	18915	table_id: # (test.t1)
-master-bin.000001	18915	Write_rows	1	18949	table_id: # flags: STMT_END_F
-master-bin.000001	18949	Table_map	1	18990	table_id: # (test.t1)
-master-bin.000001	18990	Write_rows	1	19024	table_id: # flags: STMT_END_F
-master-bin.000001	19024	Table_map	1	19065	table_id: # (test.t1)
-master-bin.000001	19065	Write_rows	1	19099	table_id: # flags: STMT_END_F
-master-bin.000001	19099	Table_map	1	19140	table_id: # (test.t1)
-master-bin.000001	19140	Write_rows	1	19174	table_id: # flags: STMT_END_F
-master-bin.000001	19174	Table_map	1	19215	table_id: # (test.t1)
-master-bin.000001	19215	Write_rows	1	19249	table_id: # flags: STMT_END_F
-master-bin.000001	19249	Table_map	1	19290	table_id: # (test.t1)
-master-bin.000001	19290	Write_rows	1	19324	table_id: # flags: STMT_END_F
-master-bin.000001	19324	Table_map	1	19365	table_id: # (test.t1)
-master-bin.000001	19365	Write_rows	1	19399	table_id: # flags: STMT_END_F
-master-bin.000001	19399	Table_map	1	19440	table_id: # (test.t1)
-master-bin.000001	19440	Write_rows	1	19474	table_id: # flags: STMT_END_F
-master-bin.000001	19474	Table_map	1	19515	table_id: # (test.t1)
-master-bin.000001	19515	Write_rows	1	19549	table_id: # flags: STMT_END_F
-master-bin.000001	19549	Table_map	1	19590	table_id: # (test.t1)
-master-bin.000001	19590	Write_rows	1	19624	table_id: # flags: STMT_END_F
-master-bin.000001	19624	Table_map	1	19665	table_id: # (test.t1)
-master-bin.000001	19665	Write_rows	1	19699	table_id: # flags: STMT_END_F
-master-bin.000001	19699	Table_map	1	19740	table_id: # (test.t1)
-master-bin.000001	19740	Write_rows	1	19774	table_id: # flags: STMT_END_F
-master-bin.000001	19774	Table_map	1	19815	table_id: # (test.t1)
-master-bin.000001	19815	Write_rows	1	19849	table_id: # flags: STMT_END_F
-master-bin.000001	19849	Table_map	1	19890	table_id: # (test.t1)
-master-bin.000001	19890	Write_rows	1	19924	table_id: # flags: STMT_END_F
-master-bin.000001	19924	Table_map	1	19965	table_id: # (test.t1)
-master-bin.000001	19965	Write_rows	1	19999	table_id: # flags: STMT_END_F
-master-bin.000001	19999	Table_map	1	20040	table_id: # (test.t1)
-master-bin.000001	20040	Write_rows	1	20074	table_id: # flags: STMT_END_F
-master-bin.000001	20074	Table_map	1	20115	table_id: # (test.t1)
-master-bin.000001	20115	Write_rows	1	20149	table_id: # flags: STMT_END_F
-master-bin.000001	20149	Table_map	1	20190	table_id: # (test.t1)
-master-bin.000001	20190	Write_rows	1	20224	table_id: # flags: STMT_END_F
-master-bin.000001	20224	Table_map	1	20265	table_id: # (test.t1)
-master-bin.000001	20265	Write_rows	1	20299	table_id: # flags: STMT_END_F
-master-bin.000001	20299	Table_map	1	20340	table_id: # (test.t1)
-master-bin.000001	20340	Write_rows	1	20374	table_id: # flags: STMT_END_F
-master-bin.000001	20374	Table_map	1	20415	table_id: # (test.t1)
-master-bin.000001	20415	Write_rows	1	20449	table_id: # flags: STMT_END_F
-master-bin.000001	20449	Table_map	1	20490	table_id: # (test.t1)
-master-bin.000001	20490	Write_rows	1	20524	table_id: # flags: STMT_END_F
-master-bin.000001	20524	Table_map	1	20565	table_id: # (test.t1)
-master-bin.000001	20565	Write_rows	1	20599	table_id: # flags: STMT_END_F
-master-bin.000001	20599	Table_map	1	20640	table_id: # (test.t1)
-master-bin.000001	20640	Write_rows	1	20674	table_id: # flags: STMT_END_F
-master-bin.000001	20674	Table_map	1	20715	table_id: # (test.t1)
-master-bin.000001	20715	Write_rows	1	20749	table_id: # flags: STMT_END_F
-master-bin.000001	20749	Table_map	1	20790	table_id: # (test.t1)
-master-bin.000001	20790	Write_rows	1	20824	table_id: # flags: STMT_END_F
-master-bin.000001	20824	Table_map	1	20865	table_id: # (test.t1)
-master-bin.000001	20865	Write_rows	1	20899	table_id: # flags: STMT_END_F
-master-bin.000001	20899	Table_map	1	20940	table_id: # (test.t1)
-master-bin.000001	20940	Write_rows	1	20974	table_id: # flags: STMT_END_F
-master-bin.000001	20974	Table_map	1	21015	table_id: # (test.t1)
-master-bin.000001	21015	Write_rows	1	21049	table_id: # flags: STMT_END_F
-master-bin.000001	21049	Table_map	1	21090	table_id: # (test.t1)
-master-bin.000001	21090	Write_rows	1	21124	table_id: # flags: STMT_END_F
-master-bin.000001	21124	Table_map	1	21165	table_id: # (test.t1)
-master-bin.000001	21165	Write_rows	1	21199	table_id: # flags: STMT_END_F
-master-bin.000001	21199	Table_map	1	21240	table_id: # (test.t1)
-master-bin.000001	21240	Write_rows	1	21274	table_id: # flags: STMT_END_F
-master-bin.000001	21274	Table_map	1	21315	table_id: # (test.t1)
-master-bin.000001	21315	Write_rows	1	21349	table_id: # flags: STMT_END_F
-master-bin.000001	21349	Table_map	1	21390	table_id: # (test.t1)
-master-bin.000001	21390	Write_rows	1	21424	table_id: # flags: STMT_END_F
-master-bin.000001	21424	Table_map	1	21465	table_id: # (test.t1)
-master-bin.000001	21465	Write_rows	1	21499	table_id: # flags: STMT_END_F
-master-bin.000001	21499	Table_map	1	21540	table_id: # (test.t1)
-master-bin.000001	21540	Write_rows	1	21574	table_id: # flags: STMT_END_F
-master-bin.000001	21574	Table_map	1	21615	table_id: # (test.t1)
-master-bin.000001	21615	Write_rows	1	21649	table_id: # flags: STMT_END_F
-master-bin.000001	21649	Table_map	1	21690	table_id: # (test.t1)
-master-bin.000001	21690	Write_rows	1	21724	table_id: # flags: STMT_END_F
-master-bin.000001	21724	Table_map	1	21765	table_id: # (test.t1)
-master-bin.000001	21765	Write_rows	1	21799	table_id: # flags: STMT_END_F
-master-bin.000001	21799	Table_map	1	21840	table_id: # (test.t1)
-master-bin.000001	21840	Write_rows	1	21874	table_id: # flags: STMT_END_F
-master-bin.000001	21874	Table_map	1	21915	table_id: # (test.t1)
-master-bin.000001	21915	Write_rows	1	21949	table_id: # flags: STMT_END_F
-master-bin.000001	21949	Table_map	1	21990	table_id: # (test.t1)
-master-bin.000001	21990	Write_rows	1	22024	table_id: # flags: STMT_END_F
-master-bin.000001	22024	Table_map	1	22065	table_id: # (test.t1)
-master-bin.000001	22065	Write_rows	1	22099	table_id: # flags: STMT_END_F
-master-bin.000001	22099	Table_map	1	22140	table_id: # (test.t1)
-master-bin.000001	22140	Write_rows	1	22174	table_id: # flags: STMT_END_F
-master-bin.000001	22174	Table_map	1	22215	table_id: # (test.t1)
-master-bin.000001	22215	Write_rows	1	22249	table_id: # flags: STMT_END_F
-master-bin.000001	22249	Table_map	1	22290	table_id: # (test.t1)
-master-bin.000001	22290	Write_rows	1	22324	table_id: # flags: STMT_END_F
-master-bin.000001	22324	Table_map	1	22365	table_id: # (test.t1)
-master-bin.000001	22365	Write_rows	1	22399	table_id: # flags: STMT_END_F
-master-bin.000001	22399	Table_map	1	22440	table_id: # (test.t1)
-master-bin.000001	22440	Write_rows	1	22474	table_id: # flags: STMT_END_F
-master-bin.000001	22474	Table_map	1	22515	table_id: # (test.t1)
-master-bin.000001	22515	Write_rows	1	22549	table_id: # flags: STMT_END_F
-master-bin.000001	22549	Table_map	1	22590	table_id: # (test.t1)
-master-bin.000001	22590	Write_rows	1	22624	table_id: # flags: STMT_END_F
-master-bin.000001	22624	Table_map	1	22665	table_id: # (test.t1)
-master-bin.000001	22665	Write_rows	1	22699	table_id: # flags: STMT_END_F
-master-bin.000001	22699	Table_map	1	22740	table_id: # (test.t1)
-master-bin.000001	22740	Write_rows	1	22774	table_id: # flags: STMT_END_F
-master-bin.000001	22774	Table_map	1	22815	table_id: # (test.t1)
-master-bin.000001	22815	Write_rows	1	22849	table_id: # flags: STMT_END_F
-master-bin.000001	22849	Table_map	1	22890	table_id: # (test.t1)
-master-bin.000001	22890	Write_rows	1	22924	table_id: # flags: STMT_END_F
-master-bin.000001	22924	Table_map	1	22965	table_id: # (test.t1)
-master-bin.000001	22965	Write_rows	1	22999	table_id: # flags: STMT_END_F
-master-bin.000001	22999	Table_map	1	23040	table_id: # (test.t1)
-master-bin.000001	23040	Write_rows	1	23074	table_id: # flags: STMT_END_F
-master-bin.000001	23074	Table_map	1	23115	table_id: # (test.t1)
-master-bin.000001	23115	Write_rows	1	23149	table_id: # flags: STMT_END_F
-master-bin.000001	23149	Table_map	1	23190	table_id: # (test.t1)
-master-bin.000001	23190	Write_rows	1	23224	table_id: # flags: STMT_END_F
-master-bin.000001	23224	Table_map	1	23265	table_id: # (test.t1)
-master-bin.000001	23265	Write_rows	1	23299	table_id: # flags: STMT_END_F
-master-bin.000001	23299	Table_map	1	23340	table_id: # (test.t1)
-master-bin.000001	23340	Write_rows	1	23374	table_id: # flags: STMT_END_F
-master-bin.000001	23374	Table_map	1	23415	table_id: # (test.t1)
-master-bin.000001	23415	Write_rows	1	23449	table_id: # flags: STMT_END_F
-master-bin.000001	23449	Table_map	1	23490	table_id: # (test.t1)
-master-bin.000001	23490	Write_rows	1	23524	table_id: # flags: STMT_END_F
-master-bin.000001	23524	Table_map	1	23565	table_id: # (test.t1)
-master-bin.000001	23565	Write_rows	1	23599	table_id: # flags: STMT_END_F
-master-bin.000001	23599	Table_map	1	23640	table_id: # (test.t1)
-master-bin.000001	23640	Write_rows	1	23674	table_id: # flags: STMT_END_F
-master-bin.000001	23674	Table_map	1	23715	table_id: # (test.t1)
-master-bin.000001	23715	Write_rows	1	23749	table_id: # flags: STMT_END_F
-master-bin.000001	23749	Table_map	1	23790	table_id: # (test.t1)
-master-bin.000001	23790	Write_rows	1	23824	table_id: # flags: STMT_END_F
-master-bin.000001	23824	Table_map	1	23865	table_id: # (test.t1)
-master-bin.000001	23865	Write_rows	1	23899	table_id: # flags: STMT_END_F
-master-bin.000001	23899	Table_map	1	23940	table_id: # (test.t1)
-master-bin.000001	23940	Write_rows	1	23974	table_id: # flags: STMT_END_F
-master-bin.000001	23974	Table_map	1	24015	table_id: # (test.t1)
-master-bin.000001	24015	Write_rows	1	24049	table_id: # flags: STMT_END_F
-master-bin.000001	24049	Table_map	1	24090	table_id: # (test.t1)
-master-bin.000001	24090	Write_rows	1	24124	table_id: # flags: STMT_END_F
-master-bin.000001	24124	Table_map	1	24165	table_id: # (test.t1)
-master-bin.000001	24165	Write_rows	1	24199	table_id: # flags: STMT_END_F
-master-bin.000001	24199	Table_map	1	24240	table_id: # (test.t1)
-master-bin.000001	24240	Write_rows	1	24274	table_id: # flags: STMT_END_F
-master-bin.000001	24274	Table_map	1	24315	table_id: # (test.t1)
-master-bin.000001	24315	Write_rows	1	24349	table_id: # flags: STMT_END_F
-master-bin.000001	24349	Table_map	1	24390	table_id: # (test.t1)
-master-bin.000001	24390	Write_rows	1	24424	table_id: # flags: STMT_END_F
-master-bin.000001	24424	Table_map	1	24465	table_id: # (test.t1)
-master-bin.000001	24465	Write_rows	1	24499	table_id: # flags: STMT_END_F
-master-bin.000001	24499	Table_map	1	24540	table_id: # (test.t1)
-master-bin.000001	24540	Write_rows	1	24574	table_id: # flags: STMT_END_F
-master-bin.000001	24574	Table_map	1	24615	table_id: # (test.t1)
-master-bin.000001	24615	Write_rows	1	24649	table_id: # flags: STMT_END_F
-master-bin.000001	24649	Table_map	1	24690	table_id: # (test.t1)
-master-bin.000001	24690	Write_rows	1	24724	table_id: # flags: STMT_END_F
-master-bin.000001	24724	Table_map	1	24765	table_id: # (test.t1)
-master-bin.000001	24765	Write_rows	1	24799	table_id: # flags: STMT_END_F
-master-bin.000001	24799	Table_map	1	24840	table_id: # (test.t1)
-master-bin.000001	24840	Write_rows	1	24874	table_id: # flags: STMT_END_F
-master-bin.000001	24874	Table_map	1	24915	table_id: # (test.t1)
-master-bin.000001	24915	Write_rows	1	24949	table_id: # flags: STMT_END_F
-master-bin.000001	24949	Table_map	1	24990	table_id: # (test.t1)
-master-bin.000001	24990	Write_rows	1	25024	table_id: # flags: STMT_END_F
-master-bin.000001	25024	Table_map	1	25065	table_id: # (test.t1)
-master-bin.000001	25065	Write_rows	1	25099	table_id: # flags: STMT_END_F
-master-bin.000001	25099	Table_map	1	25140	table_id: # (test.t1)
-master-bin.000001	25140	Write_rows	1	25174	table_id: # flags: STMT_END_F
-master-bin.000001	25174	Table_map	1	25215	table_id: # (test.t1)
-master-bin.000001	25215	Write_rows	1	25249	table_id: # flags: STMT_END_F
-master-bin.000001	25249	Table_map	1	25290	table_id: # (test.t1)
-master-bin.000001	25290	Write_rows	1	25324	table_id: # flags: STMT_END_F
-master-bin.000001	25324	Table_map	1	25365	table_id: # (test.t1)
-master-bin.000001	25365	Write_rows	1	25399	table_id: # flags: STMT_END_F
-master-bin.000001	25399	Table_map	1	25440	table_id: # (test.t1)
-master-bin.000001	25440	Write_rows	1	25474	table_id: # flags: STMT_END_F
-master-bin.000001	25474	Table_map	1	25515	table_id: # (test.t1)
-master-bin.000001	25515	Write_rows	1	25549	table_id: # flags: STMT_END_F
-master-bin.000001	25549	Table_map	1	25590	table_id: # (test.t1)
-master-bin.000001	25590	Write_rows	1	25624	table_id: # flags: STMT_END_F
-master-bin.000001	25624	Table_map	1	25665	table_id: # (test.t1)
-master-bin.000001	25665	Write_rows	1	25699	table_id: # flags: STMT_END_F
-master-bin.000001	25699	Table_map	1	25740	table_id: # (test.t1)
-master-bin.000001	25740	Write_rows	1	25774	table_id: # flags: STMT_END_F
-master-bin.000001	25774	Table_map	1	25815	table_id: # (test.t1)
-master-bin.000001	25815	Write_rows	1	25849	table_id: # flags: STMT_END_F
-master-bin.000001	25849	Table_map	1	25890	table_id: # (test.t1)
-master-bin.000001	25890	Write_rows	1	25924	table_id: # flags: STMT_END_F
-master-bin.000001	25924	Table_map	1	25965	table_id: # (test.t1)
-master-bin.000001	25965	Write_rows	1	25999	table_id: # flags: STMT_END_F
-master-bin.000001	25999	Table_map	1	26040	table_id: # (test.t1)
-master-bin.000001	26040	Write_rows	1	26074	table_id: # flags: STMT_END_F
-master-bin.000001	26074	Table_map	1	26115	table_id: # (test.t1)
-master-bin.000001	26115	Write_rows	1	26149	table_id: # flags: STMT_END_F
-master-bin.000001	26149	Table_map	1	26190	table_id: # (test.t1)
-master-bin.000001	26190	Write_rows	1	26224	table_id: # flags: STMT_END_F
-master-bin.000001	26224	Table_map	1	26265	table_id: # (test.t1)
-master-bin.000001	26265	Write_rows	1	26299	table_id: # flags: STMT_END_F
-master-bin.000001	26299	Table_map	1	26340	table_id: # (test.t1)
-master-bin.000001	26340	Write_rows	1	26374	table_id: # flags: STMT_END_F
-master-bin.000001	26374	Table_map	1	26415	table_id: # (test.t1)
-master-bin.000001	26415	Write_rows	1	26449	table_id: # flags: STMT_END_F
-master-bin.000001	26449	Table_map	1	26490	table_id: # (test.t1)
-master-bin.000001	26490	Write_rows	1	26524	table_id: # flags: STMT_END_F
-master-bin.000001	26524	Table_map	1	26565	table_id: # (test.t1)
-master-bin.000001	26565	Write_rows	1	26599	table_id: # flags: STMT_END_F
-master-bin.000001	26599	Table_map	1	26640	table_id: # (test.t1)
-master-bin.000001	26640	Write_rows	1	26674	table_id: # flags: STMT_END_F
-master-bin.000001	26674	Table_map	1	26715	table_id: # (test.t1)
-master-bin.000001	26715	Write_rows	1	26749	table_id: # flags: STMT_END_F
-master-bin.000001	26749	Table_map	1	26790	table_id: # (test.t1)
-master-bin.000001	26790	Write_rows	1	26824	table_id: # flags: STMT_END_F
-master-bin.000001	26824	Table_map	1	26865	table_id: # (test.t1)
-master-bin.000001	26865	Write_rows	1	26899	table_id: # flags: STMT_END_F
-master-bin.000001	26899	Table_map	1	26940	table_id: # (test.t1)
-master-bin.000001	26940	Write_rows	1	26974	table_id: # flags: STMT_END_F
-master-bin.000001	26974	Table_map	1	27015	table_id: # (test.t1)
-master-bin.000001	27015	Write_rows	1	27049	table_id: # flags: STMT_END_F
-master-bin.000001	27049	Table_map	1	27090	table_id: # (test.t1)
-master-bin.000001	27090	Write_rows	1	27124	table_id: # flags: STMT_END_F
-master-bin.000001	27124	Table_map	1	27165	table_id: # (test.t1)
-master-bin.000001	27165	Write_rows	1	27199	table_id: # flags: STMT_END_F
-master-bin.000001	27199	Table_map	1	27240	table_id: # (test.t1)
-master-bin.000001	27240	Write_rows	1	27274	table_id: # flags: STMT_END_F
-master-bin.000001	27274	Table_map	1	27315	table_id: # (test.t1)
-master-bin.000001	27315	Write_rows	1	27349	table_id: # flags: STMT_END_F
-master-bin.000001	27349	Table_map	1	27390	table_id: # (test.t1)
-master-bin.000001	27390	Write_rows	1	27424	table_id: # flags: STMT_END_F
-master-bin.000001	27424	Table_map	1	27465	table_id: # (test.t1)
-master-bin.000001	27465	Write_rows	1	27499	table_id: # flags: STMT_END_F
-master-bin.000001	27499	Table_map	1	27540	table_id: # (test.t1)
-master-bin.000001	27540	Write_rows	1	27574	table_id: # flags: STMT_END_F
-master-bin.000001	27574	Table_map	1	27615	table_id: # (test.t1)
-master-bin.000001	27615	Write_rows	1	27649	table_id: # flags: STMT_END_F
-master-bin.000001	27649	Table_map	1	27690	table_id: # (test.t1)
-master-bin.000001	27690	Write_rows	1	27724	table_id: # flags: STMT_END_F
-master-bin.000001	27724	Table_map	1	27765	table_id: # (test.t1)
-master-bin.000001	27765	Write_rows	1	27799	table_id: # flags: STMT_END_F
-master-bin.000001	27799	Table_map	1	27840	table_id: # (test.t1)
-master-bin.000001	27840	Write_rows	1	27874	table_id: # flags: STMT_END_F
-master-bin.000001	27874	Table_map	1	27915	table_id: # (test.t1)
-master-bin.000001	27915	Write_rows	1	27949	table_id: # flags: STMT_END_F
-master-bin.000001	27949	Table_map	1	27990	table_id: # (test.t1)
-master-bin.000001	27990	Write_rows	1	28024	table_id: # flags: STMT_END_F
-master-bin.000001	28024	Table_map	1	28065	table_id: # (test.t1)
-master-bin.000001	28065	Write_rows	1	28099	table_id: # flags: STMT_END_F
-master-bin.000001	28099	Table_map	1	28140	table_id: # (test.t1)
-master-bin.000001	28140	Write_rows	1	28174	table_id: # flags: STMT_END_F
-master-bin.000001	28174	Table_map	1	28215	table_id: # (test.t1)
-master-bin.000001	28215	Write_rows	1	28249	table_id: # flags: STMT_END_F
-master-bin.000001	28249	Table_map	1	28290	table_id: # (test.t1)
-master-bin.000001	28290	Write_rows	1	28324	table_id: # flags: STMT_END_F
-master-bin.000001	28324	Table_map	1	28365	table_id: # (test.t1)
-master-bin.000001	28365	Write_rows	1	28399	table_id: # flags: STMT_END_F
-master-bin.000001	28399	Table_map	1	28440	table_id: # (test.t1)
-master-bin.000001	28440	Write_rows	1	28474	table_id: # flags: STMT_END_F
-master-bin.000001	28474	Table_map	1	28515	table_id: # (test.t1)
-master-bin.000001	28515	Write_rows	1	28549	table_id: # flags: STMT_END_F
-master-bin.000001	28549	Table_map	1	28590	table_id: # (test.t1)
-master-bin.000001	28590	Write_rows	1	28624	table_id: # flags: STMT_END_F
-master-bin.000001	28624	Table_map	1	28665	table_id: # (test.t1)
-master-bin.000001	28665	Write_rows	1	28699	table_id: # flags: STMT_END_F
-master-bin.000001	28699	Table_map	1	28740	table_id: # (test.t1)
-master-bin.000001	28740	Write_rows	1	28774	table_id: # flags: STMT_END_F
-master-bin.000001	28774	Table_map	1	28815	table_id: # (test.t1)
-master-bin.000001	28815	Write_rows	1	28849	table_id: # flags: STMT_END_F
-master-bin.000001	28849	Table_map	1	28890	table_id: # (test.t1)
-master-bin.000001	28890	Write_rows	1	28924	table_id: # flags: STMT_END_F
-master-bin.000001	28924	Table_map	1	28965	table_id: # (test.t1)
-master-bin.000001	28965	Write_rows	1	28999	table_id: # flags: STMT_END_F
-master-bin.000001	28999	Table_map	1	29040	table_id: # (test.t1)
-master-bin.000001	29040	Write_rows	1	29074	table_id: # flags: STMT_END_F
-master-bin.000001	29074	Table_map	1	29115	table_id: # (test.t1)
-master-bin.000001	29115	Write_rows	1	29149	table_id: # flags: STMT_END_F
-master-bin.000001	29149	Table_map	1	29190	table_id: # (test.t1)
-master-bin.000001	29190	Write_rows	1	29224	table_id: # flags: STMT_END_F
-master-bin.000001	29224	Table_map	1	29265	table_id: # (test.t1)
-master-bin.000001	29265	Write_rows	1	29299	table_id: # flags: STMT_END_F
-master-bin.000001	29299	Table_map	1	29340	table_id: # (test.t1)
-master-bin.000001	29340	Write_rows	1	29374	table_id: # flags: STMT_END_F
-master-bin.000001	29374	Table_map	1	29415	table_id: # (test.t1)
-master-bin.000001	29415	Write_rows	1	29449	table_id: # flags: STMT_END_F
-master-bin.000001	29449	Table_map	1	29490	table_id: # (test.t1)
-master-bin.000001	29490	Write_rows	1	29524	table_id: # flags: STMT_END_F
-master-bin.000001	29524	Table_map	1	29565	table_id: # (test.t1)
-master-bin.000001	29565	Write_rows	1	29599	table_id: # flags: STMT_END_F
-master-bin.000001	29599	Table_map	1	29640	table_id: # (test.t1)
-master-bin.000001	29640	Write_rows	1	29674	table_id: # flags: STMT_END_F
-master-bin.000001	29674	Table_map	1	29715	table_id: # (test.t1)
-master-bin.000001	29715	Write_rows	1	29749	table_id: # flags: STMT_END_F
-master-bin.000001	29749	Table_map	1	29790	table_id: # (test.t1)
-master-bin.000001	29790	Write_rows	1	29824	table_id: # flags: STMT_END_F
-master-bin.000001	29824	Table_map	1	29865	table_id: # (test.t1)
-master-bin.000001	29865	Write_rows	1	29899	table_id: # flags: STMT_END_F
-master-bin.000001	29899	Table_map	1	29940	table_id: # (test.t1)
-master-bin.000001	29940	Write_rows	1	29974	table_id: # flags: STMT_END_F
-master-bin.000001	29974	Table_map	1	30015	table_id: # (test.t1)
-master-bin.000001	30015	Write_rows	1	30049	table_id: # flags: STMT_END_F
-master-bin.000001	30049	Table_map	1	30090	table_id: # (test.t1)
-master-bin.000001	30090	Write_rows	1	30124	table_id: # flags: STMT_END_F
-master-bin.000001	30124	Table_map	1	30165	table_id: # (test.t1)
-master-bin.000001	30165	Write_rows	1	30199	table_id: # flags: STMT_END_F
-master-bin.000001	30199	Table_map	1	30240	table_id: # (test.t1)
-master-bin.000001	30240	Write_rows	1	30274	table_id: # flags: STMT_END_F
-master-bin.000001	30274	Xid	1	30301	COMMIT /* XID */
-master-bin.000001	30301	Rotate	1	30345	master-bin.000002;pos=4
+master-bin.000001	#	Query	#	#	use `test`; create table t1 (a int) engine=innodb
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Rotate	#	#	master-bin.000002;pos=4
 drop table t1;
 set global binlog_cache_size=@bcs;
 set session autocommit = @ac;
@@ -1081,15 +1079,14 @@ set @b= 14632475938453979136;
 execute stmt using @a, @b;
 deallocate prepare stmt;
 drop table t1;
-show binlog events from 0;
+show binlog events from <binlog_start>;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	4	Format_desc	1	106	Server version, Binlog ver: 4
-master-bin.000001	106	Query	1	227	use `test`; create table t1 (a bigint unsigned, b bigint(20) unsigned)
-master-bin.000001	227	Query	1	295	BEGIN
-master-bin.000001	295	Table_map	1	337	table_id: # (test.t1)
-master-bin.000001	337	Write_rows	1	383	table_id: # flags: STMT_END_F
-master-bin.000001	383	Query	1	452	COMMIT
-master-bin.000001	452	Query	1	528	use `test`; drop table t1
+master-bin.000001	#	Query	#	#	use `test`; create table t1 (a bigint unsigned, b bigint(20) unsigned)
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	#	#	COMMIT
+master-bin.000001	#	Query	#	#	use `test`; drop table t1
 reset master;
 CREATE DATABASE bug39182 DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
 USE bug39182;
@@ -1289,14 +1286,14 @@ drop table if exists t3;
 create table t3 (a int(11) NOT NULL AUTO_INCREMENT, b text, PRIMARY KEY (a) ) engine=innodb;
 show master status;
 File	Position	Binlog_Do_DB	Binlog_Ignore_DB
-master-bin.000001	346		
+master-bin.000001	#	<Binlog_Do_DB>	<Binlog_Ignore_DB>
 insert into t3(b) values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
 insert into t3(b) values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
 insert into t3(b) values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
 insert into t3(b) values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
-show master status /* must show new binlog index after rotating */;
+show master status;
 File	Position	Binlog_Do_DB	Binlog_Ignore_DB
-master-bin.000002	106		
+master-bin.000002	#	<Binlog_Do_DB>	<Binlog_Ignore_DB>
 drop table t3;
 #
 # Bug #45998: database crashes when running "create as select"

=== modified file 'mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result'
--- a/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result	2010-03-28 11:57:33 +0000
+++ b/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result	2010-05-04 19:31:49 +0000
@@ -879,11 +879,11 @@ delete from t4;
 insert into t3 values (1,1),(2,2);
 insert into t4 values (1,1),(2,2);
 reset master;
-UPDATE t3,t4 SET t3.a=t4.a + bug27417(1);
+UPDATE t3,t4 SET t3.a = t4.a + bug27417(1) where t3.a = 1;
 ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
 select count(*) from t1 /* must be 1 */;
 count(*)
-2
+1
 drop table t4;
 delete from t1;
 delete from t2;

=== modified file 'mysql-test/suite/binlog/r/binlog_stm_binlog.result'
--- a/mysql-test/suite/binlog/r/binlog_stm_binlog.result	2010-05-13 11:00:53 +0000
+++ b/mysql-test/suite/binlog/r/binlog_stm_binlog.result	2010-08-02 09:01:24 +0000
@@ -3,14 +3,13 @@ create table t1 (a int, b int) engine=in
 begin;
 insert into t1 values (1,2);
 commit;
-show binlog events;
+show binlog events from <binlog_start>;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	4	Format_desc	1	106	Server ver: #, Binlog ver: #
-master-bin.000001	106	Query	1	192	use `test`; drop table if exists t1
-master-bin.000001	192	Query	1	299	use `test`; create table t1 (a int, b int) engine=innodb
-master-bin.000001	299	Query	1	367	BEGIN
-master-bin.000001	367	Query	1	457	use `test`; insert into t1 values (1,2)
-master-bin.000001	457	Xid	1	484	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	use `test`; drop table if exists t1
+master-bin.000001	#	Query	#	#	use `test`; create table t1 (a int, b int) engine=innodb
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values (1,2)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
 drop table t1;
 drop table if exists t1, t2;
 reset master;
@@ -38,115 +37,115 @@ create table t1 (n int) engine=innodb;
 begin;
 commit;
 drop table t1;
-show binlog events in 'master-bin.000001' from 106;
+show binlog events from <binlog_start>;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	1	#	use `test`; create table t1 (n int) engine=innodb
-master-bin.000001	#	Query	1	#	BEGIN
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(100 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(99 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(98 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(97 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(96 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(95 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(94 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(93 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(92 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(91 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(90 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(89 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(88 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(87 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(86 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(85 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(84 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(83 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(82 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(81 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(80 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(79 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(78 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(77 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(76 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(75 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(74 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(73 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(72 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(71 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(70 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(69 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(68 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(67 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(66 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(65 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(64 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(63 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(62 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(61 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(60 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(59 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(58 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(57 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(56 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(55 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(54 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(53 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(52 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(51 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(50 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(49 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(48 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(47 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(46 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(45 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(44 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(43 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(42 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(41 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(40 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(39 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(38 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(37 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(36 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(35 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(34 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(33 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(32 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(31 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(30 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(29 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(28 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(27 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(26 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(25 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(24 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(23 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(22 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(21 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(20 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(19 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(18 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(17 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(16 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(15 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(14 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(13 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(12 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(11 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(10 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(9 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(8 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(7 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(6 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(5 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(4 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(3 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(2 + 4)
-master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(1 + 4)
-master-bin.000001	#	Xid	1	#	COMMIT /* xid= */
-master-bin.000001	#	Rotate	1	#	master-bin.000002;pos=4
-show binlog events in 'master-bin.000002' from 106;
+master-bin.000001	#	Query	#	#	use `test`; create table t1 (n int) engine=innodb
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(100 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(99 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(98 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(97 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(96 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(95 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(94 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(93 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(92 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(91 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(90 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(89 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(88 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(87 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(86 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(85 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(84 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(83 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(82 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(81 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(80 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(79 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(78 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(77 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(76 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(75 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(74 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(73 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(72 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(71 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(70 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(69 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(68 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(67 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(66 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(65 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(64 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(63 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(62 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(61 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(60 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(59 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(58 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(57 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(56 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(55 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(54 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(53 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(52 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(51 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(50 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(49 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(48 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(47 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(46 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(45 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(44 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(43 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(42 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(41 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(40 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(39 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(38 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(37 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(36 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(35 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(34 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(33 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(32 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(31 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(30 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(29 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(28 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(27 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(26 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(25 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(24 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(23 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(22 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(21 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(20 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(19 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(18 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(17 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(16 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(15 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(14 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(13 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(12 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(11 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(10 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(9 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(8 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(7 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(6 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(5 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(4 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(3 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(2 + 4)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(1 + 4)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Rotate	#	#	master-bin.000002;pos=4
+show binlog events in 'master-bin.000002' from <binlog_start>;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000002	#	Query	1	#	use `test`; drop table t1
+master-bin.000002	#	Query	#	#	use `test`; drop table t1
 set @ac = @@autocommit;
 set autocommit= 0;
 reset master;
@@ -157,427 +156,425 @@ insert into t1 values (2);
 insert into t1 values (3);
 commit;
 drop table t1;
-show binlog events from 0;
+show binlog events from <binlog_start>;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	4	Format_desc	1	106	Server version, Binlog ver: 4
-master-bin.000001	106	Query	1	205	use `test`; create table t1(n int) engine=innodb
-master-bin.000001	205	Query	1	273	BEGIN
-master-bin.000001	273	Query	1	361	use `test`; insert into t1 values (1)
-master-bin.000001	361	Query	1	449	use `test`; insert into t1 values (2)
-master-bin.000001	449	Query	1	537	use `test`; insert into t1 values (3)
-master-bin.000001	537	Xid	1	564	COMMIT /* XID */
-master-bin.000001	564	Query	1	640	use `test`; drop table t1
+master-bin.000001	#	Query	#	#	use `test`; create table t1(n int) engine=innodb
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values (1)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values (2)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values (3)
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Query	#	#	use `test`; drop table t1
 set @bcs = @@binlog_cache_size;
 set global binlog_cache_size=4096;
 reset master;
 create table t1 (a int) engine=innodb;
-show binlog events from 0;
+show binlog events from <binlog_start>;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	4	Format_desc	1	106	Server version, Binlog ver: 4
-master-bin.000001	106	Query	1	206	use `test`; create table t1 (a int) engine=innodb
-master-bin.000001	206	Query	1	274	BEGIN
-master-bin.000001	274	Query	1	365	use `test`; insert into t1 values( 400 )
-master-bin.000001	365	Query	1	456	use `test`; insert into t1 values( 399 )
-master-bin.000001	456	Query	1	547	use `test`; insert into t1 values( 398 )
-master-bin.000001	547	Query	1	638	use `test`; insert into t1 values( 397 )
-master-bin.000001	638	Query	1	729	use `test`; insert into t1 values( 396 )
-master-bin.000001	729	Query	1	820	use `test`; insert into t1 values( 395 )
-master-bin.000001	820	Query	1	911	use `test`; insert into t1 values( 394 )
-master-bin.000001	911	Query	1	1002	use `test`; insert into t1 values( 393 )
-master-bin.000001	1002	Query	1	1093	use `test`; insert into t1 values( 392 )
-master-bin.000001	1093	Query	1	1184	use `test`; insert into t1 values( 391 )
-master-bin.000001	1184	Query	1	1275	use `test`; insert into t1 values( 390 )
-master-bin.000001	1275	Query	1	1366	use `test`; insert into t1 values( 389 )
-master-bin.000001	1366	Query	1	1457	use `test`; insert into t1 values( 388 )
-master-bin.000001	1457	Query	1	1548	use `test`; insert into t1 values( 387 )
-master-bin.000001	1548	Query	1	1639	use `test`; insert into t1 values( 386 )
-master-bin.000001	1639	Query	1	1730	use `test`; insert into t1 values( 385 )
-master-bin.000001	1730	Query	1	1821	use `test`; insert into t1 values( 384 )
-master-bin.000001	1821	Query	1	1912	use `test`; insert into t1 values( 383 )
-master-bin.000001	1912	Query	1	2003	use `test`; insert into t1 values( 382 )
-master-bin.000001	2003	Query	1	2094	use `test`; insert into t1 values( 381 )
-master-bin.000001	2094	Query	1	2185	use `test`; insert into t1 values( 380 )
-master-bin.000001	2185	Query	1	2276	use `test`; insert into t1 values( 379 )
-master-bin.000001	2276	Query	1	2367	use `test`; insert into t1 values( 378 )
-master-bin.000001	2367	Query	1	2458	use `test`; insert into t1 values( 377 )
-master-bin.000001	2458	Query	1	2549	use `test`; insert into t1 values( 376 )
-master-bin.000001	2549	Query	1	2640	use `test`; insert into t1 values( 375 )
-master-bin.000001	2640	Query	1	2731	use `test`; insert into t1 values( 374 )
-master-bin.000001	2731	Query	1	2822	use `test`; insert into t1 values( 373 )
-master-bin.000001	2822	Query	1	2913	use `test`; insert into t1 values( 372 )
-master-bin.000001	2913	Query	1	3004	use `test`; insert into t1 values( 371 )
-master-bin.000001	3004	Query	1	3095	use `test`; insert into t1 values( 370 )
-master-bin.000001	3095	Query	1	3186	use `test`; insert into t1 values( 369 )
-master-bin.000001	3186	Query	1	3277	use `test`; insert into t1 values( 368 )
-master-bin.000001	3277	Query	1	3368	use `test`; insert into t1 values( 367 )
-master-bin.000001	3368	Query	1	3459	use `test`; insert into t1 values( 366 )
-master-bin.000001	3459	Query	1	3550	use `test`; insert into t1 values( 365 )
-master-bin.000001	3550	Query	1	3641	use `test`; insert into t1 values( 364 )
-master-bin.000001	3641	Query	1	3732	use `test`; insert into t1 values( 363 )
-master-bin.000001	3732	Query	1	3823	use `test`; insert into t1 values( 362 )
-master-bin.000001	3823	Query	1	3914	use `test`; insert into t1 values( 361 )
-master-bin.000001	3914	Query	1	4005	use `test`; insert into t1 values( 360 )
-master-bin.000001	4005	Query	1	4096	use `test`; insert into t1 values( 359 )
-master-bin.000001	4096	Query	1	4187	use `test`; insert into t1 values( 358 )
-master-bin.000001	4187	Query	1	4278	use `test`; insert into t1 values( 357 )
-master-bin.000001	4278	Query	1	4369	use `test`; insert into t1 values( 356 )
-master-bin.000001	4369	Query	1	4460	use `test`; insert into t1 values( 355 )
-master-bin.000001	4460	Query	1	4551	use `test`; insert into t1 values( 354 )
-master-bin.000001	4551	Query	1	4642	use `test`; insert into t1 values( 353 )
-master-bin.000001	4642	Query	1	4733	use `test`; insert into t1 values( 352 )
-master-bin.000001	4733	Query	1	4824	use `test`; insert into t1 values( 351 )
-master-bin.000001	4824	Query	1	4915	use `test`; insert into t1 values( 350 )
-master-bin.000001	4915	Query	1	5006	use `test`; insert into t1 values( 349 )
-master-bin.000001	5006	Query	1	5097	use `test`; insert into t1 values( 348 )
-master-bin.000001	5097	Query	1	5188	use `test`; insert into t1 values( 347 )
-master-bin.000001	5188	Query	1	5279	use `test`; insert into t1 values( 346 )
-master-bin.000001	5279	Query	1	5370	use `test`; insert into t1 values( 345 )
-master-bin.000001	5370	Query	1	5461	use `test`; insert into t1 values( 344 )
-master-bin.000001	5461	Query	1	5552	use `test`; insert into t1 values( 343 )
-master-bin.000001	5552	Query	1	5643	use `test`; insert into t1 values( 342 )
-master-bin.000001	5643	Query	1	5734	use `test`; insert into t1 values( 341 )
-master-bin.000001	5734	Query	1	5825	use `test`; insert into t1 values( 340 )
-master-bin.000001	5825	Query	1	5916	use `test`; insert into t1 values( 339 )
-master-bin.000001	5916	Query	1	6007	use `test`; insert into t1 values( 338 )
-master-bin.000001	6007	Query	1	6098	use `test`; insert into t1 values( 337 )
-master-bin.000001	6098	Query	1	6189	use `test`; insert into t1 values( 336 )
-master-bin.000001	6189	Query	1	6280	use `test`; insert into t1 values( 335 )
-master-bin.000001	6280	Query	1	6371	use `test`; insert into t1 values( 334 )
-master-bin.000001	6371	Query	1	6462	use `test`; insert into t1 values( 333 )
-master-bin.000001	6462	Query	1	6553	use `test`; insert into t1 values( 332 )
-master-bin.000001	6553	Query	1	6644	use `test`; insert into t1 values( 331 )
-master-bin.000001	6644	Query	1	6735	use `test`; insert into t1 values( 330 )
-master-bin.000001	6735	Query	1	6826	use `test`; insert into t1 values( 329 )
-master-bin.000001	6826	Query	1	6917	use `test`; insert into t1 values( 328 )
-master-bin.000001	6917	Query	1	7008	use `test`; insert into t1 values( 327 )
-master-bin.000001	7008	Query	1	7099	use `test`; insert into t1 values( 326 )
-master-bin.000001	7099	Query	1	7190	use `test`; insert into t1 values( 325 )
-master-bin.000001	7190	Query	1	7281	use `test`; insert into t1 values( 324 )
-master-bin.000001	7281	Query	1	7372	use `test`; insert into t1 values( 323 )
-master-bin.000001	7372	Query	1	7463	use `test`; insert into t1 values( 322 )
-master-bin.000001	7463	Query	1	7554	use `test`; insert into t1 values( 321 )
-master-bin.000001	7554	Query	1	7645	use `test`; insert into t1 values( 320 )
-master-bin.000001	7645	Query	1	7736	use `test`; insert into t1 values( 319 )
-master-bin.000001	7736	Query	1	7827	use `test`; insert into t1 values( 318 )
-master-bin.000001	7827	Query	1	7918	use `test`; insert into t1 values( 317 )
-master-bin.000001	7918	Query	1	8009	use `test`; insert into t1 values( 316 )
-master-bin.000001	8009	Query	1	8100	use `test`; insert into t1 values( 315 )
-master-bin.000001	8100	Query	1	8191	use `test`; insert into t1 values( 314 )
-master-bin.000001	8191	Query	1	8282	use `test`; insert into t1 values( 313 )
-master-bin.000001	8282	Query	1	8373	use `test`; insert into t1 values( 312 )
-master-bin.000001	8373	Query	1	8464	use `test`; insert into t1 values( 311 )
-master-bin.000001	8464	Query	1	8555	use `test`; insert into t1 values( 310 )
-master-bin.000001	8555	Query	1	8646	use `test`; insert into t1 values( 309 )
-master-bin.000001	8646	Query	1	8737	use `test`; insert into t1 values( 308 )
-master-bin.000001	8737	Query	1	8828	use `test`; insert into t1 values( 307 )
-master-bin.000001	8828	Query	1	8919	use `test`; insert into t1 values( 306 )
-master-bin.000001	8919	Query	1	9010	use `test`; insert into t1 values( 305 )
-master-bin.000001	9010	Query	1	9101	use `test`; insert into t1 values( 304 )
-master-bin.000001	9101	Query	1	9192	use `test`; insert into t1 values( 303 )
-master-bin.000001	9192	Query	1	9283	use `test`; insert into t1 values( 302 )
-master-bin.000001	9283	Query	1	9374	use `test`; insert into t1 values( 301 )
-master-bin.000001	9374	Query	1	9465	use `test`; insert into t1 values( 300 )
-master-bin.000001	9465	Query	1	9556	use `test`; insert into t1 values( 299 )
-master-bin.000001	9556	Query	1	9647	use `test`; insert into t1 values( 298 )
-master-bin.000001	9647	Query	1	9738	use `test`; insert into t1 values( 297 )
-master-bin.000001	9738	Query	1	9829	use `test`; insert into t1 values( 296 )
-master-bin.000001	9829	Query	1	9920	use `test`; insert into t1 values( 295 )
-master-bin.000001	9920	Query	1	10011	use `test`; insert into t1 values( 294 )
-master-bin.000001	10011	Query	1	10102	use `test`; insert into t1 values( 293 )
-master-bin.000001	10102	Query	1	10193	use `test`; insert into t1 values( 292 )
-master-bin.000001	10193	Query	1	10284	use `test`; insert into t1 values( 291 )
-master-bin.000001	10284	Query	1	10375	use `test`; insert into t1 values( 290 )
-master-bin.000001	10375	Query	1	10466	use `test`; insert into t1 values( 289 )
-master-bin.000001	10466	Query	1	10557	use `test`; insert into t1 values( 288 )
-master-bin.000001	10557	Query	1	10648	use `test`; insert into t1 values( 287 )
-master-bin.000001	10648	Query	1	10739	use `test`; insert into t1 values( 286 )
-master-bin.000001	10739	Query	1	10830	use `test`; insert into t1 values( 285 )
-master-bin.000001	10830	Query	1	10921	use `test`; insert into t1 values( 284 )
-master-bin.000001	10921	Query	1	11012	use `test`; insert into t1 values( 283 )
-master-bin.000001	11012	Query	1	11103	use `test`; insert into t1 values( 282 )
-master-bin.000001	11103	Query	1	11194	use `test`; insert into t1 values( 281 )
-master-bin.000001	11194	Query	1	11285	use `test`; insert into t1 values( 280 )
-master-bin.000001	11285	Query	1	11376	use `test`; insert into t1 values( 279 )
-master-bin.000001	11376	Query	1	11467	use `test`; insert into t1 values( 278 )
-master-bin.000001	11467	Query	1	11558	use `test`; insert into t1 values( 277 )
-master-bin.000001	11558	Query	1	11649	use `test`; insert into t1 values( 276 )
-master-bin.000001	11649	Query	1	11740	use `test`; insert into t1 values( 275 )
-master-bin.000001	11740	Query	1	11831	use `test`; insert into t1 values( 274 )
-master-bin.000001	11831	Query	1	11922	use `test`; insert into t1 values( 273 )
-master-bin.000001	11922	Query	1	12013	use `test`; insert into t1 values( 272 )
-master-bin.000001	12013	Query	1	12104	use `test`; insert into t1 values( 271 )
-master-bin.000001	12104	Query	1	12195	use `test`; insert into t1 values( 270 )
-master-bin.000001	12195	Query	1	12286	use `test`; insert into t1 values( 269 )
-master-bin.000001	12286	Query	1	12377	use `test`; insert into t1 values( 268 )
-master-bin.000001	12377	Query	1	12468	use `test`; insert into t1 values( 267 )
-master-bin.000001	12468	Query	1	12559	use `test`; insert into t1 values( 266 )
-master-bin.000001	12559	Query	1	12650	use `test`; insert into t1 values( 265 )
-master-bin.000001	12650	Query	1	12741	use `test`; insert into t1 values( 264 )
-master-bin.000001	12741	Query	1	12832	use `test`; insert into t1 values( 263 )
-master-bin.000001	12832	Query	1	12923	use `test`; insert into t1 values( 262 )
-master-bin.000001	12923	Query	1	13014	use `test`; insert into t1 values( 261 )
-master-bin.000001	13014	Query	1	13105	use `test`; insert into t1 values( 260 )
-master-bin.000001	13105	Query	1	13196	use `test`; insert into t1 values( 259 )
-master-bin.000001	13196	Query	1	13287	use `test`; insert into t1 values( 258 )
-master-bin.000001	13287	Query	1	13378	use `test`; insert into t1 values( 257 )
-master-bin.000001	13378	Query	1	13469	use `test`; insert into t1 values( 256 )
-master-bin.000001	13469	Query	1	13560	use `test`; insert into t1 values( 255 )
-master-bin.000001	13560	Query	1	13651	use `test`; insert into t1 values( 254 )
-master-bin.000001	13651	Query	1	13742	use `test`; insert into t1 values( 253 )
-master-bin.000001	13742	Query	1	13833	use `test`; insert into t1 values( 252 )
-master-bin.000001	13833	Query	1	13924	use `test`; insert into t1 values( 251 )
-master-bin.000001	13924	Query	1	14015	use `test`; insert into t1 values( 250 )
-master-bin.000001	14015	Query	1	14106	use `test`; insert into t1 values( 249 )
-master-bin.000001	14106	Query	1	14197	use `test`; insert into t1 values( 248 )
-master-bin.000001	14197	Query	1	14288	use `test`; insert into t1 values( 247 )
-master-bin.000001	14288	Query	1	14379	use `test`; insert into t1 values( 246 )
-master-bin.000001	14379	Query	1	14470	use `test`; insert into t1 values( 245 )
-master-bin.000001	14470	Query	1	14561	use `test`; insert into t1 values( 244 )
-master-bin.000001	14561	Query	1	14652	use `test`; insert into t1 values( 243 )
-master-bin.000001	14652	Query	1	14743	use `test`; insert into t1 values( 242 )
-master-bin.000001	14743	Query	1	14834	use `test`; insert into t1 values( 241 )
-master-bin.000001	14834	Query	1	14925	use `test`; insert into t1 values( 240 )
-master-bin.000001	14925	Query	1	15016	use `test`; insert into t1 values( 239 )
-master-bin.000001	15016	Query	1	15107	use `test`; insert into t1 values( 238 )
-master-bin.000001	15107	Query	1	15198	use `test`; insert into t1 values( 237 )
-master-bin.000001	15198	Query	1	15289	use `test`; insert into t1 values( 236 )
-master-bin.000001	15289	Query	1	15380	use `test`; insert into t1 values( 235 )
-master-bin.000001	15380	Query	1	15471	use `test`; insert into t1 values( 234 )
-master-bin.000001	15471	Query	1	15562	use `test`; insert into t1 values( 233 )
-master-bin.000001	15562	Query	1	15653	use `test`; insert into t1 values( 232 )
-master-bin.000001	15653	Query	1	15744	use `test`; insert into t1 values( 231 )
-master-bin.000001	15744	Query	1	15835	use `test`; insert into t1 values( 230 )
-master-bin.000001	15835	Query	1	15926	use `test`; insert into t1 values( 229 )
-master-bin.000001	15926	Query	1	16017	use `test`; insert into t1 values( 228 )
-master-bin.000001	16017	Query	1	16108	use `test`; insert into t1 values( 227 )
-master-bin.000001	16108	Query	1	16199	use `test`; insert into t1 values( 226 )
-master-bin.000001	16199	Query	1	16290	use `test`; insert into t1 values( 225 )
-master-bin.000001	16290	Query	1	16381	use `test`; insert into t1 values( 224 )
-master-bin.000001	16381	Query	1	16472	use `test`; insert into t1 values( 223 )
-master-bin.000001	16472	Query	1	16563	use `test`; insert into t1 values( 222 )
-master-bin.000001	16563	Query	1	16654	use `test`; insert into t1 values( 221 )
-master-bin.000001	16654	Query	1	16745	use `test`; insert into t1 values( 220 )
-master-bin.000001	16745	Query	1	16836	use `test`; insert into t1 values( 219 )
-master-bin.000001	16836	Query	1	16927	use `test`; insert into t1 values( 218 )
-master-bin.000001	16927	Query	1	17018	use `test`; insert into t1 values( 217 )
-master-bin.000001	17018	Query	1	17109	use `test`; insert into t1 values( 216 )
-master-bin.000001	17109	Query	1	17200	use `test`; insert into t1 values( 215 )
-master-bin.000001	17200	Query	1	17291	use `test`; insert into t1 values( 214 )
-master-bin.000001	17291	Query	1	17382	use `test`; insert into t1 values( 213 )
-master-bin.000001	17382	Query	1	17473	use `test`; insert into t1 values( 212 )
-master-bin.000001	17473	Query	1	17564	use `test`; insert into t1 values( 211 )
-master-bin.000001	17564	Query	1	17655	use `test`; insert into t1 values( 210 )
-master-bin.000001	17655	Query	1	17746	use `test`; insert into t1 values( 209 )
-master-bin.000001	17746	Query	1	17837	use `test`; insert into t1 values( 208 )
-master-bin.000001	17837	Query	1	17928	use `test`; insert into t1 values( 207 )
-master-bin.000001	17928	Query	1	18019	use `test`; insert into t1 values( 206 )
-master-bin.000001	18019	Query	1	18110	use `test`; insert into t1 values( 205 )
-master-bin.000001	18110	Query	1	18201	use `test`; insert into t1 values( 204 )
-master-bin.000001	18201	Query	1	18292	use `test`; insert into t1 values( 203 )
-master-bin.000001	18292	Query	1	18383	use `test`; insert into t1 values( 202 )
-master-bin.000001	18383	Query	1	18474	use `test`; insert into t1 values( 201 )
-master-bin.000001	18474	Query	1	18565	use `test`; insert into t1 values( 200 )
-master-bin.000001	18565	Query	1	18656	use `test`; insert into t1 values( 199 )
-master-bin.000001	18656	Query	1	18747	use `test`; insert into t1 values( 198 )
-master-bin.000001	18747	Query	1	18838	use `test`; insert into t1 values( 197 )
-master-bin.000001	18838	Query	1	18929	use `test`; insert into t1 values( 196 )
-master-bin.000001	18929	Query	1	19020	use `test`; insert into t1 values( 195 )
-master-bin.000001	19020	Query	1	19111	use `test`; insert into t1 values( 194 )
-master-bin.000001	19111	Query	1	19202	use `test`; insert into t1 values( 193 )
-master-bin.000001	19202	Query	1	19293	use `test`; insert into t1 values( 192 )
-master-bin.000001	19293	Query	1	19384	use `test`; insert into t1 values( 191 )
-master-bin.000001	19384	Query	1	19475	use `test`; insert into t1 values( 190 )
-master-bin.000001	19475	Query	1	19566	use `test`; insert into t1 values( 189 )
-master-bin.000001	19566	Query	1	19657	use `test`; insert into t1 values( 188 )
-master-bin.000001	19657	Query	1	19748	use `test`; insert into t1 values( 187 )
-master-bin.000001	19748	Query	1	19839	use `test`; insert into t1 values( 186 )
-master-bin.000001	19839	Query	1	19930	use `test`; insert into t1 values( 185 )
-master-bin.000001	19930	Query	1	20021	use `test`; insert into t1 values( 184 )
-master-bin.000001	20021	Query	1	20112	use `test`; insert into t1 values( 183 )
-master-bin.000001	20112	Query	1	20203	use `test`; insert into t1 values( 182 )
-master-bin.000001	20203	Query	1	20294	use `test`; insert into t1 values( 181 )
-master-bin.000001	20294	Query	1	20385	use `test`; insert into t1 values( 180 )
-master-bin.000001	20385	Query	1	20476	use `test`; insert into t1 values( 179 )
-master-bin.000001	20476	Query	1	20567	use `test`; insert into t1 values( 178 )
-master-bin.000001	20567	Query	1	20658	use `test`; insert into t1 values( 177 )
-master-bin.000001	20658	Query	1	20749	use `test`; insert into t1 values( 176 )
-master-bin.000001	20749	Query	1	20840	use `test`; insert into t1 values( 175 )
-master-bin.000001	20840	Query	1	20931	use `test`; insert into t1 values( 174 )
-master-bin.000001	20931	Query	1	21022	use `test`; insert into t1 values( 173 )
-master-bin.000001	21022	Query	1	21113	use `test`; insert into t1 values( 172 )
-master-bin.000001	21113	Query	1	21204	use `test`; insert into t1 values( 171 )
-master-bin.000001	21204	Query	1	21295	use `test`; insert into t1 values( 170 )
-master-bin.000001	21295	Query	1	21386	use `test`; insert into t1 values( 169 )
-master-bin.000001	21386	Query	1	21477	use `test`; insert into t1 values( 168 )
-master-bin.000001	21477	Query	1	21568	use `test`; insert into t1 values( 167 )
-master-bin.000001	21568	Query	1	21659	use `test`; insert into t1 values( 166 )
-master-bin.000001	21659	Query	1	21750	use `test`; insert into t1 values( 165 )
-master-bin.000001	21750	Query	1	21841	use `test`; insert into t1 values( 164 )
-master-bin.000001	21841	Query	1	21932	use `test`; insert into t1 values( 163 )
-master-bin.000001	21932	Query	1	22023	use `test`; insert into t1 values( 162 )
-master-bin.000001	22023	Query	1	22114	use `test`; insert into t1 values( 161 )
-master-bin.000001	22114	Query	1	22205	use `test`; insert into t1 values( 160 )
-master-bin.000001	22205	Query	1	22296	use `test`; insert into t1 values( 159 )
-master-bin.000001	22296	Query	1	22387	use `test`; insert into t1 values( 158 )
-master-bin.000001	22387	Query	1	22478	use `test`; insert into t1 values( 157 )
-master-bin.000001	22478	Query	1	22569	use `test`; insert into t1 values( 156 )
-master-bin.000001	22569	Query	1	22660	use `test`; insert into t1 values( 155 )
-master-bin.000001	22660	Query	1	22751	use `test`; insert into t1 values( 154 )
-master-bin.000001	22751	Query	1	22842	use `test`; insert into t1 values( 153 )
-master-bin.000001	22842	Query	1	22933	use `test`; insert into t1 values( 152 )
-master-bin.000001	22933	Query	1	23024	use `test`; insert into t1 values( 151 )
-master-bin.000001	23024	Query	1	23115	use `test`; insert into t1 values( 150 )
-master-bin.000001	23115	Query	1	23206	use `test`; insert into t1 values( 149 )
-master-bin.000001	23206	Query	1	23297	use `test`; insert into t1 values( 148 )
-master-bin.000001	23297	Query	1	23388	use `test`; insert into t1 values( 147 )
-master-bin.000001	23388	Query	1	23479	use `test`; insert into t1 values( 146 )
-master-bin.000001	23479	Query	1	23570	use `test`; insert into t1 values( 145 )
-master-bin.000001	23570	Query	1	23661	use `test`; insert into t1 values( 144 )
-master-bin.000001	23661	Query	1	23752	use `test`; insert into t1 values( 143 )
-master-bin.000001	23752	Query	1	23843	use `test`; insert into t1 values( 142 )
-master-bin.000001	23843	Query	1	23934	use `test`; insert into t1 values( 141 )
-master-bin.000001	23934	Query	1	24025	use `test`; insert into t1 values( 140 )
-master-bin.000001	24025	Query	1	24116	use `test`; insert into t1 values( 139 )
-master-bin.000001	24116	Query	1	24207	use `test`; insert into t1 values( 138 )
-master-bin.000001	24207	Query	1	24298	use `test`; insert into t1 values( 137 )
-master-bin.000001	24298	Query	1	24389	use `test`; insert into t1 values( 136 )
-master-bin.000001	24389	Query	1	24480	use `test`; insert into t1 values( 135 )
-master-bin.000001	24480	Query	1	24571	use `test`; insert into t1 values( 134 )
-master-bin.000001	24571	Query	1	24662	use `test`; insert into t1 values( 133 )
-master-bin.000001	24662	Query	1	24753	use `test`; insert into t1 values( 132 )
-master-bin.000001	24753	Query	1	24844	use `test`; insert into t1 values( 131 )
-master-bin.000001	24844	Query	1	24935	use `test`; insert into t1 values( 130 )
-master-bin.000001	24935	Query	1	25026	use `test`; insert into t1 values( 129 )
-master-bin.000001	25026	Query	1	25117	use `test`; insert into t1 values( 128 )
-master-bin.000001	25117	Query	1	25208	use `test`; insert into t1 values( 127 )
-master-bin.000001	25208	Query	1	25299	use `test`; insert into t1 values( 126 )
-master-bin.000001	25299	Query	1	25390	use `test`; insert into t1 values( 125 )
-master-bin.000001	25390	Query	1	25481	use `test`; insert into t1 values( 124 )
-master-bin.000001	25481	Query	1	25572	use `test`; insert into t1 values( 123 )
-master-bin.000001	25572	Query	1	25663	use `test`; insert into t1 values( 122 )
-master-bin.000001	25663	Query	1	25754	use `test`; insert into t1 values( 121 )
-master-bin.000001	25754	Query	1	25845	use `test`; insert into t1 values( 120 )
-master-bin.000001	25845	Query	1	25936	use `test`; insert into t1 values( 119 )
-master-bin.000001	25936	Query	1	26027	use `test`; insert into t1 values( 118 )
-master-bin.000001	26027	Query	1	26118	use `test`; insert into t1 values( 117 )
-master-bin.000001	26118	Query	1	26209	use `test`; insert into t1 values( 116 )
-master-bin.000001	26209	Query	1	26300	use `test`; insert into t1 values( 115 )
-master-bin.000001	26300	Query	1	26391	use `test`; insert into t1 values( 114 )
-master-bin.000001	26391	Query	1	26482	use `test`; insert into t1 values( 113 )
-master-bin.000001	26482	Query	1	26573	use `test`; insert into t1 values( 112 )
-master-bin.000001	26573	Query	1	26664	use `test`; insert into t1 values( 111 )
-master-bin.000001	26664	Query	1	26755	use `test`; insert into t1 values( 110 )
-master-bin.000001	26755	Query	1	26846	use `test`; insert into t1 values( 109 )
-master-bin.000001	26846	Query	1	26937	use `test`; insert into t1 values( 108 )
-master-bin.000001	26937	Query	1	27028	use `test`; insert into t1 values( 107 )
-master-bin.000001	27028	Query	1	27119	use `test`; insert into t1 values( 106 )
-master-bin.000001	27119	Query	1	27210	use `test`; insert into t1 values( 105 )
-master-bin.000001	27210	Query	1	27301	use `test`; insert into t1 values( 104 )
-master-bin.000001	27301	Query	1	27392	use `test`; insert into t1 values( 103 )
-master-bin.000001	27392	Query	1	27483	use `test`; insert into t1 values( 102 )
-master-bin.000001	27483	Query	1	27574	use `test`; insert into t1 values( 101 )
-master-bin.000001	27574	Query	1	27665	use `test`; insert into t1 values( 100 )
-master-bin.000001	27665	Query	1	27755	use `test`; insert into t1 values( 99 )
-master-bin.000001	27755	Query	1	27845	use `test`; insert into t1 values( 98 )
-master-bin.000001	27845	Query	1	27935	use `test`; insert into t1 values( 97 )
-master-bin.000001	27935	Query	1	28025	use `test`; insert into t1 values( 96 )
-master-bin.000001	28025	Query	1	28115	use `test`; insert into t1 values( 95 )
-master-bin.000001	28115	Query	1	28205	use `test`; insert into t1 values( 94 )
-master-bin.000001	28205	Query	1	28295	use `test`; insert into t1 values( 93 )
-master-bin.000001	28295	Query	1	28385	use `test`; insert into t1 values( 92 )
-master-bin.000001	28385	Query	1	28475	use `test`; insert into t1 values( 91 )
-master-bin.000001	28475	Query	1	28565	use `test`; insert into t1 values( 90 )
-master-bin.000001	28565	Query	1	28655	use `test`; insert into t1 values( 89 )
-master-bin.000001	28655	Query	1	28745	use `test`; insert into t1 values( 88 )
-master-bin.000001	28745	Query	1	28835	use `test`; insert into t1 values( 87 )
-master-bin.000001	28835	Query	1	28925	use `test`; insert into t1 values( 86 )
-master-bin.000001	28925	Query	1	29015	use `test`; insert into t1 values( 85 )
-master-bin.000001	29015	Query	1	29105	use `test`; insert into t1 values( 84 )
-master-bin.000001	29105	Query	1	29195	use `test`; insert into t1 values( 83 )
-master-bin.000001	29195	Query	1	29285	use `test`; insert into t1 values( 82 )
-master-bin.000001	29285	Query	1	29375	use `test`; insert into t1 values( 81 )
-master-bin.000001	29375	Query	1	29465	use `test`; insert into t1 values( 80 )
-master-bin.000001	29465	Query	1	29555	use `test`; insert into t1 values( 79 )
-master-bin.000001	29555	Query	1	29645	use `test`; insert into t1 values( 78 )
-master-bin.000001	29645	Query	1	29735	use `test`; insert into t1 values( 77 )
-master-bin.000001	29735	Query	1	29825	use `test`; insert into t1 values( 76 )
-master-bin.000001	29825	Query	1	29915	use `test`; insert into t1 values( 75 )
-master-bin.000001	29915	Query	1	30005	use `test`; insert into t1 values( 74 )
-master-bin.000001	30005	Query	1	30095	use `test`; insert into t1 values( 73 )
-master-bin.000001	30095	Query	1	30185	use `test`; insert into t1 values( 72 )
-master-bin.000001	30185	Query	1	30275	use `test`; insert into t1 values( 71 )
-master-bin.000001	30275	Query	1	30365	use `test`; insert into t1 values( 70 )
-master-bin.000001	30365	Query	1	30455	use `test`; insert into t1 values( 69 )
-master-bin.000001	30455	Query	1	30545	use `test`; insert into t1 values( 68 )
-master-bin.000001	30545	Query	1	30635	use `test`; insert into t1 values( 67 )
-master-bin.000001	30635	Query	1	30725	use `test`; insert into t1 values( 66 )
-master-bin.000001	30725	Query	1	30815	use `test`; insert into t1 values( 65 )
-master-bin.000001	30815	Query	1	30905	use `test`; insert into t1 values( 64 )
-master-bin.000001	30905	Query	1	30995	use `test`; insert into t1 values( 63 )
-master-bin.000001	30995	Query	1	31085	use `test`; insert into t1 values( 62 )
-master-bin.000001	31085	Query	1	31175	use `test`; insert into t1 values( 61 )
-master-bin.000001	31175	Query	1	31265	use `test`; insert into t1 values( 60 )
-master-bin.000001	31265	Query	1	31355	use `test`; insert into t1 values( 59 )
-master-bin.000001	31355	Query	1	31445	use `test`; insert into t1 values( 58 )
-master-bin.000001	31445	Query	1	31535	use `test`; insert into t1 values( 57 )
-master-bin.000001	31535	Query	1	31625	use `test`; insert into t1 values( 56 )
-master-bin.000001	31625	Query	1	31715	use `test`; insert into t1 values( 55 )
-master-bin.000001	31715	Query	1	31805	use `test`; insert into t1 values( 54 )
-master-bin.000001	31805	Query	1	31895	use `test`; insert into t1 values( 53 )
-master-bin.000001	31895	Query	1	31985	use `test`; insert into t1 values( 52 )
-master-bin.000001	31985	Query	1	32075	use `test`; insert into t1 values( 51 )
-master-bin.000001	32075	Query	1	32165	use `test`; insert into t1 values( 50 )
-master-bin.000001	32165	Query	1	32255	use `test`; insert into t1 values( 49 )
-master-bin.000001	32255	Query	1	32345	use `test`; insert into t1 values( 48 )
-master-bin.000001	32345	Query	1	32435	use `test`; insert into t1 values( 47 )
-master-bin.000001	32435	Query	1	32525	use `test`; insert into t1 values( 46 )
-master-bin.000001	32525	Query	1	32615	use `test`; insert into t1 values( 45 )
-master-bin.000001	32615	Query	1	32705	use `test`; insert into t1 values( 44 )
-master-bin.000001	32705	Query	1	32795	use `test`; insert into t1 values( 43 )
-master-bin.000001	32795	Query	1	32885	use `test`; insert into t1 values( 42 )
-master-bin.000001	32885	Query	1	32975	use `test`; insert into t1 values( 41 )
-master-bin.000001	32975	Query	1	33065	use `test`; insert into t1 values( 40 )
-master-bin.000001	33065	Query	1	33155	use `test`; insert into t1 values( 39 )
-master-bin.000001	33155	Query	1	33245	use `test`; insert into t1 values( 38 )
-master-bin.000001	33245	Query	1	33335	use `test`; insert into t1 values( 37 )
-master-bin.000001	33335	Query	1	33425	use `test`; insert into t1 values( 36 )
-master-bin.000001	33425	Query	1	33515	use `test`; insert into t1 values( 35 )
-master-bin.000001	33515	Query	1	33605	use `test`; insert into t1 values( 34 )
-master-bin.000001	33605	Query	1	33695	use `test`; insert into t1 values( 33 )
-master-bin.000001	33695	Query	1	33785	use `test`; insert into t1 values( 32 )
-master-bin.000001	33785	Query	1	33875	use `test`; insert into t1 values( 31 )
-master-bin.000001	33875	Query	1	33965	use `test`; insert into t1 values( 30 )
-master-bin.000001	33965	Query	1	34055	use `test`; insert into t1 values( 29 )
-master-bin.000001	34055	Query	1	34145	use `test`; insert into t1 values( 28 )
-master-bin.000001	34145	Query	1	34235	use `test`; insert into t1 values( 27 )
-master-bin.000001	34235	Query	1	34325	use `test`; insert into t1 values( 26 )
-master-bin.000001	34325	Query	1	34415	use `test`; insert into t1 values( 25 )
-master-bin.000001	34415	Query	1	34505	use `test`; insert into t1 values( 24 )
-master-bin.000001	34505	Query	1	34595	use `test`; insert into t1 values( 23 )
-master-bin.000001	34595	Query	1	34685	use `test`; insert into t1 values( 22 )
-master-bin.000001	34685	Query	1	34775	use `test`; insert into t1 values( 21 )
-master-bin.000001	34775	Query	1	34865	use `test`; insert into t1 values( 20 )
-master-bin.000001	34865	Query	1	34955	use `test`; insert into t1 values( 19 )
-master-bin.000001	34955	Query	1	35045	use `test`; insert into t1 values( 18 )
-master-bin.000001	35045	Query	1	35135	use `test`; insert into t1 values( 17 )
-master-bin.000001	35135	Query	1	35225	use `test`; insert into t1 values( 16 )
-master-bin.000001	35225	Query	1	35315	use `test`; insert into t1 values( 15 )
-master-bin.000001	35315	Query	1	35405	use `test`; insert into t1 values( 14 )
-master-bin.000001	35405	Query	1	35495	use `test`; insert into t1 values( 13 )
-master-bin.000001	35495	Query	1	35585	use `test`; insert into t1 values( 12 )
-master-bin.000001	35585	Query	1	35675	use `test`; insert into t1 values( 11 )
-master-bin.000001	35675	Query	1	35765	use `test`; insert into t1 values( 10 )
-master-bin.000001	35765	Query	1	35854	use `test`; insert into t1 values( 9 )
-master-bin.000001	35854	Query	1	35943	use `test`; insert into t1 values( 8 )
-master-bin.000001	35943	Query	1	36032	use `test`; insert into t1 values( 7 )
-master-bin.000001	36032	Query	1	36121	use `test`; insert into t1 values( 6 )
-master-bin.000001	36121	Query	1	36210	use `test`; insert into t1 values( 5 )
-master-bin.000001	36210	Query	1	36299	use `test`; insert into t1 values( 4 )
-master-bin.000001	36299	Query	1	36388	use `test`; insert into t1 values( 3 )
-master-bin.000001	36388	Query	1	36477	use `test`; insert into t1 values( 2 )
-master-bin.000001	36477	Query	1	36566	use `test`; insert into t1 values( 1 )
-master-bin.000001	36566	Xid	1	36593	COMMIT /* XID */
-master-bin.000001	36593	Rotate	1	36637	master-bin.000002;pos=4
+master-bin.000001	#	Query	#	#	use `test`; create table t1 (a int) engine=innodb
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 400 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 399 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 398 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 397 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 396 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 395 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 394 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 393 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 392 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 391 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 390 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 389 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 388 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 387 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 386 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 385 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 384 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 383 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 382 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 381 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 380 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 379 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 378 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 377 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 376 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 375 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 374 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 373 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 372 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 371 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 370 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 369 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 368 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 367 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 366 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 365 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 364 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 363 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 362 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 361 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 360 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 359 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 358 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 357 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 356 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 355 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 354 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 353 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 352 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 351 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 350 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 349 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 348 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 347 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 346 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 345 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 344 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 343 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 342 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 341 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 340 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 339 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 338 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 337 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 336 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 335 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 334 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 333 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 332 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 331 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 330 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 329 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 328 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 327 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 326 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 325 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 324 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 323 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 322 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 321 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 320 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 319 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 318 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 317 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 316 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 315 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 314 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 313 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 312 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 311 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 310 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 309 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 308 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 307 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 306 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 305 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 304 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 303 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 302 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 301 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 300 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 299 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 298 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 297 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 296 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 295 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 294 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 293 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 292 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 291 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 290 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 289 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 288 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 287 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 286 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 285 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 284 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 283 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 282 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 281 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 280 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 279 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 278 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 277 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 276 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 275 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 274 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 273 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 272 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 271 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 270 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 269 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 268 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 267 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 266 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 265 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 264 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 263 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 262 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 261 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 260 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 259 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 258 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 257 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 256 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 255 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 254 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 253 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 252 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 251 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 250 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 249 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 248 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 247 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 246 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 245 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 244 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 243 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 242 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 241 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 240 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 239 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 238 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 237 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 236 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 235 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 234 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 233 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 232 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 231 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 230 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 229 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 228 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 227 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 226 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 225 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 224 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 223 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 222 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 221 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 220 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 219 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 218 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 217 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 216 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 215 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 214 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 213 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 212 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 211 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 210 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 209 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 208 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 207 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 206 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 205 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 204 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 203 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 202 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 201 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 200 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 199 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 198 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 197 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 196 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 195 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 194 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 193 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 192 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 191 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 190 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 189 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 188 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 187 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 186 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 185 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 184 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 183 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 182 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 181 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 180 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 179 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 178 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 177 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 176 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 175 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 174 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 173 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 172 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 171 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 170 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 169 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 168 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 167 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 166 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 165 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 164 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 163 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 162 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 161 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 160 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 159 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 158 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 157 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 156 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 155 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 154 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 153 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 152 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 151 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 150 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 149 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 148 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 147 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 146 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 145 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 144 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 143 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 142 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 141 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 140 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 139 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 138 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 137 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 136 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 135 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 134 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 133 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 132 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 131 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 130 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 129 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 128 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 127 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 126 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 125 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 124 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 123 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 122 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 121 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 120 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 119 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 118 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 117 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 116 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 115 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 114 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 113 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 112 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 111 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 110 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 109 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 108 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 107 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( <binlog_start> )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 105 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 104 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 103 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 102 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 101 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 100 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 99 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 98 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 97 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 96 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 95 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 94 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 93 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 92 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 91 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 90 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 89 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 88 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 87 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 86 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 85 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 84 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 83 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 82 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 81 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 80 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 79 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 78 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 77 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 76 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 75 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 74 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 73 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 72 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 71 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 70 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 69 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 68 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 67 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 66 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 65 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 64 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 63 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 62 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 61 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 60 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 59 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 58 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 57 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 56 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 55 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 54 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 53 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 52 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 51 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 50 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 49 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 48 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 47 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 46 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 45 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 44 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 43 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 42 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 41 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 40 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 39 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 38 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 37 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 36 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 35 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 34 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 33 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 32 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 31 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 30 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 29 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 28 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 27 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 26 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 25 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 24 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 23 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 22 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 21 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 20 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 19 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 18 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 17 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 16 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 15 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 14 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 13 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 12 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 11 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 10 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 9 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 8 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 7 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 6 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 5 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 4 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 3 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 2 )
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values( 1 )
+master-bin.000001	#	Xid	#	#	COMMIT /* XID */
+master-bin.000001	#	Rotate	#	#	master-bin.000002;pos=4
 drop table t1;
 set global binlog_cache_size=@bcs;
 set session autocommit = @ac;
@@ -590,12 +587,11 @@ set @b= 14632475938453979136;
 execute stmt using @a, @b;
 deallocate prepare stmt;
 drop table t1;
-show binlog events from 0;
+show binlog events from <binlog_start>;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	4	Format_desc	1	106	Server version, Binlog ver: 4
-master-bin.000001	106	Query	1	227	use `test`; create table t1 (a bigint unsigned, b bigint(20) unsigned)
-master-bin.000001	227	Query	1	351	use `test`; insert into t1 values (9999999999999999,14632475938453979136)
-master-bin.000001	351	Query	1	427	use `test`; drop table t1
+master-bin.000001	#	Query	#	#	use `test`; create table t1 (a bigint unsigned, b bigint(20) unsigned)
+master-bin.000001	#	Query	#	#	use `test`; insert into t1 values (9999999999999999,14632475938453979136)
+master-bin.000001	#	Query	#	#	use `test`; drop table t1
 reset master;
 CREATE DATABASE bug39182 DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
 USE bug39182;
@@ -766,14 +762,14 @@ drop table if exists t3;
 create table t3 (a int(11) NOT NULL AUTO_INCREMENT, b text, PRIMARY KEY (a) ) engine=innodb;
 show master status;
 File	Position	Binlog_Do_DB	Binlog_Ignore_DB
-master-bin.000001	346		
+master-bin.000001	#	<Binlog_Do_DB>	<Binlog_Ignore_DB>
 insert into t3(b) values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
 insert into t3(b) values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
 insert into t3(b) values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
 insert into t3(b) values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
-show master status /* must show new binlog index after rotating */;
+show master status;
 File	Position	Binlog_Do_DB	Binlog_Ignore_DB
-master-bin.000002	106		
+master-bin.000002	#	<Binlog_Do_DB>	<Binlog_Ignore_DB>
 drop table t3;
 #
 # Bug #45998: database crashes when running "create as select"

=== modified file 'mysql-test/suite/binlog/r/binlog_stm_blackhole.result'
--- a/mysql-test/suite/binlog/r/binlog_stm_blackhole.result	2009-12-06 01:11:32 +0000
+++ b/mysql-test/suite/binlog/r/binlog_stm_blackhole.result	2010-05-24 13:54:08 +0000
@@ -104,9 +104,8 @@ select * from t2;
 a
 select * from t3;
 a
-show binlog events;
+show binlog events from <binlog_start>;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Format_desc	#	#	Server ver: VERSION, Binlog ver: 4
 master-bin.000001	#	Query	#	#	use `test`; drop table t1,t2
 master-bin.000001	#	Query	#	#	use `test`; create table t1 (a int) engine=blackhole
 master-bin.000001	#	Query	#	#	BEGIN
@@ -126,7 +125,7 @@ master-bin.000001	#	Query	#	#	use `test`
 master-bin.000001	#	Query	#	#	COMMIT
 master-bin.000001	#	Query	#	#	use `test`; create table t2 (a varchar(200)) engine=blackhole
 master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Begin_load_query	#	#	;file_id=#;block_len=581
+master-bin.000001	#	Begin_load_query	#	#	;file_id=#;block_len=#
 master-bin.000001	#	Execute_load_query	#	#	use `test`; LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE `t2` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`) ;file_id=#
 master-bin.000001	#	Query	#	#	COMMIT
 master-bin.000001	#	Query	#	#	use `test`; alter table t1 add b int
@@ -163,13 +162,6 @@ start transaction;
 insert into t1 values(2);
 rollback;
 set autocommit=1;
-show binlog events;
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Format_desc	#	#	Server ver: VERSION, Binlog ver: 4
-master-bin.000001	#	Query	#	#	use `test`; create table t1 (a int) engine=blackhole
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; insert into t1 values(1)
-master-bin.000001	#	Query	#	#	COMMIT
 drop table if exists t1;
 reset master;
 create table t1 (a int auto_increment, primary key (a)) engine=blackhole;

=== modified file 'mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result'
--- a/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result	2010-03-28 11:57:33 +0000
+++ b/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result	2010-05-19 17:01:12 +0000
@@ -364,6 +364,9 @@ master-bin.000001	#	Query	#	#	use `test`
 master-bin.000001	#	Query	#	#	BEGIN
 master-bin.000001	#	Query	#	#	use `test`; INSERT INTO t2 values (100,100)
 master-bin.000001	#	Query	#	#	COMMIT
+master-bin.000001	#	Query	#	#	BEGIN
+master-bin.000001	#	Query	#	#	use `test`; INSERT INTO t2 values (101,101)
+master-bin.000001	#	Query	#	#	ROLLBACK
 master-bin.000001	#	Query	#	#	use `test`; DROP TABLE t1,t2
 reset master;
 create table t1 (a int) engine=innodb;
@@ -802,7 +805,7 @@ delete from t4;
 insert into t3 values (1,1),(2,2);
 insert into t4 values (1,1),(2,2);
 reset master;
-UPDATE t3,t4 SET t3.a=t4.a + bug27417(1);
+UPDATE t3,t4 SET t3.a = t4.a + bug27417(1) where t3.a = 1;
 ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
 select count(*) from t1 /* must be 1 */;
 count(*)

=== modified file 'mysql-test/suite/binlog/t/binlog_base64_flag.test'
--- a/mysql-test/suite/binlog/t/binlog_base64_flag.test	2008-06-30 20:11:18 +0000
+++ b/mysql-test/suite/binlog/t/binlog_base64_flag.test	2010-06-18 17:32:23 +0000
@@ -150,3 +150,16 @@ iONkSBcBAAAAKwAAAMQBAAAQABAAAAAAAAEAA//4
 ';
 
 drop table t1, char63_utf8, char128_utf8;
+
+
+--echo #
+--echo # Bug #54393: crash and/or valgrind errors in 
+--echo # mysql_client_binlog_statement
+--echo #
+--error ER_SYNTAX_ERROR
+BINLOG '';
+BINLOG '123';
+--error ER_SYNTAX_ERROR
+BINLOG '-2079193929';
+--error ER_SYNTAX_ERROR
+BINLOG 'x�����%~���D��������';

=== modified file 'mysql-test/suite/binlog/t/binlog_innodb.test'
--- a/mysql-test/suite/binlog/t/binlog_innodb.test	2009-01-08 02:06:54 +0000
+++ b/mysql-test/suite/binlog/t/binlog_innodb.test	2010-05-24 13:54:08 +0000
@@ -155,7 +155,8 @@ reset master;
 UPDATE t2,t1 SET t2.a=t1.a+2;
 # check
 select * from t2 /* must be (3,1), (4,4) */;
-show master status /* there must no UPDATE in binlog */;
+--echo # There must no UPDATE in binlog;
+source include/show_binlog_events.inc;
 
 # B. testing multi_update::send_error() execution branch
 delete from t1;
@@ -165,7 +166,8 @@ insert into t2 values (1,2),(3,4),(4,4);
 reset master;
 --error ER_DUP_ENTRY
 UPDATE t2,t1  SET t2.a=t2.b where t2.a=t1.a;
-show master status /* there must be no UPDATE query event */;
+--echo # There must be no UPDATE query event;
+source include/show_binlog_events.inc;
 
 # cleanup bug#27716
 drop table t1, t2;

=== modified file 'mysql-test/suite/binlog/t/binlog_stm_binlog.test'
--- a/mysql-test/suite/binlog/t/binlog_stm_binlog.test	2010-05-13 11:00:53 +0000
+++ b/mysql-test/suite/binlog/t/binlog_stm_binlog.test	2010-08-02 09:01:24 +0000
@@ -12,8 +12,7 @@ create table t1 (a int, b int) engine=in
 begin;
 insert into t1 values (1,2);
 commit;
---replace_regex /\/\* xid=.* \*\//\/* XID *\// /Server ver: .*, Binlog ver: .*/Server ver: #, Binlog ver: #/ /table_id: [0-9]+/table_id: #/
-show binlog events;
+source include/show_binlog_events.inc;
 drop table t1;
 
 # This is a wrapper for binlog.test so that the same test case can be used 

=== modified file 'mysql-test/suite/bugs/r/rpl_bug12691.result'
--- a/mysql-test/suite/bugs/r/rpl_bug12691.result	2008-01-31 13:23:27 +0000
+++ b/mysql-test/suite/bugs/r/rpl_bug12691.result	2010-05-24 13:54:08 +0000
@@ -16,12 +16,11 @@ LOAD DATA INFILE FILENAME
 SELECT COUNT(*) FROM t1;
 COUNT(*)
 3
-SHOW BINLOG EVENTS;
+show binlog events from <binlog_start>;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Format_desc	1	#	Server ver: #
-master-bin.000001	#	Query	1	#	use `test`; CREATE TABLE t1 (b CHAR(10))
-master-bin.000001	#	Begin_load_query	1	#	;file_id=#;block_len=#
-master-bin.000001	#	Execute_load_query	1	#	use `test`; LOAD DATA INFILE FILENAME ;file_id=#
+master-bin.000001	#	Query	#	#	use `test`; CREATE TABLE t1 (b CHAR(10))
+master-bin.000001	#	Begin_load_query	#	#	;file_id=#;block_len=#
+master-bin.000001	#	Execute_load_query	#	#	use `test`; LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/rpl_bug12691.dat' INTO TABLE `t1` FIELDS TERMINATED BY '|' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`b`) ;file_id=#
 
 **** On Slave ****
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;

=== modified file 'mysql-test/suite/bugs/r/rpl_bug36391.result'
--- a/mysql-test/suite/bugs/r/rpl_bug36391.result	2009-01-27 20:49:37 +0000
+++ b/mysql-test/suite/bugs/r/rpl_bug36391.result	2010-05-24 13:54:08 +0000
@@ -13,5 +13,6 @@ Tables_in_test
 t1
 show master status;
 File	Position	Binlog_Do_DB	Binlog_Ignore_DB
-master-bin.000001	278		
+master-bin.000001	#	<Binlog_Do_DB>	<Binlog_Ignore_DB>
 flush logs;
+drop table t1;

=== modified file 'mysql-test/suite/bugs/t/rpl_bug12691.test'
--- a/mysql-test/suite/bugs/t/rpl_bug12691.test	2008-01-31 13:23:27 +0000
+++ b/mysql-test/suite/bugs/t/rpl_bug12691.test	2010-05-24 13:54:08 +0000
@@ -28,9 +28,7 @@ STOP SLAVE;
 
 SELECT COUNT(*) FROM t1;
 
---replace_column 2 # 5 #
---replace_regex /Server ver: .+/Server ver: #/ /table_id: [0-9]+/table_id: #/ /COMMIT.+xid=[0-9]+.+/#/ /file_id=[0-9]+/file_id=#/ /block_len=[0-9]+/block_len=#/ /'.+'/FILENAME/
-SHOW BINLOG EVENTS;
+source include/show_binlog_events.inc;
 
 --save_master_pos
 

=== modified file 'mysql-test/suite/bugs/t/rpl_bug36391.test'
--- a/mysql-test/suite/bugs/t/rpl_bug36391.test	2009-01-27 20:49:37 +0000
+++ b/mysql-test/suite/bugs/t/rpl_bug36391.test	2010-05-24 13:54:08 +0000
@@ -21,8 +21,10 @@ create table t1(id int);
 
 show tables;
 
-show master status;
+--source include/show_master_status.inc
 
 flush logs;
 
 --exec $MYSQL_BINLOG $MYSQL_TEST_DIR/var/log/master-bin.000001 | $MYSQL test
+
+drop table t1;

=== modified file 'mysql-test/suite/engines/funcs/r/rpl_000015.result'
--- a/mysql-test/suite/engines/funcs/r/rpl_000015.result	2010-03-18 06:42:07 +0000
+++ b/mysql-test/suite/engines/funcs/r/rpl_000015.result	2010-05-24 13:54:08 +0000
@@ -10,166 +10,25 @@ File	Position	Binlog_Do_DB	Binlog_Ignore
 master-bin.000001	106		
 stop slave;
 reset slave;
-show slave status;
-Slave_IO_State	#
-Master_Host	127.0.0.1
-Master_User	root
-Master_Port	MASTER_PORT
-Connect_Retry	#
 Master_Log_File	
 Read_Master_Log_Pos	4
-Relay_Log_File	#
-Relay_Log_Pos	#
 Relay_Master_Log_File	
-Slave_IO_Running	No
-Slave_SQL_Running	No
-Replicate_Do_DB	
-Replicate_Ignore_DB	
-Replicate_Do_Table	
-Replicate_Ignore_Table	
-Replicate_Wild_Do_Table	
-Replicate_Wild_Ignore_Table	
-Last_Errno	0
-Last_Error	
-Skip_Counter	0
 Exec_Master_Log_Pos	0
-Relay_Log_Space	#
-Until_Condition	None
-Until_Log_File	
-Until_Log_Pos	0
-Master_SSL_Allowed	No
-Master_SSL_CA_File	
-Master_SSL_CA_Path	
-Master_SSL_Cert	
-Master_SSL_Cipher	
-Master_SSL_Key	
-Seconds_Behind_Master	#
-Master_SSL_Verify_Server_Cert	No
-Last_IO_Errno	0
-Last_IO_Error	
-Last_SQL_Errno	0
-Last_SQL_Error	
 change master to master_host='127.0.0.1';
-show slave status;
-Slave_IO_State	#
-Master_Host	127.0.0.1
-Master_User	root
-Master_Port	MASTER_PORT
-Connect_Retry	#
 Master_Log_File	
 Read_Master_Log_Pos	4
-Relay_Log_File	#
-Relay_Log_Pos	#
 Relay_Master_Log_File	
-Slave_IO_Running	No
-Slave_SQL_Running	No
-Replicate_Do_DB	
-Replicate_Ignore_DB	
-Replicate_Do_Table	
-Replicate_Ignore_Table	
-Replicate_Wild_Do_Table	
-Replicate_Wild_Ignore_Table	
-Last_Errno	0
-Last_Error	
-Skip_Counter	0
 Exec_Master_Log_Pos	0
-Relay_Log_Space	#
-Until_Condition	None
-Until_Log_File	
-Until_Log_Pos	0
-Master_SSL_Allowed	No
-Master_SSL_CA_File	
-Master_SSL_CA_Path	
-Master_SSL_Cert	
-Master_SSL_Cipher	
-Master_SSL_Key	
-Seconds_Behind_Master	#
-Master_SSL_Verify_Server_Cert	No
-Last_IO_Errno	0
-Last_IO_Error	
-Last_SQL_Errno	0
-Last_SQL_Error	
 change master to master_host='127.0.0.1',master_user='root',
 master_password='',master_port=MASTER_PORT;
-show slave status;
-Slave_IO_State	#
-Master_Host	127.0.0.1
-Master_User	root
-Master_Port	MASTER_PORT
-Connect_Retry	#
 Master_Log_File	
 Read_Master_Log_Pos	4
-Relay_Log_File	#
-Relay_Log_Pos	#
 Relay_Master_Log_File	
-Slave_IO_Running	No
-Slave_SQL_Running	No
-Replicate_Do_DB	
-Replicate_Ignore_DB	
-Replicate_Do_Table	
-Replicate_Ignore_Table	
-Replicate_Wild_Do_Table	
-Replicate_Wild_Ignore_Table	
-Last_Errno	0
-Last_Error	
-Skip_Counter	0
 Exec_Master_Log_Pos	0
-Relay_Log_Space	#
-Until_Condition	None
-Until_Log_File	
-Until_Log_Pos	0
-Master_SSL_Allowed	No
-Master_SSL_CA_File	
-Master_SSL_CA_Path	
-Master_SSL_Cert	
-Master_SSL_Cipher	
-Master_SSL_Key	
-Seconds_Behind_Master	#
-Master_SSL_Verify_Server_Cert	No
-Last_IO_Errno	0
-Last_IO_Error	
-Last_SQL_Errno	0
-Last_SQL_Error	
 start slave;
-show slave status;
-Slave_IO_State	Waiting for master to send event
-Master_Host	127.0.0.1
-Master_User	root
-Master_Port	MASTER_PORT
-Connect_Retry	1
 Master_Log_File	master-bin.000001
-Read_Master_Log_Pos	106
-Relay_Log_File	slave-relay-bin.000002
-Relay_Log_Pos	252
 Relay_Master_Log_File	master-bin.000001
-Slave_IO_Running	Yes
-Slave_SQL_Running	Yes
-Replicate_Do_DB	
-Replicate_Ignore_DB	
-Replicate_Do_Table	
-Replicate_Ignore_Table	
-Replicate_Wild_Do_Table	
-Replicate_Wild_Ignore_Table	
-Last_Errno	0
-Last_Error	
-Skip_Counter	0
-Exec_Master_Log_Pos	106
-Relay_Log_Space	407
-Until_Condition	None
-Until_Log_File	
-Until_Log_Pos	0
-Master_SSL_Allowed	No
-Master_SSL_CA_File	
-Master_SSL_CA_Path	
-Master_SSL_Cert	
-Master_SSL_Cipher	
-Master_SSL_Key	
-Seconds_Behind_Master	#
-Master_SSL_Verify_Server_Cert	No
-Last_IO_Errno	0
-Last_IO_Error	
-Last_SQL_Errno	0
-Last_SQL_Error	
+Checking that both slave threads are running.
 drop table if exists t1;
 create table t1 (n int, PRIMARY KEY(n));
 insert into t1 values (10),(45),(90);

=== modified file 'mysql-test/suite/engines/funcs/r/rpl_REDIRECT.result'
--- a/mysql-test/suite/engines/funcs/r/rpl_REDIRECT.result	2010-03-18 06:42:07 +0000
+++ b/mysql-test/suite/engines/funcs/r/rpl_REDIRECT.result	2010-05-24 13:54:08 +0000
@@ -4,8 +4,7 @@ reset master;
 reset slave;
 drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
 start slave;
-SHOW SLAVE STATUS;
-Slave_IO_State	Master_Host	Master_User	Master_Port	Connect_Retry	Master_Log_File	Read_Master_Log_Pos	Relay_Log_File	Relay_Log_Pos	Relay_Master_Log_File	Slave_IO_Running	Slave_SQL_Running	Replicate_Do_DB	Replicate_Ignore_DB	Replicate_Do_Table	Replicate_Ignore_Table	Replicate_Wild_Do_Table	Replicate_Wild_Ignore_Table	Last_Errno	Last_Error	Skip_Counter	Exec_Master_Log_Pos	Relay_Log_Space	Until_Condition	Until_Log_File	Until_Log_Pos	Master_SSL_Allowed	Master_SSL_CA_File	Master_SSL_CA_Path	Master_SSL_Cert	Master_SSL_Cipher	Master_SSL_Key	Seconds_Behind_Master	Master_SSL_Verify_Server_Cert	Last_IO_Errno	Last_IO_Error	Last_SQL_Errno	Last_SQL_Error
+SHOW SLAVE STATUS;;
 SHOW SLAVE HOSTS;
 Server_id	Host	Port	Rpl_recovery_rank	Master_id
 2	127.0.0.1	SLAVE_PORT	0	1

=== modified file 'mysql-test/suite/engines/funcs/r/rpl_change_master.result'
--- a/mysql-test/suite/engines/funcs/r/rpl_change_master.result	2010-03-18 06:42:07 +0000
+++ b/mysql-test/suite/engines/funcs/r/rpl_change_master.result	2010-05-24 13:54:08 +0000
@@ -11,13 +11,7 @@ stop slave sql_thread;
 insert into t1 values(1);
 insert into t1 values(2);
 stop slave;
-show slave status;
-Slave_IO_State	Master_Host	Master_User	Master_Port	Connect_Retry	Master_Log_File	Read_Master_Log_Pos	Relay_Log_File	Relay_Log_Pos	Relay_Master_Log_File	Slave_IO_Running	Slave_SQL_Running	Replicate_Do_DB	Replicate_Ignore_DB	Replicate_Do_Table	Replicate_Ignore_Table	Replicate_Wild_Do_Table	Replicate_Wild_Ignore_Table	Last_Errno	Last_Error	Skip_Counter	Exec_Master_Log_Pos	Relay_Log_Space	Until_Condition	Until_Log_File	Until_Log_Pos	Master_SSL_Allowed	Master_SSL_CA_File	Master_SSL_CA_Path	Master_SSL_Cert	Master_SSL_Cipher	Master_SSL_Key	Seconds_Behind_Master	Master_SSL_Verify_Server_Cert	Last_IO_Errno	Last_IO_Error	Last_SQL_Errno	Last_SQL_Error
-#	127.0.0.1	root	MASTER_MYPORT	1	master-bin.000001	#	#	#	master-bin.000001	No	No							0		0	191	#	None		0	No						#	No	0		0	
 change master to master_user='root';
-show slave status;
-Slave_IO_State	Master_Host	Master_User	Master_Port	Connect_Retry	Master_Log_File	Read_Master_Log_Pos	Relay_Log_File	Relay_Log_Pos	Relay_Master_Log_File	Slave_IO_Running	Slave_SQL_Running	Replicate_Do_DB	Replicate_Ignore_DB	Replicate_Do_Table	Replicate_Ignore_Table	Replicate_Wild_Do_Table	Replicate_Wild_Ignore_Table	Last_Errno	Last_Error	Skip_Counter	Exec_Master_Log_Pos	Relay_Log_Space	Until_Condition	Until_Log_File	Until_Log_Pos	Master_SSL_Allowed	Master_SSL_CA_File	Master_SSL_CA_Path	Master_SSL_Cert	Master_SSL_Cipher	Master_SSL_Key	Seconds_Behind_Master	Master_SSL_Verify_Server_Cert	Last_IO_Errno	Last_IO_Error	Last_SQL_Errno	Last_SQL_Error
-#	127.0.0.1	root	MASTER_MYPORT	1	master-bin.000001	#	#	#	master-bin.000001	No	No							0		0	191	#	None		0	No						#	No	0		0	
 start slave;
 select * from t1;
 n

=== modified file 'mysql-test/suite/engines/funcs/r/rpl_empty_master_crash.result'
--- a/mysql-test/suite/engines/funcs/r/rpl_empty_master_crash.result	2010-03-18 06:42:07 +0000
+++ b/mysql-test/suite/engines/funcs/r/rpl_empty_master_crash.result	2010-05-24 13:54:08 +0000
@@ -4,8 +4,6 @@ reset master;
 reset slave;
 drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
 start slave;
-show slave status;
-Slave_IO_State	Master_Host	Master_User	Master_Port	Connect_Retry	Master_Log_File	Read_Master_Log_Pos	Relay_Log_File	Relay_Log_Pos	Relay_Master_Log_File	Slave_IO_Running	Slave_SQL_Running	Replicate_Do_DB	Replicate_Ignore_DB	Replicate_Do_Table	Replicate_Ignore_Table	Replicate_Wild_Do_Table	Replicate_Wild_Ignore_Table	Last_Errno	Last_Error	Skip_Counter	Exec_Master_Log_Pos	Relay_Log_Space	Until_Condition	Until_Log_File	Until_Log_Pos	Master_SSL_Allowed	Master_SSL_CA_File	Master_SSL_CA_Path	Master_SSL_Cert	Master_SSL_Cipher	Master_SSL_Key	Seconds_Behind_Master	Master_SSL_Verify_Server_Cert	Last_IO_Errno	Last_IO_Error	Last_SQL_Errno	Last_SQL_Error
 load table t1 from master;
 ERROR 08S01: Error connecting to master: Master is not configured
 load table t1 from master;

=== modified file 'mysql-test/suite/engines/funcs/r/rpl_flushlog_loop.result'
--- a/mysql-test/suite/engines/funcs/r/rpl_flushlog_loop.result	2010-03-18 06:42:07 +0000
+++ b/mysql-test/suite/engines/funcs/r/rpl_flushlog_loop.result	2010-05-24 13:54:08 +0000
@@ -17,43 +17,6 @@ let $result_pattern= '%127.0.0.1%root%sl
 
 --source include/wait_slave_status.inc
 flush logs;
-SHOW SLAVE STATUS;
-Slave_IO_State	#
-Master_Host	127.0.0.1
-Master_User	root
-Master_Port	SLAVE_PORT
-Connect_Retry	60
-Master_Log_File	slave-bin.000001
-Read_Master_Log_Pos	106
-Relay_Log_File	#
-Relay_Log_Pos	#
-Relay_Master_Log_File	slave-bin.000001
-Slave_IO_Running	Yes
-Slave_SQL_Running	Yes
-Replicate_Do_DB	
-Replicate_Ignore_DB	
-Replicate_Do_Table	
-Replicate_Ignore_Table	#
-Replicate_Wild_Do_Table	
-Replicate_Wild_Ignore_Table	
-Last_Errno	0
-Last_Error	
-Skip_Counter	0
-Exec_Master_Log_Pos	106
-Relay_Log_Space	#
-Until_Condition	None
-Until_Log_File	
-Until_Log_Pos	0
-Master_SSL_Allowed	No
-Master_SSL_CA_File	
-Master_SSL_CA_Path	
-Master_SSL_Cert	
-Master_SSL_Cipher	
-Master_SSL_Key	
-Seconds_Behind_Master	#
-Master_SSL_Verify_Server_Cert	No
-Last_IO_Errno	0
-Last_IO_Error	
-Last_SQL_Errno	0
-Last_SQL_Error	
+Relay_Log_File	mysqld-relay-bin.000003
+Checking that both slave threads are running.
 STOP SLAVE;

=== modified file 'mysql-test/suite/engines/funcs/r/rpl_loaddata_s.result'
--- a/mysql-test/suite/engines/funcs/r/rpl_loaddata_s.result	2010-03-18 06:42:07 +0000
+++ b/mysql-test/suite/engines/funcs/r/rpl_loaddata_s.result	2010-05-24 13:54:08 +0000
@@ -10,6 +10,6 @@ load data infile '../../std_data/rpl_loa
 select count(*) from test.t1;
 count(*)
 2
-show binlog events from 106;
+show binlog events from <binlog_start>;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 drop table test.t1;

=== modified file 'mysql-test/suite/engines/funcs/r/rpl_log_pos.result'
--- a/mysql-test/suite/engines/funcs/r/rpl_log_pos.result	2010-03-18 06:42:07 +0000
+++ b/mysql-test/suite/engines/funcs/r/rpl_log_pos.result	2010-05-24 13:54:08 +0000
@@ -4,39 +4,23 @@ reset master;
 reset slave;
 drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
 start slave;
-show master status;
-File	Position	Binlog_Do_DB	Binlog_Ignore_DB
-master-bin.000001	106	<Binlog_Ignore_DB>	
-show slave status;
-Slave_IO_State	Master_Host	Master_User	Master_Port	Connect_Retry	Master_Log_File	Read_Master_Log_Pos	Relay_Log_File	Relay_Log_Pos	Relay_Master_Log_File	Slave_IO_Running	Slave_SQL_Running	Replicate_Do_DB	Replicate_Ignore_DB	Replicate_Do_Table	Replicate_Ignore_Table	Replicate_Wild_Do_Table	Replicate_Wild_Ignore_Table	Last_Errno	Last_Error	Skip_Counter	Exec_Master_Log_Pos	Relay_Log_Space	Until_Condition	Until_Log_File	Until_Log_Pos	Master_SSL_Allowed	Master_SSL_CA_File	Master_SSL_CA_Path	Master_SSL_Cert	Master_SSL_Cipher	Master_SSL_Key	Seconds_Behind_Master	Master_SSL_Verify_Server_Cert	Last_IO_Errno	Last_IO_Error	Last_SQL_Errno	Last_SQL_Error
-#	127.0.0.1	root	MASTER_PORT	1	master-bin.000001	106	#	#	master-bin.000001	Yes	Yes							0		0	106	#	None		0	No						#	No	0		0	
 stop slave;
-change master to master_log_pos=106;
+change master to master_log_pos=MASTER_LOG_POS;
 start slave;
 stop slave;
-change master to master_log_pos=106;
-show slave status;
-Slave_IO_State	Master_Host	Master_User	Master_Port	Connect_Retry	Master_Log_File	Read_Master_Log_Pos	Relay_Log_File	Relay_Log_Pos	Relay_Master_Log_File	Slave_IO_Running	Slave_SQL_Running	Replicate_Do_DB	Replicate_Ignore_DB	Replicate_Do_Table	Replicate_Ignore_Table	Replicate_Wild_Do_Table	Replicate_Wild_Ignore_Table	Last_Errno	Last_Error	Skip_Counter	Exec_Master_Log_Pos	Relay_Log_Space	Until_Condition	Until_Log_File	Until_Log_Pos	Master_SSL_Allowed	Master_SSL_CA_File	Master_SSL_CA_Path	Master_SSL_Cert	Master_SSL_Cipher	Master_SSL_Key	Seconds_Behind_Master	Master_SSL_Verify_Server_Cert	Last_IO_Errno	Last_IO_Error	Last_SQL_Errno	Last_SQL_Error
-#	127.0.0.1	root	MASTER_PORT	1	master-bin.000001	106	#	#	master-bin.000001	No	No							0		0	106	#	None		0	No						#	No	0		0	
+change master to master_log_pos=MASTER_LOG_POS;
 start slave;
-show slave status;
-Slave_IO_State	Master_Host	Master_User	Master_Port	Connect_Retry	Master_Log_File	Read_Master_Log_Pos	Relay_Log_File	Relay_Log_Pos	Relay_Master_Log_File	Slave_IO_Running	Slave_SQL_Running	Replicate_Do_DB	Replicate_Ignore_DB	Replicate_Do_Table	Replicate_Ignore_Table	Replicate_Wild_Do_Table	Replicate_Wild_Ignore_Table	Last_Errno	Last_Error	Skip_Counter	Exec_Master_Log_Pos	Relay_Log_Space	Until_Condition	Until_Log_File	Until_Log_Pos	Master_SSL_Allowed	Master_SSL_CA_File	Master_SSL_CA_Path	Master_SSL_Cert	Master_SSL_Cipher	Master_SSL_Key	Seconds_Behind_Master	Master_SSL_Verify_Server_Cert	Last_IO_Errno	Last_IO_Error	Last_SQL_Errno	Last_SQL_Error
-#	127.0.0.1	root	MASTER_PORT	1	master-bin.000001	106	#	#	master-bin.000001	Yes	Yes							0		0	106	#	None		0	No						#	No	0		0	
 stop slave;
-change master to master_log_pos=177;
+# impossible position leads to an error
+change master to master_log_pos=MASTER_LOG_POS;
 start slave;
-show slave status;
-Slave_IO_State	Master_Host	Master_User	Master_Port	Connect_Retry	Master_Log_File	Read_Master_Log_Pos	Relay_Log_File	Relay_Log_Pos	Relay_Master_Log_File	Slave_IO_Running	Slave_SQL_Running	Replicate_Do_DB	Replicate_Ignore_DB	Replicate_Do_Table	Replicate_Ignore_Table	Replicate_Wild_Do_Table	Replicate_Wild_Ignore_Table	Last_Errno	Last_Error	Skip_Counter	Exec_Master_Log_Pos	Relay_Log_Space	Until_Condition	Until_Log_File	Until_Log_Pos	Master_SSL_Allowed	Master_SSL_CA_File	Master_SSL_CA_Path	Master_SSL_Cert	Master_SSL_Cipher	Master_SSL_Key	Seconds_Behind_Master	Master_SSL_Verify_Server_Cert	Last_IO_Errno	Last_IO_Error	Last_SQL_Errno	Last_SQL_Error
-#	127.0.0.1	root	MASTER_PORT	1	master-bin.000001	177	#	#	master-bin.000001	No	Yes							0		0	177	#	None		0	No						#	No	1236	Got fatal error 1236 from master when reading data from binary log: 'Client requested master to start replication from impossible position'	0	
-show master status;
-File	Position	Binlog_Do_DB	Binlog_Ignore_DB
-master-bin.000001	106	<Binlog_Ignore_DB>	
+Last_IO_Error = Got fatal error 1236 from master when reading data from binary log: 'Client requested master to start replication from impossible position'
 create table if not exists t1 (n int);
 drop table if exists t1;
 create table t1 (n int);
 insert into t1 values (1),(2),(3);
 stop slave;
-change master to master_log_pos=206;
+change master to master_log_pos=MASTER_LOG_POS;
 start slave;
 select * from t1 ORDER BY n;
 n

=== modified file 'mysql-test/suite/engines/funcs/r/rpl_rbr_to_sbr.result'
--- a/mysql-test/suite/engines/funcs/r/rpl_rbr_to_sbr.result	2010-03-18 06:42:07 +0000
+++ b/mysql-test/suite/engines/funcs/r/rpl_rbr_to_sbr.result	2010-05-24 13:54:08 +0000
@@ -14,47 +14,16 @@ MIXED	MIXED
 CREATE TABLE t1 (a INT, b LONG);
 INSERT INTO t1 VALUES (1,1), (2,2);
 INSERT INTO t1 VALUES (3,UUID()), (4,UUID());
-SHOW BINLOG EVENTS;
+show binlog events from <binlog_start>;
 **** On Slave ****
-SHOW SLAVE STATUS;
-Slave_IO_State	#
-Master_Host	127.0.0.1
-Master_User	root
-Master_Port	MASTER_PORT
-Connect_Retry	1
-Master_Log_File	master-bin.000001
-Read_Master_Log_Pos	#
-Relay_Log_File	#
-Relay_Log_Pos	#
-Relay_Master_Log_File	master-bin.000001
-Slave_IO_Running	Yes
-Slave_SQL_Running	Yes
-Replicate_Do_DB	
-Replicate_Ignore_DB	
-Replicate_Do_Table	
-Replicate_Ignore_Table	
-Replicate_Wild_Do_Table	
-Replicate_Wild_Ignore_Table	
-Last_Errno	0
-Last_Error	
-Skip_Counter	0
-Exec_Master_Log_Pos	#
-Relay_Log_Space	#
-Until_Condition	None
-Until_Log_File	
-Until_Log_Pos	0
-Master_SSL_Allowed	No
-Master_SSL_CA_File	
-Master_SSL_CA_Path	
-Master_SSL_Cert	
-Master_SSL_Cipher	
-Master_SSL_Key	
-Seconds_Behind_Master	#
-Master_SSL_Verify_Server_Cert	No
-Last_IO_Errno	0
-Last_IO_Error	
-Last_SQL_Errno	0
-Last_SQL_Error	
-SHOW BINLOG EVENTS;
+show binlog events from <binlog_start>;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+slave-bin.000001	#	Query	#	#	use `test`; CREATE TABLE t1 (a INT, b LONG)
+slave-bin.000001	#	Query	#	#	use `test`; INSERT INTO t1 VALUES (1,1), (2,2)
+slave-bin.000001	#	Query	#	#	BEGIN
+slave-bin.000001	#	Table_map	#	#	table_id: # (test.t1)
+slave-bin.000001	#	Write_rows	#	#	table_id: # flags: STMT_END_F
+slave-bin.000001	#	Query	#	#	COMMIT
+show binlog events from <binlog_start>;
 DROP TABLE IF EXISTS t1;
 SET GLOBAL BINLOG_FORMAT=@saved_binlog_format;

=== modified file 'mysql-test/suite/engines/funcs/r/rpl_row_drop.result'
--- a/mysql-test/suite/engines/funcs/r/rpl_row_drop.result	2010-03-18 06:42:07 +0000
+++ b/mysql-test/suite/engines/funcs/r/rpl_row_drop.result	2010-05-24 13:54:08 +0000
@@ -41,12 +41,11 @@ t1
 t2
 **** On Master ****
 DROP TABLE t1,t2;
-SHOW BINLOG EVENTS;
+show binlog events from <binlog_start>;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	4	Format_desc	1	106	Server ver: VERSION, Binlog ver: 4
-master-bin.000001	106	Query	1	192	use `test`; CREATE TABLE t1 (a int)
-master-bin.000001	192	Query	1	278	use `test`; CREATE TABLE t2 (a int)
-master-bin.000001	278	Query	1	382	use `test`; DROP TABLE `t1` /* generated by server */
+master-bin.000001	#	Query	#	#	use `test`; CREATE TABLE t1 (a int)
+master-bin.000001	#	Query	#	#	use `test`; CREATE TABLE t2 (a int)
+master-bin.000001	#	Query	#	#	use `test`; DROP TABLE `t1` /* generated by server */
 SHOW TABLES;
 Tables_in_test
 t2

=== modified file 'mysql-test/suite/engines/funcs/r/rpl_row_inexist_tbl.result'
--- a/mysql-test/suite/engines/funcs/r/rpl_row_inexist_tbl.result	2010-03-18 06:42:07 +0000
+++ b/mysql-test/suite/engines/funcs/r/rpl_row_inexist_tbl.result	2010-05-24 13:54:08 +0000
@@ -17,43 +17,5 @@ a
 0
 drop table t1;
 insert into t1 values (1);
-show slave status;
-Slave_IO_State	#
-Master_Host	127.0.0.1
-Master_User	root
-Master_Port	MASTER_MYPORT
-Connect_Retry	1
-Master_Log_File	master-bin.000001
-Read_Master_Log_Pos	#
-Relay_Log_File	#
-Relay_Log_Pos	#
-Relay_Master_Log_File	master-bin.000001
-Slave_IO_Running	Yes
-Slave_SQL_Running	No
-Replicate_Do_DB	
-Replicate_Ignore_DB	
-Replicate_Do_Table	
-Replicate_Ignore_Table	test.t2
-Replicate_Wild_Do_Table	
-Replicate_Wild_Ignore_Table	
-Last_Errno	1146
-Last_Error	Error 'Table 'test.t1' doesn't exist' on opening tables
-Skip_Counter	0
-Exec_Master_Log_Pos	#
-Relay_Log_Space	#
-Until_Condition	None
-Until_Log_File	
-Until_Log_Pos	0
-Master_SSL_Allowed	No
-Master_SSL_CA_File	
-Master_SSL_CA_Path	
-Master_SSL_Cert	
-Master_SSL_Cipher	
-Master_SSL_Key	
-Seconds_Behind_Master	#
-Master_SSL_Verify_Server_Cert	No
-Last_IO_Errno	0
-Last_IO_Error	
-Last_SQL_Errno	1146
-Last_SQL_Error	Error 'Table 'test.t1' doesn't exist' on opening tables
+Last_SQL_Error = Error 'Table 'test.t1' doesn't exist' on opening tables
 drop table t1, t2;

=== modified file 'mysql-test/suite/engines/funcs/r/rpl_row_max_relay_size.result'
--- a/mysql-test/suite/engines/funcs/r/rpl_row_max_relay_size.result	2010-03-18 06:42:07 +0000
+++ b/mysql-test/suite/engines/funcs/r/rpl_row_max_relay_size.result	2010-05-24 13:54:08 +0000
@@ -24,45 +24,7 @@ select @@global.max_relay_log_size;
 @@global.max_relay_log_size
 4096
 start slave;
-SHOW SLAVE STATUS;
-Slave_IO_State	#
-Master_Host	127.0.0.1
-Master_User	root
-Master_Port	MASTER_PORT
-Connect_Retry	1
-Master_Log_File	master-bin.000001
-Read_Master_Log_Pos	#
-Relay_Log_File	#
-Relay_Log_Pos	#
-Relay_Master_Log_File	master-bin.000001
-Slave_IO_Running	Yes
-Slave_SQL_Running	Yes
-Replicate_Do_DB	
-Replicate_Ignore_DB	
-Replicate_Do_Table	
-Replicate_Ignore_Table	#
-Replicate_Wild_Do_Table	
-Replicate_Wild_Ignore_Table	
-Last_Errno	0
-Last_Error	
-Skip_Counter	0
-Exec_Master_Log_Pos	#
-Relay_Log_Space	#
-Until_Condition	None
-Until_Log_File	
-Until_Log_Pos	0
-Master_SSL_Allowed	No
-Master_SSL_CA_File	
-Master_SSL_CA_Path	
-Master_SSL_Cert	
-Master_SSL_Cipher	
-Master_SSL_Key	
-Seconds_Behind_Master	#
-Master_SSL_Verify_Server_Cert	No
-Last_IO_Errno	#
-Last_IO_Error	#
-Last_SQL_Errno	0
-Last_SQL_Error	
+Checking that both slave threads are running.
 #
 # Test 2
 #
@@ -72,45 +34,7 @@ set global max_relay_log_size=(5*4096);
 select @@global.max_relay_log_size;
 @@global.max_relay_log_size	20480
 start slave;
-SHOW SLAVE STATUS;
-Slave_IO_State	#
-Master_Host	127.0.0.1
-Master_User	root
-Master_Port	MASTER_PORT
-Connect_Retry	1
-Master_Log_File	master-bin.000001
-Read_Master_Log_Pos	#
-Relay_Log_File	#
-Relay_Log_Pos	#
-Relay_Master_Log_File	master-bin.000001
-Slave_IO_Running	Yes
-Slave_SQL_Running	Yes
-Replicate_Do_DB	
-Replicate_Ignore_DB	
-Replicate_Do_Table	
-Replicate_Ignore_Table	#
-Replicate_Wild_Do_Table	
-Replicate_Wild_Ignore_Table	
-Last_Errno	0
-Last_Error	
-Skip_Counter	0
-Exec_Master_Log_Pos	#
-Relay_Log_Space	#
-Until_Condition	None
-Until_Log_File	
-Until_Log_Pos	0
-Master_SSL_Allowed	No
-Master_SSL_CA_File	
-Master_SSL_CA_Path	
-Master_SSL_Cert	
-Master_SSL_Cipher	
-Master_SSL_Key	
-Seconds_Behind_Master	#
-Master_SSL_Verify_Server_Cert	No
-Last_IO_Errno	#
-Last_IO_Error	#
-Last_SQL_Errno	0
-Last_SQL_Error	
+Checking that both slave threads are running.
 #
 # Test 3: max_relay_log_size = 0
 #
@@ -120,90 +44,13 @@ set global max_relay_log_size=0;
 select @@global.max_relay_log_size;
 @@global.max_relay_log_size	0
 start slave;
-SHOW SLAVE STATUS;
-Slave_IO_State	#
-Master_Host	127.0.0.1
-Master_User	root
-Master_Port	MASTER_PORT
-Connect_Retry	1
-Master_Log_File	master-bin.000001
-Read_Master_Log_Pos	#
-Relay_Log_File	#
-Relay_Log_Pos	#
-Relay_Master_Log_File	master-bin.000001
-Slave_IO_Running	Yes
-Slave_SQL_Running	Yes
-Replicate_Do_DB	
-Replicate_Ignore_DB	
-Replicate_Do_Table	
-Replicate_Ignore_Table	#
-Replicate_Wild_Do_Table	
-Replicate_Wild_Ignore_Table	
-Last_Errno	0
-Last_Error	
-Skip_Counter	0
-Exec_Master_Log_Pos	#
-Relay_Log_Space	#
-Until_Condition	None
-Until_Log_File	
-Until_Log_Pos	0
-Master_SSL_Allowed	No
-Master_SSL_CA_File	
-Master_SSL_CA_Path	
-Master_SSL_Cert	
-Master_SSL_Cipher	
-Master_SSL_Key	
-Seconds_Behind_Master	#
-Master_SSL_Verify_Server_Cert	No
-Last_IO_Errno	#
-Last_IO_Error	#
-Last_SQL_Errno	0
-Last_SQL_Error	
+Checking that both slave threads are running.
 #
 # Test 4: Tests below are mainly to ensure that we have not coded with wrong assumptions
 #
 stop slave;
 reset slave;
 flush logs;
-SHOW SLAVE STATUS;
-Slave_IO_State	#
-Master_Host	127.0.0.1
-Master_User	root
-Master_Port	MASTER_PORT
-Connect_Retry	1
-Master_Log_File	
-Read_Master_Log_Pos	#
-Relay_Log_File	#
-Relay_Log_Pos	#
-Relay_Master_Log_File	
-Slave_IO_Running	No
-Slave_SQL_Running	No
-Replicate_Do_DB	
-Replicate_Ignore_DB	
-Replicate_Do_Table	
-Replicate_Ignore_Table	#
-Replicate_Wild_Do_Table	
-Replicate_Wild_Ignore_Table	
-Last_Errno	0
-Last_Error	
-Skip_Counter	0
-Exec_Master_Log_Pos	#
-Relay_Log_Space	#
-Until_Condition	None
-Until_Log_File	
-Until_Log_Pos	0
-Master_SSL_Allowed	No
-Master_SSL_CA_File	
-Master_SSL_CA_Path	
-Master_SSL_Cert	
-Master_SSL_Cipher	
-Master_SSL_Key	
-Seconds_Behind_Master	#
-Master_SSL_Verify_Server_Cert	No
-Last_IO_Errno	#
-Last_IO_Error	#
-Last_SQL_Errno	0
-Last_SQL_Error	
 #
 # Test 5
 #
@@ -211,89 +58,13 @@ reset slave;
 start slave;
 flush logs;
 create table t1 (a int);
-SHOW SLAVE STATUS;
-Slave_IO_State	#
-Master_Host	127.0.0.1
-Master_User	root
-Master_Port	MASTER_PORT
-Connect_Retry	1
-Master_Log_File	master-bin.000001
-Read_Master_Log_Pos	#
-Relay_Log_File	#
-Relay_Log_Pos	#
-Relay_Master_Log_File	master-bin.000001
-Slave_IO_Running	Yes
-Slave_SQL_Running	Yes
-Replicate_Do_DB	
-Replicate_Ignore_DB	
-Replicate_Do_Table	
-Replicate_Ignore_Table	#
-Replicate_Wild_Do_Table	
-Replicate_Wild_Ignore_Table	
-Last_Errno	0
-Last_Error	
-Skip_Counter	0
-Exec_Master_Log_Pos	#
-Relay_Log_Space	#
-Until_Condition	None
-Until_Log_File	
-Until_Log_Pos	0
-Master_SSL_Allowed	No
-Master_SSL_CA_File	
-Master_SSL_CA_Path	
-Master_SSL_Cert	
-Master_SSL_Cipher	
-Master_SSL_Key	
-Seconds_Behind_Master	#
-Master_SSL_Verify_Server_Cert	No
-Last_IO_Errno	#
-Last_IO_Error	#
-Last_SQL_Errno	0
-Last_SQL_Error	
+Checking that both slave threads are running.
 #
 # Test 6: one more rotation, to be sure Relay_Log_Space is correctly updated
 #
 flush logs;
 drop table t1;
-SHOW SLAVE STATUS;
-Slave_IO_State	#
-Master_Host	127.0.0.1
-Master_User	root
-Master_Port	MASTER_PORT
-Connect_Retry	1
-Master_Log_File	master-bin.000001
-Read_Master_Log_Pos	#
-Relay_Log_File	#
-Relay_Log_Pos	#
-Relay_Master_Log_File	master-bin.000001
-Slave_IO_Running	Yes
-Slave_SQL_Running	Yes
-Replicate_Do_DB	
-Replicate_Ignore_DB	
-Replicate_Do_Table	
-Replicate_Ignore_Table	#
-Replicate_Wild_Do_Table	
-Replicate_Wild_Ignore_Table	
-Last_Errno	0
-Last_Error	
-Skip_Counter	0
-Exec_Master_Log_Pos	#
-Relay_Log_Space	#
-Until_Condition	None
-Until_Log_File	
-Until_Log_Pos	0
-Master_SSL_Allowed	No
-Master_SSL_CA_File	
-Master_SSL_CA_Path	
-Master_SSL_Cert	
-Master_SSL_Cipher	
-Master_SSL_Key	
-Seconds_Behind_Master	#
-Master_SSL_Verify_Server_Cert	No
-Last_IO_Errno	#
-Last_IO_Error	#
-Last_SQL_Errno	0
-Last_SQL_Error	
+Checking that both slave threads are running.
 flush logs;
 show master status;
 File	Position	Binlog_Do_DB	Binlog_Ignore_DB

=== modified file 'mysql-test/suite/engines/funcs/r/rpl_row_reset_slave.result'
--- a/mysql-test/suite/engines/funcs/r/rpl_row_reset_slave.result	2010-03-18 06:42:07 +0000
+++ b/mysql-test/suite/engines/funcs/r/rpl_row_reset_slave.result	2010-05-24 13:54:08 +0000
@@ -4,196 +4,37 @@ reset master;
 reset slave;
 drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
 start slave;
-SHOW SLAVE STATUS;
-Slave_IO_State	#
-Master_Host	127.0.0.1
 Master_User	root
-Master_Port	MASTER_PORT
-Connect_Retry	1
-Master_Log_File	master-bin.000001
-Read_Master_Log_Pos	#
-Relay_Log_File	#
-Relay_Log_Pos	#
-Relay_Master_Log_File	master-bin.000001
-Slave_IO_Running	Yes
-Slave_SQL_Running	Yes
-Replicate_Do_DB	
-Replicate_Ignore_DB	
-Replicate_Do_Table	
-Replicate_Ignore_Table	#
-Replicate_Wild_Do_Table	
-Replicate_Wild_Ignore_Table	
-Last_Errno	0
-Last_Error	
-Skip_Counter	0
-Exec_Master_Log_Pos	#
-Relay_Log_Space	#
-Until_Condition	None
-Until_Log_File	
-Until_Log_Pos	0
-Master_SSL_Allowed	No
-Master_SSL_CA_File	
-Master_SSL_CA_Path	
-Master_SSL_Cert	
-Master_SSL_Cipher	
-Master_SSL_Key	
-Seconds_Behind_Master	#
-Master_SSL_Verify_Server_Cert	No
-Last_IO_Errno	#
-Last_IO_Error	#
-Last_SQL_Errno	0
-Last_SQL_Error	
-stop slave;
-change master to master_user='test';
-SHOW SLAVE STATUS;
-Slave_IO_State	#
 Master_Host	127.0.0.1
+include/stop_slave.inc
+change master to master_user='test';
 Master_User	test
-Master_Port	MASTER_PORT
-Connect_Retry	1
-Master_Log_File	master-bin.000001
-Read_Master_Log_Pos	#
-Relay_Log_File	#
-Relay_Log_Pos	#
-Relay_Master_Log_File	master-bin.000001
-Slave_IO_Running	No
-Slave_SQL_Running	No
-Replicate_Do_DB	
-Replicate_Ignore_DB	
-Replicate_Do_Table	
-Replicate_Ignore_Table	#
-Replicate_Wild_Do_Table	
-Replicate_Wild_Ignore_Table	
-Last_Errno	0
-Last_Error	
-Skip_Counter	0
-Exec_Master_Log_Pos	#
-Relay_Log_Space	#
-Until_Condition	None
-Until_Log_File	
-Until_Log_Pos	0
-Master_SSL_Allowed	No
-Master_SSL_CA_File	
-Master_SSL_CA_Path	
-Master_SSL_Cert	
-Master_SSL_Cipher	
-Master_SSL_Key	
-Seconds_Behind_Master	#
-Master_SSL_Verify_Server_Cert	No
-Last_IO_Errno	#
-Last_IO_Error	#
-Last_SQL_Errno	0
-Last_SQL_Error	
-reset slave;
-SHOW SLAVE STATUS;
-Slave_IO_State	#
 Master_Host	127.0.0.1
+reset slave;
 Master_User	root
-Master_Port	MASTER_PORT
-Connect_Retry	1
-Master_Log_File	
-Read_Master_Log_Pos	#
-Relay_Log_File	#
-Relay_Log_Pos	#
-Relay_Master_Log_File	
-Slave_IO_Running	No
-Slave_SQL_Running	No
-Replicate_Do_DB	
-Replicate_Ignore_DB	
-Replicate_Do_Table	
-Replicate_Ignore_Table	#
-Replicate_Wild_Do_Table	
-Replicate_Wild_Ignore_Table	
-Last_Errno	0
-Last_Error	
-Skip_Counter	0
-Exec_Master_Log_Pos	#
-Relay_Log_Space	#
-Until_Condition	None
-Until_Log_File	
-Until_Log_Pos	0
-Master_SSL_Allowed	No
-Master_SSL_CA_File	
-Master_SSL_CA_Path	
-Master_SSL_Cert	
-Master_SSL_Cipher	
-Master_SSL_Key	
-Seconds_Behind_Master	#
-Master_SSL_Verify_Server_Cert	No
-Last_IO_Errno	#
-Last_IO_Error	#
-Last_SQL_Errno	0
-Last_SQL_Error	
-start slave;
-SHOW SLAVE STATUS;
-Slave_IO_State	#
 Master_Host	127.0.0.1
+include/start_slave.inc
 Master_User	root
-Master_Port	MASTER_PORT
-Connect_Retry	1
-Master_Log_File	master-bin.000001
-Read_Master_Log_Pos	#
-Relay_Log_File	#
-Relay_Log_Pos	#
-Relay_Master_Log_File	master-bin.000001
-Slave_IO_Running	Yes
-Slave_SQL_Running	Yes
-Replicate_Do_DB	
-Replicate_Ignore_DB	
-Replicate_Do_Table	
-Replicate_Ignore_Table	#
-Replicate_Wild_Do_Table	
-Replicate_Wild_Ignore_Table	
-Last_Errno	0
-Last_Error	
-Skip_Counter	0
-Exec_Master_Log_Pos	#
-Relay_Log_Space	#
-Until_Condition	None
-Until_Log_File	
-Until_Log_Pos	0
-Master_SSL_Allowed	No
-Master_SSL_CA_File	
-Master_SSL_CA_Path	
-Master_SSL_Cert	
-Master_SSL_Cipher	
-Master_SSL_Key	
-Seconds_Behind_Master	#
-Master_SSL_Verify_Server_Cert	No
-Last_IO_Errno	#
-Last_IO_Error	#
-Last_SQL_Errno	0
-Last_SQL_Error	
-stop slave;
+Master_Host	127.0.0.1
+include/stop_slave.inc
 reset slave;
-start slave;
+include/start_slave.inc
 create temporary table t1 (a int);
-stop slave;
+include/stop_slave.inc
 reset slave;
-start slave;
+include/start_slave.inc
 show status like 'slave_open_temp_tables';
 Variable_name	Value
 Slave_open_temp_tables	0
-stop slave;
+include/stop_slave.inc
 reset slave;
-*** errno must be zero: 0 ***
 change master to master_user='impossible_user_name';
 start slave;
-ONE
-1
 include/stop_slave.inc
 change master to master_user='root';
 include/start_slave.inc
-*** last errno must be  zero: 0 ***
-*** last error must be blank:  ***
 include/stop_slave.inc
 change master to master_user='impossible_user_name';
 start slave;
-ONE
-1
 include/stop_slave.inc
 reset slave;
-*** io  last errno must be  zero: 0  ***
-*** io  last error must be blank:   ***
-*** sql last errno must be  zero: 0 ***
-*** sql last error must be blank:  ***

=== modified file 'mysql-test/suite/engines/funcs/r/rpl_row_until.result'
--- a/mysql-test/suite/engines/funcs/r/rpl_row_until.result	2010-03-18 06:42:07 +0000
+++ b/mysql-test/suite/engines/funcs/r/rpl_row_until.result	2010-05-24 13:54:08 +0000
@@ -12,193 +12,39 @@ create table t2(n int not null auto_incr
 insert into t2 values (1),(2);
 insert into t2 values (3),(4);
 drop table t2;
-start slave until master_log_file='master-bin.000001', master_log_pos=311;
+start slave until master_log_file='master-bin.000001', master_log_pos=MASTER_LOG_POS;
 select * from t1;
 n
 1
 2
 3
 4
-show slave status;
-Slave_IO_State	#
-Master_Host	127.0.0.1
-Master_User	root
-Master_Port	MASTER_MYPORT
-Connect_Retry	1
-Master_Log_File	master-bin.000001
-Read_Master_Log_Pos	#
-Relay_Log_File	slave-relay-bin.000004
-Relay_Log_Pos	#
-Relay_Master_Log_File	master-bin.000001
-Slave_IO_Running	#
-Slave_SQL_Running	No
-Replicate_Do_DB	
-Replicate_Ignore_DB	
-Replicate_Do_Table	
-Replicate_Ignore_Table	
-Replicate_Wild_Do_Table	
-Replicate_Wild_Ignore_Table	
-Last_Errno	0
-Last_Error	
-Skip_Counter	0
-Exec_Master_Log_Pos	#
-Relay_Log_Space	#
-Until_Condition	Master
-Until_Log_File	master-bin.000001
-Until_Log_Pos	311
-Master_SSL_Allowed	No
-Master_SSL_CA_File	
-Master_SSL_CA_Path	
-Master_SSL_Cert	
-Master_SSL_Cipher	
-Master_SSL_Key	
-Seconds_Behind_Master	#
-Master_SSL_Verify_Server_Cert	No
-Last_IO_Errno	0
-Last_IO_Error	
-Last_SQL_Errno	0
-Last_SQL_Error	
-start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291;
+start slave until master_log_file='master-no-such-bin.000001', master_log_pos=MASTER_LOG_POS;
 select * from t1;
-n	1
-n	2
-n	3
-n	4
-show slave status;
-Slave_IO_State	#
-Master_Host	127.0.0.1
-Master_User	root
-Master_Port	MASTER_MYPORT
-Connect_Retry	1
-Master_Log_File	master-bin.000001
-Read_Master_Log_Pos	#
-Relay_Log_File	slave-relay-bin.000004
-Relay_Log_Pos	#
-Relay_Master_Log_File	master-bin.000001
-Slave_IO_Running	#
-Slave_SQL_Running	No
-Replicate_Do_DB	
-Replicate_Ignore_DB	
-Replicate_Do_Table	
-Replicate_Ignore_Table	
-Replicate_Wild_Do_Table	
-Replicate_Wild_Ignore_Table	
-Last_Errno	0
-Last_Error	
-Skip_Counter	0
-Exec_Master_Log_Pos	#
-Relay_Log_Space	#
-Until_Condition	Master
-Until_Log_File	master-no-such-bin.000001
-Until_Log_Pos	291
-Master_SSL_Allowed	No
-Master_SSL_CA_File	
-Master_SSL_CA_Path	
-Master_SSL_Cert	
-Master_SSL_Cipher	
-Master_SSL_Key	
-Seconds_Behind_Master	#
-Master_SSL_Verify_Server_Cert	No
-Last_IO_Errno	0
-Last_IO_Error	
-Last_SQL_Errno	0
-Last_SQL_Error	
-start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=728;
+n
+1
+2
+3
+4
+start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=RELAY_LOG_POS;
 select * from t2;
-show slave status;
-Slave_IO_State	#
-Master_Host	127.0.0.1
-Master_User	root
-Master_Port	MASTER_MYPORT
-Connect_Retry	1
-Master_Log_File	master-bin.000001
-Read_Master_Log_Pos	#
-Relay_Log_File	slave-relay-bin.000004
-Relay_Log_Pos	#
-Relay_Master_Log_File	master-bin.000001
-Slave_IO_Running	#
-Slave_SQL_Running	No
-Replicate_Do_DB	
-Replicate_Ignore_DB	
-Replicate_Do_Table	
-Replicate_Ignore_Table	
-Replicate_Wild_Do_Table	
-Replicate_Wild_Ignore_Table	
-Last_Errno	0
-Last_Error	
-Skip_Counter	0
-Exec_Master_Log_Pos	#
-Relay_Log_Space	#
-Until_Condition	Relay
-Until_Log_File	slave-relay-bin.000004
-Until_Log_Pos	728
-Master_SSL_Allowed	No
-Master_SSL_CA_File	
-Master_SSL_CA_Path	
-Master_SSL_Cert	
-Master_SSL_Cipher	
-Master_SSL_Key	
-Seconds_Behind_Master	#
-Master_SSL_Verify_Server_Cert	No
-Last_IO_Errno	0
-Last_IO_Error	
-Last_SQL_Errno	0
-Last_SQL_Error	
+n
+1
+2
 start slave;
 stop slave;
-start slave until master_log_file='master-bin.000001', master_log_pos=740;
-show slave status;
-Slave_IO_State	#
-Master_Host	127.0.0.1
-Master_User	root
-Master_Port	MASTER_MYPORT
-Connect_Retry	1
-Master_Log_File	master-bin.000001
-Read_Master_Log_Pos	#
-Relay_Log_File	slave-relay-bin.000004
-Relay_Log_Pos	#
-Relay_Master_Log_File	master-bin.000001
-Slave_IO_Running	Yes
-Slave_SQL_Running	No
-Replicate_Do_DB	
-Replicate_Ignore_DB	
-Replicate_Do_Table	
-Replicate_Ignore_Table	
-Replicate_Wild_Do_Table	
-Replicate_Wild_Ignore_Table	
-Last_Errno	0
-Last_Error	
-Skip_Counter	0
-Exec_Master_Log_Pos	#
-Relay_Log_Space	#
-Until_Condition	Master
-Until_Log_File	master-bin.000001
-Until_Log_Pos	740
-Master_SSL_Allowed	No
-Master_SSL_CA_File	
-Master_SSL_CA_Path	
-Master_SSL_Cert	
-Master_SSL_Cipher	
-Master_SSL_Key	
-Seconds_Behind_Master	#
-Master_SSL_Verify_Server_Cert	No
-Last_IO_Errno	0
-Last_IO_Error	
-Last_SQL_Errno	0
-Last_SQL_Error	
-start slave until master_log_file='master-bin', master_log_pos=561;
+start slave until master_log_file='master-bin.000001', master_log_pos=MASTER_LOG_POS;
+start slave until master_log_file='master-bin', master_log_pos=MASTER_LOG_POS;
 ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
-start slave until master_log_file='master-bin.000001', master_log_pos=561, relay_log_pos=12;
+start slave until master_log_file='master-bin.000001', master_log_pos=MASTER_LOG_POS, relay_log_pos=RELAY_LOG_POS;
 ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
 start slave until master_log_file='master-bin.000001';
 ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
 start slave until relay_log_file='slave-relay-bin.000002';
 ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
-start slave until relay_log_file='slave-relay-bin.000002', master_log_pos=561;
+start slave until relay_log_file='slave-relay-bin.000002', master_log_pos=MASTER_LOG_POS;
 ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
 start slave sql_thread;
-start slave until master_log_file='master-bin.000001', master_log_pos=740;
+start slave until master_log_file='master-bin.000001', master_log_pos=MASTER_LOG_POS;
 Warnings:
-Level	Note
-Code	1254
-Message	Slave is already running
+Note	1254	Slave is already running

=== modified file 'mysql-test/suite/engines/funcs/r/rpl_server_id1.result'
--- a/mysql-test/suite/engines/funcs/r/rpl_server_id1.result	2010-03-18 06:42:07 +0000
+++ b/mysql-test/suite/engines/funcs/r/rpl_server_id1.result	2010-05-24 13:54:08 +0000
@@ -8,10 +8,8 @@ create table t1 (n int);
 reset master;
 stop slave;
 change master to master_port=SLAVE_PORT;
-show slave status;
-Slave_IO_State	Master_Host	Master_User	Master_Port	Connect_Retry	Master_Log_File	Read_Master_Log_Pos	Relay_Log_File	Relay_Log_Pos	Relay_Master_Log_File	Slave_IO_Running	Slave_SQL_Running	Replicate_Do_DB	Replicate_Ignore_DB	Replicate_Do_Table	Replicate_Ignore_Table	Replicate_Wild_Do_Table	Replicate_Wild_Ignore_Table	Last_Errno	Last_Error	Skip_Counter	Exec_Master_Log_Pos	Relay_Log_Space	Until_Condition	Until_Log_File	Until_Log_Pos	Master_SSL_Allowed	Master_SSL_CA_File	Master_SSL_CA_Path	Master_SSL_Cert	Master_SSL_Cipher	Master_SSL_Key	Seconds_Behind_Master	Master_SSL_Verify_Server_Cert	Last_IO_Errno	Last_IO_Error	Last_SQL_Errno	Last_SQL_Error
-	127.0.0.1	root	SLAVE_PORT	1		4	slave-relay-bin.000001	4		No	No				#		#	0		0	0	106	None		0	No						NULL	No	0		0	
 start slave;
+Last_IO_Error = Fatal error: The slave I/O thread stops because master and slave have equal MySQL server ids; these ids must be different for replication to work (or the --replicate-same-server-id option must be used on slave but this does not always make sense; please check the manual before using it).
 insert into t1 values (1);
 show status like "slave_running";
 Variable_name	Value

=== modified file 'mysql-test/suite/engines/funcs/r/rpl_server_id2.result'
--- a/mysql-test/suite/engines/funcs/r/rpl_server_id2.result	2010-03-18 06:42:07 +0000
+++ b/mysql-test/suite/engines/funcs/r/rpl_server_id2.result	2010-05-24 13:54:08 +0000
@@ -8,9 +8,6 @@ create table t1 (n int);
 reset master;
 stop slave;
 change master to master_port=SLAVE_PORT;
-show slave status;
-Slave_IO_State	Master_Host	Master_User	Master_Port	Connect_Retry	Master_Log_File	Read_Master_Log_Pos	Relay_Log_File	Relay_Log_Pos	Relay_Master_Log_File	Slave_IO_Running	Slave_SQL_Running	Replicate_Do_DB	Replicate_Ignore_DB	Replicate_Do_Table	Replicate_Ignore_Table	Replicate_Wild_Do_Table	Replicate_Wild_Ignore_Table	Last_Errno	Last_Error	Skip_Counter	Exec_Master_Log_Pos	Relay_Log_Space	Until_Condition	Until_Log_File	Until_Log_Pos	Master_SSL_Allowed	Master_SSL_CA_File	Master_SSL_CA_Path	Master_SSL_Cert	Master_SSL_Cipher	Master_SSL_Key	Seconds_Behind_Master	Master_SSL_Verify_Server_Cert	Last_IO_Errno	Last_IO_Error	Last_SQL_Errno	Last_SQL_Error
-	127.0.0.1	root	SLAVE_PORT	1		4	slave-relay-bin.000001	4		No	No						#	0		0	0	106	None		0	No						NULL	No	0		0	
 start slave;
 insert into t1 values (1);
 select * from t1;

=== modified file 'mysql-test/suite/engines/funcs/r/rpl_slave_status.result'
--- a/mysql-test/suite/engines/funcs/r/rpl_slave_status.result	2010-03-18 06:42:07 +0000
+++ b/mysql-test/suite/engines/funcs/r/rpl_slave_status.result	2010-05-24 13:54:08 +0000
@@ -18,44 +18,5 @@ drop user rpl at 127.0.0.1;
 flush privileges;
 stop slave;
 start slave;
-show slave status;
-Slave_IO_State	#
-Master_Host	127.0.0.1
-Master_User	rpl
-Master_Port	MASTER_MYPORT
-Connect_Retry	1
-Master_Log_File	master-bin.000001
-Read_Master_Log_Pos	#
-Relay_Log_File	#
-Relay_Log_Pos	#
-Relay_Master_Log_File	master-bin.000001
-Slave_IO_Running	No
-Slave_SQL_Running	Yes
-Replicate_Do_DB	
-Replicate_Ignore_DB	
-Replicate_Do_Table	
-Replicate_Ignore_Table	
-Replicate_Wild_Do_Table	
-Replicate_Wild_Ignore_Table	
-Last_Errno	0
-Last_Error	
-Skip_Counter	0
-Exec_Master_Log_Pos	#
-Relay_Log_Space	#
-Until_Condition	None
-Until_Log_File	
-Until_Log_Pos	0
-Master_SSL_Allowed	No
-Master_SSL_CA_File	
-Master_SSL_CA_Path	
-Master_SSL_Cert	
-Master_SSL_Cipher	
-Master_SSL_Key	
-Seconds_Behind_Master	NULL
-Master_SSL_Verify_Server_Cert	No
-Last_IO_Errno	#
-Last_IO_Error	#
-Last_SQL_Errno	0
-Last_SQL_Error	
 drop table t1;
 drop table t1;

=== modified file 'mysql-test/suite/engines/funcs/r/rpl_stm_max_relay_size.result'
--- a/mysql-test/suite/engines/funcs/r/rpl_stm_max_relay_size.result	2010-03-18 06:42:07 +0000
+++ b/mysql-test/suite/engines/funcs/r/rpl_stm_max_relay_size.result	2010-05-24 13:54:08 +0000
@@ -21,45 +21,7 @@ select @@global.max_relay_log_size;
 @@global.max_relay_log_size
 4096
 start slave;
-SHOW SLAVE STATUS;
-Slave_IO_State	#
-Master_Host	127.0.0.1
-Master_User	root
-Master_Port	MASTER_PORT
-Connect_Retry	1
-Master_Log_File	master-bin.000001
-Read_Master_Log_Pos	#
-Relay_Log_File	#
-Relay_Log_Pos	#
-Relay_Master_Log_File	master-bin.000001
-Slave_IO_Running	Yes
-Slave_SQL_Running	Yes
-Replicate_Do_DB	
-Replicate_Ignore_DB	
-Replicate_Do_Table	
-Replicate_Ignore_Table	#
-Replicate_Wild_Do_Table	
-Replicate_Wild_Ignore_Table	
-Last_Errno	0
-Last_Error	
-Skip_Counter	0
-Exec_Master_Log_Pos	#
-Relay_Log_Space	#
-Until_Condition	None
-Until_Log_File	
-Until_Log_Pos	0
-Master_SSL_Allowed	No
-Master_SSL_CA_File	
-Master_SSL_CA_Path	
-Master_SSL_Cert	
-Master_SSL_Cipher	
-Master_SSL_Key	
-Seconds_Behind_Master	#
-Master_SSL_Verify_Server_Cert	No
-Last_IO_Errno	#
-Last_IO_Error	#
-Last_SQL_Errno	0
-Last_SQL_Error	
+Checking that both slave threads are running.
 #
 # Test 2
 #
@@ -69,45 +31,7 @@ set global max_relay_log_size=(5*4096);
 select @@global.max_relay_log_size;
 @@global.max_relay_log_size	20480
 start slave;
-SHOW SLAVE STATUS;
-Slave_IO_State	#
-Master_Host	127.0.0.1
-Master_User	root
-Master_Port	MASTER_PORT
-Connect_Retry	1
-Master_Log_File	master-bin.000001
-Read_Master_Log_Pos	#
-Relay_Log_File	#
-Relay_Log_Pos	#
-Relay_Master_Log_File	master-bin.000001
-Slave_IO_Running	Yes
-Slave_SQL_Running	Yes
-Replicate_Do_DB	
-Replicate_Ignore_DB	
-Replicate_Do_Table	
-Replicate_Ignore_Table	#
-Replicate_Wild_Do_Table	
-Replicate_Wild_Ignore_Table	
-Last_Errno	0
-Last_Error	
-Skip_Counter	0
-Exec_Master_Log_Pos	#
-Relay_Log_Space	#
-Until_Condition	None
-Until_Log_File	
-Until_Log_Pos	0
-Master_SSL_Allowed	No
-Master_SSL_CA_File	
-Master_SSL_CA_Path	
-Master_SSL_Cert	
-Master_SSL_Cipher	
-Master_SSL_Key	
-Seconds_Behind_Master	#
-Master_SSL_Verify_Server_Cert	No
-Last_IO_Errno	#
-Last_IO_Error	#
-Last_SQL_Errno	0
-Last_SQL_Error	
+Checking that both slave threads are running.
 #
 # Test 3: max_relay_log_size = 0
 #
@@ -117,90 +41,13 @@ set global max_relay_log_size=0;
 select @@global.max_relay_log_size;
 @@global.max_relay_log_size	0
 start slave;
-SHOW SLAVE STATUS;
-Slave_IO_State	#
-Master_Host	127.0.0.1
-Master_User	root
-Master_Port	MASTER_PORT
-Connect_Retry	1
-Master_Log_File	master-bin.000001
-Read_Master_Log_Pos	#
-Relay_Log_File	#
-Relay_Log_Pos	#
-Relay_Master_Log_File	master-bin.000001
-Slave_IO_Running	Yes
-Slave_SQL_Running	Yes
-Replicate_Do_DB	
-Replicate_Ignore_DB	
-Replicate_Do_Table	
-Replicate_Ignore_Table	#
-Replicate_Wild_Do_Table	
-Replicate_Wild_Ignore_Table	
-Last_Errno	0
-Last_Error	
-Skip_Counter	0
-Exec_Master_Log_Pos	#
-Relay_Log_Space	#
-Until_Condition	None
-Until_Log_File	
-Until_Log_Pos	0
-Master_SSL_Allowed	No
-Master_SSL_CA_File	
-Master_SSL_CA_Path	
-Master_SSL_Cert	
-Master_SSL_Cipher	
-Master_SSL_Key	
-Seconds_Behind_Master	#
-Master_SSL_Verify_Server_Cert	No
-Last_IO_Errno	#
-Last_IO_Error	#
-Last_SQL_Errno	0
-Last_SQL_Error	
+Checking that both slave threads are running.
 #
 # Test 4: Tests below are mainly to ensure that we have not coded with wrong assumptions
 #
 stop slave;
 reset slave;
 flush logs;
-SHOW SLAVE STATUS;
-Slave_IO_State	#
-Master_Host	127.0.0.1
-Master_User	root
-Master_Port	MASTER_PORT
-Connect_Retry	1
-Master_Log_File	
-Read_Master_Log_Pos	#
-Relay_Log_File	#
-Relay_Log_Pos	#
-Relay_Master_Log_File	
-Slave_IO_Running	No
-Slave_SQL_Running	No
-Replicate_Do_DB	
-Replicate_Ignore_DB	
-Replicate_Do_Table	
-Replicate_Ignore_Table	#
-Replicate_Wild_Do_Table	
-Replicate_Wild_Ignore_Table	
-Last_Errno	0
-Last_Error	
-Skip_Counter	0
-Exec_Master_Log_Pos	#
-Relay_Log_Space	#
-Until_Condition	None
-Until_Log_File	
-Until_Log_Pos	0
-Master_SSL_Allowed	No
-Master_SSL_CA_File	
-Master_SSL_CA_Path	
-Master_SSL_Cert	
-Master_SSL_Cipher	
-Master_SSL_Key	
-Seconds_Behind_Master	#
-Master_SSL_Verify_Server_Cert	No
-Last_IO_Errno	#
-Last_IO_Error	#
-Last_SQL_Errno	0
-Last_SQL_Error	
 #
 # Test 5
 #
@@ -208,89 +55,13 @@ reset slave;
 start slave;
 flush logs;
 create table t1 (a int);
-SHOW SLAVE STATUS;
-Slave_IO_State	#
-Master_Host	127.0.0.1
-Master_User	root
-Master_Port	MASTER_PORT
-Connect_Retry	1
-Master_Log_File	master-bin.000001
-Read_Master_Log_Pos	#
-Relay_Log_File	#
-Relay_Log_Pos	#
-Relay_Master_Log_File	master-bin.000001
-Slave_IO_Running	Yes
-Slave_SQL_Running	Yes
-Replicate_Do_DB	
-Replicate_Ignore_DB	
-Replicate_Do_Table	
-Replicate_Ignore_Table	#
-Replicate_Wild_Do_Table	
-Replicate_Wild_Ignore_Table	
-Last_Errno	0
-Last_Error	
-Skip_Counter	0
-Exec_Master_Log_Pos	#
-Relay_Log_Space	#
-Until_Condition	None
-Until_Log_File	
-Until_Log_Pos	0
-Master_SSL_Allowed	No
-Master_SSL_CA_File	
-Master_SSL_CA_Path	
-Master_SSL_Cert	
-Master_SSL_Cipher	
-Master_SSL_Key	
-Seconds_Behind_Master	#
-Master_SSL_Verify_Server_Cert	No
-Last_IO_Errno	#
-Last_IO_Error	#
-Last_SQL_Errno	0
-Last_SQL_Error	
+Checking that both slave threads are running.
 #
 # Test 6: one more rotation, to be sure Relay_Log_Space is correctly updated
 #
 flush logs;
 drop table t1;
-SHOW SLAVE STATUS;
-Slave_IO_State	#
-Master_Host	127.0.0.1
-Master_User	root
-Master_Port	MASTER_PORT
-Connect_Retry	1
-Master_Log_File	master-bin.000001
-Read_Master_Log_Pos	#
-Relay_Log_File	#
-Relay_Log_Pos	#
-Relay_Master_Log_File	master-bin.000001
-Slave_IO_Running	Yes
-Slave_SQL_Running	Yes
-Replicate_Do_DB	
-Replicate_Ignore_DB	
-Replicate_Do_Table	
-Replicate_Ignore_Table	#
-Replicate_Wild_Do_Table	
-Replicate_Wild_Ignore_Table	
-Last_Errno	0
-Last_Error	
-Skip_Counter	0
-Exec_Master_Log_Pos	#
-Relay_Log_Space	#
-Until_Condition	None
-Until_Log_File	
-Until_Log_Pos	0
-Master_SSL_Allowed	No
-Master_SSL_CA_File	
-Master_SSL_CA_Path	
-Master_SSL_Cert	
-Master_SSL_Cipher	
-Master_SSL_Key	
-Seconds_Behind_Master	#
-Master_SSL_Verify_Server_Cert	No
-Last_IO_Errno	#
-Last_IO_Error	#
-Last_SQL_Errno	0
-Last_SQL_Error	
+Checking that both slave threads are running.
 flush logs;
 show master status;
 File	Position	Binlog_Do_DB	Binlog_Ignore_DB

=== modified file 'mysql-test/suite/engines/funcs/r/rpl_stm_reset_slave.result'
--- a/mysql-test/suite/engines/funcs/r/rpl_stm_reset_slave.result	2010-03-18 06:42:07 +0000
+++ b/mysql-test/suite/engines/funcs/r/rpl_stm_reset_slave.result	2010-05-24 13:54:08 +0000
@@ -4,196 +4,37 @@ reset master;
 reset slave;
 drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
 start slave;
-SHOW SLAVE STATUS;
-Slave_IO_State	#
-Master_Host	127.0.0.1
 Master_User	root
-Master_Port	MASTER_PORT
-Connect_Retry	1
-Master_Log_File	master-bin.000001
-Read_Master_Log_Pos	#
-Relay_Log_File	#
-Relay_Log_Pos	#
-Relay_Master_Log_File	master-bin.000001
-Slave_IO_Running	Yes
-Slave_SQL_Running	Yes
-Replicate_Do_DB	
-Replicate_Ignore_DB	
-Replicate_Do_Table	
-Replicate_Ignore_Table	#
-Replicate_Wild_Do_Table	
-Replicate_Wild_Ignore_Table	
-Last_Errno	0
-Last_Error	
-Skip_Counter	0
-Exec_Master_Log_Pos	#
-Relay_Log_Space	#
-Until_Condition	None
-Until_Log_File	
-Until_Log_Pos	0
-Master_SSL_Allowed	No
-Master_SSL_CA_File	
-Master_SSL_CA_Path	
-Master_SSL_Cert	
-Master_SSL_Cipher	
-Master_SSL_Key	
-Seconds_Behind_Master	#
-Master_SSL_Verify_Server_Cert	No
-Last_IO_Errno	#
-Last_IO_Error	#
-Last_SQL_Errno	0
-Last_SQL_Error	
-stop slave;
-change master to master_user='test';
-SHOW SLAVE STATUS;
-Slave_IO_State	#
 Master_Host	127.0.0.1
+include/stop_slave.inc
+change master to master_user='test';
 Master_User	test
-Master_Port	MASTER_PORT
-Connect_Retry	1
-Master_Log_File	master-bin.000001
-Read_Master_Log_Pos	#
-Relay_Log_File	#
-Relay_Log_Pos	#
-Relay_Master_Log_File	master-bin.000001
-Slave_IO_Running	No
-Slave_SQL_Running	No
-Replicate_Do_DB	
-Replicate_Ignore_DB	
-Replicate_Do_Table	
-Replicate_Ignore_Table	#
-Replicate_Wild_Do_Table	
-Replicate_Wild_Ignore_Table	
-Last_Errno	0
-Last_Error	
-Skip_Counter	0
-Exec_Master_Log_Pos	#
-Relay_Log_Space	#
-Until_Condition	None
-Until_Log_File	
-Until_Log_Pos	0
-Master_SSL_Allowed	No
-Master_SSL_CA_File	
-Master_SSL_CA_Path	
-Master_SSL_Cert	
-Master_SSL_Cipher	
-Master_SSL_Key	
-Seconds_Behind_Master	#
-Master_SSL_Verify_Server_Cert	No
-Last_IO_Errno	#
-Last_IO_Error	#
-Last_SQL_Errno	0
-Last_SQL_Error	
-reset slave;
-SHOW SLAVE STATUS;
-Slave_IO_State	#
 Master_Host	127.0.0.1
+reset slave;
 Master_User	root
-Master_Port	MASTER_PORT
-Connect_Retry	1
-Master_Log_File	
-Read_Master_Log_Pos	#
-Relay_Log_File	#
-Relay_Log_Pos	#
-Relay_Master_Log_File	
-Slave_IO_Running	No
-Slave_SQL_Running	No
-Replicate_Do_DB	
-Replicate_Ignore_DB	
-Replicate_Do_Table	
-Replicate_Ignore_Table	#
-Replicate_Wild_Do_Table	
-Replicate_Wild_Ignore_Table	
-Last_Errno	0
-Last_Error	
-Skip_Counter	0
-Exec_Master_Log_Pos	#
-Relay_Log_Space	#
-Until_Condition	None
-Until_Log_File	
-Until_Log_Pos	0
-Master_SSL_Allowed	No
-Master_SSL_CA_File	
-Master_SSL_CA_Path	
-Master_SSL_Cert	
-Master_SSL_Cipher	
-Master_SSL_Key	
-Seconds_Behind_Master	#
-Master_SSL_Verify_Server_Cert	No
-Last_IO_Errno	#
-Last_IO_Error	#
-Last_SQL_Errno	0
-Last_SQL_Error	
-start slave;
-SHOW SLAVE STATUS;
-Slave_IO_State	#
 Master_Host	127.0.0.1
+include/start_slave.inc
 Master_User	root
-Master_Port	MASTER_PORT
-Connect_Retry	1
-Master_Log_File	master-bin.000001
-Read_Master_Log_Pos	#
-Relay_Log_File	#
-Relay_Log_Pos	#
-Relay_Master_Log_File	master-bin.000001
-Slave_IO_Running	Yes
-Slave_SQL_Running	Yes
-Replicate_Do_DB	
-Replicate_Ignore_DB	
-Replicate_Do_Table	
-Replicate_Ignore_Table	#
-Replicate_Wild_Do_Table	
-Replicate_Wild_Ignore_Table	
-Last_Errno	0
-Last_Error	
-Skip_Counter	0
-Exec_Master_Log_Pos	#
-Relay_Log_Space	#
-Until_Condition	None
-Until_Log_File	
-Until_Log_Pos	0
-Master_SSL_Allowed	No
-Master_SSL_CA_File	
-Master_SSL_CA_Path	
-Master_SSL_Cert	
-Master_SSL_Cipher	
-Master_SSL_Key	
-Seconds_Behind_Master	#
-Master_SSL_Verify_Server_Cert	No
-Last_IO_Errno	#
-Last_IO_Error	#
-Last_SQL_Errno	0
-Last_SQL_Error	
-stop slave;
+Master_Host	127.0.0.1
+include/stop_slave.inc
 reset slave;
-start slave;
+include/start_slave.inc
 create temporary table t1 (a int);
-stop slave;
+include/stop_slave.inc
 reset slave;
-start slave;
+include/start_slave.inc
 show status like 'slave_open_temp_tables';
 Variable_name	Value
 Slave_open_temp_tables	1
-stop slave;
+include/stop_slave.inc
 reset slave;
-*** errno must be zero: 0 ***
 change master to master_user='impossible_user_name';
 start slave;
-ONE
-1
 include/stop_slave.inc
 change master to master_user='root';
 include/start_slave.inc
-*** last errno must be  zero: 0 ***
-*** last error must be blank:  ***
 include/stop_slave.inc
 change master to master_user='impossible_user_name';
 start slave;
-ONE
-1
 include/stop_slave.inc
 reset slave;
-*** io  last errno must be  zero: 0  ***
-*** io  last error must be blank:   ***
-*** sql last errno must be  zero: 0 ***
-*** sql last error must be blank:  ***

=== modified file 'mysql-test/suite/engines/funcs/r/rpl_switch_stm_row_mixed.result'
--- a/mysql-test/suite/engines/funcs/r/rpl_switch_stm_row_mixed.result	2010-03-18 06:42:07 +0000
+++ b/mysql-test/suite/engines/funcs/r/rpl_switch_stm_row_mixed.result	2010-05-24 13:54:08 +0000
@@ -376,7 +376,7 @@ CREATE TABLE t12 (data LONG);
 LOCK TABLES t12 WRITE;
 INSERT INTO t12 VALUES(UUID());
 UNLOCK TABLES;
-show binlog events;
-show binlog events;
+show binlog events from <binlog_start>;
+show binlog events from <binlog_start>;
 drop database mysqltest1;
 set global binlog_format= @saved_binlog_format;

=== modified file 'mysql-test/suite/engines/funcs/t/rpl_000015.test'
--- a/mysql-test/suite/engines/funcs/t/rpl_000015.test	2010-03-18 06:42:07 +0000
+++ b/mysql-test/suite/engines/funcs/t/rpl_000015.test	2010-05-24 13:54:08 +0000
@@ -11,31 +11,25 @@ save_master_pos;
 connection slave;
 stop slave;
 reset slave;
---vertical_results
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 5 # 8 # 9 # 23 # 33 #
-show slave status;
+let $status_items= Master_Log_File, Read_Master_Log_Pos, Relay_Master_Log_File, Exec_Master_Log_Pos;
+source include/show_slave_status.inc;
 
 change master to master_host='127.0.0.1';
 # The following needs to be cleaned up when change master is fixed
---vertical_results
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 5 # 8 # 9 # 23 # 33 #
-show slave status;
+source include/show_slave_status.inc;
+
 --replace_result $MASTER_MYPORT MASTER_PORT
 eval change master to master_host='127.0.0.1',master_user='root',
  master_password='',master_port=$MASTER_MYPORT;
---vertical_results
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 5 # 8 # 9 # 23 # 33 #
-show slave status;
+source include/show_slave_status.inc;
+
 start slave;
 sync_with_master;
+let $status_items= Master_Log_File, Relay_Master_Log_File;
+source include/show_slave_status.inc;
+source include/check_slave_is_running.inc;
+
 --vertical_results
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 5 # 8 # 9 # 23 # 33 #
---replace_column 33 #
-show slave status;
 connection master;
 --disable_warnings
 drop table if exists t1;

=== modified file 'mysql-test/suite/engines/funcs/t/rpl_REDIRECT.test'
--- a/mysql-test/suite/engines/funcs/t/rpl_REDIRECT.test	2010-03-18 06:42:07 +0000
+++ b/mysql-test/suite/engines/funcs/t/rpl_REDIRECT.test	2010-05-24 13:54:08 +0000
@@ -7,15 +7,11 @@ source include/master-slave.inc;
 --disable_ps_protocol
 
 #first, make sure the slave has had enough time to register
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
 
 #discover slaves
 connection master;
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 16 # 23 # 33 #
-SHOW SLAVE STATUS;
+--query_vertical SHOW SLAVE STATUS;
 --replace_result $SLAVE_MYPORT SLAVE_PORT
 SHOW SLAVE HOSTS;
 rpl_probe;
@@ -25,9 +21,7 @@ enable_rpl_parse;
 create table t1 ( n int);
 insert into t1 values (1),(2),(3),(4);
 disable_rpl_parse;
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
 insert into t1 values(5);
 connection master;
 enable_rpl_parse;

=== modified file 'mysql-test/suite/engines/funcs/t/rpl_change_master.test'
--- a/mysql-test/suite/engines/funcs/t/rpl_change_master.test	2010-03-18 06:42:07 +0000
+++ b/mysql-test/suite/engines/funcs/t/rpl_change_master.test	2010-05-24 13:54:08 +0000
@@ -18,13 +18,26 @@ save_master_pos;
 connection slave;
 --real_sleep 3 # wait for I/O thread to have read updates
 stop slave;
---replace_result $MASTER_MYPORT MASTER_MYPORT
---replace_column 1 # 7 # 8 # 9 # 23 # 33 #
-show slave status;
+source include/wait_for_slave_to_stop.inc;
+
+let $read_pos= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1);
+let $exec_pos= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1);
+if (`SELECT $read_pos = $exec_pos`)
+{
+  source include/show_rpl_debug_info.inc;
+  echo 'Read_Master_Log_Pos: $read_pos' == 'Exec_Master_Log_Pos: $exec_pos';
+  die Failed because Read_Master_Log_Pos is equal to Exec_Master_Log_Pos;
+} 
 change master to master_user='root';
---replace_result $MASTER_MYPORT MASTER_MYPORT
---replace_column 1 # 7 # 8 # 9 # 23 # 33 #
-show slave status;
+let $read_pos= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1);
+let $exec_pos= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1);
+if (`SELECT $read_pos <> $exec_pos`)
+{
+  source include/show_rpl_debug_info.inc;
+  echo 'Read_Master_Log_Pos: $read_pos' <> 'Exec_Master_Log_Pos: $exec_pos';
+  die Failed because Read_Master_Log_Pos is not equal to Exec_Master_Log_Pos;
+}
+
 start slave;
 sync_with_master;
 select * from t1;

=== modified file 'mysql-test/suite/engines/funcs/t/rpl_empty_master_crash.test'
--- a/mysql-test/suite/engines/funcs/t/rpl_empty_master_crash.test	2010-03-18 06:42:07 +0000
+++ b/mysql-test/suite/engines/funcs/t/rpl_empty_master_crash.test	2010-05-24 13:54:08 +0000
@@ -1,8 +1,5 @@
 source include/master-slave.inc;
 
---replace_column 1 # 8 # 9 # 16 # 23 # 33 #
-show slave status;
-
 #
 # Load table should not succeed on the master as this is not a slave
 #

=== modified file 'mysql-test/suite/engines/funcs/t/rpl_flushlog_loop.test'
--- a/mysql-test/suite/engines/funcs/t/rpl_flushlog_loop.test	2010-03-18 06:42:07 +0000
+++ b/mysql-test/suite/engines/funcs/t/rpl_flushlog_loop.test	2010-05-24 13:54:08 +0000
@@ -41,8 +41,7 @@ sleep 5;
 #
 #  Show status of slave
 #
---replace_result $SLAVE_MYPORT SLAVE_PORT
---replace_column 1 # 8 # 9 # 16 # 23 # 33 #
---vertical_results
-SHOW SLAVE STATUS;
+--let status_items= Relay_Log_File
+--source include/show_slave_status.inc
+--source include/check_slave_is_running.inc
 STOP SLAVE;

=== modified file 'mysql-test/suite/engines/funcs/t/rpl_loaddata_s.test'
--- a/mysql-test/suite/engines/funcs/t/rpl_loaddata_s.test	2010-03-18 06:42:07 +0000
+++ b/mysql-test/suite/engines/funcs/t/rpl_loaddata_s.test	2010-05-24 13:54:08 +0000
@@ -20,9 +20,7 @@ save_master_pos;
 connection slave;
 sync_with_master;
 select count(*) from test.t1; # check that LOAD was replicated
---replace_column 2 # 5 #
---replace_regex /table_id: [0-9]+/table_id: #/
-show binlog events from 106; # should be nothing
+source include/show_binlog_events.inc;
 
 # Cleanup
 connection master;

=== modified file 'mysql-test/suite/engines/funcs/t/rpl_log_pos.test'
--- a/mysql-test/suite/engines/funcs/t/rpl_log_pos.test	2010-03-18 06:42:07 +0000
+++ b/mysql-test/suite/engines/funcs/t/rpl_log_pos.test	2010-05-24 13:54:08 +0000
@@ -11,36 +11,41 @@
 # Passes with rbr no problem, removed statement include [jbm]
 
 source include/master-slave.inc;
---replace_column 3 <Binlog_Ignore_DB>
-show master status;
+let $master_log_pos= query_get_value(SHOW MASTER STATUS, Position, 1);
 sync_slave_with_master;
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 23 # 33 #
-show slave status;
 stop slave;
-change master to master_log_pos=106;
+
+--replace_result $master_log_pos MASTER_LOG_POS
+eval change master to master_log_pos=$master_log_pos;
 start slave;
 sleep 5;
 stop slave;
-change master to master_log_pos=106;
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 23 # 33 #
-show slave status;
+
+--replace_result $master_log_pos MASTER_LOG_POS
+eval change master to master_log_pos=$master_log_pos;
+--let $slave_param= Read_Master_Log_Pos
+--let $slave_param_value= $master_log_pos
+--source include/wait_for_slave_param.inc
+
 start slave;
 sleep 5;
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 23 # 33 #
-show slave status;
+--let $slave_param= Read_Master_Log_Pos
+--let $slave_param_value= $master_log_pos
+--source include/wait_for_slave_param.inc
+--source include/check_slave_no_error.inc
+
 stop slave;
+--echo # impossible position leads to an error
+--replace_result 177 MASTER_LOG_POS
 change master to master_log_pos=177;
 start slave;
 sleep 2;
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 23 # 33 #
-show slave status;
+let $slave_io_errno= 1236;
+let $show_slave_io_error= 1;
+source include/wait_for_slave_io_error.inc;
 connection master;
---replace_column 3 <Binlog_Ignore_DB>
-show master status;
+
+let $master_log_pos= query_get_value(SHOW MASTER STATUS, Position, 1);
 create table if not exists t1 (n int);
 drop table if exists t1;
 create table t1 (n int);
@@ -48,7 +53,9 @@ insert into t1 values (1),(2),(3);
 save_master_pos;
 connection slave;
 stop slave;
-change master to master_log_pos=206;
+
+--replace_result $master_log_pos MASTER_LOG_POS
+eval change master to master_log_pos=$master_log_pos;
 start slave;
 sync_with_master;
 select * from t1 ORDER BY n;

=== modified file 'mysql-test/suite/engines/funcs/t/rpl_rbr_to_sbr.test'
--- a/mysql-test/suite/engines/funcs/t/rpl_rbr_to_sbr.test	2010-03-18 06:42:07 +0000
+++ b/mysql-test/suite/engines/funcs/t/rpl_rbr_to_sbr.test	2010-05-24 13:54:08 +0000
@@ -15,25 +15,17 @@ SELECT @@GLOBAL.BINLOG_FORMAT, @@SESSION
 CREATE TABLE t1 (a INT, b LONG);
 INSERT INTO t1 VALUES (1,1), (2,2);
 INSERT INTO t1 VALUES (3,UUID()), (4,UUID());
-let $VERSION=`select version()`;
---replace_result $VERSION VERSION
---replace_column 2 # 5 #
---replace_regex /table_id: [0-9]+/table_id: #/
 # Different number of binlog events are generated by different engines
 --disable_result_log
-SHOW BINLOG EVENTS;
+source include/show_binlog_events.inc;
 --enable_result_log
 sync_slave_with_master;
 --echo **** On Slave ****
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
---query_vertical SHOW SLAVE STATUS
---replace_result $VERSION VERSION
---replace_column 2 # 5 #
---replace_regex /table_id: [0-9]+/table_id: #/
+source include/show_binlog_events.inc;
+
 # Different number of binlog events are generated by different engines
 --disable_result_log
-SHOW BINLOG EVENTS;
+source include/show_binlog_events.inc;
 --enable_result_log
 --exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/rpl_rbr_to_sbr_master.sql
 --exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/rpl_rbr_to_sbr_slave.sql

=== modified file 'mysql-test/suite/engines/funcs/t/rpl_row_drop.test'
--- a/mysql-test/suite/engines/funcs/t/rpl_row_drop.test	2010-03-18 06:42:07 +0000
+++ b/mysql-test/suite/engines/funcs/t/rpl_row_drop.test	2010-05-24 13:54:08 +0000
@@ -30,10 +30,7 @@ connection master;
 --echo **** On Master ****
 # Should drop the non-temporary table t1 and the temporary table t2
 DROP TABLE t1,t2;
-let $VERSION=`select version()`;
---replace_result $VERSION VERSION
---replace_regex /table_id: [0-9]+/table_id: #/
-SHOW BINLOG EVENTS;
+source include/show_binlog_events.inc;
 SHOW TABLES;
 sync_slave_with_master;
 --echo **** On Slave ****

=== modified file 'mysql-test/suite/engines/funcs/t/rpl_row_inexist_tbl.test'
--- a/mysql-test/suite/engines/funcs/t/rpl_row_inexist_tbl.test	2010-03-18 06:42:07 +0000
+++ b/mysql-test/suite/engines/funcs/t/rpl_row_inexist_tbl.test	2010-05-24 13:54:08 +0000
@@ -22,13 +22,11 @@ connection master;
 insert into t1 values (1);
 
 connection slave;
-# slave should have stopped because can't find table t1
-wait_for_slave_to_stop;
+# slave should have stopped because can't find table t1 
 # see if we have a good error message:
---replace_result $MASTER_MYPORT MASTER_MYPORT
---replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
---vertical_results
-show slave status;
+--let $slave_sql_errno= 1146
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error.inc
 
 # cleanup
 connection master;

=== modified file 'mysql-test/suite/engines/funcs/t/rpl_row_until.test'
--- a/mysql-test/suite/engines/funcs/t/rpl_row_until.test	2010-03-18 06:42:07 +0000
+++ b/mysql-test/suite/engines/funcs/t/rpl_row_until.test	2010-05-24 13:54:08 +0000
@@ -18,44 +18,50 @@ connection master;
 # create some events on master
 create table t1(n int not null auto_increment primary key);
 insert into t1 values (1),(2),(3),(4);
+let $master_log_pos_1= query_get_value(SHOW MASTER STATUS, Position, 1);
 drop table t1;
+
 create table t2(n int not null auto_increment primary key);
 insert into t2 values (1),(2);
+let $master_log_pos_2= query_get_value(SHOW MASTER STATUS, Position, 1);
 insert into t2 values (3),(4);
 drop table t2;
 
 # try to replicate all queries until drop of t1
 connection slave;
-start slave until master_log_file='master-bin.000001', master_log_pos=311;
+--replace_result $master_log_pos_1 MASTER_LOG_POS
+eval start slave until master_log_file='master-bin.000001', master_log_pos=$master_log_pos_1;
 sleep 2;
 wait_for_slave_to_stop;
 # here table should be still not deleted
 select * from t1;
---vertical_results
---replace_result $MASTER_MYPORT MASTER_MYPORT
---replace_column 1 # 7 # 9 # 11 # 22 # 23 # 33 #
-show slave status;
+--let $slave_param= Exec_Master_Log_Pos
+--let $slave_param_value= $master_log_pos_1
+--source include/check_slave_param.inc
 
 # this should fail right after start
+--replace_result 291 MASTER_LOG_POS
 start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291;
 # again this table should be still not deleted
 select * from t1;
 sleep 2;
 wait_for_slave_to_stop;
---vertical_results
---replace_result $MASTER_MYPORT MASTER_MYPORT
---replace_column 1 # 7 # 9 # 11 # 22 # 23 # 33 #
-show slave status;
+--let $slave_param= Exec_Master_Log_Pos
+--let $slave_param_value= $master_log_pos_1
+--source include/check_slave_param.inc
 
 # try replicate all up to and not including the second insert to t2;
-start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=728;
+let $master_log_pos= $master_log_pos_2;
+let $relay_log_file= slave-relay-bin.000004;
+--source include/get_relay_log_pos.inc
+--replace_result $relay_log_pos RELAY_LOG_POS
+eval start slave until relay_log_file='$relay_log_file', relay_log_pos=$relay_log_pos;
 sleep 2;
 wait_for_slave_to_stop;
 select * from t2;
---vertical_results
---replace_result $MASTER_MYPORT MASTER_MYPORT
---replace_column 1 # 7 # 9 # 11 # 22 # 23 # 33 #
-show slave status;
+--let $slave_param= Exec_Master_Log_Pos
+--let $slave_param_value= $master_log_pos
+--source include/check_slave_param.inc
 
 # clean up
 start slave;
@@ -65,27 +71,32 @@ connection slave;
 sync_with_master;
 stop slave;
 
+--let $exec_log_pos_1= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1)
 # this should stop immediately as we are already there
-start slave until master_log_file='master-bin.000001', master_log_pos=740;
+--replace_result $master_log_pos_2 MASTER_LOG_POS
+eval start slave until master_log_file='master-bin.000001', master_log_pos=$master_log_pos_2;
 sleep 2;
 wait_for_slave_to_stop;
 # here the sql slave thread should be stopped
---vertical_results
---replace_result $MASTER_MYPORT MASTER_MYPORT bin.000005 bin.000004 bin.000006 bin.000004 bin.000007 bin.000004
---replace_column 1 # 7 # 9 # 22 # 23 # 33 #
-show slave status;
+--let $slave_param= Exec_Master_Log_Pos
+--let $slave_param_value= $exec_log_pos_1
+--source include/check_slave_param.inc
 
 #testing various error conditions
+--replace_result 561 MASTER_LOG_POS
 --error 1277
 start slave until master_log_file='master-bin', master_log_pos=561;
+--replace_result 561 MASTER_LOG_POS 12 RELAY_LOG_POS
 --error 1277
 start slave until master_log_file='master-bin.000001', master_log_pos=561, relay_log_pos=12;
 --error 1277
 start slave until master_log_file='master-bin.000001';
 --error 1277
 start slave until relay_log_file='slave-relay-bin.000002';
+--replace_result 561 MASTER_LOG_POS
 --error 1277
 start slave until relay_log_file='slave-relay-bin.000002', master_log_pos=561;
 # Warning should be given for second command
 start slave sql_thread;
+--replace_result 740 MASTER_LOG_POS
 start slave until master_log_file='master-bin.000001', master_log_pos=740;

=== modified file 'mysql-test/suite/engines/funcs/t/rpl_server_id1.test'
--- a/mysql-test/suite/engines/funcs/t/rpl_server_id1.test	2010-03-18 06:42:07 +0000
+++ b/mysql-test/suite/engines/funcs/t/rpl_server_id1.test	2010-05-24 13:54:08 +0000
@@ -12,10 +12,13 @@ reset master;
 stop slave;
 --replace_result $SLAVE_MYPORT SLAVE_PORT
 eval change master to master_port=$SLAVE_MYPORT;
---replace_result $SLAVE_MYPORT SLAVE_PORT
---replace_column 16 # 18 #
-show slave status;
+source include/check_slave_no_error.inc;
+
 start slave;
+let $slave_io_errno= 1593;
+let $show_slave_io_error= 1;
+source include/wait_for_slave_io_error.inc;
+
 insert into t1 values (1);
 # can't MASTER_POS_WAIT(), it does not work in this weird setup
 # (when slave is its own master without --replicate-same-server-id)

=== modified file 'mysql-test/suite/engines/funcs/t/rpl_server_id2.test'
--- a/mysql-test/suite/engines/funcs/t/rpl_server_id2.test	2010-03-18 06:42:07 +0000
+++ b/mysql-test/suite/engines/funcs/t/rpl_server_id2.test	2010-05-24 13:54:08 +0000
@@ -9,9 +9,6 @@ reset master;
 stop slave;
 --replace_result $SLAVE_MYPORT SLAVE_PORT
 eval change master to master_port=$SLAVE_MYPORT;
---replace_result $SLAVE_MYPORT SLAVE_PORT
---replace_column 18 #
-show slave status;
 start slave;
 insert into t1 values (1);
 save_master_pos;

=== modified file 'mysql-test/suite/engines/funcs/t/rpl_slave_status.test'
--- a/mysql-test/suite/engines/funcs/t/rpl_slave_status.test	2010-03-18 06:42:07 +0000
+++ b/mysql-test/suite/engines/funcs/t/rpl_slave_status.test	2010-05-24 13:54:08 +0000
@@ -22,9 +22,7 @@ drop table if exists t1;
 --enable_warnings
 create table t1 (n int);
 insert into t1 values (1);
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
 select * from t1;
 
 # 3. Delete new replication user
@@ -40,12 +38,8 @@ stop slave;
 start slave;
 
 # 5. Make sure Slave_IO_Running = No
---replace_result $MASTER_MYPORT MASTER_MYPORT
-# Column 1 is replaced, since the output can be either
-# "Connecting to master" or "Waiting for master update"
---replace_column 1 # 7 # 8 # 9 # 22 # 23 # 35 # 36 #
---vertical_results
-show slave status;
+let $slave_io_errno= 1045;
+source include/wait_for_slave_io_error.inc;
 
 # Cleanup (Note that slave IO thread is not running)
 connection slave;

=== modified file 'mysql-test/suite/engines/funcs/t/rpl_switch_stm_row_mixed.test'
--- a/mysql-test/suite/engines/funcs/t/rpl_switch_stm_row_mixed.test	2010-03-18 06:42:07 +0000
+++ b/mysql-test/suite/engines/funcs/t/rpl_switch_stm_row_mixed.test	2010-05-24 13:54:08 +0000
@@ -501,9 +501,7 @@ INSERT INTO t12 VALUES(UUID());
 UNLOCK TABLES;
 
 --disable_result_log
---replace_column 2 # 5 #
---replace_regex /table_id: [0-9]+/table_id: #/
-show binlog events;
+source include/show_binlog_events.inc;
 --enable_result_log
 sync_slave_with_master;
 
@@ -520,9 +518,7 @@ diff_files $MYSQLTEST_VARDIR/tmp/rpl_swi
 
 connection master;
 --disable_result_log
---replace_column 2 # 5 #
---replace_regex /table_id: [0-9]+/table_id: #/
-show binlog events;
+source include/show_binlog_events.inc;
 --enable_result_log
 
 # Now test that mysqlbinlog works fine on a binlog generated by the

=== modified file 'mysql-test/suite/funcs_1/r/is_columns_is.result'
--- a/mysql-test/suite/funcs_1/r/is_columns_is.result	2010-04-28 19:29:45 +0000
+++ b/mysql-test/suite/funcs_1/r/is_columns_is.result	2010-08-05 15:38:06 +0000
@@ -41,7 +41,7 @@ NULL	information_schema	COLUMN_PRIVILEGE
 NULL	information_schema	COLUMN_PRIVILEGES	TABLE_CATALOG	2	NULL	YES	varchar	512	1536	NULL	NULL	utf8	utf8_general_ci	varchar(512)			select	
 NULL	information_schema	COLUMN_PRIVILEGES	TABLE_NAME	4		NO	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select	
 NULL	information_schema	COLUMN_PRIVILEGES	TABLE_SCHEMA	3		NO	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select	
-NULL	information_schema	ENGINES	COMMENT	3		NO	varchar	80	240	NULL	NULL	utf8	utf8_general_ci	varchar(80)			select	
+NULL	information_schema	ENGINES	COMMENT	3		NO	varchar	160	480	NULL	NULL	utf8	utf8_general_ci	varchar(160)			select	
 NULL	information_schema	ENGINES	ENGINE	1		NO	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select	
 NULL	information_schema	ENGINES	SAVEPOINTS	6	NULL	YES	varchar	3	9	NULL	NULL	utf8	utf8_general_ci	varchar(3)			select	
 NULL	information_schema	ENGINES	SUPPORT	2		NO	varchar	8	24	NULL	NULL	utf8	utf8_general_ci	varchar(8)			select	
@@ -198,14 +198,15 @@ NULL	information_schema	INNODB_SYS_INDEX
 NULL	information_schema	INNODB_SYS_INDEXES	SPACE	6	0	NO	bigint	NULL	NULL	19	0	NULL	NULL	bigint(21) unsigned			select	
 NULL	information_schema	INNODB_SYS_INDEXES	TABLE_ID	1	0	NO	bigint	NULL	NULL	19	0	NULL	NULL	bigint(21) unsigned			select	
 NULL	information_schema	INNODB_SYS_INDEXES	TYPE	5	0	NO	bigint	NULL	NULL	19	0	NULL	NULL	bigint(21) unsigned			select	
-NULL	information_schema	INNODB_SYS_TABLES	CLUSTER_NAME	7		NO	varchar	192	576	NULL	NULL	utf8	utf8_general_ci	varchar(192)			select	
-NULL	information_schema	INNODB_SYS_TABLES	ID	2	0	NO	bigint	NULL	NULL	19	0	NULL	NULL	bigint(21) unsigned			select	
-NULL	information_schema	INNODB_SYS_TABLES	MIX_ID	5	0	NO	bigint	NULL	NULL	19	0	NULL	NULL	bigint(21) unsigned			select	
-NULL	information_schema	INNODB_SYS_TABLES	MIX_LEN	6	0	NO	bigint	NULL	NULL	19	0	NULL	NULL	bigint(21) unsigned			select	
-NULL	information_schema	INNODB_SYS_TABLES	NAME	1		NO	varchar	192	576	NULL	NULL	utf8	utf8_general_ci	varchar(192)			select	
-NULL	information_schema	INNODB_SYS_TABLES	N_COLS	3	0	NO	bigint	NULL	NULL	19	0	NULL	NULL	bigint(21) unsigned			select	
-NULL	information_schema	INNODB_SYS_TABLES	SPACE	8	0	NO	bigint	NULL	NULL	19	0	NULL	NULL	bigint(21) unsigned			select	
-NULL	information_schema	INNODB_SYS_TABLES	TYPE	4	0	NO	bigint	NULL	NULL	19	0	NULL	NULL	bigint(21) unsigned			select	
+NULL	information_schema	INNODB_SYS_TABLES	CLUSTER_NAME	8		NO	varchar	192	576	NULL	NULL	utf8	utf8_general_ci	varchar(192)			select	
+NULL	information_schema	INNODB_SYS_TABLES	ID	3	0	NO	bigint	NULL	NULL	19	0	NULL	NULL	bigint(21) unsigned			select	
+NULL	information_schema	INNODB_SYS_TABLES	MIX_ID	6	0	NO	bigint	NULL	NULL	19	0	NULL	NULL	bigint(21) unsigned			select	
+NULL	information_schema	INNODB_SYS_TABLES	MIX_LEN	7	0	NO	bigint	NULL	NULL	19	0	NULL	NULL	bigint(21) unsigned			select	
+NULL	information_schema	INNODB_SYS_TABLES	NAME	2		NO	varchar	192	576	NULL	NULL	utf8	utf8_general_ci	varchar(192)			select	
+NULL	information_schema	INNODB_SYS_TABLES	N_COLS	4	0	NO	bigint	NULL	NULL	19	0	NULL	NULL	bigint(21) unsigned			select	
+NULL	information_schema	INNODB_SYS_TABLES	SCHEMA	1		NO	varchar	192	576	NULL	NULL	utf8	utf8_general_ci	varchar(192)			select	
+NULL	information_schema	INNODB_SYS_TABLES	SPACE	9	0	NO	bigint	NULL	NULL	19	0	NULL	NULL	bigint(21) unsigned			select	
+NULL	information_schema	INNODB_SYS_TABLES	TYPE	5	0	NO	bigint	NULL	NULL	19	0	NULL	NULL	bigint(21) unsigned			select	
 NULL	information_schema	INNODB_TABLE_STATS	clust_size	4	0	NO	bigint	NULL	NULL	19	0	NULL	NULL	bigint(21) unsigned			select	
 NULL	information_schema	INNODB_TABLE_STATS	modified	6	0	NO	bigint	NULL	NULL	19	0	NULL	NULL	bigint(21) unsigned			select	
 NULL	information_schema	INNODB_TABLE_STATS	other_size	5	0	NO	bigint	NULL	NULL	19	0	NULL	NULL	bigint(21) unsigned			select	
@@ -515,7 +516,7 @@ NULL	information_schema	COLUMNS	NUMERIC_
 3.0000	information_schema	COLUMN_PRIVILEGES	IS_GRANTABLE	varchar	3	9	utf8	utf8_general_ci	varchar(3)
 3.0000	information_schema	ENGINES	ENGINE	varchar	64	192	utf8	utf8_general_ci	varchar(64)
 3.0000	information_schema	ENGINES	SUPPORT	varchar	8	24	utf8	utf8_general_ci	varchar(8)
-3.0000	information_schema	ENGINES	COMMENT	varchar	80	240	utf8	utf8_general_ci	varchar(80)
+3.0000	information_schema	ENGINES	COMMENT	varchar	160	480	utf8	utf8_general_ci	varchar(160)
 3.0000	information_schema	ENGINES	TRANSACTIONS	varchar	3	9	utf8	utf8_general_ci	varchar(3)
 3.0000	information_schema	ENGINES	XA	varchar	3	9	utf8	utf8_general_ci	varchar(3)
 3.0000	information_schema	ENGINES	SAVEPOINTS	varchar	3	9	utf8	utf8_general_ci	varchar(3)
@@ -670,6 +671,7 @@ NULL	information_schema	INNODB_SYS_INDEX
 NULL	information_schema	INNODB_SYS_INDEXES	TYPE	bigint	NULL	NULL	NULL	NULL	bigint(21) unsigned
 NULL	information_schema	INNODB_SYS_INDEXES	SPACE	bigint	NULL	NULL	NULL	NULL	bigint(21) unsigned
 NULL	information_schema	INNODB_SYS_INDEXES	PAGE_NO	bigint	NULL	NULL	NULL	NULL	bigint(21) unsigned
+3.0000	information_schema	INNODB_SYS_TABLES	SCHEMA	varchar	192	576	utf8	utf8_general_ci	varchar(192)
 3.0000	information_schema	INNODB_SYS_TABLES	NAME	varchar	192	576	utf8	utf8_general_ci	varchar(192)
 NULL	information_schema	INNODB_SYS_TABLES	ID	bigint	NULL	NULL	NULL	NULL	bigint(21) unsigned
 NULL	information_schema	INNODB_SYS_TABLES	N_COLS	bigint	NULL	NULL	NULL	NULL	bigint(21) unsigned

=== modified file 'mysql-test/suite/funcs_1/r/is_engines.result'
--- a/mysql-test/suite/funcs_1/r/is_engines.result	2008-12-17 15:45:34 +0000
+++ b/mysql-test/suite/funcs_1/r/is_engines.result	2010-08-05 15:38:06 +0000
@@ -30,7 +30,7 @@ DESCRIBE          information_schema.ENG
 Field	Type	Null	Key	Default	Extra
 ENGINE	varchar(64)	NO			
 SUPPORT	varchar(8)	NO			
-COMMENT	varchar(80)	NO			
+COMMENT	varchar(160)	NO			
 TRANSACTIONS	varchar(3)	YES		NULL	
 XA	varchar(3)	YES		NULL	
 SAVEPOINTS	varchar(3)	YES		NULL	
@@ -39,7 +39,7 @@ Table	Create Table
 ENGINES	CREATE TEMPORARY TABLE `ENGINES` (
   `ENGINE` varchar(64) NOT NULL DEFAULT '',
   `SUPPORT` varchar(8) NOT NULL DEFAULT '',
-  `COMMENT` varchar(80) NOT NULL DEFAULT '',
+  `COMMENT` varchar(160) NOT NULL DEFAULT '',
   `TRANSACTIONS` varchar(3) DEFAULT NULL,
   `XA` varchar(3) DEFAULT NULL,
   `SAVEPOINTS` varchar(3) DEFAULT NULL
@@ -48,7 +48,7 @@ SHOW COLUMNS FROM information_schema.ENG
 Field	Type	Null	Key	Default	Extra
 ENGINE	varchar(64)	NO			
 SUPPORT	varchar(8)	NO			
-COMMENT	varchar(80)	NO			
+COMMENT	varchar(160)	NO			
 TRANSACTIONS	varchar(3)	YES		NULL	
 XA	varchar(3)	YES		NULL	
 SAVEPOINTS	varchar(3)	YES		NULL	

=== modified file 'mysql-test/suite/funcs_1/t/is_columns_is.test'
--- a/mysql-test/suite/funcs_1/t/is_columns_is.test	2009-10-10 09:59:06 +0000
+++ b/mysql-test/suite/funcs_1/t/is_columns_is.test	2010-08-05 11:40:54 +0000
@@ -18,6 +18,7 @@
 --source include/not_embedded.inc
 # This test depends on having the PBXT information_schema stuff.
 --source include/have_pbxt.inc
+--source include/have_xtradb.inc
 
 let $my_where = WHERE table_schema = 'information_schema'
 AND table_name <> 'profiling';

=== modified file 'mysql-test/suite/funcs_1/t/is_engines_innodb.test'
--- a/mysql-test/suite/funcs_1/t/is_engines_innodb.test	2008-03-07 19:18:14 +0000
+++ b/mysql-test/suite/funcs_1/t/is_engines_innodb.test	2010-08-04 10:19:18 +0000
@@ -11,5 +11,6 @@
 let $engine_type= InnoDB;
 --source include/have_innodb.inc
 --vertical_results
+--replace_regex /XtraDB engine based on InnoDB plugin. //
 eval SELECT * FROM information_schema.engines
 WHERE ENGINE = '$engine_type';

=== modified file 'mysql-test/suite/innodb/r/innodb-autoinc-44030.result'
--- a/mysql-test/suite/innodb/r/innodb-autoinc-44030.result	2010-05-26 18:55:40 +0000
+++ b/mysql-test/suite/innodb/r/innodb-autoinc-44030.result	2010-08-04 08:39:53 +0000
@@ -13,18 +13,18 @@ d1
 1
 2
 INSERT INTO t1 VALUES(null);
-Got one of the listed errors
 ALTER TABLE t1 AUTO_INCREMENT = 3;
 SHOW CREATE TABLE t1;
 Table	Create Table
 t1	CREATE TABLE `t1` (
   `d1` int(11) NOT NULL AUTO_INCREMENT,
   PRIMARY KEY (`d1`)
-) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1
+) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1
 INSERT INTO t1 VALUES(null);
 SELECT * FROM t1;
 d1
 1
 2
 3
+4
 DROP TABLE t1;

=== renamed file 'mysql-test/r/innodb-autoinc-optimize.result' => 'mysql-test/suite/innodb/r/innodb-autoinc-optimize.result'
=== renamed file 'mysql-test/r/innodb-ucs2.result' => 'mysql-test/suite/innodb/r/innodb-ucs2.result'
=== added file 'mysql-test/suite/innodb/r/innodb.result'
--- a/mysql-test/suite/innodb/r/innodb.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/innodb/r/innodb.result	2010-08-04 08:39:53 +0000
@@ -0,0 +1,2359 @@
+drop table if exists t1,t2,t3,t4;
+drop database if exists mysqltest;
+create table t1 (id int unsigned not null auto_increment, code tinyint unsigned not null, name char(20) not null, primary key (id), key (code), unique (name)) engine=innodb;
+insert into t1 (code, name) values (1, 'Tim'), (1, 'Monty'), (2, 'David'), (2, 'Erik'), (3, 'Sasha'), (3, 'Jeremy'), (4, 'Matt');
+select id, code, name from t1 order by id;
+id	code	name
+1	1	Tim
+2	1	Monty
+3	2	David
+4	2	Erik
+5	3	Sasha
+6	3	Jeremy
+7	4	Matt
+update ignore t1 set id = 8, name = 'Sinisa' where id < 3;
+select id, code, name from t1 order by id;
+id	code	name
+2	1	Monty
+3	2	David
+4	2	Erik
+5	3	Sasha
+6	3	Jeremy
+7	4	Matt
+8	1	Sinisa
+update ignore t1 set id = id + 10, name = 'Ralph' where id < 4;
+select id, code, name from t1 order by id;
+id	code	name
+3	2	David
+4	2	Erik
+5	3	Sasha
+6	3	Jeremy
+7	4	Matt
+8	1	Sinisa
+12	1	Ralph
+drop table t1;
+CREATE TABLE t1 (
+id int(11) NOT NULL auto_increment,
+parent_id int(11) DEFAULT '0' NOT NULL,
+level tinyint(4) DEFAULT '0' NOT NULL,
+PRIMARY KEY (id),
+KEY parent_id (parent_id),
+KEY level (level)
+) engine=innodb;
+INSERT INTO t1 VALUES (1,0,0),(3,1,1),(4,1,1),(8,2,2),(9,2,2),(17,3,2),(22,4,2),(24,4,2),(28,5,2),(29,5,2),(30,5,2),(31,6,2),(32,6,2),(33,6,2),(203,7,2),(202,7,2),(20,3,2),(157,0,0),(193,5,2),(40,7,2),(2,1,1),(15,2,2),(6,1,1),(34,6,2),(35,6,2),(16,3,2),(7,1,1),(36,7,2),(18,3,2),(26,5,2),(27,5,2),(183,4,2),(38,7,2),(25,5,2),(37,7,2),(21,4,2),(19,3,2),(5,1,1),(179,5,2);
+update t1 set parent_id=parent_id+100;
+select * from t1 where parent_id=102;
+id	parent_id	level
+8	102	2
+9	102	2
+15	102	2
+update t1 set id=id+1000;
+update t1 set id=1024 where id=1009;
+Got one of the listed errors
+select * from t1;
+id	parent_id	level
+1001	100	0
+1002	101	1
+1003	101	1
+1004	101	1
+1005	101	1
+1006	101	1
+1007	101	1
+1008	102	2
+1009	102	2
+1015	102	2
+1016	103	2
+1017	103	2
+1018	103	2
+1019	103	2
+1020	103	2
+1021	104	2
+1022	104	2
+1024	104	2
+1025	105	2
+1026	105	2
+1027	105	2
+1028	105	2
+1029	105	2
+1030	105	2
+1031	106	2
+1032	106	2
+1033	106	2
+1034	106	2
+1035	106	2
+1036	107	2
+1037	107	2
+1038	107	2
+1040	107	2
+1157	100	0
+1179	105	2
+1183	104	2
+1193	105	2
+1202	107	2
+1203	107	2
+update ignore t1 set id=id+1;
+select * from t1;
+id	parent_id	level
+1001	100	0
+1002	101	1
+1003	101	1
+1004	101	1
+1005	101	1
+1006	101	1
+1007	101	1
+1008	102	2
+1010	102	2
+1015	102	2
+1016	103	2
+1017	103	2
+1018	103	2
+1019	103	2
+1020	103	2
+1021	104	2
+1023	104	2
+1024	104	2
+1025	105	2
+1026	105	2
+1027	105	2
+1028	105	2
+1029	105	2
+1030	105	2
+1031	106	2
+1032	106	2
+1033	106	2
+1034	106	2
+1035	106	2
+1036	107	2
+1037	107	2
+1039	107	2
+1041	107	2
+1158	100	0
+1180	105	2
+1184	104	2
+1194	105	2
+1202	107	2
+1204	107	2
+update ignore t1 set id=1023 where id=1010;
+select * from t1 where parent_id=102;
+id	parent_id	level
+1008	102	2
+1010	102	2
+1015	102	2
+explain select level from t1 where level=1;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ref	level	level	1	const	#	Using index
+explain select level,id from t1 where level=1;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ref	level	level	1	const	#	Using index
+explain select level,id,parent_id from t1 where level=1;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ref	level	level	1	const	#	
+select level,id from t1 where level=1;
+level	id
+1	1002
+1	1003
+1	1004
+1	1005
+1	1006
+1	1007
+select level,id,parent_id from t1 where level=1;
+level	id	parent_id
+1	1002	101
+1	1003	101
+1	1004	101
+1	1005	101
+1	1006	101
+1	1007	101
+optimize table t1;
+Table	Op	Msg_type	Msg_text
+test.t1	optimize	note	Table does not support optimize, doing recreate + analyze instead
+test.t1	optimize	status	OK
+show keys from t1;
+Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment
+t1	0	PRIMARY	1	id	A	#	NULL	NULL		BTREE	
+t1	1	parent_id	1	parent_id	A	#	NULL	NULL		BTREE	
+t1	1	level	1	level	A	#	NULL	NULL		BTREE	
+drop table t1;
+CREATE TABLE t1 (
+gesuchnr int(11) DEFAULT '0' NOT NULL,
+benutzer_id int(11) DEFAULT '0' NOT NULL,
+PRIMARY KEY (gesuchnr,benutzer_id)
+) engine=innodb;
+replace into t1 (gesuchnr,benutzer_id) values (2,1);
+replace into t1 (gesuchnr,benutzer_id) values (1,1);
+replace into t1 (gesuchnr,benutzer_id) values (1,1);
+select * from t1;
+gesuchnr	benutzer_id
+1	1
+2	1
+drop table t1;
+create table t1 (a int) engine=innodb;
+insert into t1 values (1), (2);
+optimize table t1;
+Table	Op	Msg_type	Msg_text
+test.t1	optimize	note	Table does not support optimize, doing recreate + analyze instead
+test.t1	optimize	status	OK
+delete from t1 where a = 1;
+select * from t1;
+a
+2
+check table t1;
+Table	Op	Msg_type	Msg_text
+test.t1	check	status	OK
+drop table t1;
+create table t1 (a int,b varchar(20)) engine=innodb;
+insert into t1 values (1,""), (2,"testing");
+delete from t1 where a = 1;
+select * from t1;
+a	b
+2	testing
+create index skr on t1 (a);
+insert into t1 values (3,""), (4,"testing");
+analyze table t1;
+Table	Op	Msg_type	Msg_text
+test.t1	analyze	status	OK
+show keys from t1;
+Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment
+t1	1	skr	1	a	A	#	NULL	NULL	YES	BTREE	
+drop table t1;
+create table t1 (a int,b varchar(20),key(a)) engine=innodb;
+insert into t1 values (1,""), (2,"testing");
+select * from t1 where a = 1;
+a	b
+1	
+drop table t1;
+create table t1 (n int not null primary key) engine=innodb;
+set autocommit=0;
+insert into t1 values (4);
+rollback;
+select n, "after rollback" from t1;
+n	after rollback
+insert into t1 values (4);
+commit;
+select n, "after commit" from t1;
+n	after commit
+4	after commit
+commit;
+insert into t1 values (5);
+insert into t1 values (4);
+ERROR 23000: Duplicate entry '4' for key 'PRIMARY'
+commit;
+select n, "after commit" from t1;
+n	after commit
+4	after commit
+5	after commit
+set autocommit=1;
+insert into t1 values (6);
+insert into t1 values (4);
+ERROR 23000: Duplicate entry '4' for key 'PRIMARY'
+select n from t1;
+n
+4
+5
+6
+set autocommit=0;
+begin;
+savepoint `my_savepoint`;
+insert into t1 values (7);
+savepoint `savept2`;
+insert into t1 values (3);
+select n from t1;
+n
+3
+4
+5
+6
+7
+savepoint savept3;
+rollback to savepoint savept2;
+rollback to savepoint savept3;
+ERROR 42000: SAVEPOINT savept3 does not exist
+rollback to savepoint savept2;
+release savepoint `my_savepoint`;
+select n from t1;
+n
+4
+5
+6
+7
+rollback to savepoint `my_savepoint`;
+ERROR 42000: SAVEPOINT my_savepoint does not exist
+rollback to savepoint savept2;
+ERROR 42000: SAVEPOINT savept2 does not exist
+insert into t1 values (8);
+savepoint sv;
+commit;
+savepoint sv;
+set autocommit=1;
+rollback;
+drop table t1;
+create table t1 (n int not null primary key) engine=innodb;
+start transaction;
+insert into t1 values (4);
+flush tables with read lock;
+commit;
+unlock tables;
+commit;
+select * from t1;
+n
+4
+drop table t1;
+create table t1 ( id int NOT NULL PRIMARY KEY, nom varchar(64)) engine=innodb;
+begin;
+insert into t1 values(1,'hamdouni');
+select id as afterbegin_id,nom as afterbegin_nom from t1;
+afterbegin_id	afterbegin_nom
+1	hamdouni
+rollback;
+select id as afterrollback_id,nom as afterrollback_nom from t1;
+afterrollback_id	afterrollback_nom
+set autocommit=0;
+insert into t1 values(2,'mysql');
+select id as afterautocommit0_id,nom as afterautocommit0_nom from t1;
+afterautocommit0_id	afterautocommit0_nom
+2	mysql
+rollback;
+select id as afterrollback_id,nom as afterrollback_nom from t1;
+afterrollback_id	afterrollback_nom
+set autocommit=1;
+drop table t1;
+CREATE TABLE t1 (id char(8) not null primary key, val int not null) engine=innodb;
+insert into t1 values ('pippo', 12);
+insert into t1 values ('pippo', 12);
+ERROR 23000: Duplicate entry 'pippo' for key 'PRIMARY'
+delete from t1;
+delete from t1 where id = 'pippo';
+select * from t1;
+id	val
+insert into t1 values ('pippo', 12);
+set autocommit=0;
+delete from t1;
+rollback;
+select * from t1;
+id	val
+pippo	12
+delete from t1;
+commit;
+select * from t1;
+id	val
+drop table t1;
+create table t1 (a integer) engine=innodb;
+start transaction;
+rename table t1 to t2;
+create table t1 (b integer) engine=innodb;
+insert into t1 values (1);
+rollback;
+drop table t1;
+rename table t2 to t1;
+drop table t1;
+set autocommit=1;
+CREATE TABLE t1 (ID INTEGER NOT NULL PRIMARY KEY, NAME VARCHAR(64)) ENGINE=innodb;
+INSERT INTO t1 VALUES (1, 'Jochen');
+select * from t1;
+ID	NAME
+1	Jochen
+drop table t1;
+CREATE TABLE t1 ( _userid VARCHAR(60) NOT NULL PRIMARY KEY) ENGINE=innodb;
+set autocommit=0;
+INSERT INTO t1  SET _userid='marc at anyware.co.uk';
+COMMIT;
+SELECT * FROM t1;
+_userid
+marc at anyware.co.uk
+SELECT _userid FROM t1 WHERE _userid='marc at anyware.co.uk';
+_userid
+marc at anyware.co.uk
+drop table t1;
+set autocommit=1;
+CREATE TABLE t1 (
+user_id int(10) DEFAULT '0' NOT NULL,
+name varchar(100),
+phone varchar(100),
+ref_email varchar(100) DEFAULT '' NOT NULL,
+detail varchar(200),
+PRIMARY KEY (user_id,ref_email)
+)engine=innodb;
+INSERT INTO t1 VALUES (10292,'sanjeev','29153373','sansh777 at hotmail.com','xxx'),(10292,'shirish','2333604','shirish at yahoo.com','ddsds'),(10292,'sonali','323232','sonali at bolly.com','filmstar');
+select * from t1 where user_id=10292;
+user_id	name	phone	ref_email	detail
+10292	sanjeev	29153373	sansh777 at hotmail.com	xxx
+10292	shirish	2333604	shirish at yahoo.com	ddsds
+10292	sonali	323232	sonali at bolly.com	filmstar
+INSERT INTO t1 VALUES (10291,'sanjeev','29153373','sansh777 at hotmail.com','xxx'),(10293,'shirish','2333604','shirish at yahoo.com','ddsds');
+select * from t1 where user_id=10292;
+user_id	name	phone	ref_email	detail
+10292	sanjeev	29153373	sansh777 at hotmail.com	xxx
+10292	shirish	2333604	shirish at yahoo.com	ddsds
+10292	sonali	323232	sonali at bolly.com	filmstar
+select * from t1 where user_id>=10292;
+user_id	name	phone	ref_email	detail
+10292	sanjeev	29153373	sansh777 at hotmail.com	xxx
+10292	shirish	2333604	shirish at yahoo.com	ddsds
+10292	sonali	323232	sonali at bolly.com	filmstar
+10293	shirish	2333604	shirish at yahoo.com	ddsds
+select * from t1 where user_id>10292;
+user_id	name	phone	ref_email	detail
+10293	shirish	2333604	shirish at yahoo.com	ddsds
+select * from t1 where user_id<10292;
+user_id	name	phone	ref_email	detail
+10291	sanjeev	29153373	sansh777 at hotmail.com	xxx
+drop table t1;
+CREATE TABLE t1 (a int not null, b int not null,c int not null,
+key(a),primary key(a,b), unique(c),key(a),unique(b));
+show index from t1;
+Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment
+t1	0	PRIMARY	1	a	A	#	NULL	NULL		BTREE	
+t1	0	PRIMARY	2	b	A	#	NULL	NULL		BTREE	
+t1	0	c	1	c	A	#	NULL	NULL		BTREE	
+t1	0	b	1	b	A	#	NULL	NULL		BTREE	
+t1	1	a	1	a	A	#	NULL	NULL		BTREE	
+t1	1	a_2	1	a	A	#	NULL	NULL		BTREE	
+drop table t1;
+create table t1 (col1 int not null, col2 char(4) not null, primary key(col1));
+alter table t1 engine=innodb;
+insert into t1 values ('1','1'),('5','2'),('2','3'),('3','4'),('4','4');
+select * from t1;
+col1	col2
+1	1
+2	3
+3	4
+4	4
+5	2
+update t1 set col2='7' where col1='4';
+select * from t1;
+col1	col2
+1	1
+2	3
+3	4
+4	7
+5	2
+alter table t1 add co3 int not null;
+select * from t1;
+col1	col2	co3
+1	1	0
+2	3	0
+3	4	0
+4	7	0
+5	2	0
+update t1 set col2='9' where col1='2';
+select * from t1;
+col1	col2	co3
+1	1	0
+2	9	0
+3	4	0
+4	7	0
+5	2	0
+drop table t1;
+create table t1 (a int not null , b int, primary key (a)) engine = innodb;
+create table t2 (a int not null , b int, primary key (a)) engine = myisam;
+insert into t1 VALUES (1,3) , (2,3), (3,3);
+select * from t1;
+a	b
+1	3
+2	3
+3	3
+insert into t2 select * from t1;
+select * from t2;
+a	b
+1	3
+2	3
+3	3
+delete from t1 where b = 3;
+select * from t1;
+a	b
+insert into t1 select * from t2;
+select * from t1;
+a	b
+1	3
+2	3
+3	3
+select * from t2;
+a	b
+1	3
+2	3
+3	3
+drop table t1,t2;
+CREATE TABLE t1 (
+user_name varchar(12),
+password text,
+subscribed char(1),
+user_id int(11) DEFAULT '0' NOT NULL,
+quota bigint(20),
+weight double,
+access_date date,
+access_time time,
+approved datetime,
+dummy_primary_key int(11) NOT NULL auto_increment,
+PRIMARY KEY (dummy_primary_key)
+) ENGINE=innodb;
+INSERT INTO t1 VALUES ('user_0','somepassword','N',0,0,0,'2000-09-07','23:06:59','2000-09-07 23:06:59',1);
+INSERT INTO t1 VALUES ('user_1','somepassword','Y',1,1,1,'2000-09-07','23:06:59','2000-09-07 23:06:59',2);
+INSERT INTO t1 VALUES ('user_2','somepassword','N',2,2,1.4142135623731,'2000-09-07','23:06:59','2000-09-07 23:06:59',3);
+INSERT INTO t1 VALUES ('user_3','somepassword','Y',3,3,1.7320508075689,'2000-09-07','23:06:59','2000-09-07 23:06:59',4);
+INSERT INTO t1 VALUES ('user_4','somepassword','N',4,4,2,'2000-09-07','23:06:59','2000-09-07 23:06:59',5);
+select  user_name, password , subscribed, user_id, quota, weight, access_date, access_time, approved, dummy_primary_key from t1 order by user_name;
+user_name	password	subscribed	user_id	quota	weight	access_date	access_time	approved	dummy_primary_key
+user_0	somepassword	N	0	0	0	2000-09-07	23:06:59	2000-09-07 23:06:59	1
+user_1	somepassword	Y	1	1	1	2000-09-07	23:06:59	2000-09-07 23:06:59	2
+user_2	somepassword	N	2	2	1.4142135623731	2000-09-07	23:06:59	2000-09-07 23:06:59	3
+user_3	somepassword	Y	3	3	1.7320508075689	2000-09-07	23:06:59	2000-09-07 23:06:59	4
+user_4	somepassword	N	4	4	2	2000-09-07	23:06:59	2000-09-07 23:06:59	5
+drop table t1;
+CREATE TABLE t1 (
+id int(11) NOT NULL auto_increment,
+parent_id int(11) DEFAULT '0' NOT NULL,
+level tinyint(4) DEFAULT '0' NOT NULL,
+KEY (id),
+KEY parent_id (parent_id),
+KEY level (level)
+) engine=innodb;
+INSERT INTO t1 VALUES (1,0,0),(3,1,1),(4,1,1),(8,2,2),(9,2,2),(17,3,2),(22,4,2),(24,4,2),(28,5,2),(29,5,2),(30,5,2),(31,6,2),(32,6,2),(33,6,2),(203,7,2),(202,7,2),(20,3,2),(157,0,0),(193,5,2),(40,7,2),(2,1,1),(15,2,2),(6,1,1),(34,6,2),(35,6,2),(16,3,2),(7,1,1),(36,7,2),(18,3,2),(26,5,2),(27,5,2),(183,4,2),(38,7,2),(25,5,2),(37,7,2),(21,4,2),(19,3,2),(5,1,1);
+INSERT INTO t1 values (179,5,2);
+update t1 set parent_id=parent_id+100;
+select * from t1 where parent_id=102;
+id	parent_id	level
+8	102	2
+9	102	2
+15	102	2
+update t1 set id=id+1000;
+update t1 set id=1024 where id=1009;
+select * from t1;
+id	parent_id	level
+1001	100	0
+1003	101	1
+1004	101	1
+1008	102	2
+1024	102	2
+1017	103	2
+1022	104	2
+1024	104	2
+1028	105	2
+1029	105	2
+1030	105	2
+1031	106	2
+1032	106	2
+1033	106	2
+1203	107	2
+1202	107	2
+1020	103	2
+1157	100	0
+1193	105	2
+1040	107	2
+1002	101	1
+1015	102	2
+1006	101	1
+1034	106	2
+1035	106	2
+1016	103	2
+1007	101	1
+1036	107	2
+1018	103	2
+1026	105	2
+1027	105	2
+1183	104	2
+1038	107	2
+1025	105	2
+1037	107	2
+1021	104	2
+1019	103	2
+1005	101	1
+1179	105	2
+update ignore t1 set id=id+1;
+select * from t1;
+id	parent_id	level
+1002	100	0
+1004	101	1
+1005	101	1
+1009	102	2
+1025	102	2
+1018	103	2
+1023	104	2
+1025	104	2
+1029	105	2
+1030	105	2
+1031	105	2
+1032	106	2
+1033	106	2
+1034	106	2
+1204	107	2
+1203	107	2
+1021	103	2
+1158	100	0
+1194	105	2
+1041	107	2
+1003	101	1
+1016	102	2
+1007	101	1
+1035	106	2
+1036	106	2
+1017	103	2
+1008	101	1
+1037	107	2
+1019	103	2
+1027	105	2
+1028	105	2
+1184	104	2
+1039	107	2
+1026	105	2
+1038	107	2
+1022	104	2
+1020	103	2
+1006	101	1
+1180	105	2
+update ignore t1 set id=1023 where id=1010;
+select * from t1 where parent_id=102;
+id	parent_id	level
+1009	102	2
+1025	102	2
+1016	102	2
+explain select level from t1 where level=1;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ref	level	level	1	const	#	Using index
+select level,id from t1 where level=1;
+level	id
+1	1004
+1	1005
+1	1003
+1	1007
+1	1008
+1	1006
+select level,id,parent_id from t1 where level=1;
+level	id	parent_id
+1	1004	101
+1	1005	101
+1	1003	101
+1	1007	101
+1	1008	101
+1	1006	101
+select level,id from t1 where level=1 order by id;
+level	id
+1	1003
+1	1004
+1	1005
+1	1006
+1	1007
+1	1008
+delete from t1 where level=1;
+select * from t1;
+id	parent_id	level
+1002	100	0
+1009	102	2
+1025	102	2
+1018	103	2
+1023	104	2
+1025	104	2
+1029	105	2
+1030	105	2
+1031	105	2
+1032	106	2
+1033	106	2
+1034	106	2
+1204	107	2
+1203	107	2
+1021	103	2
+1158	100	0
+1194	105	2
+1041	107	2
+1016	102	2
+1035	106	2
+1036	106	2
+1017	103	2
+1037	107	2
+1019	103	2
+1027	105	2
+1028	105	2
+1184	104	2
+1039	107	2
+1026	105	2
+1038	107	2
+1022	104	2
+1020	103	2
+1180	105	2
+drop table t1;
+CREATE TABLE t1 (
+sca_code char(6) NOT NULL,
+cat_code char(6) NOT NULL,
+sca_desc varchar(50),
+lan_code char(2) NOT NULL,
+sca_pic varchar(100),
+sca_sdesc varchar(50),
+sca_sch_desc varchar(16),
+PRIMARY KEY (sca_code, cat_code, lan_code),
+INDEX sca_pic (sca_pic)
+) engine = innodb ;
+INSERT INTO t1 ( sca_code, cat_code, sca_desc, lan_code, sca_pic, sca_sdesc, sca_sch_desc) VALUES ( 'PD', 'J', 'PENDANT', 'EN', NULL, NULL, 'PENDANT'),( 'RI', 'J', 'RING', 'EN', NULL, NULL, 'RING'),( 'QQ', 'N', 'RING', 'EN', 'not null', NULL, 'RING');
+select count(*) from t1 where sca_code = 'PD';
+count(*)
+1
+select count(*) from t1 where sca_code <= 'PD';
+count(*)
+1
+select count(*) from t1 where sca_pic is null;
+count(*)
+2
+alter table t1 drop index sca_pic;
+alter table t1 add index sca_pic (cat_code, sca_pic);
+select count(*) from t1 where sca_code='PD' and sca_pic is null;
+count(*)
+1
+select count(*) from t1 where cat_code='E';
+count(*)
+0
+alter table t1 drop index sca_pic;
+alter table t1 add index (sca_pic, cat_code);
+select count(*) from t1 where sca_code='PD' and sca_pic is null;
+count(*)
+1
+select count(*) from t1 where sca_pic >= 'n';
+count(*)
+1
+select sca_pic from t1 where sca_pic is null;
+sca_pic
+NULL
+NULL
+update t1 set sca_pic="test" where sca_pic is null;
+delete from t1 where sca_code='pd';
+drop table t1;
+set @a:=now();
+CREATE TABLE t1 (a int not null, b timestamp not null, primary key (a)) engine=innodb;
+insert into t1 (a) values(1),(2),(3);
+select t1.a from t1 natural join t1 as t2 where t1.b >= @a order by t1.a;
+a
+1
+2
+3
+select a from t1 natural join t1 as t2 where b >= @a order by a;
+a
+1
+2
+3
+update t1 set a=5 where a=1;
+select a from t1;
+a
+2
+3
+5
+drop table t1;
+create table t1 (a varchar(100) not null, primary key(a), b int not null) engine=innodb;
+insert into t1 values("hello",1),("world",2);
+select * from t1 order by b desc;
+a	b
+world	2
+hello	1
+optimize table t1;
+Table	Op	Msg_type	Msg_text
+test.t1	optimize	note	Table does not support optimize, doing recreate + analyze instead
+test.t1	optimize	status	OK
+show keys from t1;
+Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment
+t1	0	PRIMARY	1	a	A	#	NULL	NULL		BTREE	
+drop table t1;
+create table t1 (i int, j int ) ENGINE=innodb;
+insert into t1 values (1,2);
+select * from t1 where i=1 and j=2;
+i	j
+1	2
+create index ax1 on t1 (i,j);
+select * from t1 where i=1 and j=2;
+i	j
+1	2
+drop table t1;
+CREATE TABLE t1 (
+a int3 unsigned NOT NULL,
+b int1 unsigned NOT NULL,
+UNIQUE (a, b)
+) ENGINE = innodb;
+INSERT INTO t1 VALUES (1, 1);
+SELECT MIN(B),MAX(b) FROM t1 WHERE t1.a = 1;
+MIN(B)	MAX(b)
+1	1
+drop table t1;
+CREATE TABLE t1 (a int unsigned NOT NULL) engine=innodb;
+INSERT INTO t1 VALUES (1);
+SELECT * FROM t1;
+a
+1
+DROP TABLE t1;
+create table t1 (a int  primary key,b int, c int, d int, e int, f int, g int, h int, i int, j int, k int, l int, m int, n int, o int, p int, q int, r int, s int, t int, u int, v int, w int, x int, y int, z int, a1 int, a2 int, a3 int, a4 int, a5 int, a6 int, a7 int, a8 int, a9 int, b1 int, b2 int, b3 int, b4 int, b5 int, b6 int) engine = innodb;
+insert into t1 values (1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1);
+explain select * from t1 where a > 0 and a < 50;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	range	PRIMARY	PRIMARY	4	NULL	#	Using where
+drop table t1;
+create table t1 (id int NOT NULL,id2 int NOT NULL,id3 int NOT NULL,dummy1 char(30),primary key (id,id2),index index_id3 (id3)) engine=innodb;
+insert into t1 values (0,0,0,'ABCDEFGHIJ'),(2,2,2,'BCDEFGHIJK'),(1,1,1,'CDEFGHIJKL');
+LOCK TABLES t1 WRITE;
+insert into t1 values (99,1,2,'D'),(1,1,2,'D');
+ERROR 23000: Duplicate entry '1-1' for key 'PRIMARY'
+select id from t1;
+id
+0
+1
+2
+select id from t1;
+id
+0
+1
+2
+UNLOCK TABLES;
+DROP TABLE t1;
+create table t1 (id int NOT NULL,id2 int NOT NULL,id3 int NOT NULL,dummy1 char(30),primary key (id,id2),index index_id3 (id3)) engine=innodb;
+insert into t1 values (0,0,0,'ABCDEFGHIJ'),(2,2,2,'BCDEFGHIJK'),(1,1,1,'CDEFGHIJKL');
+LOCK TABLES t1 WRITE;
+begin;
+insert into t1 values (99,1,2,'D'),(1,1,2,'D');
+ERROR 23000: Duplicate entry '1-1' for key 'PRIMARY'
+select id from t1;
+id
+0
+1
+2
+insert ignore into t1 values (100,1,2,'D'),(1,1,99,'D');
+commit;
+select id,id3 from t1;
+id	id3
+0	0
+1	1
+2	2
+100	2
+UNLOCK TABLES;
+DROP TABLE t1;
+create table t1 (a char(20), unique (a(5))) engine=innodb;
+drop table t1;
+create table t1 (a char(20), index (a(5))) engine=innodb;
+show create table t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` char(20) DEFAULT NULL,
+  KEY `a` (`a`(5))
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+drop table t1;
+create temporary table t1 (a int not null auto_increment, primary key(a)) engine=innodb;
+insert into t1 values (NULL),(NULL),(NULL);
+delete from t1 where a=3;
+insert into t1 values (NULL);
+select * from t1;
+a
+1
+2
+4
+alter table t1 add b int;
+select * from t1;
+a	b
+1	NULL
+2	NULL
+4	NULL
+drop table t1;
+create table t1
+(
+id int auto_increment primary key,
+name varchar(32) not null,
+value text not null,
+uid int not null,
+unique key(name,uid)
+) engine=innodb;
+insert into t1 values (1,'one','one value',101),
+(2,'two','two value',102),(3,'three','three value',103);
+set insert_id=5;
+replace into t1 (value,name,uid) values ('other value','two',102);
+delete from t1 where uid=102;
+set insert_id=5;
+replace into t1 (value,name,uid) values ('other value','two',102);
+set insert_id=6;
+replace into t1 (value,name,uid) values ('other value','two',102);
+select * from t1;
+id	name	value	uid
+1	one	one value	101
+3	three	three value	103
+6	two	other value	102
+drop table t1;
+create database mysqltest;
+create table mysqltest.t1 (a int not null) engine= innodb;
+insert into mysqltest.t1 values(1);
+create table mysqltest.t2 (a int not null) engine= myisam;
+insert into mysqltest.t2 values(1);
+create table mysqltest.t3 (a int not null) engine= heap;
+insert into mysqltest.t3 values(1);
+commit;
+drop database mysqltest;
+show tables from mysqltest;
+ERROR 42000: Unknown database 'mysqltest'
+set autocommit=0;
+create table t1 (a int not null) engine= innodb;
+insert into t1 values(1),(2);
+truncate table t1;
+commit;
+truncate table t1;
+truncate table t1;
+select * from t1;
+a
+insert into t1 values(1),(2);
+delete from t1;
+select * from t1;
+a
+commit;
+drop table t1;
+set autocommit=1;
+create table t1 (a int not null) engine= innodb;
+insert into t1 values(1),(2);
+truncate table t1;
+insert into t1 values(1),(2);
+select * from t1;
+a
+1
+2
+truncate table t1;
+insert into t1 values(1),(2);
+delete from t1;
+select * from t1;
+a
+drop table t1;
+create table t1 (a int not null, b int not null, c int not null, primary key (a),key(b)) engine=innodb;
+insert into t1 values (3,3,3),(1,1,1),(2,2,2),(4,4,4);
+explain select * from t1 order by a;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	index	NULL	PRIMARY	4	NULL	#	
+explain select * from t1 order by b;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	#	Using filesort
+explain select * from t1 order by c;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	#	Using filesort
+explain select a from t1 order by a;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	index	NULL	PRIMARY	4	NULL	#	Using index
+explain select b from t1 order by b;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	index	NULL	b	4	NULL	#	Using index
+explain select a,b from t1 order by b;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	index	NULL	b	4	NULL	#	Using index
+explain select a,b from t1;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	index	NULL	b	4	NULL	#	Using index
+explain select a,b,c from t1;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	#	
+drop table t1;
+create table t1 (t int not null default 1, key (t)) engine=innodb;
+desc t1;
+Field	Type	Null	Key	Default	Extra
+t	int(11)	NO	MUL	1	
+drop table t1;
+CREATE TABLE t1 (
+number bigint(20) NOT NULL default '0',
+cname char(15) NOT NULL default '',
+carrier_id smallint(6) NOT NULL default '0',
+privacy tinyint(4) NOT NULL default '0',
+last_mod_date timestamp NOT NULL,
+last_mod_id smallint(6) NOT NULL default '0',
+last_app_date timestamp NOT NULL,
+last_app_id smallint(6) default '-1',
+version smallint(6) NOT NULL default '0',
+assigned_scps int(11) default '0',
+status tinyint(4) default '0'
+) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (4077711111,'SeanWheeler',90,2,20020111112846,500,00000000000000,-1,2,3,1);
+INSERT INTO t1 VALUES (9197722223,'berry',90,3,20020111112809,500,20020102114532,501,4,10,0);
+INSERT INTO t1 VALUES (650,'San Francisco',0,0,20011227111336,342,00000000000000,-1,1,24,1);
+INSERT INTO t1 VALUES (302467,'Sue\'s Subshop',90,3,20020109113241,500,20020102115111,501,7,24,0);
+INSERT INTO t1 VALUES (6014911113,'SudzCarwash',520,1,20020102115234,500,20020102115259,501,33,32768,0);
+INSERT INTO t1 VALUES (333,'tubs',99,2,20020109113440,501,20020109113440,500,3,10,0);
+CREATE TABLE t2 (
+number bigint(20) NOT NULL default '0',
+cname char(15) NOT NULL default '',
+carrier_id smallint(6) NOT NULL default '0',
+privacy tinyint(4) NOT NULL default '0',
+last_mod_date timestamp NOT NULL,
+last_mod_id smallint(6) NOT NULL default '0',
+last_app_date timestamp NOT NULL,
+last_app_id smallint(6) default '-1',
+version smallint(6) NOT NULL default '0',
+assigned_scps int(11) default '0',
+status tinyint(4) default '0'
+) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (4077711111,'SeanWheeler',0,2,20020111112853,500,00000000000000,-1,2,3,1);
+INSERT INTO t2 VALUES (9197722223,'berry',90,3,20020111112818,500,20020102114532,501,4,10,0);
+INSERT INTO t2 VALUES (650,'San Francisco',90,0,20020109113158,342,00000000000000,-1,1,24,1);
+INSERT INTO t2 VALUES (333,'tubs',99,2,20020109113453,501,20020109113453,500,3,10,0);
+select * from t1;
+number	cname	carrier_id	privacy	last_mod_date	last_mod_id	last_app_date	last_app_id	version	assigned_scps	status
+4077711111	SeanWheeler	90	2	2002-01-11 11:28:46	500	0000-00-00 00:00:00	-1	2	3	1
+9197722223	berry	90	3	2002-01-11 11:28:09	500	2002-01-02 11:45:32	501	4	10	0
+650	San Francisco	0	0	2001-12-27 11:13:36	342	0000-00-00 00:00:00	-1	1	24	1
+302467	Sue's Subshop	90	3	2002-01-09 11:32:41	500	2002-01-02 11:51:11	501	7	24	0
+6014911113	SudzCarwash	520	1	2002-01-02 11:52:34	500	2002-01-02 11:52:59	501	33	32768	0
+333	tubs	99	2	2002-01-09 11:34:40	501	2002-01-09 11:34:40	500	3	10	0
+select * from t2;
+number	cname	carrier_id	privacy	last_mod_date	last_mod_id	last_app_date	last_app_id	version	assigned_scps	status
+4077711111	SeanWheeler	0	2	2002-01-11 11:28:53	500	0000-00-00 00:00:00	-1	2	3	1
+9197722223	berry	90	3	2002-01-11 11:28:18	500	2002-01-02 11:45:32	501	4	10	0
+650	San Francisco	90	0	2002-01-09 11:31:58	342	0000-00-00 00:00:00	-1	1	24	1
+333	tubs	99	2	2002-01-09 11:34:53	501	2002-01-09 11:34:53	500	3	10	0
+delete t1, t2 from t1 left join t2 on t1.number=t2.number where (t1.carrier_id=90 and t1.number=t2.number) or (t2.carrier_id=90 and t1.number=t2.number) or  (t1.carrier_id=90 and t2.number is null);
+select * from t1;
+number	cname	carrier_id	privacy	last_mod_date	last_mod_id	last_app_date	last_app_id	version	assigned_scps	status
+6014911113	SudzCarwash	520	1	2002-01-02 11:52:34	500	2002-01-02 11:52:59	501	33	32768	0
+333	tubs	99	2	2002-01-09 11:34:40	501	2002-01-09 11:34:40	500	3	10	0
+select * from t2;
+number	cname	carrier_id	privacy	last_mod_date	last_mod_id	last_app_date	last_app_id	version	assigned_scps	status
+333	tubs	99	2	2002-01-09 11:34:53	501	2002-01-09 11:34:53	500	3	10	0
+select * from t2;
+number	cname	carrier_id	privacy	last_mod_date	last_mod_id	last_app_date	last_app_id	version	assigned_scps	status
+333	tubs	99	2	2002-01-09 11:34:53	501	2002-01-09 11:34:53	500	3	10	0
+drop table t1,t2;
+create table t1 (id int unsigned not null auto_increment, code tinyint unsigned not null, name char(20) not null, primary key (id), key (code), unique (name)) engine=innodb;
+BEGIN;
+SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
+SELECT @@tx_isolation,@@global.tx_isolation;
+@@tx_isolation	@@global.tx_isolation
+SERIALIZABLE	REPEATABLE-READ
+insert into t1 (code, name) values (1, 'Tim'), (1, 'Monty'), (2, 'David');
+select id, code, name from t1 order by id;
+id	code	name
+1	1	Tim
+2	1	Monty
+3	2	David
+COMMIT;
+BEGIN;
+SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
+insert into t1 (code, name) values (2, 'Erik'), (3, 'Sasha');
+select id, code, name from t1 order by id;
+id	code	name
+1	1	Tim
+2	1	Monty
+3	2	David
+4	2	Erik
+5	3	Sasha
+COMMIT;
+SET binlog_format='MIXED';
+BEGIN;
+SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+insert into t1 (code, name) values (3, 'Jeremy'), (4, 'Matt');
+select id, code, name from t1 order by id;
+id	code	name
+1	1	Tim
+2	1	Monty
+3	2	David
+4	2	Erik
+5	3	Sasha
+6	3	Jeremy
+7	4	Matt
+COMMIT;
+DROP TABLE t1;
+create table t1 (n int(10), d int(10)) engine=innodb;
+create table t2 (n int(10), d int(10)) engine=innodb;
+insert into t1 values(1,1),(1,2);
+insert into t2 values(1,10),(2,20);
+UPDATE t1,t2 SET t1.d=t2.d,t2.d=30 WHERE t1.n=t2.n;
+select * from t1;
+n	d
+1	10
+1	10
+select * from t2;
+n	d
+1	30
+2	20
+drop table t1,t2;
+drop table if exists t1, t2;
+CREATE TABLE t1 (a int, PRIMARY KEY (a));
+CREATE TABLE t2 (a int, PRIMARY KEY (a)) ENGINE=InnoDB;
+create trigger trg_del_t2 after  delete on t2 for each row
+insert into t1 values (1);
+insert into t1 values (1);
+insert into t2 values (1),(2);
+delete t2 from t2;
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+select count(*) from t2 /* must be 2 as restored after rollback caused by the error */;
+count(*)
+2
+drop table t1, t2;
+drop table if exists t1, t2;
+CREATE TABLE t1 (a int, PRIMARY KEY (a));
+CREATE TABLE t2 (a int, PRIMARY KEY (a)) ENGINE=InnoDB;
+create trigger trg_del_t2 after  delete on t2 for each row
+insert into t1 values (1);
+insert into t1 values (1);
+insert into t2 values (1),(2);
+delete t2 from t2;
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+select count(*) from t2 /* must be 2 as restored after rollback caused by the error */;
+count(*)
+2
+drop table t1, t2;
+create table t1 (a int, b int) engine=innodb;
+insert into t1 values(20,null);
+select t2.b, ifnull(t2.b,"this is null") from t1 as t2 left join t1 as t3 on
+t2.b=t3.a;
+b	ifnull(t2.b,"this is null")
+NULL	this is null
+select t2.b, ifnull(t2.b,"this is null") from t1 as t2 left join t1 as t3 on
+t2.b=t3.a order by 1;
+b	ifnull(t2.b,"this is null")
+NULL	this is null
+insert into t1 values(10,null);
+select t2.b, ifnull(t2.b,"this is null") from t1 as t2 left join t1 as t3 on
+t2.b=t3.a order by 1;
+b	ifnull(t2.b,"this is null")
+NULL	this is null
+NULL	this is null
+drop table t1;
+create table t1 (a varchar(10) not null) engine=myisam;
+create table t2 (b varchar(10) not null unique) engine=innodb;
+select t1.a from t1,t2 where t1.a=t2.b;
+a
+drop table t1,t2;
+create table t1 (a int not null, b int, primary key (a)) engine = innodb;
+create table t2 (a int not null, b int, primary key (a)) engine = innodb;
+insert into t1 values (10, 20);
+insert into t2 values (10, 20);
+update t1, t2 set t1.b = 150, t2.b = t1.b where t2.a = t1.a and t1.a = 10;
+drop table t1,t2;
+CREATE TABLE t1 (id INT NOT NULL, PRIMARY KEY (id)) ENGINE=INNODB;
+CREATE TABLE t2 (id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id), FOREIGN KEY (t1_id) REFERENCES t1(id)  ON DELETE CASCADE ) ENGINE=INNODB;
+insert into t1 set id=1;
+insert into t2 set id=1, t1_id=1;
+delete t1,t2 from t1,t2 where t1.id=t2.t1_id;
+select * from t1;
+id
+select * from t2;
+id	t1_id
+drop table t2,t1;
+CREATE TABLE t1(id INT NOT NULL,  PRIMARY KEY (id)) ENGINE=INNODB;
+CREATE TABLE t2(id  INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id)  ) ENGINE=INNODB;
+INSERT INTO t1 VALUES(1);
+INSERT INTO t2 VALUES(1, 1);
+SELECT * from t1;
+id
+1
+UPDATE t1,t2 SET t1.id=t1.id+1, t2.t1_id=t1.id+1;
+SELECT * from t1;
+id
+2
+UPDATE t1,t2 SET t1.id=t1.id+1 where t1.id!=t2.id;
+SELECT * from t1;
+id
+3
+DROP TABLE t1,t2;
+set autocommit=0;
+CREATE TABLE t1 (id CHAR(15) NOT NULL, value CHAR(40) NOT NULL, PRIMARY KEY(id)) ENGINE=InnoDB;
+CREATE TABLE t2 (id CHAR(15) NOT NULL, value CHAR(40) NOT NULL, PRIMARY KEY(id)) ENGINE=InnoDB;
+CREATE TABLE t3 (id1 CHAR(15) NOT NULL, id2 CHAR(15) NOT NULL, PRIMARY KEY(id1, id2)) ENGINE=InnoDB;
+INSERT INTO t3 VALUES("my-test-1", "my-test-2");
+COMMIT;
+INSERT INTO t1 VALUES("this-key", "will disappear");
+INSERT INTO t2 VALUES("this-key", "will also disappear");
+DELETE FROM t3 WHERE id1="my-test-1";
+SELECT * FROM t1;
+id	value
+this-key	will disappear
+SELECT * FROM t2;
+id	value
+this-key	will also disappear
+SELECT * FROM t3;
+id1	id2
+ROLLBACK;
+SELECT * FROM t1;
+id	value
+SELECT * FROM t2;
+id	value
+SELECT * FROM t3;
+id1	id2
+my-test-1	my-test-2
+SELECT * FROM t3 WHERE id1="my-test-1" LOCK IN SHARE MODE;
+id1	id2
+my-test-1	my-test-2
+COMMIT;
+set autocommit=1;
+DROP TABLE t1,t2,t3;
+CREATE TABLE t1 (a int not null primary key, b int not null, unique (b)) engine=innodb;
+INSERT INTO t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
+UPDATE t1 set a=a+100 where b between 2 and 3 and a < 1000;
+SELECT * from t1;
+a	b
+1	1
+102	2
+103	3
+4	4
+5	5
+6	6
+7	7
+8	8
+9	9
+drop table t1;
+CREATE TABLE t2 (   NEXT_T         BIGINT NOT NULL PRIMARY KEY) ENGINE=MyISAM;
+CREATE TABLE t1 (  B_ID           INTEGER NOT NULL PRIMARY KEY) ENGINE=InnoDB;
+SET AUTOCOMMIT=0;
+INSERT INTO t1 ( B_ID ) VALUES ( 1 );
+INSERT INTO t2 ( NEXT_T ) VALUES ( 1 );
+ROLLBACK;
+Warnings:
+Warning	1196	Some non-transactional changed tables couldn't be rolled back
+SELECT * FROM t1;
+B_ID
+drop table  t1,t2;
+create table t1  ( pk         int primary key,    parent     int not null,    child      int not null,       index (parent)  ) engine = innodb;
+insert into t1 values   (1,0,4),  (2,1,3),  (3,2,1),  (4,1,2);
+select distinct  parent,child   from t1   order by parent;
+parent	child
+0	4
+1	2
+1	3
+2	1
+drop table t1;
+create table t1 (a int not null auto_increment primary key, b int, c int, key(c)) engine=innodb;
+create table t2 (a int not null auto_increment primary key, b int);
+insert into t1 (b) values (null),(null),(null),(null),(null),(null),(null);
+insert into t2 (a) select b from t1;
+insert into t1 (b) select b from t2;
+insert into t2 (a) select b from t1;
+insert into t1 (a) select b from t2;
+insert into t2 (a) select b from t1;
+insert into t1 (a) select b from t2;
+insert into t2 (a) select b from t1;
+insert into t1 (a) select b from t2;
+insert into t2 (a) select b from t1;
+insert into t1 (a) select b from t2;
+select count(*) from t1;
+count(*)
+623
+explain select * from t1 where c between 1 and 2500;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	range	c	c	5	NULL	#	Using where
+update t1 set c=a;
+explain select * from t1 where c between 1 and 2500;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ALL	c	NULL	NULL	NULL	#	Using where
+drop table t1,t2;
+create table t1 (id int primary key auto_increment, fk int, index index_fk (fk)) engine=innodb;
+insert into t1 (id) values (null),(null),(null),(null),(null);
+update t1 set fk=69 where fk is null order by id limit 1;
+SELECT * from t1;
+id	fk
+2	NULL
+3	NULL
+4	NULL
+5	NULL
+1	69
+drop table t1;
+create table t1 (a int not null, b int not null, key (a));
+insert into t1 values (1,1),(1,2),(1,3),(3,1),(3,2),(3,3),(3,1),(3,2),(3,3),(2,1),(2,2),(2,3);
+SET @tmp=0;
+update t1 set b=(@tmp:=@tmp+1) order by a;
+update t1 set b=99 where a=1 order by b asc limit 1;
+update t1 set b=100 where a=1 order by b desc limit 2;
+update t1 set a=a+10+b where a=1 order by b;
+select * from t1 order by a,b;
+a	b
+2	4
+2	5
+2	6
+3	7
+3	8
+3	9
+3	10
+3	11
+3	12
+13	2
+111	100
+111	100
+drop table t1;
+create table t1 ( c char(8) not null ) engine=innodb;
+insert into t1 values ('0'),('1'),('2'),('3'),('4'),('5'),('6'),('7'),('8'),('9');
+insert into t1 values ('A'),('B'),('C'),('D'),('E'),('F');
+alter table t1 add b char(8) not null;
+alter table t1 add a char(8) not null;
+alter table t1 add primary key (a,b,c);
+update t1 set a=c, b=c;
+create table t2 (c char(8) not null, b char(8) not null, a char(8) not null, primary key(a,b,c)) engine=innodb;
+insert into t2 select * from t1;
+delete t1,t2 from t2,t1 where t1.a<'B' and t2.b=t1.b;
+drop table t1,t2;
+SET AUTOCOMMIT=1;
+create table t1 (a integer auto_increment primary key) engine=innodb;
+insert into t1 (a) values (NULL),(NULL);
+truncate table t1;
+insert into t1 (a) values (NULL),(NULL);
+SELECT * from t1;
+a
+1
+2
+drop table t1;
+CREATE TABLE t1 (`id 1` INT NOT NULL, PRIMARY KEY (`id 1`)) ENGINE=INNODB;
+CREATE TABLE t2 (id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id), FOREIGN KEY (`t1_id`) REFERENCES `t1`(`id 1`)  ON DELETE CASCADE ) ENGINE=INNODB;
+drop table t2,t1;
+create table `t1` (`id` int( 11 ) not null  ,primary key ( `id` )) engine = innodb;
+insert into `t1`values ( 1 ) ;
+create table `t2` (`id` int( 11 ) not null default '0',unique key `id` ( `id` ) ,constraint `t1_id_fk` foreign key ( `id` ) references `t1` (`id` )) engine = innodb;
+insert into `t2`values ( 1 ) ;
+create table `t3` (`id` int( 11 ) not null default '0',key `id` ( `id` ) ,constraint `t2_id_fk` foreign key ( `id` ) references `t2` (`id` )) engine = innodb;
+insert into `t3`values ( 1 ) ;
+delete t3,t2,t1 from t1,t2,t3 where t1.id =1 and t2.id = t1.id and t3.id = t2.id;
+ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`))
+update t1,t2,t3 set t3.id=5, t2.id=6, t1.id=7  where t1.id =1 and t2.id = t1.id and t3.id = t2.id;
+ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`))
+update t3 set  t3.id=7  where t1.id =1 and t2.id = t1.id and t3.id = t2.id;
+ERROR 42S22: Unknown column 't1.id' in 'where clause'
+drop table t3,t2,t1;
+create table t1(
+id int primary key,
+pid int,
+index(pid),
+foreign key(pid) references t1(id) on delete cascade) engine=innodb;
+insert into t1 values(0,0),(1,0),(2,1),(3,2),(4,3),(5,4),(6,5),(7,6),
+(8,7),(9,8),(10,9),(11,10),(12,11),(13,12),(14,13),(15,14);
+delete from t1 where id=0;
+ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t1`, CONSTRAINT `t1_ibfk_1` FOREIGN KEY (`pid`) REFERENCES `t1` (`id`) ON DELETE CASCADE)
+delete from t1 where id=15;
+delete from t1 where id=0;
+drop table t1;
+CREATE TABLE t1 (col1 int(1))ENGINE=InnoDB;
+CREATE TABLE t2 (col1 int(1),stamp TIMESTAMP,INDEX stamp_idx
+(stamp))ENGINE=InnoDB;
+insert into t1 values (1),(2),(3);
+insert into t2 values (1, 20020204130000),(2, 20020204130000),(4,20020204310000 ),(5,20020204230000);
+Warnings:
+Warning	1265	Data truncated for column 'stamp' at row 3
+SELECT col1 FROM t1 UNION SELECT col1 FROM t2 WHERE stamp <
+'20020204120000' GROUP BY col1;
+col1
+1
+2
+3
+4
+drop table t1,t2;
+CREATE TABLE t1 (
+`id` int(10) unsigned NOT NULL auto_increment,
+`id_object` int(10) unsigned default '0',
+`id_version` int(10) unsigned NOT NULL default '1',
+`label` varchar(100) NOT NULL default '',
+`description` text,
+PRIMARY KEY  (`id`),
+KEY `id_object` (`id_object`),
+KEY `id_version` (`id_version`)
+) ENGINE=InnoDB;
+INSERT INTO t1 VALUES("6", "3382", "9", "Test", NULL), ("7", "102", "5", "Le Pekin (Test)", NULL),("584", "1794", "4", "Test de resto", NULL),("837", "1822", "6", "Test 3", NULL),("1119", "3524", "1", "Societe Test", NULL),("1122", "3525", "1", "Fournisseur Test", NULL);
+CREATE TABLE t2 (
+`id` int(10) unsigned NOT NULL auto_increment,
+`id_version` int(10) unsigned NOT NULL default '1',
+PRIMARY KEY  (`id`),
+KEY `id_version` (`id_version`)
+) ENGINE=InnoDB;
+INSERT INTO t2 VALUES("3524", "1"),("3525", "1"),("1794", "4"),("102", "5"),("1822", "6"),("3382", "9");
+SELECT t2.id, t1.`label` FROM t2 INNER JOIN
+(SELECT t1.id_object as id_object FROM t1 WHERE t1.`label` LIKE '%test%') AS lbl 
+ON (t2.id = lbl.id_object) INNER JOIN t1 ON (t2.id = t1.id_object);
+id	label
+3382	Test
+102	Le Pekin (Test)
+1794	Test de resto
+1822	Test 3
+3524	Societe Test
+3525	Fournisseur Test
+drop table t1,t2;
+create table t1 (a int, b varchar(200), c text not null) checksum=1 engine=myisam;
+create table t2 (a int, b varchar(200), c text not null) checksum=0 engine=innodb;
+create table t3 (a int, b varchar(200), c text not null) checksum=1 engine=innodb;
+insert t1 values (1, "aaa", "bbb"), (NULL, "", "ccccc"), (0, NULL, "");
+insert t2 select * from t1;
+insert t3 select * from t1;
+checksum table t1, t2, t3, t4 quick;
+Table	Checksum
+test.t1	3442722830
+test.t2	NULL
+test.t3	NULL
+test.t4	NULL
+Warnings:
+Error	1146	Table 'test.t4' doesn't exist
+checksum table t1, t2, t3, t4;
+Table	Checksum
+test.t1	3442722830
+test.t2	3442722830
+test.t3	3442722830
+test.t4	NULL
+Warnings:
+Error	1146	Table 'test.t4' doesn't exist
+checksum table t1, t2, t3, t4 extended;
+Table	Checksum
+test.t1	3442722830
+test.t2	3442722830
+test.t3	3442722830
+test.t4	NULL
+Warnings:
+Error	1146	Table 'test.t4' doesn't exist
+drop table t1,t2,t3;
+create table t1 (id int,  name char(10) not null,  name2 char(10) not null) engine=innodb;
+insert into t1 values(1,'first','fff'),(2,'second','sss'),(3,'third','ttt');
+select trim(name2) from t1  union all  select trim(name) from t1 union all select trim(id) from t1;
+trim(name2)
+fff
+sss
+ttt
+first
+second
+third
+1
+2
+3
+drop table t1;
+create table t1 (a int) engine=innodb;
+create table t2 like t1;
+drop table t1,t2;
+create table t1 (id int(11) not null, id2 int(11) not null, unique (id,id2)) engine=innodb;
+create table t2 (id int(11) not null, constraint t1_id_fk foreign key ( id ) references t1 (id)) engine = innodb;
+show create table t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `id` int(11) NOT NULL,
+  `id2` int(11) NOT NULL,
+  UNIQUE KEY `id` (`id`,`id2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+show create table t2;
+Table	Create Table
+t2	CREATE TABLE `t2` (
+  `id` int(11) NOT NULL,
+  KEY `t1_id_fk` (`id`),
+  CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+create index id on t2 (id);
+show create table t2;
+Table	Create Table
+t2	CREATE TABLE `t2` (
+  `id` int(11) NOT NULL,
+  KEY `id` (`id`),
+  CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+create index id2 on t2 (id);
+show create table t2;
+Table	Create Table
+t2	CREATE TABLE `t2` (
+  `id` int(11) NOT NULL,
+  KEY `id` (`id`),
+  KEY `id2` (`id`),
+  CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+drop index id2 on t2;
+drop index id on t2;
+ERROR HY000: Cannot drop index 'id': needed in a foreign key constraint
+show create table t2;
+Table	Create Table
+t2	CREATE TABLE `t2` (
+  `id` int(11) NOT NULL,
+  KEY `id` (`id`),
+  CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+drop table t2;
+create table t2 (id int(11) not null, id2 int(11) not null, constraint t1_id_fk foreign key (id,id2) references t1 (id,id2)) engine = innodb;
+show create table t2;
+Table	Create Table
+t2	CREATE TABLE `t2` (
+  `id` int(11) NOT NULL,
+  `id2` int(11) NOT NULL,
+  KEY `t1_id_fk` (`id`,`id2`),
+  CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`, `id2`) REFERENCES `t1` (`id`, `id2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+create unique index id on t2 (id,id2);
+show create table t2;
+Table	Create Table
+t2	CREATE TABLE `t2` (
+  `id` int(11) NOT NULL,
+  `id2` int(11) NOT NULL,
+  UNIQUE KEY `id` (`id`,`id2`),
+  CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`, `id2`) REFERENCES `t1` (`id`, `id2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+drop table t2;
+create table t2 (id int(11) not null, id2 int(11) not null, unique (id,id2),constraint t1_id_fk foreign key (id2,id) references t1 (id,id2)) engine = innodb;
+show create table t2;
+Table	Create Table
+t2	CREATE TABLE `t2` (
+  `id` int(11) NOT NULL,
+  `id2` int(11) NOT NULL,
+  UNIQUE KEY `id` (`id`,`id2`),
+  KEY `t1_id_fk` (`id2`,`id`),
+  CONSTRAINT `t1_id_fk` FOREIGN KEY (`id2`, `id`) REFERENCES `t1` (`id`, `id2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+drop table t2;
+create table t2 (id int(11) not null, id2 int(11) not null, unique (id,id2), constraint t1_id_fk foreign key (id) references t1 (id)) engine = innodb;
+show create table t2;
+Table	Create Table
+t2	CREATE TABLE `t2` (
+  `id` int(11) NOT NULL,
+  `id2` int(11) NOT NULL,
+  UNIQUE KEY `id` (`id`,`id2`),
+  CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+drop table t2;
+create table t2 (id int(11) not null, id2 int(11) not null, unique (id,id2),constraint t1_id_fk foreign key (id2,id) references t1 (id,id2)) engine = innodb;
+show create table t2;
+Table	Create Table
+t2	CREATE TABLE `t2` (
+  `id` int(11) NOT NULL,
+  `id2` int(11) NOT NULL,
+  UNIQUE KEY `id` (`id`,`id2`),
+  KEY `t1_id_fk` (`id2`,`id`),
+  CONSTRAINT `t1_id_fk` FOREIGN KEY (`id2`, `id`) REFERENCES `t1` (`id`, `id2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+drop table t2;
+create table t2 (id int(11) not null auto_increment, id2 int(11) not null, constraint t1_id_fk foreign key (id) references t1 (id), primary key (id), index (id,id2)) engine = innodb;
+show create table t2;
+Table	Create Table
+t2	CREATE TABLE `t2` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `id2` int(11) NOT NULL,
+  PRIMARY KEY (`id`),
+  KEY `id` (`id`,`id2`),
+  CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+drop table t2;
+create table t2 (id int(11) not null auto_increment, id2 int(11) not null, constraint t1_id_fk foreign key (id) references t1 (id)) engine= innodb;
+show create table t2;
+Table	Create Table
+t2	CREATE TABLE `t2` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `id2` int(11) NOT NULL,
+  KEY `t1_id_fk` (`id`),
+  CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+alter table t2 add index id_test (id), add index id_test2 (id,id2);
+show create table t2;
+Table	Create Table
+t2	CREATE TABLE `t2` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `id2` int(11) NOT NULL,
+  KEY `id_test` (`id`),
+  KEY `id_test2` (`id`,`id2`),
+  CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+drop table t2;
+create table t2 (id int(11) not null, id2 int(11) not null, constraint t1_id_fk foreign key (id2,id) references t1 (id)) engine = innodb;
+ERROR 42000: Incorrect foreign key definition for 't1_id_fk': Key reference and table reference don't match
+create table t2 (a int auto_increment primary key, b int, index(b), foreign key (b) references t1(id), unique(b)) engine=innodb;
+show create table t2;
+Table	Create Table
+t2	CREATE TABLE `t2` (
+  `a` int(11) NOT NULL AUTO_INCREMENT,
+  `b` int(11) DEFAULT NULL,
+  PRIMARY KEY (`a`),
+  UNIQUE KEY `b_2` (`b`),
+  KEY `b` (`b`),
+  CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`b`) REFERENCES `t1` (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+drop table t2;
+create table t2 (a int auto_increment primary key, b int, foreign key (b) references t1(id), foreign key (b) references t1(id), unique(b)) engine=innodb;
+show create table t2;
+Table	Create Table
+t2	CREATE TABLE `t2` (
+  `a` int(11) NOT NULL AUTO_INCREMENT,
+  `b` int(11) DEFAULT NULL,
+  PRIMARY KEY (`a`),
+  UNIQUE KEY `b` (`b`),
+  CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`b`) REFERENCES `t1` (`id`),
+  CONSTRAINT `t2_ibfk_2` FOREIGN KEY (`b`) REFERENCES `t1` (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+drop table t2, t1;
+create table t1 (c char(10), index (c,c)) engine=innodb;
+ERROR 42S21: Duplicate column name 'c'
+create table t1 (c1 char(10), c2 char(10), index (c1,c2,c1)) engine=innodb;
+ERROR 42S21: Duplicate column name 'c1'
+create table t1 (c1 char(10), c2 char(10), index (c1,c1,c2)) engine=innodb;
+ERROR 42S21: Duplicate column name 'c1'
+create table t1 (c1 char(10), c2 char(10), index (c2,c1,c1)) engine=innodb;
+ERROR 42S21: Duplicate column name 'c1'
+create table t1 (c1 char(10), c2 char(10)) engine=innodb;
+alter table t1 add key (c1,c1);
+ERROR 42S21: Duplicate column name 'c1'
+alter table t1 add key (c2,c1,c1);
+ERROR 42S21: Duplicate column name 'c1'
+alter table t1 add key (c1,c2,c1);
+ERROR 42S21: Duplicate column name 'c1'
+alter table t1 add key (c1,c1,c2);
+ERROR 42S21: Duplicate column name 'c1'
+drop table t1;
+create table t1(a int(1) , b int(1)) engine=innodb;
+insert into t1 values ('1111', '3333');
+select distinct concat(a, b) from t1;
+concat(a, b)
+11113333
+drop table t1;
+CREATE TABLE t1 ( a char(10) ) ENGINE=InnoDB;
+SELECT a FROM t1 WHERE MATCH (a) AGAINST ('test' IN BOOLEAN MODE);
+ERROR HY000: The used table type doesn't support FULLTEXT indexes
+DROP TABLE t1;
+CREATE TABLE t1 (a_id tinyint(4) NOT NULL default '0', PRIMARY KEY  (a_id)) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+INSERT INTO t1 VALUES (1),(2),(3);
+CREATE TABLE t2 (b_id tinyint(4) NOT NULL default '0',b_a tinyint(4) NOT NULL default '0', PRIMARY KEY  (b_id), KEY  (b_a), 
+CONSTRAINT fk_b_a FOREIGN KEY (b_a) REFERENCES t1 (a_id) ON DELETE CASCADE ON UPDATE NO ACTION) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+INSERT INTO t2 VALUES (1,1),(2,1),(3,1),(4,2),(5,2);
+SELECT * FROM (SELECT t1.*,GROUP_CONCAT(t2.b_id SEPARATOR ',') as b_list FROM (t1 LEFT JOIN (t2) on t1.a_id = t2.b_a) GROUP BY t1.a_id ) AS xyz;
+a_id	b_list
+1	1,2,3
+2	4,5
+3	NULL
+DROP TABLE t2;
+DROP TABLE t1;
+create temporary table t1 (a int) engine=innodb;
+insert into t1 values (4711);
+truncate t1;
+insert into t1 values (42);
+select * from t1;
+a
+42
+drop table t1;
+create table t1 (a int) engine=innodb;
+insert into t1 values (4711);
+truncate t1;
+insert into t1 values (42);
+select * from t1;
+a
+42
+drop table t1;
+create table t1 (a int not null, b int not null, c blob not null, d int not null, e int, primary key (a,b,c(255),d)) engine=innodb;
+insert into t1 values (2,2,"b",2,2),(1,1,"a",1,1),(3,3,"ab",3,3);
+select * from t1 order by a,b,c,d;
+a	b	c	d	e
+1	1	a	1	1
+2	2	b	2	2
+3	3	ab	3	3
+explain select * from t1 order by a,b,c,d;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	3	Using filesort
+drop table t1;
+create table t1 (a char(1), b char(1), key(a, b)) engine=innodb;
+insert into t1 values ('8', '6'), ('4', '7');
+select min(a) from t1;
+min(a)
+4
+select min(b) from t1 where a='8';
+min(b)
+6
+drop table t1;
+create table t1 (x bigint unsigned not null primary key) engine=innodb;
+insert into t1(x) values (0xfffffffffffffff0),(0xfffffffffffffff1);
+select * from t1;
+x
+18446744073709551600
+18446744073709551601
+select count(*) from t1 where x>0;
+count(*)
+2
+select count(*) from t1 where x=0;
+count(*)
+0
+select count(*) from t1 where x<0;
+count(*)
+0
+select count(*) from t1 where x < -16;
+count(*)
+0
+select count(*) from t1 where x = -16;
+count(*)
+0
+explain select count(*) from t1 where x > -16;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	index	PRIMARY	PRIMARY	8	NULL	2	Using where; Using index
+select count(*) from t1 where x > -16;
+count(*)
+2
+select * from t1 where x > -16;
+x
+18446744073709551600
+18446744073709551601
+select count(*) from t1 where x = 18446744073709551601;
+count(*)
+1
+drop table t1;
+SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_buffer_pool_pages_total';
+variable_value
+8191
+SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_page_size';
+variable_value
+16384
+SELECT variable_value - @innodb_rows_deleted_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_deleted';
+variable_value - @innodb_rows_deleted_orig
+71
+SELECT variable_value - @innodb_rows_inserted_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_inserted';
+variable_value - @innodb_rows_inserted_orig
+1063
+SELECT variable_value - @innodb_rows_updated_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_updated';
+variable_value - @innodb_rows_updated_orig
+865
+SELECT variable_value - @innodb_row_lock_waits_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_waits';
+variable_value - @innodb_row_lock_waits_orig
+0
+SELECT variable_value - @innodb_row_lock_current_waits_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_current_waits';
+variable_value - @innodb_row_lock_current_waits_orig
+0
+SELECT variable_value - @innodb_row_lock_time_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time';
+variable_value - @innodb_row_lock_time_orig
+0
+SELECT variable_value - @innodb_row_lock_time_max_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time_max';
+variable_value - @innodb_row_lock_time_max_orig
+0
+SELECT variable_value - @innodb_row_lock_time_avg_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time_avg';
+variable_value - @innodb_row_lock_time_avg_orig
+0
+SET @innodb_sync_spin_loops_orig = @@innodb_sync_spin_loops;
+show variables like "innodb_sync_spin_loops";
+Variable_name	Value
+innodb_sync_spin_loops	30
+set global innodb_sync_spin_loops=1000;
+show variables like "innodb_sync_spin_loops";
+Variable_name	Value
+innodb_sync_spin_loops	1000
+set global innodb_sync_spin_loops=0;
+show variables like "innodb_sync_spin_loops";
+Variable_name	Value
+innodb_sync_spin_loops	0
+set global innodb_sync_spin_loops=20;
+show variables like "innodb_sync_spin_loops";
+Variable_name	Value
+innodb_sync_spin_loops	20
+set global innodb_sync_spin_loops=@innodb_sync_spin_loops_orig;
+SET @old_innodb_thread_concurrency= @@global.innodb_thread_concurrency;
+show variables like "innodb_thread_concurrency";
+Variable_name	Value
+innodb_thread_concurrency	0
+set global innodb_thread_concurrency=1001;
+Warnings:
+Warning	1292	Truncated incorrect thread_concurrency value: '1001'
+show variables like "innodb_thread_concurrency";
+Variable_name	Value
+innodb_thread_concurrency	1000
+set global innodb_thread_concurrency=0;
+show variables like "innodb_thread_concurrency";
+Variable_name	Value
+innodb_thread_concurrency	0
+set global innodb_thread_concurrency=16;
+show variables like "innodb_thread_concurrency";
+Variable_name	Value
+innodb_thread_concurrency	16
+SET @@global.innodb_thread_concurrency= @old_innodb_thread_concurrency;
+show variables like "innodb_concurrency_tickets";
+Variable_name	Value
+innodb_concurrency_tickets	500
+set global innodb_concurrency_tickets=1000;
+show variables like "innodb_concurrency_tickets";
+Variable_name	Value
+innodb_concurrency_tickets	1000
+set global innodb_concurrency_tickets=0;
+Warnings:
+Warning	1292	Truncated incorrect concurrency_tickets value: '0'
+show variables like "innodb_concurrency_tickets";
+Variable_name	Value
+innodb_concurrency_tickets	1
+set global innodb_concurrency_tickets=500;
+show variables like "innodb_concurrency_tickets";
+Variable_name	Value
+innodb_concurrency_tickets	500
+show variables like "innodb_thread_sleep_delay";
+Variable_name	Value
+innodb_thread_sleep_delay	10000
+set global innodb_thread_sleep_delay=100000;
+show variables like "innodb_thread_sleep_delay";
+Variable_name	Value
+innodb_thread_sleep_delay	100000
+set global innodb_thread_sleep_delay=0;
+show variables like "innodb_thread_sleep_delay";
+Variable_name	Value
+innodb_thread_sleep_delay	0
+set global innodb_thread_sleep_delay=10000;
+show variables like "innodb_thread_sleep_delay";
+Variable_name	Value
+innodb_thread_sleep_delay	10000
+set storage_engine=INNODB;
+drop table if exists t1,t2,t3;
+--- Testing varchar ---
+--- Testing varchar ---
+create table t1 (v varchar(10), c char(10), t text);
+insert into t1 values('+ ', '+ ', '+ ');
+set @a=repeat(' ',20);
+insert into t1 values (concat('+', at a),concat('+', at a),concat('+', at a));
+Warnings:
+Note	1265	Data truncated for column 'v' at row 1
+select concat('*',v,'*',c,'*',t,'*') from t1;
+concat('*',v,'*',c,'*',t,'*')
+*+ *+*+ *
+*+         *+*+                    *
+show create table t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `v` varchar(10) DEFAULT NULL,
+  `c` char(10) DEFAULT NULL,
+  `t` text
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+create table t2 like t1;
+show create table t2;
+Table	Create Table
+t2	CREATE TABLE `t2` (
+  `v` varchar(10) DEFAULT NULL,
+  `c` char(10) DEFAULT NULL,
+  `t` text
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+create table t3 select * from t1;
+show create table t3;
+Table	Create Table
+t3	CREATE TABLE `t3` (
+  `v` varchar(10) DEFAULT NULL,
+  `c` char(10) DEFAULT NULL,
+  `t` text
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+alter table t1 modify c varchar(10);
+show create table t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `v` varchar(10) DEFAULT NULL,
+  `c` varchar(10) DEFAULT NULL,
+  `t` text
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+alter table t1 modify v char(10);
+show create table t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `v` char(10) DEFAULT NULL,
+  `c` varchar(10) DEFAULT NULL,
+  `t` text
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+alter table t1 modify t varchar(10);
+Warnings:
+Note	1265	Data truncated for column 't' at row 2
+show create table t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `v` char(10) DEFAULT NULL,
+  `c` varchar(10) DEFAULT NULL,
+  `t` varchar(10) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+select concat('*',v,'*',c,'*',t,'*') from t1;
+concat('*',v,'*',c,'*',t,'*')
+*+*+*+ *
+*+*+*+         *
+drop table t1,t2,t3;
+create table t1 (v varchar(10), c char(10), t text, key(v), key(c), key(t(10)));
+show create table t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `v` varchar(10) DEFAULT NULL,
+  `c` char(10) DEFAULT NULL,
+  `t` text,
+  KEY `v` (`v`),
+  KEY `c` (`c`),
+  KEY `t` (`t`(10))
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+select count(*) from t1;
+count(*)
+270
+insert into t1 values(concat('a',char(1)),concat('a',char(1)),concat('a',char(1)));
+select count(*) from t1 where v='a';
+count(*)
+10
+select count(*) from t1 where c='a';
+count(*)
+10
+select count(*) from t1 where t='a';
+count(*)
+10
+select count(*) from t1 where v='a  ';
+count(*)
+10
+select count(*) from t1 where c='a  ';
+count(*)
+10
+select count(*) from t1 where t='a  ';
+count(*)
+10
+select count(*) from t1 where v between 'a' and 'a ';
+count(*)
+10
+select count(*) from t1 where v between 'a' and 'a ' and v between 'a  ' and 'b\n';
+count(*)
+10
+select count(*) from t1 where v like 'a%';
+count(*)
+11
+select count(*) from t1 where c like 'a%';
+count(*)
+11
+select count(*) from t1 where t like 'a%';
+count(*)
+11
+select count(*) from t1 where v like 'a %';
+count(*)
+9
+explain select count(*) from t1 where v='a  ';
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ref	v	v	13	const	#	Using where; Using index
+explain select count(*) from t1 where c='a  ';
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ref	c	c	11	const	#	Using where; Using index
+explain select count(*) from t1 where t='a  ';
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ref	t	t	13	const	#	Using where
+explain select count(*) from t1 where v like 'a%';
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	range	v	v	13	NULL	#	Using where; Using index
+explain select count(*) from t1 where v between 'a' and 'a ';
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ref	v	v	13	const	#	Using where; Using index
+explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a  ' and 'b\n';
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ref	v	v	13	const	#	Using where; Using index
+alter table t1 add unique(v);
+ERROR 23000: Duplicate entry '{ ' for key 'v_2'
+alter table t1 add key(v);
+select concat('*',v,'*',c,'*',t,'*') as qq from t1 where v='a';
+qq
+*a*a*a*
+*a *a*a *
+*a  *a*a  *
+*a   *a*a   *
+*a    *a*a    *
+*a     *a*a     *
+*a      *a*a      *
+*a       *a*a       *
+*a        *a*a        *
+*a         *a*a         *
+explain select * from t1 where v='a';
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ref	v,v_2	#	13	const	#	Using where
+select v,count(*) from t1 group by v limit 10;
+v	count(*)
+a	1
+a	10
+b	10
+c	10
+d	10
+e	10
+f	10
+g	10
+h	10
+i	10
+select v,count(t) from t1 group by v limit 10;
+v	count(t)
+a	1
+a	10
+b	10
+c	10
+d	10
+e	10
+f	10
+g	10
+h	10
+i	10
+select v,count(c) from t1 group by v limit 10;
+v	count(c)
+a	1
+a	10
+b	10
+c	10
+d	10
+e	10
+f	10
+g	10
+h	10
+i	10
+select sql_big_result v,count(t) from t1 group by v limit 10;
+v	count(t)
+a	1
+a	10
+b	10
+c	10
+d	10
+e	10
+f	10
+g	10
+h	10
+i	10
+select sql_big_result v,count(c) from t1 group by v limit 10;
+v	count(c)
+a	1
+a 	10
+b     	10
+c    	10
+d   	10
+e  	10
+f     	10
+g    	10
+h	10
+i     	10
+select c,count(*) from t1 group by c limit 10;
+c	count(*)
+a	1
+a	10
+b	10
+c	10
+d	10
+e	10
+f	10
+g	10
+h	10
+i	10
+select c,count(t) from t1 group by c limit 10;
+c	count(t)
+a	1
+a	10
+b	10
+c	10
+d	10
+e	10
+f	10
+g	10
+h	10
+i	10
+select sql_big_result c,count(t) from t1 group by c limit 10;
+c	count(t)
+a	1
+a	10
+b	10
+c	10
+d	10
+e	10
+f	10
+g	10
+h	10
+i	10
+select t,count(*) from t1 group by t limit 10;
+t	count(*)
+a	1
+a	10
+b	10
+c	10
+d	10
+e	10
+f	10
+g	10
+h	10
+i	10
+select t,count(t) from t1 group by t limit 10;
+t	count(t)
+a	1
+a	10
+b	10
+c	10
+d	10
+e	10
+f	10
+g	10
+h	10
+i	10
+select sql_big_result t,count(t) from t1 group by t limit 10;
+t	count(t)
+a	1
+a	10
+b	10
+c	10
+d	10
+e	10
+f	10
+g	10
+h	10
+i	10
+alter table t1 modify v varchar(300), drop key v, drop key v_2, add key v (v);
+show create table t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `v` varchar(300) DEFAULT NULL,
+  `c` char(10) DEFAULT NULL,
+  `t` text,
+  KEY `c` (`c`),
+  KEY `t` (`t`(10)),
+  KEY `v` (`v`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+select count(*) from t1 where v='a';
+count(*)
+10
+select count(*) from t1 where v='a  ';
+count(*)
+10
+select count(*) from t1 where v between 'a' and 'a ';
+count(*)
+10
+select count(*) from t1 where v between 'a' and 'a ' and v between 'a  ' and 'b\n';
+count(*)
+10
+select count(*) from t1 where v like 'a%';
+count(*)
+11
+select count(*) from t1 where v like 'a %';
+count(*)
+9
+explain select count(*) from t1 where v='a  ';
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ref	v	v	303	const	#	Using where; Using index
+explain select count(*) from t1 where v like 'a%';
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	range	v	v	303	NULL	#	Using where; Using index
+explain select count(*) from t1 where v between 'a' and 'a ';
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ref	v	v	303	const	#	Using where; Using index
+explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a  ' and 'b\n';
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ref	v	v	303	const	#	Using where; Using index
+explain select * from t1 where v='a';
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ref	v	v	303	const	#	Using where
+select v,count(*) from t1 group by v limit 10;
+v	count(*)
+a	1
+a	10
+b	10
+c	10
+d	10
+e	10
+f	10
+g	10
+h	10
+i	10
+select v,count(t) from t1 group by v limit 10;
+v	count(t)
+a	1
+a	10
+b	10
+c	10
+d	10
+e	10
+f	10
+g	10
+h	10
+i	10
+select sql_big_result v,count(t) from t1 group by v limit 10;
+v	count(t)
+a	1
+a	10
+b	10
+c	10
+d	10
+e	10
+f	10
+g	10
+h	10
+i	10
+alter table t1 drop key v, add key v (v(30));
+show create table t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `v` varchar(300) DEFAULT NULL,
+  `c` char(10) DEFAULT NULL,
+  `t` text,
+  KEY `c` (`c`),
+  KEY `t` (`t`(10)),
+  KEY `v` (`v`(30))
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+select count(*) from t1 where v='a';
+count(*)
+10
+select count(*) from t1 where v='a  ';
+count(*)
+10
+select count(*) from t1 where v between 'a' and 'a ';
+count(*)
+10
+select count(*) from t1 where v between 'a' and 'a ' and v between 'a  ' and 'b\n';
+count(*)
+10
+select count(*) from t1 where v like 'a%';
+count(*)
+11
+select count(*) from t1 where v like 'a %';
+count(*)
+9
+explain select count(*) from t1 where v='a  ';
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ref	v	v	33	const	#	Using where
+explain select count(*) from t1 where v like 'a%';
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	range	v	v	33	NULL	#	Using where
+explain select count(*) from t1 where v between 'a' and 'a ';
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ref	v	v	33	const	#	Using where
+explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a  ' and 'b\n';
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ref	v	v	33	const	#	Using where
+explain select * from t1 where v='a';
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ref	v	v	33	const	#	Using where
+select v,count(*) from t1 group by v limit 10;
+v	count(*)
+a	1
+a	10
+b	10
+c	10
+d	10
+e	10
+f	10
+g	10
+h	10
+i	10
+select v,count(t) from t1 group by v limit 10;
+v	count(t)
+a	1
+a	10
+b	10
+c	10
+d	10
+e	10
+f	10
+g	10
+h	10
+i	10
+select sql_big_result v,count(t) from t1 group by v limit 10;
+v	count(t)
+a	1
+a	10
+b	10
+c	10
+d	10
+e	10
+f	10
+g	10
+h	10
+i	10
+alter table t1 modify v varchar(600), drop key v, add key v (v);
+show create table t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `v` varchar(600) DEFAULT NULL,
+  `c` char(10) DEFAULT NULL,
+  `t` text,
+  KEY `c` (`c`),
+  KEY `t` (`t`(10)),
+  KEY `v` (`v`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+select v,count(*) from t1 group by v limit 10;
+v	count(*)
+a	1
+a	10
+b	10
+c	10
+d	10
+e	10
+f	10
+g	10
+h	10
+i	10
+select v,count(t) from t1 group by v limit 10;
+v	count(t)
+a	1
+a	10
+b	10
+c	10
+d	10
+e	10
+f	10
+g	10
+h	10
+i	10
+select sql_big_result v,count(t) from t1 group by v limit 10;
+v	count(t)
+a	1
+a	10
+b	10
+c	10
+d	10
+e	10
+f	10
+g	10
+h	10
+i	10
+drop table t1;
+create table t1 (a char(10), unique (a));
+insert into t1 values ('a   ');
+insert into t1 values ('a ');
+ERROR 23000: Duplicate entry 'a' for key 'a'
+alter table t1 modify a varchar(10);
+insert into t1 values ('a '),('a  '),('a   '),('a         ');
+ERROR 23000: Duplicate entry 'a ' for key 'a'
+insert into t1 values ('a     ');
+ERROR 23000: Duplicate entry 'a     ' for key 'a'
+insert into t1 values ('a          ');
+ERROR 23000: Duplicate entry 'a         ' for key 'a'
+insert into t1 values ('a ');
+ERROR 23000: Duplicate entry 'a ' for key 'a'
+update t1 set a='a  ' where a like 'a%';
+select concat(a,'.') from t1;
+concat(a,'.')
+a  .
+update t1 set a='abc    ' where a like 'a ';
+select concat(a,'.') from t1;
+concat(a,'.')
+a  .
+update t1 set a='a      ' where a like 'a %';
+select concat(a,'.') from t1;
+concat(a,'.')
+a      .
+update t1 set a='a  ' where a like 'a      ';
+select concat(a,'.') from t1;
+concat(a,'.')
+a  .
+drop table t1;
+create table t1 (v varchar(10), c char(10), t text, key(v(5)), key(c(5)), key(t(5)));
+show create table t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `v` varchar(10) DEFAULT NULL,
+  `c` char(10) DEFAULT NULL,
+  `t` text,
+  KEY `v` (`v`(5)),
+  KEY `c` (`c`(5)),
+  KEY `t` (`t`(5))
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 (v char(10) character set utf8);
+show create table t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `v` char(10) CHARACTER SET utf8 DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 (v varchar(10), c char(10)) row_format=fixed;
+Warnings:
+Warning	1478	InnoDB: assuming ROW_FORMAT=COMPACT.
+show create table t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `v` varchar(10) DEFAULT NULL,
+  `c` char(10) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=FIXED
+insert into t1 values('a','a'),('a ','a ');
+select concat('*',v,'*',c,'*') from t1;
+concat('*',v,'*',c,'*')
+*a*a*
+*a *a*
+drop table t1;
+create table t1 (v varchar(65530), key(v(10)));
+insert into t1 values(repeat('a',65530));
+select length(v) from t1 where v=repeat('a',65530);
+length(v)
+65530
+drop table t1;
+create table t1(a int, b varchar(12), key ba(b, a));
+insert into t1 values (1, 'A'), (20, NULL);
+explain select * from t1 where a=20 and b is null;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ref	ba	ba	20	const,const	1	Using where; Using index
+select * from t1 where a=20 and b is null;
+a	b
+20	NULL
+drop table t1;
+create table t1 (v varchar(65530), key(v));
+Warnings:
+Warning	1071	Specified key was too long; max key length is 767 bytes
+drop table t1;
+create table t1 (v varchar(65536));
+Warnings:
+Note	1246	Converting column 'v' from VARCHAR to TEXT
+show create table t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `v` mediumtext
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+drop table t1;
+create table t1 (v varchar(65530) character set utf8);
+Warnings:
+Note	1246	Converting column 'v' from VARCHAR to TEXT
+show create table t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `v` mediumtext CHARACTER SET utf8
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+drop table t1;
+set storage_engine=MyISAM;

=== renamed file 'mysql-test/r/innodb_autoinc_lock_mode_zero.result' => 'mysql-test/suite/innodb/r/innodb_autoinc_lock_mode_zero.result'
=== modified file 'mysql-test/suite/innodb/r/innodb_bug21704.result'
--- a/mysql-test/suite/innodb/r/innodb_bug21704.result	2010-05-26 18:55:40 +0000
+++ b/mysql-test/suite/innodb/r/innodb_bug21704.result	2010-08-04 08:39:53 +0000
@@ -25,8 +25,8 @@ ALTER TABLE t1 CHANGE a c INT;
 ERROR HY000: Error on rename of '#sql-temporary' to './test/t1' (errno: 150)
 # Ensure that online column rename works.
 ALTER TABLE t1 CHANGE b c INT;
-affected rows: 0
-info: Records: 0  Duplicates: 0  Warnings: 0
+affected rows: 3
+info: Records: 3  Duplicates: 0  Warnings: 0
 
 # Test renaming the column in the referencing table
 
@@ -34,8 +34,8 @@ ALTER TABLE t2 CHANGE a c INT;
 ERROR HY000: Error on rename of '#sql-temporary' to './test/t2' (errno: 150)
 # Ensure that online column rename works.
 ALTER TABLE t2 CHANGE b c INT;
-affected rows: 0
-info: Records: 0  Duplicates: 0  Warnings: 0
+affected rows: 3
+info: Records: 3  Duplicates: 0  Warnings: 0
 
 # Test with self-referential constraints
 
@@ -45,8 +45,8 @@ ALTER TABLE t3 CHANGE b d INT;
 ERROR HY000: Error on rename of '#sql-temporary' to './test/t3' (errno: 150)
 # Ensure that online column rename works.
 ALTER TABLE t3 CHANGE c d INT;
-affected rows: 0
-info: Records: 0  Duplicates: 0  Warnings: 0
+affected rows: 3
+info: Records: 3  Duplicates: 0  Warnings: 0
 
 # Cleanup.
 

=== renamed file 'mysql-test/r/innodb_bug30919.result' => 'mysql-test/suite/innodb/r/innodb_bug30919.result'
=== renamed file 'mysql-test/r/innodb_bug42419.result' => 'mysql-test/suite/innodb/r/innodb_bug42419.result'
=== added file 'mysql-test/suite/innodb/r/innodb_bug48024.result'
--- a/mysql-test/suite/innodb/r/innodb_bug48024.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/innodb/r/innodb_bug48024.result	2010-05-14 13:02:28 +0000
@@ -0,0 +1,10 @@
+CREATE TABLE bug48024(a int PRIMARY KEY,b int NOT NULL,KEY(b)) ENGINE=InnoDB;
+CREATE TABLE bug48024_b(b int PRIMARY KEY) ENGINE=InnoDB;
+ALTER TABLE bug48024 /*/ADD CONSTRAINT FOREIGN KEY(c) REFERENCES(a),/*/
+ADD CONSTRAINT FOREIGN KEY(b) REFERENCES bug48024_b(b);
+DROP TABLE bug48024,bug48024_b;
+CREATE TABLE bug48024(a int PRIMARY KEY,b int NOT NULL,KEY(b)) ENGINE=InnoDB;
+CREATE TABLE bug48024_b(b int PRIMARY KEY) ENGINE=InnoDB;
+ALTER TABLE bug48024 /*/ADD CONSTRAINT FOREIGN KEY(c) REFERENCES(a),/*/
+ADD CONSTRAINT FOREIGN KEY(b) REFERENCES bug48024_b(b)|
+DROP TABLE bug48024,bug48024_b;

=== added file 'mysql-test/suite/innodb/r/innodb_bug49164.result'
--- a/mysql-test/suite/innodb/r/innodb_bug49164.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/innodb/r/innodb_bug49164.result	2010-05-10 11:37:52 +0000
@@ -0,0 +1,42 @@
+SET tx_isolation = 'READ-COMMITTED';
+CREATE TABLE bug49164 (a INT, b BIGINT, c TINYINT, PRIMARY KEY (a, b))
+ENGINE=InnoDB;
+insert into bug49164 values (1,1,1), (2,2,2), (3,3,3);
+begin;
+update bug49164 set c=7;
+select * from bug49164;
+a	b	c
+1	1	7
+2	2	7
+3	3	7
+rollback;
+select * from bug49164;
+a	b	c
+1	1	1
+2	2	2
+3	3	3
+begin;
+update bug49164 set c=7;
+SET tx_isolation = 'READ-COMMITTED';
+begin;
+select * from bug49164;
+a	b	c
+1	1	1
+2	2	2
+3	3	3
+commit;
+begin;
+update bug49164 set c=6 where a=1 and b=1;
+rollback;
+select * from bug49164;
+a	b	c
+1	1	1
+2	2	2
+3	3	3
+commit;
+select * from bug49164;
+a	b	c
+1	1	6
+2	2	2
+3	3	3
+drop table bug49164;

=== added file 'mysql-test/suite/innodb/r/innodb_bug53674.result'
--- a/mysql-test/suite/innodb/r/innodb_bug53674.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/innodb/r/innodb_bug53674.result	2010-06-02 10:26:37 +0000
@@ -0,0 +1,11 @@
+create table bug53674(a int)engine=innodb;
+insert into bug53674 values (1),(2);
+start transaction;
+select * from bug53674 for update;
+a
+1
+2
+select * from bug53674 where a=(select a from bug53674 where a > 1);
+a
+2
+drop table bug53674;

=== added file 'mysql-test/suite/innodb/r/innodb_bug54044.result'
--- a/mysql-test/suite/innodb/r/innodb_bug54044.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/innodb/r/innodb_bug54044.result	2010-06-29 07:13:18 +0000
@@ -0,0 +1,3 @@
+CREATE TEMPORARY TABLE table_54044 ENGINE = INNODB
+AS SELECT IF(NULL  IS NOT NULL, NULL, NULL);
+ERROR HY000: Can't create table 'test.table_54044' (errno: -1)

=== renamed file 'mysql-test/r/innodb_gis.result' => 'mysql-test/suite/innodb/r/innodb_gis.result'
=== renamed file 'mysql-test/r/innodb_lock_wait_timeout_1.result' => 'mysql-test/suite/innodb/r/innodb_lock_wait_timeout_1.result'
=== modified file 'mysql-test/suite/innodb/r/innodb_misc1.result'
--- a/mysql-test/suite/innodb/r/innodb_misc1.result	2010-05-26 18:55:40 +0000
+++ b/mysql-test/suite/innodb/r/innodb_misc1.result	2010-08-04 08:39:53 +0000
@@ -763,6 +763,7 @@ t1	CREATE TABLE `t1` (
   CONSTRAINT `t1_t2` FOREIGN KEY (`id`) REFERENCES `t2` (`id`)
 ) ENGINE=InnoDB AUTO_INCREMENT=349 DEFAULT CHARSET=latin1
 DROP TABLE t1,t2;
+SET SESSION innodb_strict_mode = on;
 CREATE TABLE t1 (
 c01 CHAR(255), c02 CHAR(255), c03 CHAR(255), c04 CHAR(255),
 c05 CHAR(255), c06 CHAR(255), c07 CHAR(255), c08 CHAR(255),

=== added file 'mysql-test/suite/innodb/r/innodb_multi_update.result'
--- a/mysql-test/suite/innodb/r/innodb_multi_update.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/innodb/r/innodb_multi_update.result	2010-05-05 10:40:01 +0000
@@ -0,0 +1,76 @@
+CREATE TABLE bug38999_1 (a int not null primary key, b int not null, key (b)) engine=innodb;
+CREATE TABLE bug38999_2 (a int not null primary key, b int not null, key (b)) engine=innodb;
+INSERT INTO bug38999_1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9),(10,10),(11,11),(12,12);
+INSERT INTO bug38999_2 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
+update bug38999_1,bug38999_2 set bug38999_1.a=bug38999_1.a+100;
+select * from bug38999_1;
+a	b
+101	1
+102	2
+103	3
+104	4
+105	5
+106	6
+107	7
+108	8
+109	9
+110	10
+111	11
+112	12
+update bug38999_1,bug38999_2 set bug38999_1.a=bug38999_1.a+100 where bug38999_1.a=101;
+select * from bug38999_1;
+a	b
+201	1
+102	2
+103	3
+104	4
+105	5
+106	6
+107	7
+108	8
+109	9
+110	10
+111	11
+112	12
+update bug38999_1,bug38999_2 set bug38999_1.b=bug38999_1.b+10 where bug38999_1.b=2;
+select * from bug38999_1;
+a	b
+201	1
+103	3
+104	4
+105	5
+106	6
+107	7
+108	8
+109	9
+110	10
+111	11
+102	12
+112	12
+update bug38999_1,bug38999_2 set bug38999_1.b=bug38999_1.b+2,bug38999_2.b=bug38999_1.b+10 where bug38999_1.b between 3 and 5 and bug38999_1.a=bug38999_2.a+100;
+select * from bug38999_1;
+a	b
+201	1
+103	5
+104	6
+106	6
+105	7
+107	7
+108	8
+109	9
+110	10
+111	11
+102	12
+112	12
+select * from bug38999_2;
+a	b
+1	1
+2	2
+6	6
+7	7
+8	8
+9	9
+3	13
+4	14
+5	15
+drop table bug38999_1,bug38999_2;

=== renamed file 'mysql-test/r/innodb_mysql.result' => 'mysql-test/suite/innodb/r/innodb_mysql.result'
--- a/mysql-test/r/innodb_mysql.result	2010-05-26 18:55:40 +0000
+++ b/mysql-test/suite/innodb/r/innodb_mysql.result	2010-08-02 09:01:24 +0000
@@ -2386,4 +2386,125 @@ SELECT SECOND(c)- at bug47453 FROM t1 JOIN
 SECOND(c)- at bug47453
 0
 DROP TABLE t1, t2;
+#
+# Bug#38999 valgrind warnings for update statement in function compare_record()
+#
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
+CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 values (1),(2),(3),(4),(5);
+INSERT INTO t2 values (1);
+SELECT * FROM t1 WHERE a = 2;
+a
+2
+UPDATE t1,t2 SET t1.a = t1.a + 100 WHERE t1.a = 1;
+DROP TABLE t1,t2;
+#
+# Bug #53334: wrong result for outer join with impossible ON condition
+# (see the same test case for MyISAM in join.test)
+#
+CREATE TABLE t1 (id INT PRIMARY KEY);
+CREATE TABLE t2 (id INT);
+INSERT INTO t1 VALUES (75);
+INSERT INTO t1 VALUES (79);
+INSERT INTO t1 VALUES (78);
+INSERT INTO t1 VALUES (77);
+REPLACE INTO t1 VALUES (76);
+REPLACE INTO t1 VALUES (76);
+INSERT INTO t1 VALUES (104);
+INSERT INTO t1 VALUES (103);
+INSERT INTO t1 VALUES (102);
+INSERT INTO t1 VALUES (101);
+INSERT INTO t1 VALUES (105);
+INSERT INTO t1 VALUES (106);
+INSERT INTO t1 VALUES (107);
+INSERT INTO t2 VALUES (107),(75),(1000);
+SELECT t1.id,t2.id FROM t2 LEFT JOIN t1 ON t1.id>=74 AND t1.id<=0
+WHERE t2.id=75 AND t1.id IS NULL;
+id	id
+NULL	75
+EXPLAIN SELECT t1.id,t2.id FROM t2 LEFT JOIN t1 ON t1.id>=74 AND t1.id<=0
+WHERE t2.id=75 AND t1.id IS NULL;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	const	PRIMARY	NULL	NULL	NULL	1	Impossible ON condition
+1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	3	Using where
+DROP TABLE t1,t2;
+#
+# Bug #53830: !table || (!table->read_set || bitmap_is_set(table->read_set, field_index))
+#
+CREATE TABLE t1 (a INT, b INT, c INT, d INT,
+PRIMARY KEY(a,b,c), KEY(b,d))
+ENGINE=InnoDB;
+INSERT INTO t1 VALUES (0, 77, 1, 3);
+UPDATE t1 SET d = 0 WHERE b = 77 AND c = 25;
+DROP TABLE t1;
+#
+# Bug#50389 Using intersect does not return all rows
+#
+CREATE TABLE t1 (
+f1 INT(10) NOT NULL,
+f2 INT(10),
+f3 INT(10),
+f4 TINYINT(4),
+f5 VARCHAR(50),
+PRIMARY KEY (f1),
+KEY idx1 (f2,f5,f4),
+KEY idx2 (f2,f4)
+) ENGINE=InnoDB;
+LOAD DATA INFILE '../../std_data/intersect-bug50389.tsv' INTO TABLE t1;
+SELECT * FROM t1 WHERE f1 IN
+(3305028,3353871,3772880,3346860,4228206,3336022,
+3470988,3305175,3329875,3817277,3856380,3796193,
+3784744,4180925,4559596,3963734,3856391,4494153)
+AND f5 = 'abcdefghijklmnopwrst' AND f2 = 1221457 AND f4 = 0 ;
+f1	f2	f3	f4	f5
+3305175	1221457	0	0	abcdefghijklmnopwrst
+3329875	1221457	1382427	0	abcdefghijklmnopwrst
+3336022	1221457	0	0	abcdefghijklmnopwrst
+3346860	1221457	0	0	abcdefghijklmnopwrst
+3772880	1221457	0	0	abcdefghijklmnopwrst
+3784744	1221457	1382427	0	abcdefghijklmnopwrst
+3796193	1221457	0	0	abcdefghijklmnopwrst
+4228206	1221457	0	0	abcdefghijklmnopwrst
+4494153	1221457	0	0	abcdefghijklmnopwrst
+4559596	1221457	0	0	abcdefghijklmnopwrst
+EXPLAIN SELECT * FROM t1 WHERE f1 IN
+(3305028,3353871,3772880,3346860,4228206,3336022,
+3470988,3305175,3329875,3817277,3856380,3796193,
+3784744,4180925,4559596,3963734,3856391,4494153)
+AND f5 = 'abcdefghijklmnopwrst' AND f2 = 1221457 AND f4 = 0 ;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	index_merge	PRIMARY,idx1,idx2	idx2,idx1,PRIMARY	7,60,4	NULL	1	Using intersect(idx2,idx1,PRIMARY); Using where
+DROP TABLE t1;
+#
+# Bug#51431 Wrong sort order after import of dump file
+#
+CREATE TABLE t1 (
+f1 INT(11) NOT NULL,
+f2 int(11) NOT NULL,
+f3 int(11) NOT NULL,
+f4 tinyint(1) NOT NULL,
+PRIMARY KEY (f1),
+UNIQUE KEY (f2, f3),
+KEY (f4)
+) ENGINE=InnoDB;
+INSERT INTO t1 VALUES
+(1,1,991,1), (2,1,992,1), (3,1,993,1), (4,1,994,1), (5,1,995,1),
+(6,1,996,1), (7,1,997,1), (8,1,998,1), (10,1,999,1), (11,1,9910,1),
+(16,1,9911,1), (17,1,9912,1), (18,1,9913,1), (19,1,9914,1), (20,1,9915,1),
+(21,1,9916,1), (22,1,9917,1), (23,1,9918,1), (24,1,9919,1), (25,1,9920,1),
+(26,1,9921,1), (27,1,9922,1);
+FLUSH TABLES;
+SELECT * FROM t1 WHERE f2 = 1 AND f4 = TRUE
+ORDER BY f1 DESC LIMIT 5;
+f1	f2	f3	f4
+27	1	9922	1
+26	1	9921	1
+25	1	9920	1
+24	1	9919	1
+23	1	9918	1
+EXPLAIN SELECT * FROM t1 WHERE f2 = 1 AND f4 = TRUE
+ORDER BY f1 DESC LIMIT 5;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	range	f2,f4	f4	1	NULL	11	Using where
+DROP TABLE t1;
 End of 5.1 tests

=== renamed file 'mysql-test/r/innodb_mysql_rbk.result' => 'mysql-test/suite/innodb/r/innodb_mysql_rbk.result'
=== renamed file 'mysql-test/r/innodb_notembedded.result' => 'mysql-test/suite/innodb/r/innodb_notembedded.result'
=== renamed file 'mysql-test/r/innodb_timeout_rollback.result' => 'mysql-test/suite/innodb/r/innodb_timeout_rollback.result'
=== modified file 'mysql-test/suite/innodb/t/disabled.def'
--- a/mysql-test/suite/innodb/t/disabled.def	2010-05-27 17:18:31 +0000
+++ b/mysql-test/suite/innodb/t/disabled.def	2010-08-04 08:39:53 +0000
@@ -9,6 +9,6 @@
 #  Do not use any TAB characters for whitespace.
 #
 ##############################################################################
-innodb : Bug#53306 2010-04-30 VasilDimov valgrind warnings
-innodb_bug52663 : Waiting for merge with XtraDB
-innodb_bug51920 : Waiting for merge with XtraDB
+
+#innodb : Bug#53306 2010-04-30 VasilDimov valgrind warnings
+innodb_bug48024 : Waiting for merge with Percona Server; bug fixed in innodb_plugin in MySQL 5.1.48

=== modified file 'mysql-test/suite/innodb/t/innodb-autoinc-44030.test'
--- a/mysql-test/suite/innodb/t/innodb-autoinc-44030.test	2010-05-26 18:55:40 +0000
+++ b/mysql-test/suite/innodb/t/innodb-autoinc-44030.test	2010-08-04 08:39:53 +0000
@@ -27,7 +27,7 @@ SELECT * FROM t1;
 # longer results in the two data dictionaries being out of sync. If they
 # revert their changes then this check for ER_AUTOINC_READ_FAILED will need
 # to be enabled. Also, see http://bugs.mysql.com/bug.php?id=47621.
--- error ER_AUTOINC_READ_FAILED,1467
+# -- error ER_AUTOINC_READ_FAILED,1467
 INSERT INTO t1 VALUES(null);
 ALTER TABLE t1 AUTO_INCREMENT = 3;
 SHOW CREATE TABLE t1;

=== renamed file 'mysql-test/t/innodb-autoinc-optimize.test' => 'mysql-test/suite/innodb/t/innodb-autoinc-optimize.test'
=== renamed file 'mysql-test/t/innodb-ucs2.test' => 'mysql-test/suite/innodb/t/innodb-ucs2.test'
=== added file 'mysql-test/suite/innodb/t/innodb.test'
--- a/mysql-test/suite/innodb/t/innodb.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/innodb/t/innodb.test	2010-08-04 08:39:53 +0000
@@ -0,0 +1,1392 @@
+#######################################################################
+#                                                                     #
+# Please, DO NOT TOUCH this file as well as the innodb.result file.   #
+# These files are to be modified ONLY BY INNOBASE guys.               #
+#                                                                     #
+# Use innodb_mysql.[test|result] files instead.                       #
+#                                                                     #
+# If nevertheless you need to make some changes here, please, forward #
+# your commit message                                                 #
+# To: innodb_dev_ww at oracle.com                                        #
+# Cc: dev-innodb at mysql.com                                            #
+# (otherwise your changes may be erased).                             #
+#                                                                     #
+#######################################################################
+
+-- source include/have_innodb.inc
+
+let $MYSQLD_DATADIR= `select @@datadir`;
+
+# Save the original values of some variables in order to be able to
+# estimate how much they have changed during the tests. Previously this
+# test assumed that e.g. rows_deleted is 0 here and after deleting 23
+# rows it expected that rows_deleted will be 23. Now we do not make
+# assumptions about the values of the variables at the beginning, e.g.
+# rows_deleted should be 23 + "rows_deleted before the test". This allows
+# the test to be run multiple times without restarting the mysqld server.
+# See Bug#43309 Test main.innodb can't be run twice
+-- disable_query_log
+SET @innodb_thread_concurrency_orig = @@innodb_thread_concurrency;
+
+SET @innodb_rows_deleted_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_deleted');
+SET @innodb_rows_inserted_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_inserted');
+SET @innodb_rows_updated_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_updated');
+SET @innodb_row_lock_waits_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_waits');
+SET @innodb_row_lock_current_waits_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_current_waits');
+SET @innodb_row_lock_time_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time');
+SET @innodb_row_lock_time_max_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time_max');
+SET @innodb_row_lock_time_avg_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time_avg');
+-- enable_query_log
+
+--disable_warnings
+drop table if exists t1,t2,t3,t4;
+drop database if exists mysqltest;
+--enable_warnings
+
+#
+# Small basic test with ignore
+#
+
+create table t1 (id int unsigned not null auto_increment, code tinyint unsigned not null, name char(20) not null, primary key (id), key (code), unique (name)) engine=innodb;
+
+insert into t1 (code, name) values (1, 'Tim'), (1, 'Monty'), (2, 'David'), (2, 'Erik'), (3, 'Sasha'), (3, 'Jeremy'), (4, 'Matt');
+select id, code, name from t1 order by id;
+
+update ignore t1 set id = 8, name = 'Sinisa' where id < 3;
+select id, code, name from t1 order by id;
+update ignore t1 set id = id + 10, name = 'Ralph' where id < 4;
+select id, code, name from t1 order by id;
+
+drop table t1;
+
+#
+# A bit bigger test
+# The 'replace_column' statements are needed because the cardinality calculated
+# by innodb is not always the same between runs
+#
+
+CREATE TABLE t1 (
+  id int(11) NOT NULL auto_increment,
+  parent_id int(11) DEFAULT '0' NOT NULL,
+  level tinyint(4) DEFAULT '0' NOT NULL,
+  PRIMARY KEY (id),
+  KEY parent_id (parent_id),
+  KEY level (level)
+) engine=innodb;
+INSERT INTO t1 VALUES (1,0,0),(3,1,1),(4,1,1),(8,2,2),(9,2,2),(17,3,2),(22,4,2),(24,4,2),(28,5,2),(29,5,2),(30,5,2),(31,6,2),(32,6,2),(33,6,2),(203,7,2),(202,7,2),(20,3,2),(157,0,0),(193,5,2),(40,7,2),(2,1,1),(15,2,2),(6,1,1),(34,6,2),(35,6,2),(16,3,2),(7,1,1),(36,7,2),(18,3,2),(26,5,2),(27,5,2),(183,4,2),(38,7,2),(25,5,2),(37,7,2),(21,4,2),(19,3,2),(5,1,1),(179,5,2);
+update t1 set parent_id=parent_id+100;
+select * from t1 where parent_id=102;
+update t1 set id=id+1000;
+-- error ER_DUP_ENTRY,1022
+update t1 set id=1024 where id=1009; 
+select * from t1;
+update ignore t1 set id=id+1; # This will change all rows
+select * from t1;
+update ignore t1 set id=1023 where id=1010;
+select * from t1 where parent_id=102;
+--replace_column 9 #
+explain select level from t1 where level=1;
+--replace_column 9 #
+explain select level,id from t1 where level=1;
+--replace_column 9 #
+explain select level,id,parent_id from t1 where level=1;
+select level,id from t1 where level=1;
+select level,id,parent_id from t1 where level=1;
+optimize table t1;
+--replace_column 7 #
+show keys from t1;
+drop table t1;
+
+#
+# Test replace
+#
+
+CREATE TABLE t1 (
+  gesuchnr int(11) DEFAULT '0' NOT NULL,
+  benutzer_id int(11) DEFAULT '0' NOT NULL,
+  PRIMARY KEY (gesuchnr,benutzer_id)
+) engine=innodb;
+
+replace into t1 (gesuchnr,benutzer_id) values (2,1);
+replace into t1 (gesuchnr,benutzer_id) values (1,1);
+replace into t1 (gesuchnr,benutzer_id) values (1,1);
+select * from t1;
+drop table t1;
+
+#
+# test delete using hidden_primary_key
+#
+
+create table t1 (a int) engine=innodb;
+insert into t1 values (1), (2);
+optimize table t1;
+delete from t1 where a = 1;
+select * from t1;
+check table t1;
+drop table t1;
+
+create table t1 (a int,b varchar(20)) engine=innodb;
+insert into t1 values (1,""), (2,"testing");
+delete from t1 where a = 1;
+select * from t1;
+create index skr on t1 (a);
+insert into t1 values (3,""), (4,"testing");
+analyze table t1;
+--replace_column 7 #
+show keys from t1;
+drop table t1;
+
+
+# Test of reading on secondary key with may be null
+
+create table t1 (a int,b varchar(20),key(a)) engine=innodb;
+insert into t1 values (1,""), (2,"testing");
+select * from t1 where a = 1;
+drop table t1;
+
+#
+# Test rollback
+#
+
+create table t1 (n int not null primary key) engine=innodb;
+set autocommit=0;
+insert into t1 values (4);
+rollback;
+select n, "after rollback" from t1;
+insert into t1 values (4);
+commit;
+select n, "after commit" from t1;
+commit;
+insert into t1 values (5);
+-- error ER_DUP_ENTRY
+insert into t1 values (4);
+commit;
+select n, "after commit" from t1;
+set autocommit=1;
+insert into t1 values (6);
+-- error ER_DUP_ENTRY
+insert into t1 values (4);
+select n from t1;
+set autocommit=0;
+#
+# savepoints
+#
+begin;
+savepoint `my_savepoint`;
+insert into t1 values (7);
+savepoint `savept2`;
+insert into t1 values (3);
+select n from t1;
+savepoint savept3;
+rollback to savepoint savept2;
+--error 1305
+rollback to savepoint savept3;
+rollback to savepoint savept2;
+release savepoint `my_savepoint`;
+select n from t1;
+-- error 1305
+rollback to savepoint `my_savepoint`;
+--error 1305
+rollback to savepoint savept2;
+insert into t1 values (8);
+savepoint sv;
+commit;
+savepoint sv;
+set autocommit=1;
+# nop
+rollback;
+drop table t1;
+
+#
+# Test for commit and FLUSH TABLES WITH READ LOCK
+#
+
+create table t1 (n int not null primary key) engine=innodb;
+start transaction;
+insert into t1 values (4);
+flush tables with read lock;
+#
+# Current code can't handle a read lock in middle of transaction
+#--error 1223;
+commit;
+unlock tables;
+commit;
+select * from t1;
+drop table t1;
+
+#
+# Testing transactions
+#
+
+create table t1 ( id int NOT NULL PRIMARY KEY, nom varchar(64)) engine=innodb;
+begin;
+insert into t1 values(1,'hamdouni');
+select id as afterbegin_id,nom as afterbegin_nom from t1;
+rollback;
+select id as afterrollback_id,nom as afterrollback_nom from t1;
+set autocommit=0;
+insert into t1 values(2,'mysql');
+select id as afterautocommit0_id,nom as afterautocommit0_nom from t1;
+rollback;
+select id as afterrollback_id,nom as afterrollback_nom from t1;
+set autocommit=1;
+drop table t1;
+
+#
+# Simple not autocommit test
+# 
+
+CREATE TABLE t1 (id char(8) not null primary key, val int not null) engine=innodb;
+insert into t1 values ('pippo', 12);
+-- error ER_DUP_ENTRY
+insert into t1 values ('pippo', 12); # Gives error
+delete from t1;
+delete from t1 where id = 'pippo';
+select * from t1;
+
+insert into t1 values ('pippo', 12);
+set autocommit=0;
+delete from t1;
+rollback;
+select * from t1;
+delete from t1;
+commit;
+select * from t1;
+drop table t1;
+
+#
+# Test of active transactions
+#
+
+create table t1 (a integer) engine=innodb;
+start transaction;
+rename table t1 to t2;
+create table t1 (b integer) engine=innodb;
+insert into t1 values (1);
+rollback;
+drop table t1;
+rename table t2 to t1;
+drop table t1;
+set autocommit=1;
+
+#
+# The following simple tests failed at some point
+#
+
+CREATE TABLE t1 (ID INTEGER NOT NULL PRIMARY KEY, NAME VARCHAR(64)) ENGINE=innodb;
+INSERT INTO t1 VALUES (1, 'Jochen');
+select * from t1;
+drop table t1;
+
+CREATE TABLE t1 ( _userid VARCHAR(60) NOT NULL PRIMARY KEY) ENGINE=innodb;
+set autocommit=0;
+INSERT INTO t1  SET _userid='marc at anyware.co.uk';
+COMMIT;
+SELECT * FROM t1;
+SELECT _userid FROM t1 WHERE _userid='marc at anyware.co.uk';
+drop table t1;
+set autocommit=1;
+
+#
+# Test when reading on part of unique key
+#
+CREATE TABLE t1 (
+  user_id int(10) DEFAULT '0' NOT NULL,
+  name varchar(100),
+  phone varchar(100),
+  ref_email varchar(100) DEFAULT '' NOT NULL,
+  detail varchar(200),
+  PRIMARY KEY (user_id,ref_email)
+)engine=innodb;
+
+INSERT INTO t1 VALUES (10292,'sanjeev','29153373','sansh777 at hotmail.com','xxx'),(10292,'shirish','2333604','shirish at yahoo.com','ddsds'),(10292,'sonali','323232','sonali at bolly.com','filmstar');
+select * from t1 where user_id=10292;
+INSERT INTO t1 VALUES (10291,'sanjeev','29153373','sansh777 at hotmail.com','xxx'),(10293,'shirish','2333604','shirish at yahoo.com','ddsds');
+select * from t1 where user_id=10292;
+select * from t1 where user_id>=10292;
+select * from t1 where user_id>10292;
+select * from t1 where user_id<10292;
+drop table t1;
+
+#
+# Test that keys are created in right order
+#
+
+CREATE TABLE t1 (a int not null, b int not null,c int not null,
+key(a),primary key(a,b), unique(c),key(a),unique(b));
+--replace_column 7 #
+show index from t1;
+drop table t1;
+
+#
+# Test of ALTER TABLE and innodb tables
+#
+
+create table t1 (col1 int not null, col2 char(4) not null, primary key(col1));
+alter table t1 engine=innodb;
+insert into t1 values ('1','1'),('5','2'),('2','3'),('3','4'),('4','4');
+select * from t1;
+update t1 set col2='7' where col1='4';
+select * from t1;
+alter table t1 add co3 int not null;
+select * from t1;
+update t1 set col2='9' where col1='2';
+select * from t1;
+drop table t1;
+
+#
+# INSERT INTO innodb tables
+#
+
+create table t1 (a int not null , b int, primary key (a)) engine = innodb;
+create table t2 (a int not null , b int, primary key (a)) engine = myisam;
+insert into t1 VALUES (1,3) , (2,3), (3,3);
+select * from t1;
+insert into t2 select * from t1;
+select * from t2;
+delete from t1 where b = 3;
+select * from t1;
+insert into t1 select * from t2;
+select * from t1;
+select * from t2;
+drop table t1,t2;
+
+#
+# ORDER BY on not primary key
+#
+
+CREATE TABLE t1 (
+  user_name varchar(12),
+  password text,
+  subscribed char(1),
+  user_id int(11) DEFAULT '0' NOT NULL,
+  quota bigint(20),
+  weight double,
+  access_date date,
+  access_time time,
+  approved datetime,
+  dummy_primary_key int(11) NOT NULL auto_increment,
+  PRIMARY KEY (dummy_primary_key)
+) ENGINE=innodb;
+INSERT INTO t1 VALUES ('user_0','somepassword','N',0,0,0,'2000-09-07','23:06:59','2000-09-07 23:06:59',1);
+INSERT INTO t1 VALUES ('user_1','somepassword','Y',1,1,1,'2000-09-07','23:06:59','2000-09-07 23:06:59',2);
+INSERT INTO t1 VALUES ('user_2','somepassword','N',2,2,1.4142135623731,'2000-09-07','23:06:59','2000-09-07 23:06:59',3);
+INSERT INTO t1 VALUES ('user_3','somepassword','Y',3,3,1.7320508075689,'2000-09-07','23:06:59','2000-09-07 23:06:59',4);
+INSERT INTO t1 VALUES ('user_4','somepassword','N',4,4,2,'2000-09-07','23:06:59','2000-09-07 23:06:59',5);
+select  user_name, password , subscribed, user_id, quota, weight, access_date, access_time, approved, dummy_primary_key from t1 order by user_name;
+drop table t1;
+
+#
+# Testing of tables without primary keys
+#
+
+CREATE TABLE t1 (
+  id int(11) NOT NULL auto_increment,
+  parent_id int(11) DEFAULT '0' NOT NULL,
+  level tinyint(4) DEFAULT '0' NOT NULL,
+  KEY (id),
+  KEY parent_id (parent_id),
+  KEY level (level)
+) engine=innodb;
+INSERT INTO t1 VALUES (1,0,0),(3,1,1),(4,1,1),(8,2,2),(9,2,2),(17,3,2),(22,4,2),(24,4,2),(28,5,2),(29,5,2),(30,5,2),(31,6,2),(32,6,2),(33,6,2),(203,7,2),(202,7,2),(20,3,2),(157,0,0),(193,5,2),(40,7,2),(2,1,1),(15,2,2),(6,1,1),(34,6,2),(35,6,2),(16,3,2),(7,1,1),(36,7,2),(18,3,2),(26,5,2),(27,5,2),(183,4,2),(38,7,2),(25,5,2),(37,7,2),(21,4,2),(19,3,2),(5,1,1);
+INSERT INTO t1 values (179,5,2);
+update t1 set parent_id=parent_id+100;
+select * from t1 where parent_id=102;
+update t1 set id=id+1000;
+update t1 set id=1024 where id=1009; 
+select * from t1;
+update ignore t1 set id=id+1; # This will change all rows
+select * from t1;
+update ignore t1 set id=1023 where id=1010;
+select * from t1 where parent_id=102;
+--replace_column 9 #
+explain select level from t1 where level=1;
+select level,id from t1 where level=1;
+select level,id,parent_id from t1 where level=1;
+select level,id from t1 where level=1 order by id;
+delete from t1 where level=1;
+select * from t1;
+drop table t1;
+
+#
+# Test of index only reads
+#
+CREATE TABLE t1 (
+   sca_code char(6) NOT NULL,
+   cat_code char(6) NOT NULL,
+   sca_desc varchar(50),
+   lan_code char(2) NOT NULL,
+   sca_pic varchar(100),
+   sca_sdesc varchar(50),
+   sca_sch_desc varchar(16),
+   PRIMARY KEY (sca_code, cat_code, lan_code),
+   INDEX sca_pic (sca_pic)
+) engine = innodb ;
+
+INSERT INTO t1 ( sca_code, cat_code, sca_desc, lan_code, sca_pic, sca_sdesc, sca_sch_desc) VALUES ( 'PD', 'J', 'PENDANT', 'EN', NULL, NULL, 'PENDANT'),( 'RI', 'J', 'RING', 'EN', NULL, NULL, 'RING'),( 'QQ', 'N', 'RING', 'EN', 'not null', NULL, 'RING');
+select count(*) from t1 where sca_code = 'PD';
+select count(*) from t1 where sca_code <= 'PD';
+select count(*) from t1 where sca_pic is null;
+alter table t1 drop index sca_pic;
+alter table t1 add index sca_pic (cat_code, sca_pic);
+select count(*) from t1 where sca_code='PD' and sca_pic is null;
+select count(*) from t1 where cat_code='E';
+
+alter table t1 drop index sca_pic;
+alter table t1 add index (sca_pic, cat_code);
+select count(*) from t1 where sca_code='PD' and sca_pic is null;
+select count(*) from t1 where sca_pic >= 'n';
+select sca_pic from t1 where sca_pic is null;
+update t1 set sca_pic="test" where sca_pic is null;
+delete from t1 where sca_code='pd';
+drop table t1;
+
+#
+# Test of opening table twice and timestamps
+#
+set @a:=now();
+CREATE TABLE t1 (a int not null, b timestamp not null, primary key (a)) engine=innodb;
+insert into t1 (a) values(1),(2),(3);
+select t1.a from t1 natural join t1 as t2 where t1.b >= @a order by t1.a;
+select a from t1 natural join t1 as t2 where b >= @a order by a;
+update t1 set a=5 where a=1;
+select a from t1;
+drop table t1;
+
+#
+# Test with variable length primary key
+#
+create table t1 (a varchar(100) not null, primary key(a), b int not null) engine=innodb;
+insert into t1 values("hello",1),("world",2);
+select * from t1 order by b desc;
+optimize table t1;
+--replace_column 7 #
+show keys from t1;
+drop table t1;
+
+#
+# Test of create index with NULL columns
+#
+create table t1 (i int, j int ) ENGINE=innodb;
+insert into t1 values (1,2);
+select * from t1 where i=1 and j=2;
+create index ax1 on t1 (i,j);
+select * from t1 where i=1 and j=2;
+drop table t1;
+
+#
+# Test min-max optimization
+#
+
+CREATE TABLE t1 (
+  a int3 unsigned NOT NULL,
+  b int1 unsigned NOT NULL,
+  UNIQUE (a, b)
+) ENGINE = innodb;
+ 
+INSERT INTO t1 VALUES (1, 1);
+SELECT MIN(B),MAX(b) FROM t1 WHERE t1.a = 1;
+drop table t1;
+
+#
+# Test INSERT DELAYED
+#
+
+CREATE TABLE t1 (a int unsigned NOT NULL) engine=innodb;
+# Can't test this in 3.23
+# INSERT DELAYED INTO t1 VALUES (1);
+INSERT INTO t1 VALUES (1);
+SELECT * FROM t1;
+DROP TABLE t1;
+
+
+#
+# Crash when using many tables (Test case by Jeremy D Zawodny)
+#
+
+create table t1 (a int  primary key,b int, c int, d int, e int, f int, g int, h int, i int, j int, k int, l int, m int, n int, o int, p int, q int, r int, s int, t int, u int, v int, w int, x int, y int, z int, a1 int, a2 int, a3 int, a4 int, a5 int, a6 int, a7 int, a8 int, a9 int, b1 int, b2 int, b3 int, b4 int, b5 int, b6 int) engine = innodb;
+insert into t1 values (1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1);
+--replace_column 9 #
+explain select * from t1 where a > 0 and a < 50;
+drop table t1;
+
+#
+# Test lock tables
+#
+
+create table t1 (id int NOT NULL,id2 int NOT NULL,id3 int NOT NULL,dummy1 char(30),primary key (id,id2),index index_id3 (id3)) engine=innodb;
+insert into t1 values (0,0,0,'ABCDEFGHIJ'),(2,2,2,'BCDEFGHIJK'),(1,1,1,'CDEFGHIJKL');
+LOCK TABLES t1 WRITE;
+--error ER_DUP_ENTRY
+insert into t1 values (99,1,2,'D'),(1,1,2,'D');
+select id from t1;
+select id from t1;
+UNLOCK TABLES;
+DROP TABLE t1;
+
+create table t1 (id int NOT NULL,id2 int NOT NULL,id3 int NOT NULL,dummy1 char(30),primary key (id,id2),index index_id3 (id3)) engine=innodb;
+insert into t1 values (0,0,0,'ABCDEFGHIJ'),(2,2,2,'BCDEFGHIJK'),(1,1,1,'CDEFGHIJKL');
+LOCK TABLES t1 WRITE;
+begin;
+--error ER_DUP_ENTRY
+insert into t1 values (99,1,2,'D'),(1,1,2,'D');
+select id from t1;
+insert ignore into t1 values (100,1,2,'D'),(1,1,99,'D');
+commit;
+select id,id3 from t1;
+UNLOCK TABLES;
+DROP TABLE t1;
+
+#
+# Test prefix key
+#
+create table t1 (a char(20), unique (a(5))) engine=innodb;
+drop table t1;
+create table t1 (a char(20), index (a(5))) engine=innodb;
+show create table t1;
+drop table t1;
+
+#
+# Test using temporary table and auto_increment
+#
+
+create temporary table t1 (a int not null auto_increment, primary key(a)) engine=innodb;
+insert into t1 values (NULL),(NULL),(NULL);
+delete from t1 where a=3;
+insert into t1 values (NULL);
+select * from t1;
+alter table t1 add b int;
+select * from t1;
+drop table t1;
+
+#Slashdot bug
+create table t1
+ (
+  id int auto_increment primary key,
+  name varchar(32) not null,
+  value text not null,
+  uid int not null,
+  unique key(name,uid)
+ ) engine=innodb;
+insert into t1 values (1,'one','one value',101),
+ (2,'two','two value',102),(3,'three','three value',103);
+set insert_id=5;
+replace into t1 (value,name,uid) values ('other value','two',102);
+delete from t1 where uid=102;
+set insert_id=5;
+replace into t1 (value,name,uid) values ('other value','two',102);
+set insert_id=6;
+replace into t1 (value,name,uid) values ('other value','two',102);
+select * from t1;
+drop table t1;
+
+#
+# Test DROP DATABASE
+#
+
+create database mysqltest;
+create table mysqltest.t1 (a int not null) engine= innodb;
+insert into mysqltest.t1 values(1);
+create table mysqltest.t2 (a int not null) engine= myisam;
+insert into mysqltest.t2 values(1);
+create table mysqltest.t3 (a int not null) engine= heap;
+insert into mysqltest.t3 values(1);
+commit;
+drop database mysqltest;
+# Don't check error message
+--error 1049
+show tables from mysqltest;
+
+#
+# Test truncate table with and without auto_commit
+#
+
+set autocommit=0;
+create table t1 (a int not null) engine= innodb;
+insert into t1 values(1),(2);
+truncate table t1;
+commit;
+truncate table t1;
+truncate table t1;
+select * from t1;
+insert into t1 values(1),(2);
+delete from t1;
+select * from t1;
+commit;
+drop table t1;
+set autocommit=1;
+
+create table t1 (a int not null) engine= innodb;
+insert into t1 values(1),(2);
+truncate table t1;
+insert into t1 values(1),(2);
+select * from t1;
+truncate table t1;
+insert into t1 values(1),(2);
+delete from t1;
+select * from t1;
+drop table t1;
+
+#
+# Test of how ORDER BY works when doing it on the whole table
+#
+
+create table t1 (a int not null, b int not null, c int not null, primary key (a),key(b)) engine=innodb;
+insert into t1 values (3,3,3),(1,1,1),(2,2,2),(4,4,4);
+--replace_column 9 #
+explain select * from t1 order by a;
+--replace_column 9 #
+explain select * from t1 order by b;
+--replace_column 9 #
+explain select * from t1 order by c;
+--replace_column 9 #
+explain select a from t1 order by a;
+--replace_column 9 #
+explain select b from t1 order by b;
+--replace_column 9 #
+explain select a,b from t1 order by b;
+--replace_column 9 #
+explain select a,b from t1;
+--replace_column 9 #
+explain select a,b,c from t1;
+drop table t1;
+
+#
+# Check describe
+#
+
+create table t1 (t int not null default 1, key (t)) engine=innodb;
+desc t1;
+drop table t1;
+
+#
+# Test of multi-table-delete
+#
+
+CREATE TABLE t1 (
+  number bigint(20) NOT NULL default '0',
+  cname char(15) NOT NULL default '',
+  carrier_id smallint(6) NOT NULL default '0',
+  privacy tinyint(4) NOT NULL default '0',
+  last_mod_date timestamp NOT NULL,
+  last_mod_id smallint(6) NOT NULL default '0',
+  last_app_date timestamp NOT NULL,
+  last_app_id smallint(6) default '-1',
+  version smallint(6) NOT NULL default '0',
+  assigned_scps int(11) default '0',
+  status tinyint(4) default '0'
+) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (4077711111,'SeanWheeler',90,2,20020111112846,500,00000000000000,-1,2,3,1);
+INSERT INTO t1 VALUES (9197722223,'berry',90,3,20020111112809,500,20020102114532,501,4,10,0);
+INSERT INTO t1 VALUES (650,'San Francisco',0,0,20011227111336,342,00000000000000,-1,1,24,1);
+INSERT INTO t1 VALUES (302467,'Sue\'s Subshop',90,3,20020109113241,500,20020102115111,501,7,24,0);
+INSERT INTO t1 VALUES (6014911113,'SudzCarwash',520,1,20020102115234,500,20020102115259,501,33,32768,0);
+INSERT INTO t1 VALUES (333,'tubs',99,2,20020109113440,501,20020109113440,500,3,10,0);
+CREATE TABLE t2 (
+  number bigint(20) NOT NULL default '0',
+  cname char(15) NOT NULL default '',
+  carrier_id smallint(6) NOT NULL default '0',
+  privacy tinyint(4) NOT NULL default '0',
+  last_mod_date timestamp NOT NULL,
+  last_mod_id smallint(6) NOT NULL default '0',
+  last_app_date timestamp NOT NULL,
+  last_app_id smallint(6) default '-1',
+  version smallint(6) NOT NULL default '0',
+  assigned_scps int(11) default '0',
+  status tinyint(4) default '0'
+) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (4077711111,'SeanWheeler',0,2,20020111112853,500,00000000000000,-1,2,3,1);
+INSERT INTO t2 VALUES (9197722223,'berry',90,3,20020111112818,500,20020102114532,501,4,10,0);
+INSERT INTO t2 VALUES (650,'San Francisco',90,0,20020109113158,342,00000000000000,-1,1,24,1);
+INSERT INTO t2 VALUES (333,'tubs',99,2,20020109113453,501,20020109113453,500,3,10,0);
+select * from t1;
+select * from t2;
+delete t1, t2 from t1 left join t2 on t1.number=t2.number where (t1.carrier_id=90 and t1.number=t2.number) or (t2.carrier_id=90 and t1.number=t2.number) or  (t1.carrier_id=90 and t2.number is null);
+select * from t1;
+select * from t2; 
+select * from t2;
+drop table t1,t2;
+
+#
+# A simple test with some isolation levels
+# TODO: Make this into a test using replication to really test how
+# this works.
+#
+
+create table t1 (id int unsigned not null auto_increment, code tinyint unsigned not null, name char(20) not null, primary key (id), key (code), unique (name)) engine=innodb;
+
+BEGIN;
+SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
+SELECT @@tx_isolation,@@global.tx_isolation;
+insert into t1 (code, name) values (1, 'Tim'), (1, 'Monty'), (2, 'David');
+select id, code, name from t1 order by id;
+COMMIT;
+
+BEGIN;
+SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
+insert into t1 (code, name) values (2, 'Erik'), (3, 'Sasha');
+select id, code, name from t1 order by id;
+COMMIT;
+
+SET binlog_format='MIXED';
+BEGIN;
+SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+insert into t1 (code, name) values (3, 'Jeremy'), (4, 'Matt');
+select id, code, name from t1 order by id;
+COMMIT;
+DROP TABLE t1;
+
+#
+# Test of multi-table-update
+#
+create table t1 (n int(10), d int(10)) engine=innodb;
+create table t2 (n int(10), d int(10)) engine=innodb;
+insert into t1 values(1,1),(1,2);
+insert into t2 values(1,10),(2,20);
+UPDATE t1,t2 SET t1.d=t2.d,t2.d=30 WHERE t1.n=t2.n;
+select * from t1;
+select * from t2;
+drop table t1,t2;
+
+#
+# Bug #29136  	erred multi-delete on trans table does not rollback 
+#
+
+# prepare
+--disable_warnings
+drop table if exists t1, t2;
+--enable_warnings
+CREATE TABLE t1 (a int, PRIMARY KEY (a));
+CREATE TABLE t2 (a int, PRIMARY KEY (a)) ENGINE=InnoDB;
+create trigger trg_del_t2 after  delete on t2 for each row
+       insert into t1 values (1);
+insert into t1 values (1);
+insert into t2 values (1),(2);
+
+
+# exec cases A, B - see multi_update.test
+
+# A. send_error() w/o send_eof() branch
+
+--error ER_DUP_ENTRY
+delete t2 from t2;
+
+# check
+
+select count(*) from t2 /* must be 2 as restored after rollback caused by the error */;
+
+# cleanup bug#29136
+
+drop table t1, t2;
+
+
+#
+# Bug #29136  	erred multi-delete on trans table does not rollback 
+#
+
+# prepare
+--disable_warnings
+drop table if exists t1, t2;
+--enable_warnings
+CREATE TABLE t1 (a int, PRIMARY KEY (a));
+CREATE TABLE t2 (a int, PRIMARY KEY (a)) ENGINE=InnoDB;
+create trigger trg_del_t2 after  delete on t2 for each row
+       insert into t1 values (1);
+insert into t1 values (1);
+insert into t2 values (1),(2);
+
+
+# exec cases A, B - see multi_update.test
+
+# A. send_error() w/o send_eof() branch
+
+--error ER_DUP_ENTRY
+delete t2 from t2;
+
+# check
+
+select count(*) from t2 /* must be 2 as restored after rollback caused by the error */;
+
+# cleanup bug#29136
+
+drop table t1, t2;
+
+
+#
+# Testing of IFNULL
+#
+create table t1 (a int, b int) engine=innodb;
+insert into t1 values(20,null);
+select t2.b, ifnull(t2.b,"this is null") from t1 as t2 left join t1 as t3 on
+t2.b=t3.a;
+select t2.b, ifnull(t2.b,"this is null") from t1 as t2 left join t1 as t3 on
+t2.b=t3.a order by 1;
+insert into t1 values(10,null);
+select t2.b, ifnull(t2.b,"this is null") from t1 as t2 left join t1 as t3 on
+t2.b=t3.a order by 1;
+drop table t1;
+
+#
+# Test of read_through not existing const_table
+#
+
+create table t1 (a varchar(10) not null) engine=myisam;
+create table t2 (b varchar(10) not null unique) engine=innodb;
+select t1.a from t1,t2 where t1.a=t2.b;
+drop table t1,t2;
+create table t1 (a int not null, b int, primary key (a)) engine = innodb;
+create table t2 (a int not null, b int, primary key (a)) engine = innodb;
+insert into t1 values (10, 20);
+insert into t2 values (10, 20);
+update t1, t2 set t1.b = 150, t2.b = t1.b where t2.a = t1.a and t1.a = 10;
+drop table t1,t2;
+
+#
+# Test of multi-table-delete with foreign key constraints
+#
+
+CREATE TABLE t1 (id INT NOT NULL, PRIMARY KEY (id)) ENGINE=INNODB;
+CREATE TABLE t2 (id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id), FOREIGN KEY (t1_id) REFERENCES t1(id)  ON DELETE CASCADE ) ENGINE=INNODB;
+insert into t1 set id=1;
+insert into t2 set id=1, t1_id=1;
+delete t1,t2 from t1,t2 where t1.id=t2.t1_id;
+select * from t1;
+select * from t2;
+drop table t2,t1;
+CREATE TABLE t1(id INT NOT NULL,  PRIMARY KEY (id)) ENGINE=INNODB;
+CREATE TABLE t2(id  INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id)  ) ENGINE=INNODB;
+INSERT INTO t1 VALUES(1);
+INSERT INTO t2 VALUES(1, 1);
+SELECT * from t1;
+UPDATE t1,t2 SET t1.id=t1.id+1, t2.t1_id=t1.id+1;
+SELECT * from t1;
+UPDATE t1,t2 SET t1.id=t1.id+1 where t1.id!=t2.id;
+SELECT * from t1;
+DROP TABLE t1,t2;
+
+#
+# Test of range_optimizer
+#
+
+set autocommit=0;
+
+CREATE TABLE t1 (id CHAR(15) NOT NULL, value CHAR(40) NOT NULL, PRIMARY KEY(id)) ENGINE=InnoDB;
+
+CREATE TABLE t2 (id CHAR(15) NOT NULL, value CHAR(40) NOT NULL, PRIMARY KEY(id)) ENGINE=InnoDB;
+
+CREATE TABLE t3 (id1 CHAR(15) NOT NULL, id2 CHAR(15) NOT NULL, PRIMARY KEY(id1, id2)) ENGINE=InnoDB;
+
+INSERT INTO t3 VALUES("my-test-1", "my-test-2");
+COMMIT;
+
+INSERT INTO t1 VALUES("this-key", "will disappear");
+INSERT INTO t2 VALUES("this-key", "will also disappear");
+DELETE FROM t3 WHERE id1="my-test-1";
+
+SELECT * FROM t1;
+SELECT * FROM t2;
+SELECT * FROM t3;
+ROLLBACK;
+
+SELECT * FROM t1;
+SELECT * FROM t2;
+SELECT * FROM t3;
+SELECT * FROM t3 WHERE id1="my-test-1" LOCK IN SHARE MODE;
+COMMIT;
+set autocommit=1;
+DROP TABLE t1,t2,t3;
+
+#
+# Check update with conflicting key
+#
+
+CREATE TABLE t1 (a int not null primary key, b int not null, unique (b)) engine=innodb;
+INSERT INTO t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
+# We need the a < 1000 test here to quard against the halloween problems
+UPDATE t1 set a=a+100 where b between 2 and 3 and a < 1000;
+SELECT * from t1;
+drop table t1;
+
+CREATE TABLE t2 (   NEXT_T         BIGINT NOT NULL PRIMARY KEY) ENGINE=MyISAM;
+CREATE TABLE t1 (  B_ID           INTEGER NOT NULL PRIMARY KEY) ENGINE=InnoDB;
+SET AUTOCOMMIT=0;
+INSERT INTO t1 ( B_ID ) VALUES ( 1 );
+INSERT INTO t2 ( NEXT_T ) VALUES ( 1 );
+ROLLBACK;
+SELECT * FROM t1;
+drop table  t1,t2;
+create table t1  ( pk         int primary key,    parent     int not null,    child      int not null,       index (parent)  ) engine = innodb;
+insert into t1 values   (1,0,4),  (2,1,3),  (3,2,1),  (4,1,2);
+select distinct  parent,child   from t1   order by parent;
+drop table t1;
+
+#
+# Test that MySQL priorities clustered indexes
+#
+create table t1 (a int not null auto_increment primary key, b int, c int, key(c)) engine=innodb;
+create table t2 (a int not null auto_increment primary key, b int);
+insert into t1 (b) values (null),(null),(null),(null),(null),(null),(null);
+insert into t2 (a) select b from t1;
+insert into t1 (b) select b from t2;
+insert into t2 (a) select b from t1;
+insert into t1 (a) select b from t2;
+insert into t2 (a) select b from t1;
+insert into t1 (a) select b from t2;
+insert into t2 (a) select b from t1;
+insert into t1 (a) select b from t2;
+insert into t2 (a) select b from t1;
+insert into t1 (a) select b from t2;
+select count(*) from t1;
+--replace_column 9 #
+explain select * from t1 where c between 1 and 2500;
+update t1 set c=a;
+--replace_column 9 #
+explain select * from t1 where c between 1 and 2500;
+drop table t1,t2;
+
+#
+# Test of UPDATE ... ORDER BY
+#
+
+create table t1 (id int primary key auto_increment, fk int, index index_fk (fk)) engine=innodb;
+
+insert into t1 (id) values (null),(null),(null),(null),(null);
+update t1 set fk=69 where fk is null order by id limit 1;
+SELECT * from t1;
+drop table t1;
+
+create table t1 (a int not null, b int not null, key (a));
+insert into t1 values (1,1),(1,2),(1,3),(3,1),(3,2),(3,3),(3,1),(3,2),(3,3),(2,1),(2,2),(2,3);
+SET @tmp=0;
+update t1 set b=(@tmp:=@tmp+1) order by a;
+update t1 set b=99 where a=1 order by b asc limit 1;
+update t1 set b=100 where a=1 order by b desc limit 2;
+update t1 set a=a+10+b where a=1 order by b;
+select * from t1 order by a,b;
+drop table t1;
+
+#
+# Test of multi-table-updates (bug #1980).
+#
+
+create table t1 ( c char(8) not null ) engine=innodb;
+insert into t1 values ('0'),('1'),('2'),('3'),('4'),('5'),('6'),('7'),('8'),('9');
+insert into t1 values ('A'),('B'),('C'),('D'),('E'),('F');
+
+alter table t1 add b char(8) not null;
+alter table t1 add a char(8) not null;
+alter table t1 add primary key (a,b,c);
+update t1 set a=c, b=c;
+
+create table t2 (c char(8) not null, b char(8) not null, a char(8) not null, primary key(a,b,c)) engine=innodb;
+insert into t2 select * from t1;
+
+delete t1,t2 from t2,t1 where t1.a<'B' and t2.b=t1.b;
+drop table t1,t2;
+
+#
+# test autoincrement with TRUNCATE
+#
+
+SET AUTOCOMMIT=1;
+create table t1 (a integer auto_increment primary key) engine=innodb;
+insert into t1 (a) values (NULL),(NULL);
+truncate table t1;
+insert into t1 (a) values (NULL),(NULL);
+SELECT * from t1;
+drop table t1;
+
+#
+# Test dictionary handling with spaceand quoting
+#
+
+CREATE TABLE t1 (`id 1` INT NOT NULL, PRIMARY KEY (`id 1`)) ENGINE=INNODB;
+CREATE TABLE t2 (id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id), FOREIGN KEY (`t1_id`) REFERENCES `t1`(`id 1`)  ON DELETE CASCADE ) ENGINE=INNODB;
+#show create table t2;
+drop table t2,t1;
+
+#
+# Test of multi updated and foreign keys
+#
+
+create table `t1` (`id` int( 11 ) not null  ,primary key ( `id` )) engine = innodb;
+insert into `t1`values ( 1 ) ;
+create table `t2` (`id` int( 11 ) not null default '0',unique key `id` ( `id` ) ,constraint `t1_id_fk` foreign key ( `id` ) references `t1` (`id` )) engine = innodb;
+insert into `t2`values ( 1 ) ;
+create table `t3` (`id` int( 11 ) not null default '0',key `id` ( `id` ) ,constraint `t2_id_fk` foreign key ( `id` ) references `t2` (`id` )) engine = innodb;
+insert into `t3`values ( 1 ) ;
+--error 1451
+delete t3,t2,t1 from t1,t2,t3 where t1.id =1 and t2.id = t1.id and t3.id = t2.id;
+--error 1451
+update t1,t2,t3 set t3.id=5, t2.id=6, t1.id=7  where t1.id =1 and t2.id = t1.id and t3.id = t2.id;
+--error 1054
+update t3 set  t3.id=7  where t1.id =1 and t2.id = t1.id and t3.id = t2.id;
+drop table t3,t2,t1;
+
+#
+# test for recursion depth limit
+#
+create table t1(
+	id int primary key,
+	pid int,
+	index(pid),
+	foreign key(pid) references t1(id) on delete cascade) engine=innodb;
+insert into t1 values(0,0),(1,0),(2,1),(3,2),(4,3),(5,4),(6,5),(7,6),
+	(8,7),(9,8),(10,9),(11,10),(12,11),(13,12),(14,13),(15,14);
+-- error 1451
+delete from t1 where id=0;
+delete from t1 where id=15;
+delete from t1 where id=0;
+
+drop table t1;
+
+#
+# Test timestamps
+#
+
+CREATE TABLE t1 (col1 int(1))ENGINE=InnoDB;
+CREATE TABLE t2 (col1 int(1),stamp TIMESTAMP,INDEX stamp_idx
+(stamp))ENGINE=InnoDB;
+insert into t1 values (1),(2),(3);
+# Note that timestamp 3 is wrong
+insert into t2 values (1, 20020204130000),(2, 20020204130000),(4,20020204310000 ),(5,20020204230000);
+SELECT col1 FROM t1 UNION SELECT col1 FROM t2 WHERE stamp <
+'20020204120000' GROUP BY col1;
+drop table t1,t2;
+
+#
+# Test by Francois MASUREL
+#
+
+CREATE TABLE t1 (
+  `id` int(10) unsigned NOT NULL auto_increment,
+  `id_object` int(10) unsigned default '0',
+  `id_version` int(10) unsigned NOT NULL default '1',
+  `label` varchar(100) NOT NULL default '',
+  `description` text,
+  PRIMARY KEY  (`id`),
+  KEY `id_object` (`id_object`),
+  KEY `id_version` (`id_version`)
+) ENGINE=InnoDB;
+
+INSERT INTO t1 VALUES("6", "3382", "9", "Test", NULL), ("7", "102", "5", "Le Pekin (Test)", NULL),("584", "1794", "4", "Test de resto", NULL),("837", "1822", "6", "Test 3", NULL),("1119", "3524", "1", "Societe Test", NULL),("1122", "3525", "1", "Fournisseur Test", NULL);
+
+CREATE TABLE t2 (
+  `id` int(10) unsigned NOT NULL auto_increment,
+  `id_version` int(10) unsigned NOT NULL default '1',
+  PRIMARY KEY  (`id`),
+  KEY `id_version` (`id_version`)
+) ENGINE=InnoDB;
+
+INSERT INTO t2 VALUES("3524", "1"),("3525", "1"),("1794", "4"),("102", "5"),("1822", "6"),("3382", "9");
+
+SELECT t2.id, t1.`label` FROM t2 INNER JOIN
+(SELECT t1.id_object as id_object FROM t1 WHERE t1.`label` LIKE '%test%') AS lbl 
+ON (t2.id = lbl.id_object) INNER JOIN t1 ON (t2.id = t1.id_object);
+drop table t1,t2;
+
+create table t1 (a int, b varchar(200), c text not null) checksum=1 engine=myisam;
+create table t2 (a int, b varchar(200), c text not null) checksum=0 engine=innodb;
+create table t3 (a int, b varchar(200), c text not null) checksum=1 engine=innodb;
+insert t1 values (1, "aaa", "bbb"), (NULL, "", "ccccc"), (0, NULL, "");
+insert t2 select * from t1;
+insert t3 select * from t1;
+checksum table t1, t2, t3, t4 quick;
+checksum table t1, t2, t3, t4;
+checksum table t1, t2, t3, t4 extended;
+#show table status;
+drop table t1,t2,t3;
+
+#
+# Test problem with refering to different fields in same table in UNION
+# (Bug #2552)
+#
+create table t1 (id int,  name char(10) not null,  name2 char(10) not null) engine=innodb;
+insert into t1 values(1,'first','fff'),(2,'second','sss'),(3,'third','ttt');
+select trim(name2) from t1  union all  select trim(name) from t1 union all select trim(id) from t1;
+drop table t1;
+
+#
+# Bug2160
+#
+create table t1 (a int) engine=innodb;
+create table t2 like t1;
+drop table t1,t2;
+
+#
+# Test of automaticly created foreign keys
+#
+
+create table t1 (id int(11) not null, id2 int(11) not null, unique (id,id2)) engine=innodb;
+create table t2 (id int(11) not null, constraint t1_id_fk foreign key ( id ) references t1 (id)) engine = innodb;
+show create table t1;
+show create table t2;
+create index id on t2 (id);
+show create table t2;
+create index id2 on t2 (id);
+show create table t2;
+drop index id2 on t2;
+--error ER_DROP_INDEX_FK
+drop index id on t2;
+show create table t2;
+drop table t2;
+
+create table t2 (id int(11) not null, id2 int(11) not null, constraint t1_id_fk foreign key (id,id2) references t1 (id,id2)) engine = innodb;
+show create table t2;
+create unique index id on t2 (id,id2);
+show create table t2;
+drop table t2;
+
+# Check foreign key columns created in different order than key columns
+create table t2 (id int(11) not null, id2 int(11) not null, unique (id,id2),constraint t1_id_fk foreign key (id2,id) references t1 (id,id2)) engine = innodb;
+show create table t2;
+drop table t2;
+
+create table t2 (id int(11) not null, id2 int(11) not null, unique (id,id2), constraint t1_id_fk foreign key (id) references t1 (id)) engine = innodb;
+show create table t2;
+drop table t2;
+
+create table t2 (id int(11) not null, id2 int(11) not null, unique (id,id2),constraint t1_id_fk foreign key (id2,id) references t1 (id,id2)) engine = innodb;
+show create table t2;
+drop table t2;
+
+create table t2 (id int(11) not null auto_increment, id2 int(11) not null, constraint t1_id_fk foreign key (id) references t1 (id), primary key (id), index (id,id2)) engine = innodb;
+show create table t2;
+drop table t2;
+
+create table t2 (id int(11) not null auto_increment, id2 int(11) not null, constraint t1_id_fk foreign key (id) references t1 (id)) engine= innodb;
+show create table t2;
+alter table t2 add index id_test (id), add index id_test2 (id,id2);
+show create table t2;
+drop table t2;
+
+# Test error handling
+
+# Embedded server doesn't chdir to data directory
+--replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ ''
+--error ER_WRONG_FK_DEF
+create table t2 (id int(11) not null, id2 int(11) not null, constraint t1_id_fk foreign key (id2,id) references t1 (id)) engine = innodb;
+
+# bug#3749
+
+create table t2 (a int auto_increment primary key, b int, index(b), foreign key (b) references t1(id), unique(b)) engine=innodb;
+show create table t2;
+drop table t2;
+create table t2 (a int auto_increment primary key, b int, foreign key (b) references t1(id), foreign key (b) references t1(id), unique(b)) engine=innodb;
+show create table t2;
+drop table t2, t1;
+
+
+#
+# Bug #6126: Duplicate columns in keys gives misleading error message
+#
+--error 1060
+create table t1 (c char(10), index (c,c)) engine=innodb;
+--error 1060
+create table t1 (c1 char(10), c2 char(10), index (c1,c2,c1)) engine=innodb;
+--error 1060
+create table t1 (c1 char(10), c2 char(10), index (c1,c1,c2)) engine=innodb;
+--error 1060
+create table t1 (c1 char(10), c2 char(10), index (c2,c1,c1)) engine=innodb;
+create table t1 (c1 char(10), c2 char(10)) engine=innodb;
+--error 1060
+alter table t1 add key (c1,c1);
+--error 1060
+alter table t1 add key (c2,c1,c1);
+--error 1060
+alter table t1 add key (c1,c2,c1);
+--error 1060
+alter table t1 add key (c1,c1,c2);
+drop table t1;
+
+#
+# Bug #4082: integer truncation
+#
+
+create table t1(a int(1) , b int(1)) engine=innodb;
+insert into t1 values ('1111', '3333');
+select distinct concat(a, b) from t1;
+drop table t1;
+
+#
+# BUG#7709 test case - Boolean fulltext query against unsupported 
+#                      engines does not fail
+#
+
+CREATE TABLE t1 ( a char(10) ) ENGINE=InnoDB;
+--error 1214
+SELECT a FROM t1 WHERE MATCH (a) AGAINST ('test' IN BOOLEAN MODE);
+DROP TABLE t1;
+
+#
+# check null values #1
+#
+
+--disable_warnings
+CREATE TABLE t1 (a_id tinyint(4) NOT NULL default '0', PRIMARY KEY  (a_id)) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+INSERT INTO t1 VALUES (1),(2),(3);
+CREATE TABLE t2 (b_id tinyint(4) NOT NULL default '0',b_a tinyint(4) NOT NULL default '0', PRIMARY KEY  (b_id), KEY  (b_a), 
+                CONSTRAINT fk_b_a FOREIGN KEY (b_a) REFERENCES t1 (a_id) ON DELETE CASCADE ON UPDATE NO ACTION) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+--enable_warnings
+INSERT INTO t2 VALUES (1,1),(2,1),(3,1),(4,2),(5,2);
+SELECT * FROM (SELECT t1.*,GROUP_CONCAT(t2.b_id SEPARATOR ',') as b_list FROM (t1 LEFT JOIN (t2) on t1.a_id = t2.b_a) GROUP BY t1.a_id ) AS xyz;
+DROP TABLE t2;
+DROP TABLE t1;
+
+#
+# Bug#11816 - Truncate table doesn't work with temporary innodb tables
+# This is not an innodb bug, but we test it using innodb.
+#
+create temporary table t1 (a int) engine=innodb;
+insert into t1 values (4711);
+truncate t1;
+insert into t1 values (42);
+select * from t1;
+drop table t1;
+# Show that it works with permanent tables too.
+create table t1 (a int) engine=innodb;
+insert into t1 values (4711);
+truncate t1;
+insert into t1 values (42);
+select * from t1;
+drop table t1;
+
+#
+# Bug #13025  Server crash during filesort	
+#
+
+create table t1 (a int not null, b int not null, c blob not null, d int not null, e int, primary key (a,b,c(255),d)) engine=innodb;
+insert into t1 values (2,2,"b",2,2),(1,1,"a",1,1),(3,3,"ab",3,3);
+select * from t1 order by a,b,c,d;
+explain select * from t1 order by a,b,c,d;
+drop table t1;
+
+#
+# BUG#11039,#13218 Wrong key length in min()
+#
+
+create table t1 (a char(1), b char(1), key(a, b)) engine=innodb;
+insert into t1 values ('8', '6'), ('4', '7');
+select min(a) from t1;
+select min(b) from t1 where a='8';
+drop table t1;
+
+# End of 4.1 tests
+
+#
+# range optimizer problem
+#
+
+create table t1 (x bigint unsigned not null primary key) engine=innodb;
+insert into t1(x) values (0xfffffffffffffff0),(0xfffffffffffffff1);
+select * from t1;
+select count(*) from t1 where x>0;
+select count(*) from t1 where x=0;
+select count(*) from t1 where x<0;
+select count(*) from t1 where x < -16;
+select count(*) from t1 where x = -16;
+explain select count(*) from t1 where x > -16;
+select count(*) from t1 where x > -16;
+select * from t1 where x > -16;
+select count(*) from t1 where x = 18446744073709551601;
+drop table t1;
+
+
+# Test for testable InnoDB status variables. This test
+# uses previous ones(pages_created, rows_deleted, ...).
+--replace_result 8192 8191
+SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_buffer_pool_pages_total';
+SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_page_size';
+SELECT variable_value - @innodb_rows_deleted_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_deleted';
+SELECT variable_value - @innodb_rows_inserted_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_inserted';
+SELECT variable_value - @innodb_rows_updated_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_updated';
+
+# Test for row locks InnoDB status variables.
+SELECT variable_value - @innodb_row_lock_waits_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_waits';
+SELECT variable_value - @innodb_row_lock_current_waits_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_current_waits';
+SELECT variable_value - @innodb_row_lock_time_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time';
+SELECT variable_value - @innodb_row_lock_time_max_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time_max';
+SELECT variable_value - @innodb_row_lock_time_avg_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time_avg';
+
+# Test for innodb_sync_spin_loops variable
+SET @innodb_sync_spin_loops_orig = @@innodb_sync_spin_loops;
+show variables like "innodb_sync_spin_loops";
+set global innodb_sync_spin_loops=1000;
+show variables like "innodb_sync_spin_loops";
+set global innodb_sync_spin_loops=0;
+show variables like "innodb_sync_spin_loops";
+set global innodb_sync_spin_loops=20;
+show variables like "innodb_sync_spin_loops";
+set global innodb_sync_spin_loops=@innodb_sync_spin_loops_orig;
+
+# Test for innodb_thread_concurrency variable
+SET @old_innodb_thread_concurrency= @@global.innodb_thread_concurrency;
+show variables like "innodb_thread_concurrency";
+set global innodb_thread_concurrency=1001;
+show variables like "innodb_thread_concurrency";
+set global innodb_thread_concurrency=0;
+show variables like "innodb_thread_concurrency";
+set global innodb_thread_concurrency=16;
+show variables like "innodb_thread_concurrency";
+SET @@global.innodb_thread_concurrency= @old_innodb_thread_concurrency;
+
+# Test for innodb_concurrency_tickets variable
+show variables like "innodb_concurrency_tickets";
+set global innodb_concurrency_tickets=1000;
+show variables like "innodb_concurrency_tickets";
+set global innodb_concurrency_tickets=0;
+show variables like "innodb_concurrency_tickets";
+set global innodb_concurrency_tickets=500;
+show variables like "innodb_concurrency_tickets";
+
+# Test for innodb_thread_sleep_delay variable
+show variables like "innodb_thread_sleep_delay";
+set global innodb_thread_sleep_delay=100000;
+show variables like "innodb_thread_sleep_delay";
+set global innodb_thread_sleep_delay=0;
+show variables like "innodb_thread_sleep_delay";
+set global innodb_thread_sleep_delay=10000;
+show variables like "innodb_thread_sleep_delay";
+
+#
+# Test varchar
+#
+
+let $default=`select @@storage_engine`;
+set storage_engine=INNODB;
+source include/varchar.inc;
+
+#
+# Some errors/warnings on create
+#
+
+# Embedded server doesn't chdir to data directory
+--replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ ''
+create table t1 (v varchar(65530), key(v));
+drop table t1;
+create table t1 (v varchar(65536));
+show create table t1;
+drop table t1;
+create table t1 (v varchar(65530) character set utf8);
+show create table t1;
+drop table t1;
+
+eval set storage_engine=$default;
+
+-- disable_query_log
+SET GLOBAL innodb_thread_concurrency = @innodb_thread_concurrency_orig;
+
+#######################################################################
+#                                                                     #
+# Please, DO NOT TOUCH this file as well as the innodb.result file.   #
+# These files are to be modified ONLY BY INNOBASE guys.               #
+#                                                                     #
+# Use innodb_mysql.[test|result] files instead.                       #
+#                                                                     #
+# If nevertheless you need to make some changes here, please, forward #
+# your commit message                                                 #
+# To: innodb_dev_ww at oracle.com                                        #
+# Cc: dev-innodb at mysql.com                                            #
+# (otherwise your changes may be erased).                             #
+#                                                                     #
+#######################################################################

=== renamed file 'mysql-test/t/innodb_autoinc_lock_mode_zero-master.opt' => 'mysql-test/suite/innodb/t/innodb_autoinc_lock_mode_zero-master.opt'
=== renamed file 'mysql-test/t/innodb_autoinc_lock_mode_zero.test' => 'mysql-test/suite/innodb/t/innodb_autoinc_lock_mode_zero.test'
=== renamed file 'mysql-test/t/innodb_bug30919-master.opt' => 'mysql-test/suite/innodb/t/innodb_bug30919-master.opt'
=== renamed file 'mysql-test/t/innodb_bug30919.test' => 'mysql-test/suite/innodb/t/innodb_bug30919.test'
=== renamed file 'mysql-test/t/innodb_bug42419.test' => 'mysql-test/suite/innodb/t/innodb_bug42419.test'
=== added file 'mysql-test/suite/innodb/t/innodb_bug48024.test'
--- a/mysql-test/suite/innodb/t/innodb_bug48024.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/innodb/t/innodb_bug48024.test	2010-05-19 07:56:13 +0000
@@ -0,0 +1,22 @@
+# Bug #48024 Innodb doesn't work with multi-statements
+
+--source include/have_innodb.inc
+
+CREATE TABLE bug48024(a int PRIMARY KEY,b int NOT NULL,KEY(b)) ENGINE=InnoDB;
+CREATE TABLE bug48024_b(b int PRIMARY KEY) ENGINE=InnoDB;
+# Bug #53644 InnoDB thinks that /*/ starts and ends a comment
+ALTER TABLE bug48024 /*/ADD CONSTRAINT FOREIGN KEY(c) REFERENCES(a),/*/
+ADD CONSTRAINT FOREIGN KEY(b) REFERENCES bug48024_b(b);
+
+DROP TABLE bug48024,bug48024_b;
+
+# Work around Bug #53750 (failure in mysql-test-run --ps-protocol)
+-- disable_ps_protocol
+delimiter |;
+CREATE TABLE bug48024(a int PRIMARY KEY,b int NOT NULL,KEY(b)) ENGINE=InnoDB;
+CREATE TABLE bug48024_b(b int PRIMARY KEY) ENGINE=InnoDB;
+ALTER TABLE bug48024 /*/ADD CONSTRAINT FOREIGN KEY(c) REFERENCES(a),/*/
+ADD CONSTRAINT FOREIGN KEY(b) REFERENCES bug48024_b(b)|
+delimiter ;|
+
+DROP TABLE bug48024,bug48024_b;

=== added file 'mysql-test/suite/innodb/t/innodb_bug49164.test'
--- a/mysql-test/suite/innodb/t/innodb_bug49164.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/innodb/t/innodb_bug49164.test	2010-05-10 11:37:52 +0000
@@ -0,0 +1,47 @@
+-- source include/have_innodb.inc
+
+# Bug #49164 READ-COMMITTED reports "matched: 0" on compound PK
+# a duplicate of
+# Bug #52663 Lost update incrementing column value under READ COMMITTED
+
+connect (con1,localhost,root,,);
+connect (con2,localhost,root,,);
+
+connection con1;
+SET tx_isolation = 'READ-COMMITTED';
+
+CREATE TABLE bug49164 (a INT, b BIGINT, c TINYINT, PRIMARY KEY (a, b))
+ENGINE=InnoDB;
+
+insert into bug49164 values (1,1,1), (2,2,2), (3,3,3);
+
+begin;
+update bug49164 set c=7;
+select * from bug49164;
+rollback;
+select * from bug49164;
+begin;
+update bug49164 set c=7;
+
+connection con2;
+
+SET tx_isolation = 'READ-COMMITTED'; 
+begin;
+select * from bug49164;
+commit;
+begin;
+--send
+update bug49164 set c=6 where a=1 and b=1;
+
+connection con1;
+rollback;
+select * from bug49164;
+connection con2;
+reap;
+commit;
+connection con1;
+select * from bug49164;
+connection default;
+disconnect con1;
+disconnect con2;
+drop table bug49164;

=== added file 'mysql-test/suite/innodb/t/innodb_bug53674-master.opt'
--- a/mysql-test/suite/innodb/t/innodb_bug53674-master.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/innodb/t/innodb_bug53674-master.opt	2010-06-02 10:26:37 +0000
@@ -0,0 +1 @@
+--log-bin --innodb-locks-unsafe-for-binlog --binlog-format=mixed

=== added file 'mysql-test/suite/innodb/t/innodb_bug53674.test'
--- a/mysql-test/suite/innodb/t/innodb_bug53674.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/innodb/t/innodb_bug53674.test	2010-06-02 10:26:37 +0000
@@ -0,0 +1,8 @@
+-- source include/have_innodb.inc
+
+create table bug53674(a int)engine=innodb;
+insert into bug53674 values (1),(2);
+start transaction;
+select * from bug53674 for update;
+select * from bug53674 where a=(select a from bug53674 where a > 1);
+drop table bug53674;

=== added file 'mysql-test/suite/innodb/t/innodb_bug54044.test'
--- a/mysql-test/suite/innodb/t/innodb_bug54044.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/innodb/t/innodb_bug54044.test	2010-06-29 07:13:18 +0000
@@ -0,0 +1,11 @@
+# This is the test for bug #54044. Special handle MYSQL_TYPE_NULL type
+# during create table, so it will not trigger assertion failure.
+
+--source include/have_innodb.inc
+
+# This 'create table' operation should fail because of
+# using NULL datatype
+--error ER_CANT_CREATE_TABLE
+CREATE TEMPORARY TABLE table_54044 ENGINE = INNODB
+ AS SELECT IF(NULL  IS NOT NULL, NULL, NULL); 
+

=== renamed file 'mysql-test/t/innodb_gis.test' => 'mysql-test/suite/innodb/t/innodb_gis.test'
=== renamed file 'mysql-test/t/innodb_lock_wait_timeout_1-master.opt' => 'mysql-test/suite/innodb/t/innodb_lock_wait_timeout_1-master.opt'
=== renamed file 'mysql-test/t/innodb_lock_wait_timeout_1.test' => 'mysql-test/suite/innodb/t/innodb_lock_wait_timeout_1.test'
=== modified file 'mysql-test/suite/innodb/t/innodb_misc1.test'
--- a/mysql-test/suite/innodb/t/innodb_misc1.test	2010-05-26 18:55:40 +0000
+++ b/mysql-test/suite/innodb/t/innodb_misc1.test	2010-08-04 08:39:53 +0000
@@ -1021,6 +1021,8 @@ DROP TABLE t1,t2;
 #
 # Bug #21101 (Prints wrong error message if max row size is too large)
 #
+#from innodb-1.0.8, any size is passed without innodb_strict_mode.
+SET SESSION innodb_strict_mode = on;
 --error 1118
 CREATE TABLE t1 (
 	c01 CHAR(255), c02 CHAR(255), c03 CHAR(255), c04 CHAR(255),

=== added file 'mysql-test/suite/innodb/t/innodb_multi_update.test'
--- a/mysql-test/suite/innodb/t/innodb_multi_update.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/innodb/t/innodb_multi_update.test	2010-05-05 10:40:01 +0000
@@ -0,0 +1,29 @@
+-- source include/have_innodb.inc
+
+#
+# Test multi update with different join methods
+#
+
+CREATE TABLE bug38999_1 (a int not null primary key, b int not null, key (b)) engine=innodb;
+CREATE TABLE bug38999_2 (a int not null primary key, b int not null, key (b)) engine=innodb;
+INSERT INTO bug38999_1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9),(10,10),(11,11),(12,12);
+INSERT INTO bug38999_2 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
+
+# Full join, without key
+update bug38999_1,bug38999_2 set bug38999_1.a=bug38999_1.a+100;
+select * from bug38999_1;
+
+# unique key
+update bug38999_1,bug38999_2 set bug38999_1.a=bug38999_1.a+100 where bug38999_1.a=101;
+select * from bug38999_1;
+
+# ref key
+update bug38999_1,bug38999_2 set bug38999_1.b=bug38999_1.b+10 where bug38999_1.b=2;
+select * from bug38999_1;
+
+# Range key (in bug38999_1)
+update bug38999_1,bug38999_2 set bug38999_1.b=bug38999_1.b+2,bug38999_2.b=bug38999_1.b+10 where bug38999_1.b between 3 and 5 and bug38999_1.a=bug38999_2.a+100;
+select * from bug38999_1;
+select * from bug38999_2;
+
+drop table bug38999_1,bug38999_2;

=== renamed file 'mysql-test/t/innodb_mysql-master.opt' => 'mysql-test/suite/innodb/t/innodb_mysql-master.opt'
=== renamed file 'mysql-test/t/innodb_mysql.test' => 'mysql-test/suite/innodb/t/innodb_mysql.test'
--- a/mysql-test/t/innodb_mysql.test	2010-05-26 18:55:40 +0000
+++ b/mysql-test/suite/innodb/t/innodb_mysql.test	2010-08-02 09:01:24 +0000
@@ -633,4 +633,123 @@ SELECT SECOND(c)- at bug47453 FROM t1 JOIN
 
 DROP TABLE t1, t2;
 
+--echo #
+--echo # Bug#38999 valgrind warnings for update statement in function compare_record()
+--echo #
+
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
+CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 values (1),(2),(3),(4),(5);
+INSERT INTO t2 values (1);
+
+SELECT * FROM t1 WHERE a = 2;
+UPDATE t1,t2 SET t1.a = t1.a + 100 WHERE t1.a = 1;
+
+DROP TABLE t1,t2;
+
+--echo #
+--echo # Bug #53334: wrong result for outer join with impossible ON condition
+--echo # (see the same test case for MyISAM in join.test)
+--echo #
+
+CREATE TABLE t1 (id INT PRIMARY KEY);
+CREATE TABLE t2 (id INT);
+
+INSERT INTO t1 VALUES (75);
+INSERT INTO t1 VALUES (79);
+INSERT INTO t1 VALUES (78);
+INSERT INTO t1 VALUES (77);
+REPLACE INTO t1 VALUES (76);
+REPLACE INTO t1 VALUES (76);
+INSERT INTO t1 VALUES (104);
+INSERT INTO t1 VALUES (103);
+INSERT INTO t1 VALUES (102);
+INSERT INTO t1 VALUES (101);
+INSERT INTO t1 VALUES (105);
+INSERT INTO t1 VALUES (106);
+INSERT INTO t1 VALUES (107);
+
+INSERT INTO t2 VALUES (107),(75),(1000);
+
+SELECT t1.id,t2.id FROM t2 LEFT JOIN t1 ON t1.id>=74 AND t1.id<=0
+  WHERE t2.id=75 AND t1.id IS NULL;
+EXPLAIN SELECT t1.id,t2.id FROM t2 LEFT JOIN t1 ON t1.id>=74 AND t1.id<=0
+  WHERE t2.id=75 AND t1.id IS NULL;
+
+DROP TABLE t1,t2;
+
+--echo #
+--echo # Bug #53830: !table || (!table->read_set || bitmap_is_set(table->read_set, field_index))
+--echo #
+
+CREATE TABLE t1 (a INT, b INT, c INT, d INT,
+                 PRIMARY KEY(a,b,c), KEY(b,d))
+                 ENGINE=InnoDB;
+INSERT INTO t1 VALUES (0, 77, 1, 3);
+
+UPDATE t1 SET d = 0 WHERE b = 77 AND c = 25;
+
+DROP TABLE t1;
+
+--echo #
+--echo # Bug#50389 Using intersect does not return all rows
+--echo #
+
+CREATE TABLE t1 (
+  f1 INT(10) NOT NULL,
+  f2 INT(10),
+  f3 INT(10),
+  f4 TINYINT(4),
+  f5 VARCHAR(50),
+  PRIMARY KEY (f1),
+  KEY idx1 (f2,f5,f4),
+  KEY idx2 (f2,f4)
+) ENGINE=InnoDB;
+
+LOAD DATA INFILE '../../std_data/intersect-bug50389.tsv' INTO TABLE t1;
+
+SELECT * FROM t1 WHERE f1 IN
+(3305028,3353871,3772880,3346860,4228206,3336022,
+ 3470988,3305175,3329875,3817277,3856380,3796193,
+ 3784744,4180925,4559596,3963734,3856391,4494153)
+AND f5 = 'abcdefghijklmnopwrst' AND f2 = 1221457 AND f4 = 0 ;
+
+EXPLAIN SELECT * FROM t1 WHERE f1 IN
+(3305028,3353871,3772880,3346860,4228206,3336022,
+ 3470988,3305175,3329875,3817277,3856380,3796193,
+ 3784744,4180925,4559596,3963734,3856391,4494153)
+AND f5 = 'abcdefghijklmnopwrst' AND f2 = 1221457 AND f4 = 0 ;
+
+DROP TABLE t1;
+
+--echo #
+--echo # Bug#51431 Wrong sort order after import of dump file
+--echo #
+
+CREATE TABLE t1 (
+  f1 INT(11) NOT NULL,
+  f2 int(11) NOT NULL,
+  f3 int(11) NOT NULL,
+  f4 tinyint(1) NOT NULL,
+  PRIMARY KEY (f1),
+  UNIQUE KEY (f2, f3),
+  KEY (f4)
+) ENGINE=InnoDB;
+
+INSERT INTO t1 VALUES
+(1,1,991,1), (2,1,992,1), (3,1,993,1), (4,1,994,1), (5,1,995,1),
+(6,1,996,1), (7,1,997,1), (8,1,998,1), (10,1,999,1), (11,1,9910,1),
+(16,1,9911,1), (17,1,9912,1), (18,1,9913,1), (19,1,9914,1), (20,1,9915,1),
+(21,1,9916,1), (22,1,9917,1), (23,1,9918,1), (24,1,9919,1), (25,1,9920,1),
+(26,1,9921,1), (27,1,9922,1);
+
+FLUSH TABLES;
+
+SELECT * FROM t1 WHERE f2 = 1 AND f4 = TRUE
+ORDER BY f1 DESC LIMIT 5;
+EXPLAIN SELECT * FROM t1 WHERE f2 = 1 AND f4 = TRUE
+ORDER BY f1 DESC LIMIT 5;
+
+DROP TABLE t1;
+
 --echo End of 5.1 tests

=== renamed file 'mysql-test/t/innodb_mysql_rbk-master.opt' => 'mysql-test/suite/innodb/t/innodb_mysql_rbk-master.opt'
=== renamed file 'mysql-test/t/innodb_mysql_rbk.test' => 'mysql-test/suite/innodb/t/innodb_mysql_rbk.test'
=== renamed file 'mysql-test/t/innodb_notembedded.test' => 'mysql-test/suite/innodb/t/innodb_notembedded.test'
=== renamed file 'mysql-test/t/innodb_timeout_rollback-master.opt' => 'mysql-test/suite/innodb/t/innodb_timeout_rollback-master.opt'
=== renamed file 'mysql-test/t/innodb_timeout_rollback.test' => 'mysql-test/suite/innodb/t/innodb_timeout_rollback.test'
=== added file 'mysql-test/suite/innodb_plugin/r/innodb-autoinc-optimize.result'
--- a/mysql-test/suite/innodb_plugin/r/innodb-autoinc-optimize.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/innodb_plugin/r/innodb-autoinc-optimize.result	2010-06-03 09:48:59 +0000
@@ -0,0 +1,9 @@
+drop table if exists t1;
+create table t1(a int not null auto_increment primary key) engine=innodb;
+insert into t1 set a = -1;
+optimize table t1;
+Table	Op	Msg_type	Msg_text
+test.t1	optimize	note	Table does not support optimize, doing recreate + analyze instead
+test.t1	optimize	status	OK
+==== clean up ====
+DROP TABLE t1;

=== added file 'mysql-test/suite/innodb_plugin/r/innodb-ucs2.result'
--- a/mysql-test/suite/innodb_plugin/r/innodb-ucs2.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/innodb_plugin/r/innodb-ucs2.result	2010-06-03 09:48:59 +0000
@@ -0,0 +1,314 @@
+drop table if exists t1, t2;
+create table t1 (
+a int, b char(10), c char(10), filler char(10), primary key(a, b(2)), unique key (a, c(2))
+) character set utf8 engine = innodb;
+create table t2 (
+a int, b char(10), c char(10), filler char(10), primary key(a, b(2)), unique key (a, c(2))
+) character set ucs2 engine = innodb;
+insert into t1 values (1,'abcdefg','abcdefg','one');
+insert into t1 values (2,'ijkilmn','ijkilmn','two');
+insert into t1 values (3,'qrstuvw','qrstuvw','three');
+insert into t1 values (4,_utf8 0xe880bd,_utf8 0xe880bd,'four');
+insert into t1 values (4,_utf8 0x5b,_utf8 0x5b,'five');
+insert into t1 values (4,_utf8 0xe880bde880bd,_utf8 0xe880bde880bd,'six');
+insert into t1 values (4,_utf8 0xe880bdD0B1e880bd,_utf8 0xe880bdD0B1e880bd,'seven');
+insert into t1 values (4,_utf8 0xD0B1,_utf8 0xD0B1,'eight');
+insert into t2 values (1,'abcdefg','abcdefg','one');
+insert into t2 values (2,'ijkilmn','ijkilmn','two');
+insert into t2 values (3,'qrstuvw','qrstuvw','three');
+insert into t2 values (4,_ucs2 0x00e400,_ucs2 0x00e400,'four');
+insert into t2 values (4,_ucs2 0x00640065,_ucs2 0x00640065,'five');
+insert into t2 values (4,_ucs2 0x00e400e50068,_ucs2 0x00e400e50068,'six');
+insert into t2 values (4,_ucs2 0x01fc,_ucs2 0x01fc,'seven');
+insert into t2 values (4,_ucs2 0x0120,_ucs2 0x0120,'eight');
+insert into t2 values (4,_ucs2 0x0563,_ucs2 0x0563,'ten');
+insert into t2 values (4,_ucs2 0x05630563,_ucs2 0x05630563,'eleven');
+insert into t2 values (4,_ucs2 0x0563001fc0563,_ucs2 0x0563001fc0563,'point');
+insert into t2 values (4,_ucs2 0x05612020,_ucs2 0x05612020,'taken');
+update t1 set filler = 'boo' where a = 1;
+update t2 set filler ='email' where a = 4;
+select a,hex(b),hex(c),filler from t1 order by filler;
+a	hex(b)	hex(c)	filler
+1	61626364656667	61626364656667	boo
+4	D0B1	D0B1	eight
+4	5B	5B	five
+4	E880BD	E880BD	four
+4	E880BDD0B1E880BD	E880BDD0B1E880BD	seven
+4	E880BDE880BD	E880BDE880BD	six
+3	71727374757677	71727374757677	three
+2	696A6B696C6D6E	696A6B696C6D6E	two
+select a,hex(b),hex(c),filler from t2 order by filler;
+a	hex(b)	hex(c)	filler
+4	05630563	05630563	email
+4	0563	0563	email
+4	05612020	05612020	email
+4	01FC	01FC	email
+4	0120	0120	email
+4	00640065	00640065	email
+4	00E400E50068	00E400E50068	email
+4	0000E400	0000E400	email
+4	0000563001FC0563	0000563001FC0563	email
+1	0061006200630064006500660067	0061006200630064006500660067	one
+3	0071007200730074007500760077	0071007200730074007500760077	three
+2	0069006A006B0069006C006D006E	0069006A006B0069006C006D006E	two
+drop table t1;
+drop table t2;
+create table t1 (
+a int, b varchar(10), c varchar(10), filler varchar(10), primary key(a, b(2)), unique key (a, c(2))
+) character set utf8 engine = innodb;
+create table t2 (
+a int, b varchar(10), c varchar(10), filler varchar(10), primary key(a, b(2)), unique key (a, c(2))
+) character set ucs2 engine = innodb;
+insert into t1 values (1,'abcdefg','abcdefg','one');
+insert into t1 values (2,'ijkilmn','ijkilmn','two');
+insert into t1 values (3,'qrstuvw','qrstuvw','three');
+insert into t1 values (4,_utf8 0xe880bd,_utf8 0xe880bd,'four');
+insert into t1 values (4,_utf8 0x5b,_utf8 0x5b,'five');
+insert into t1 values (4,_utf8 0xe880bde880bd,_utf8 0xe880bde880bd,'six');
+insert into t1 values (4,_utf8 0xe880bdD0B1e880bd,_utf8 0xe880bdD0B1e880bd,'seven');
+insert into t1 values (4,_utf8 0xD0B1,_utf8 0xD0B1,'eight');
+insert into t2 values (1,'abcdefg','abcdefg','one');
+insert into t2 values (2,'ijkilmn','ijkilmn','two');
+insert into t2 values (3,'qrstuvw','qrstuvw','three');
+insert into t2 values (4,_ucs2 0x00e400,_ucs2 0x00e400,'four');
+insert into t2 values (4,_ucs2 0x00640065,_ucs2 0x00640065,'five');
+insert into t2 values (4,_ucs2 0x00e400e50068,_ucs2 0x00e400e50068,'six');
+insert into t2 values (4,_ucs2 0x01fc,_ucs2 0x01fc,'seven');
+insert into t2 values (4,_ucs2 0x0120,_ucs2 0x0120,'eight');
+insert into t2 values (4,_ucs2 0x0563,_ucs2 0x0563,'ten');
+insert into t2 values (4,_ucs2 0x05630563,_ucs2 0x05630563,'eleven');
+insert into t2 values (4,_ucs2 0x0563001fc0563,_ucs2 0x0563001fc0563,'point');
+insert into t2 values (4,_ucs2 0x05612020,_ucs2 0x05612020,'taken');
+update t1 set filler = 'boo' where a = 1;
+update t2 set filler ='email' where a = 4;
+select a,hex(b),hex(c),filler from t1 order by filler;
+a	hex(b)	hex(c)	filler
+1	61626364656667	61626364656667	boo
+4	D0B1	D0B1	eight
+4	5B	5B	five
+4	E880BD	E880BD	four
+4	E880BDD0B1E880BD	E880BDD0B1E880BD	seven
+4	E880BDE880BD	E880BDE880BD	six
+3	71727374757677	71727374757677	three
+2	696A6B696C6D6E	696A6B696C6D6E	two
+select a,hex(b),hex(c),filler from t2 order by filler;
+a	hex(b)	hex(c)	filler
+4	05630563	05630563	email
+4	0563	0563	email
+4	05612020	05612020	email
+4	01FC	01FC	email
+4	0120	0120	email
+4	00640065	00640065	email
+4	00E400E50068	00E400E50068	email
+4	0000E400	0000E400	email
+4	0000563001FC0563	0000563001FC0563	email
+1	0061006200630064006500660067	0061006200630064006500660067	one
+3	0071007200730074007500760077	0071007200730074007500760077	three
+2	0069006A006B0069006C006D006E	0069006A006B0069006C006D006E	two
+drop table t1;
+drop table t2;
+create table t1 (
+a int, b text(10), c text(10), filler text(10), primary key(a, b(2)), unique key (a, c(2))
+) character set utf8 engine = innodb;
+create table t2 (
+a int, b text(10), c text(10), filler text(10), primary key(a, b(2)), unique key (a, c(2))
+) character set ucs2 engine = innodb;
+insert into t1 values (1,'abcdefg','abcdefg','one');
+insert into t1 values (2,'ijkilmn','ijkilmn','two');
+insert into t1 values (3,'qrstuvw','qrstuvw','three');
+insert into t1 values (4,_utf8 0xe880bd,_utf8 0xe880bd,'four');
+insert into t1 values (4,_utf8 0x5b,_utf8 0x5b,'five');
+insert into t1 values (4,_utf8 0xe880bde880bd,_utf8 0xe880bde880bd,'six');
+insert into t1 values (4,_utf8 0xe880bdD0B1e880bd,_utf8 0xe880bdD0B1e880bd,'seven');
+insert into t1 values (4,_utf8 0xD0B1,_utf8 0xD0B1,'eight');
+insert into t2 values (1,'abcdefg','abcdefg','one');
+insert into t2 values (2,'ijkilmn','ijkilmn','two');
+insert into t2 values (3,'qrstuvw','qrstuvw','three');
+insert into t2 values (4,_ucs2 0x00e400,_ucs2 0x00e400,'four');
+insert into t2 values (4,_ucs2 0x00640065,_ucs2 0x00640065,'five');
+insert into t2 values (4,_ucs2 0x00e400e50068,_ucs2 0x00e400e50068,'six');
+insert into t2 values (4,_ucs2 0x01fc,_ucs2 0x01fc,'seven');
+insert into t2 values (4,_ucs2 0x0120,_ucs2 0x0120,'eight');
+insert into t2 values (4,_ucs2 0x0563,_ucs2 0x0563,'ten');
+insert into t2 values (4,_ucs2 0x05630563,_ucs2 0x05630563,'eleven');
+insert into t2 values (4,_ucs2 0x0563001fc0563,_ucs2 0x0563001fc0563,'point');
+insert into t2 values (4,_ucs2 0x05612020,_ucs2 0x05612020,'taken');
+update t1 set filler = 'boo' where a = 1;
+update t2 set filler ='email' where a = 4;
+select a,hex(b),hex(c),filler from t1 order by filler;
+a	hex(b)	hex(c)	filler
+1	61626364656667	61626364656667	boo
+4	D0B1	D0B1	eight
+4	5B	5B	five
+4	E880BD	E880BD	four
+4	E880BDD0B1E880BD	E880BDD0B1E880BD	seven
+4	E880BDE880BD	E880BDE880BD	six
+3	71727374757677	71727374757677	three
+2	696A6B696C6D6E	696A6B696C6D6E	two
+select a,hex(b),hex(c),filler from t2 order by filler;
+a	hex(b)	hex(c)	filler
+4	0120	0120	email
+4	01FC	01FC	email
+4	0563	0563	email
+4	0000563001FC0563	0000563001FC0563	email
+4	0000E400	0000E400	email
+4	00640065	00640065	email
+4	00E400E50068	00E400E50068	email
+4	05612020	05612020	email
+4	05630563	05630563	email
+1	0061006200630064006500660067	0061006200630064006500660067	one
+3	0071007200730074007500760077	0071007200730074007500760077	three
+2	0069006A006B0069006C006D006E	0069006A006B0069006C006D006E	two
+drop table t1;
+drop table t2;
+create table t1 (
+a int, b blob(10), c blob(10), filler blob(10), primary key(a, b(2)), unique key (a, c(2))
+) character set utf8 engine = innodb;
+create table t2 (
+a int, b blob(10), c blob(10), filler blob(10), primary key(a, b(2)), unique key (a, c(2))
+) character set ucs2 engine = innodb;
+insert into t1 values (1,'abcdefg','abcdefg','one');
+insert into t1 values (2,'ijkilmn','ijkilmn','two');
+insert into t1 values (3,'qrstuvw','qrstuvw','three');
+insert into t1 values (4,_utf8 0xe880bd,_utf8 0xe880bd,'four');
+insert into t1 values (4,_utf8 0x5b,_utf8 0x5b,'five');
+insert into t1 values (4,_utf8 0xD0B1,_utf8 0xD0B1,'eight');
+insert into t2 values (1,'abcdefg','abcdefg','one');
+insert into t2 values (2,'ijkilmn','ijkilmn','two');
+insert into t2 values (3,'qrstuvw','qrstuvw','three');
+insert into t2 values (4,_ucs2 0x00e400,_ucs2 0x00e400,'four');
+insert into t2 values (4,_ucs2 0x00640065,_ucs2 0x00640065,'five');
+insert into t2 values (4,_ucs2 0x00e400e50068,_ucs2 0x00e400e50068,'six');
+insert into t2 values (4,_ucs2 0x01fc,_ucs2 0x01fc,'seven');
+insert into t2 values (4,_ucs2 0x0120,_ucs2 0x0120,'eight');
+insert into t2 values (4,_ucs2 0x0563,_ucs2 0x0563,'ten');
+insert into t2 values (4,_ucs2 0x05612020,_ucs2 0x05612020,'taken');
+update t1 set filler = 'boo' where a = 1;
+update t2 set filler ='email' where a = 4;
+select a,hex(b),hex(c),filler from t1 order by filler;
+a	hex(b)	hex(c)	filler
+1	61626364656667	61626364656667	boo
+4	D0B1	D0B1	eight
+4	5B	5B	five
+4	E880BD	E880BD	four
+3	71727374757677	71727374757677	three
+2	696A6B696C6D6E	696A6B696C6D6E	two
+select a,hex(b),hex(c),filler from t2 order by filler;
+a	hex(b)	hex(c)	filler
+4	0000E400	0000E400	email
+4	00640065	00640065	email
+4	00E400E50068	00E400E50068	email
+4	0120	0120	email
+4	01FC	01FC	email
+4	05612020	05612020	email
+4	0563	0563	email
+1	61626364656667	61626364656667	one
+3	71727374757677	71727374757677	three
+2	696A6B696C6D6E	696A6B696C6D6E	two
+drop table t1;
+drop table t2;
+commit;
+CREATE TABLE t1 (
+ind enum('0','1','2') NOT NULL default '0',
+string1 varchar(250) NOT NULL,
+PRIMARY KEY  (ind)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+CREATE TABLE t2 (
+ind enum('0','1','2') NOT NULL default '0',
+string1 varchar(250) NOT NULL,
+PRIMARY KEY  (ind)
+) ENGINE=InnoDB DEFAULT CHARSET=ucs2;
+INSERT INTO t1 VALUES ('1', ''),('2', '');
+INSERT INTO t2 VALUES ('1', ''),('2', '');
+SELECT hex(ind),hex(string1) FROM t1 ORDER BY string1;
+hex(ind)	hex(string1)
+31	
+32	
+SELECT hex(ind),hex(string1) FROM t2 ORDER BY string1;
+hex(ind)	hex(string1)
+0031	
+0032	
+drop table t1,t2;
+CREATE TABLE t1 (
+ind set('0','1','2') NOT NULL default '0',
+string1 varchar(250) NOT NULL,
+PRIMARY KEY  (ind)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+CREATE TABLE t2 (
+ind set('0','1','2') NOT NULL default '0',
+string1 varchar(250) NOT NULL,
+PRIMARY KEY  (ind)
+) ENGINE=InnoDB DEFAULT CHARSET=ucs2;
+INSERT INTO t1 VALUES ('1', ''),('2', '');
+INSERT INTO t2 VALUES ('1', ''),('2', '');
+SELECT hex(ind),hex(string1) FROM t1 ORDER BY string1;
+hex(ind)	hex(string1)
+31	
+32	
+SELECT hex(ind),hex(string1) FROM t2 ORDER BY string1;
+hex(ind)	hex(string1)
+0031	
+0032	
+drop table t1,t2;
+CREATE TABLE t1 (
+ind bit not null,
+string1 varchar(250) NOT NULL,
+PRIMARY KEY  (ind)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+CREATE TABLE t2 (
+ind bit not null,
+string1 varchar(250) NOT NULL,
+PRIMARY KEY  (ind)
+) ENGINE=InnoDB DEFAULT CHARSET=ucs2;
+insert into t1 values(0,''),(1,'');
+insert into t2 values(0,''),(1,'');
+select hex(ind),hex(string1) from t1 order by string1;
+hex(ind)	hex(string1)
+0	
+1	
+select hex(ind),hex(string1) from t2 order by string1;
+hex(ind)	hex(string1)
+0	
+1	
+drop table t1,t2;
+create table t2 (
+a int, b char(10), filler char(10), primary key(a, b(2)) 
+) character set utf8 engine = innodb;
+insert into t2 values (1,'abcdefg','one');
+insert into t2 values (2,'ijkilmn','two');
+insert into t2 values (3, 'qrstuvw','three');
+update t2 set a=5, filler='booo' where a=1;
+drop table t2;
+create table t2 (
+a int, b char(10), filler char(10), primary key(a, b(2)) 
+) character set ucs2 engine = innodb;
+insert into t2 values (1,'abcdefg','one');
+insert into t2 values (2,'ijkilmn','two');
+insert into t2 values (3, 'qrstuvw','three');
+update t2 set a=5, filler='booo' where a=1;
+drop table t2;
+create table t1(a int not null, b char(110),primary key(a,b(100))) engine=innodb default charset=utf8;
+insert into t1 values(1,'abcdefg'),(2,'defghijk');
+insert into t1 values(6,_utf8 0xD0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1);
+insert into t1 values(7,_utf8 0xD0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B2);
+select a,hex(b) from t1 order by b;
+a	hex(b)
+1	61626364656667
+2	6465666768696A6B
+6	D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1
+7	D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B2
+update t1 set b = 'three' where a = 6;
+drop table t1;
+create table t1(a int not null, b text(110),primary key(a,b(100))) engine=innodb default charset=utf8;
+insert into t1 values(1,'abcdefg'),(2,'defghijk');
+insert into t1 values(6,_utf8 0xD0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1);
+insert into t1 values(7,_utf8 0xD0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B2);
+select a,hex(b) from t1 order by b;
+a	hex(b)
+1	61626364656667
+2	6465666768696A6B
+6	D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1
+7	D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B1D0B2
+update t1 set b = 'three' where a = 6;
+drop table t1;
+End of 5.0 tests

=== modified file 'mysql-test/suite/innodb_plugin/r/innodb.result'
--- a/mysql-test/suite/innodb_plugin/r/innodb.result	2010-04-09 13:07:41 +0000
+++ b/mysql-test/suite/innodb_plugin/r/innodb.result	2010-08-05 11:40:54 +0000
@@ -1184,82 +1184,6 @@ a	b
 8	8
 9	9
 drop table t1;
-CREATE TABLE t1 (a int not null primary key, b int not null, key (b)) engine=innodb;
-CREATE TABLE t2 (a int not null primary key, b int not null, key (b)) engine=innodb;
-INSERT INTO t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9),(10,10),(11,11),(12,12);
-INSERT INTO t2 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
-update t1,t2 set t1.a=t1.a+100;
-select * from t1;
-a	b
-101	1
-102	2
-103	3
-104	4
-105	5
-106	6
-107	7
-108	8
-109	9
-110	10
-111	11
-112	12
-update t1,t2 set t1.a=t1.a+100 where t1.a=101;
-select * from t1;
-a	b
-201	1
-102	2
-103	3
-104	4
-105	5
-106	6
-107	7
-108	8
-109	9
-110	10
-111	11
-112	12
-update t1,t2 set t1.b=t1.b+10 where t1.b=2;
-select * from t1;
-a	b
-201	1
-103	3
-104	4
-105	5
-106	6
-107	7
-108	8
-109	9
-110	10
-111	11
-102	12
-112	12
-update t1,t2 set t1.b=t1.b+2,t2.b=t1.b+10 where t1.b between 3 and 5 and t1.a=t2.a+100;
-select * from t1;
-a	b
-201	1
-103	5
-104	6
-106	6
-105	7
-107	7
-108	8
-109	9
-110	10
-111	11
-102	12
-112	12
-select * from t2;
-a	b
-1	1
-2	2
-6	6
-7	7
-8	8
-9	9
-3	13
-4	14
-5	15
-drop table t1,t2;
 CREATE TABLE t2 (   NEXT_T         BIGINT NOT NULL PRIMARY KEY) ENGINE=MyISAM;
 CREATE TABLE t1 (  B_ID           INTEGER NOT NULL PRIMARY KEY) ENGINE=InnoDB;
 SET AUTOCOMMIT=0;
@@ -1438,7 +1362,7 @@ insert t2 select * from t1;
 insert t3 select * from t1;
 checksum table t1, t2, t3, t4 quick;
 Table	Checksum
-test.t1	2948697075
+test.t1	3442722830
 test.t2	NULL
 test.t3	NULL
 test.t4	NULL
@@ -1446,17 +1370,17 @@ Warnings:
 Error	1146	Table 'test.t4' doesn't exist
 checksum table t1, t2, t3, t4;
 Table	Checksum
-test.t1	2948697075
-test.t2	2948697075
-test.t3	2948697075
+test.t1	3442722830
+test.t2	3442722830
+test.t3	3442722830
 test.t4	NULL
 Warnings:
 Error	1146	Table 'test.t4' doesn't exist
 checksum table t1, t2, t3, t4 extended;
 Table	Checksum
-test.t1	2948697075
-test.t2	2948697075
-test.t3	2948697075
+test.t1	3442722830
+test.t2	3442722830
+test.t3	3442722830
 test.t4	NULL
 Warnings:
 Error	1146	Table 'test.t4' doesn't exist
@@ -1752,10 +1676,10 @@ variable_value - @innodb_rows_deleted_or
 71
 SELECT variable_value - @innodb_rows_inserted_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_inserted';
 variable_value - @innodb_rows_inserted_orig
-1087
+1066
 SELECT variable_value - @innodb_rows_updated_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_updated';
 variable_value - @innodb_rows_updated_orig
-885
+865
 SELECT variable_value - @innodb_row_lock_waits_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_waits';
 variable_value - @innodb_row_lock_waits_orig
 0

=== added file 'mysql-test/suite/innodb_plugin/r/innodb_autoinc_lock_mode_zero.result'
--- a/mysql-test/suite/innodb_plugin/r/innodb_autoinc_lock_mode_zero.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/innodb_plugin/r/innodb_autoinc_lock_mode_zero.result	2010-06-03 09:48:59 +0000
@@ -0,0 +1,39 @@
+drop table if exists t1;
+CREATE TABLE t1 (
+id int(11) NOT NULL auto_increment,
+ggid varchar(32) binary DEFAULT '' NOT NULL,
+email varchar(64) DEFAULT '' NOT NULL,
+passwd varchar(32) binary DEFAULT '' NOT NULL,
+PRIMARY KEY (id),
+UNIQUE ggid (ggid)
+) ENGINE=innodb;
+insert into t1 (ggid,passwd) values ('test1','xxx');
+insert into t1 (ggid,passwd) values ('test2','yyy');
+insert into t1 (ggid,passwd) values ('test2','this will fail');
+ERROR 23000: Duplicate entry 'test2' for key 'ggid'
+insert into t1 (ggid,id) values ('this will fail',1);
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+select * from t1 where ggid='test1';
+id	ggid	email	passwd
+1	test1		xxx
+select * from t1 where passwd='xxx';
+id	ggid	email	passwd
+1	test1		xxx
+select * from t1 where id=2;
+id	ggid	email	passwd
+2	test2		yyy
+replace into t1 (ggid,id) values ('this will work',1);
+replace into t1 (ggid,passwd) values ('test2','this will work');
+update t1 set id=100,ggid='test2' where id=1;
+ERROR 23000: Duplicate entry 'test2' for key 'ggid'
+select * from t1;
+id	ggid	email	passwd
+1	this will work		
+3	test2		this will work
+select * from t1 where id=1;
+id	ggid	email	passwd
+1	this will work		
+select * from t1 where id=999;
+id	ggid	email	passwd
+drop table t1;
+End of tests

=== added file 'mysql-test/suite/innodb_plugin/r/innodb_bug30919.result'
--- a/mysql-test/suite/innodb_plugin/r/innodb_bug30919.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/innodb_plugin/r/innodb_bug30919.result	2010-06-03 09:48:59 +0000
@@ -0,0 +1,1043 @@
+use test;
+CREATE TABLE test.part_tbl(id MEDIUMINT NOT NULL AUTO_INCREMENT,
+dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
+fkid MEDIUMINT, filler VARCHAR(255),
+PRIMARY KEY(id)) ENGINE='innodb'
+PARTITION BY RANGE(id)
+SUBPARTITION BY hash(id) subpartitions 2
+(PARTITION pa3 values less than (42),
+PARTITION pa6 values less than (60),
+PARTITION pa7 values less than (70),
+PARTITION pa8 values less than (80),
+PARTITION pa9 values less than (90),
+PARTITION pa10 values less than (100),
+PARTITION pa11 values less than MAXVALUE);
+CREATE PROCEDURE test.proc_part()
+BEGIN
+DECLARE ins_count INT DEFAULT 1000;
+DECLARE del_count INT;
+DECLARE cur_user VARCHAR(255);
+DECLARE local_uuid VARCHAR(255);
+DECLARE local_time TIMESTAMP;
+SET local_time= NOW();
+SET cur_user= CURRENT_USER();
+SET local_uuid= UUID();
+WHILE ins_count > 0 DO
+INSERT INTO test.part_tbl VALUES (NULL, NOW(), USER() , UUID(),
+ins_count,'Going to test MBR for MySQL');
+SET ins_count = ins_count - 1;
+END WHILE;
+SELECT MAX(id) FROM test.part_tbl INTO del_count;
+WHILE del_count > 0 DO
+DELETE FROM test.part_tbl WHERE id = del_count;
+select count(*) as internal_count, del_count  -- these two lines are for
+FROM test.part_tbl;                           -- debug to show the problem
+SET del_count = del_count - 2;
+END WHILE;
+END|
+CALL test.proc_part();
+internal_count	del_count
+999	1000
+internal_count	del_count
+998	998
+internal_count	del_count
+997	996
+internal_count	del_count
+996	994
+internal_count	del_count
+995	992
+internal_count	del_count
+994	990
+internal_count	del_count
+993	988
+internal_count	del_count
+992	986
+internal_count	del_count
+991	984
+internal_count	del_count
+990	982
+internal_count	del_count
+989	980
+internal_count	del_count
+988	978
+internal_count	del_count
+987	976
+internal_count	del_count
+986	974
+internal_count	del_count
+985	972
+internal_count	del_count
+984	970
+internal_count	del_count
+983	968
+internal_count	del_count
+982	966
+internal_count	del_count
+981	964
+internal_count	del_count
+980	962
+internal_count	del_count
+979	960
+internal_count	del_count
+978	958
+internal_count	del_count
+977	956
+internal_count	del_count
+976	954
+internal_count	del_count
+975	952
+internal_count	del_count
+974	950
+internal_count	del_count
+973	948
+internal_count	del_count
+972	946
+internal_count	del_count
+971	944
+internal_count	del_count
+970	942
+internal_count	del_count
+969	940
+internal_count	del_count
+968	938
+internal_count	del_count
+967	936
+internal_count	del_count
+966	934
+internal_count	del_count
+965	932
+internal_count	del_count
+964	930
+internal_count	del_count
+963	928
+internal_count	del_count
+962	926
+internal_count	del_count
+961	924
+internal_count	del_count
+960	922
+internal_count	del_count
+959	920
+internal_count	del_count
+958	918
+internal_count	del_count
+957	916
+internal_count	del_count
+956	914
+internal_count	del_count
+955	912
+internal_count	del_count
+954	910
+internal_count	del_count
+953	908
+internal_count	del_count
+952	906
+internal_count	del_count
+951	904
+internal_count	del_count
+950	902
+internal_count	del_count
+949	900
+internal_count	del_count
+948	898
+internal_count	del_count
+947	896
+internal_count	del_count
+946	894
+internal_count	del_count
+945	892
+internal_count	del_count
+944	890
+internal_count	del_count
+943	888
+internal_count	del_count
+942	886
+internal_count	del_count
+941	884
+internal_count	del_count
+940	882
+internal_count	del_count
+939	880
+internal_count	del_count
+938	878
+internal_count	del_count
+937	876
+internal_count	del_count
+936	874
+internal_count	del_count
+935	872
+internal_count	del_count
+934	870
+internal_count	del_count
+933	868
+internal_count	del_count
+932	866
+internal_count	del_count
+931	864
+internal_count	del_count
+930	862
+internal_count	del_count
+929	860
+internal_count	del_count
+928	858
+internal_count	del_count
+927	856
+internal_count	del_count
+926	854
+internal_count	del_count
+925	852
+internal_count	del_count
+924	850
+internal_count	del_count
+923	848
+internal_count	del_count
+922	846
+internal_count	del_count
+921	844
+internal_count	del_count
+920	842
+internal_count	del_count
+919	840
+internal_count	del_count
+918	838
+internal_count	del_count
+917	836
+internal_count	del_count
+916	834
+internal_count	del_count
+915	832
+internal_count	del_count
+914	830
+internal_count	del_count
+913	828
+internal_count	del_count
+912	826
+internal_count	del_count
+911	824
+internal_count	del_count
+910	822
+internal_count	del_count
+909	820
+internal_count	del_count
+908	818
+internal_count	del_count
+907	816
+internal_count	del_count
+906	814
+internal_count	del_count
+905	812
+internal_count	del_count
+904	810
+internal_count	del_count
+903	808
+internal_count	del_count
+902	806
+internal_count	del_count
+901	804
+internal_count	del_count
+900	802
+internal_count	del_count
+899	800
+internal_count	del_count
+898	798
+internal_count	del_count
+897	796
+internal_count	del_count
+896	794
+internal_count	del_count
+895	792
+internal_count	del_count
+894	790
+internal_count	del_count
+893	788
+internal_count	del_count
+892	786
+internal_count	del_count
+891	784
+internal_count	del_count
+890	782
+internal_count	del_count
+889	780
+internal_count	del_count
+888	778
+internal_count	del_count
+887	776
+internal_count	del_count
+886	774
+internal_count	del_count
+885	772
+internal_count	del_count
+884	770
+internal_count	del_count
+883	768
+internal_count	del_count
+882	766
+internal_count	del_count
+881	764
+internal_count	del_count
+880	762
+internal_count	del_count
+879	760
+internal_count	del_count
+878	758
+internal_count	del_count
+877	756
+internal_count	del_count
+876	754
+internal_count	del_count
+875	752
+internal_count	del_count
+874	750
+internal_count	del_count
+873	748
+internal_count	del_count
+872	746
+internal_count	del_count
+871	744
+internal_count	del_count
+870	742
+internal_count	del_count
+869	740
+internal_count	del_count
+868	738
+internal_count	del_count
+867	736
+internal_count	del_count
+866	734
+internal_count	del_count
+865	732
+internal_count	del_count
+864	730
+internal_count	del_count
+863	728
+internal_count	del_count
+862	726
+internal_count	del_count
+861	724
+internal_count	del_count
+860	722
+internal_count	del_count
+859	720
+internal_count	del_count
+858	718
+internal_count	del_count
+857	716
+internal_count	del_count
+856	714
+internal_count	del_count
+855	712
+internal_count	del_count
+854	710
+internal_count	del_count
+853	708
+internal_count	del_count
+852	706
+internal_count	del_count
+851	704
+internal_count	del_count
+850	702
+internal_count	del_count
+849	700
+internal_count	del_count
+848	698
+internal_count	del_count
+847	696
+internal_count	del_count
+846	694
+internal_count	del_count
+845	692
+internal_count	del_count
+844	690
+internal_count	del_count
+843	688
+internal_count	del_count
+842	686
+internal_count	del_count
+841	684
+internal_count	del_count
+840	682
+internal_count	del_count
+839	680
+internal_count	del_count
+838	678
+internal_count	del_count
+837	676
+internal_count	del_count
+836	674
+internal_count	del_count
+835	672
+internal_count	del_count
+834	670
+internal_count	del_count
+833	668
+internal_count	del_count
+832	666
+internal_count	del_count
+831	664
+internal_count	del_count
+830	662
+internal_count	del_count
+829	660
+internal_count	del_count
+828	658
+internal_count	del_count
+827	656
+internal_count	del_count
+826	654
+internal_count	del_count
+825	652
+internal_count	del_count
+824	650
+internal_count	del_count
+823	648
+internal_count	del_count
+822	646
+internal_count	del_count
+821	644
+internal_count	del_count
+820	642
+internal_count	del_count
+819	640
+internal_count	del_count
+818	638
+internal_count	del_count
+817	636
+internal_count	del_count
+816	634
+internal_count	del_count
+815	632
+internal_count	del_count
+814	630
+internal_count	del_count
+813	628
+internal_count	del_count
+812	626
+internal_count	del_count
+811	624
+internal_count	del_count
+810	622
+internal_count	del_count
+809	620
+internal_count	del_count
+808	618
+internal_count	del_count
+807	616
+internal_count	del_count
+806	614
+internal_count	del_count
+805	612
+internal_count	del_count
+804	610
+internal_count	del_count
+803	608
+internal_count	del_count
+802	606
+internal_count	del_count
+801	604
+internal_count	del_count
+800	602
+internal_count	del_count
+799	600
+internal_count	del_count
+798	598
+internal_count	del_count
+797	596
+internal_count	del_count
+796	594
+internal_count	del_count
+795	592
+internal_count	del_count
+794	590
+internal_count	del_count
+793	588
+internal_count	del_count
+792	586
+internal_count	del_count
+791	584
+internal_count	del_count
+790	582
+internal_count	del_count
+789	580
+internal_count	del_count
+788	578
+internal_count	del_count
+787	576
+internal_count	del_count
+786	574
+internal_count	del_count
+785	572
+internal_count	del_count
+784	570
+internal_count	del_count
+783	568
+internal_count	del_count
+782	566
+internal_count	del_count
+781	564
+internal_count	del_count
+780	562
+internal_count	del_count
+779	560
+internal_count	del_count
+778	558
+internal_count	del_count
+777	556
+internal_count	del_count
+776	554
+internal_count	del_count
+775	552
+internal_count	del_count
+774	550
+internal_count	del_count
+773	548
+internal_count	del_count
+772	546
+internal_count	del_count
+771	544
+internal_count	del_count
+770	542
+internal_count	del_count
+769	540
+internal_count	del_count
+768	538
+internal_count	del_count
+767	536
+internal_count	del_count
+766	534
+internal_count	del_count
+765	532
+internal_count	del_count
+764	530
+internal_count	del_count
+763	528
+internal_count	del_count
+762	526
+internal_count	del_count
+761	524
+internal_count	del_count
+760	522
+internal_count	del_count
+759	520
+internal_count	del_count
+758	518
+internal_count	del_count
+757	516
+internal_count	del_count
+756	514
+internal_count	del_count
+755	512
+internal_count	del_count
+754	510
+internal_count	del_count
+753	508
+internal_count	del_count
+752	506
+internal_count	del_count
+751	504
+internal_count	del_count
+750	502
+internal_count	del_count
+749	500
+internal_count	del_count
+748	498
+internal_count	del_count
+747	496
+internal_count	del_count
+746	494
+internal_count	del_count
+745	492
+internal_count	del_count
+744	490
+internal_count	del_count
+743	488
+internal_count	del_count
+742	486
+internal_count	del_count
+741	484
+internal_count	del_count
+740	482
+internal_count	del_count
+739	480
+internal_count	del_count
+738	478
+internal_count	del_count
+737	476
+internal_count	del_count
+736	474
+internal_count	del_count
+735	472
+internal_count	del_count
+734	470
+internal_count	del_count
+733	468
+internal_count	del_count
+732	466
+internal_count	del_count
+731	464
+internal_count	del_count
+730	462
+internal_count	del_count
+729	460
+internal_count	del_count
+728	458
+internal_count	del_count
+727	456
+internal_count	del_count
+726	454
+internal_count	del_count
+725	452
+internal_count	del_count
+724	450
+internal_count	del_count
+723	448
+internal_count	del_count
+722	446
+internal_count	del_count
+721	444
+internal_count	del_count
+720	442
+internal_count	del_count
+719	440
+internal_count	del_count
+718	438
+internal_count	del_count
+717	436
+internal_count	del_count
+716	434
+internal_count	del_count
+715	432
+internal_count	del_count
+714	430
+internal_count	del_count
+713	428
+internal_count	del_count
+712	426
+internal_count	del_count
+711	424
+internal_count	del_count
+710	422
+internal_count	del_count
+709	420
+internal_count	del_count
+708	418
+internal_count	del_count
+707	416
+internal_count	del_count
+706	414
+internal_count	del_count
+705	412
+internal_count	del_count
+704	410
+internal_count	del_count
+703	408
+internal_count	del_count
+702	406
+internal_count	del_count
+701	404
+internal_count	del_count
+700	402
+internal_count	del_count
+699	400
+internal_count	del_count
+698	398
+internal_count	del_count
+697	396
+internal_count	del_count
+696	394
+internal_count	del_count
+695	392
+internal_count	del_count
+694	390
+internal_count	del_count
+693	388
+internal_count	del_count
+692	386
+internal_count	del_count
+691	384
+internal_count	del_count
+690	382
+internal_count	del_count
+689	380
+internal_count	del_count
+688	378
+internal_count	del_count
+687	376
+internal_count	del_count
+686	374
+internal_count	del_count
+685	372
+internal_count	del_count
+684	370
+internal_count	del_count
+683	368
+internal_count	del_count
+682	366
+internal_count	del_count
+681	364
+internal_count	del_count
+680	362
+internal_count	del_count
+679	360
+internal_count	del_count
+678	358
+internal_count	del_count
+677	356
+internal_count	del_count
+676	354
+internal_count	del_count
+675	352
+internal_count	del_count
+674	350
+internal_count	del_count
+673	348
+internal_count	del_count
+672	346
+internal_count	del_count
+671	344
+internal_count	del_count
+670	342
+internal_count	del_count
+669	340
+internal_count	del_count
+668	338
+internal_count	del_count
+667	336
+internal_count	del_count
+666	334
+internal_count	del_count
+665	332
+internal_count	del_count
+664	330
+internal_count	del_count
+663	328
+internal_count	del_count
+662	326
+internal_count	del_count
+661	324
+internal_count	del_count
+660	322
+internal_count	del_count
+659	320
+internal_count	del_count
+658	318
+internal_count	del_count
+657	316
+internal_count	del_count
+656	314
+internal_count	del_count
+655	312
+internal_count	del_count
+654	310
+internal_count	del_count
+653	308
+internal_count	del_count
+652	306
+internal_count	del_count
+651	304
+internal_count	del_count
+650	302
+internal_count	del_count
+649	300
+internal_count	del_count
+648	298
+internal_count	del_count
+647	296
+internal_count	del_count
+646	294
+internal_count	del_count
+645	292
+internal_count	del_count
+644	290
+internal_count	del_count
+643	288
+internal_count	del_count
+642	286
+internal_count	del_count
+641	284
+internal_count	del_count
+640	282
+internal_count	del_count
+639	280
+internal_count	del_count
+638	278
+internal_count	del_count
+637	276
+internal_count	del_count
+636	274
+internal_count	del_count
+635	272
+internal_count	del_count
+634	270
+internal_count	del_count
+633	268
+internal_count	del_count
+632	266
+internal_count	del_count
+631	264
+internal_count	del_count
+630	262
+internal_count	del_count
+629	260
+internal_count	del_count
+628	258
+internal_count	del_count
+627	256
+internal_count	del_count
+626	254
+internal_count	del_count
+625	252
+internal_count	del_count
+624	250
+internal_count	del_count
+623	248
+internal_count	del_count
+622	246
+internal_count	del_count
+621	244
+internal_count	del_count
+620	242
+internal_count	del_count
+619	240
+internal_count	del_count
+618	238
+internal_count	del_count
+617	236
+internal_count	del_count
+616	234
+internal_count	del_count
+615	232
+internal_count	del_count
+614	230
+internal_count	del_count
+613	228
+internal_count	del_count
+612	226
+internal_count	del_count
+611	224
+internal_count	del_count
+610	222
+internal_count	del_count
+609	220
+internal_count	del_count
+608	218
+internal_count	del_count
+607	216
+internal_count	del_count
+606	214
+internal_count	del_count
+605	212
+internal_count	del_count
+604	210
+internal_count	del_count
+603	208
+internal_count	del_count
+602	206
+internal_count	del_count
+601	204
+internal_count	del_count
+600	202
+internal_count	del_count
+599	200
+internal_count	del_count
+598	198
+internal_count	del_count
+597	196
+internal_count	del_count
+596	194
+internal_count	del_count
+595	192
+internal_count	del_count
+594	190
+internal_count	del_count
+593	188
+internal_count	del_count
+592	186
+internal_count	del_count
+591	184
+internal_count	del_count
+590	182
+internal_count	del_count
+589	180
+internal_count	del_count
+588	178
+internal_count	del_count
+587	176
+internal_count	del_count
+586	174
+internal_count	del_count
+585	172
+internal_count	del_count
+584	170
+internal_count	del_count
+583	168
+internal_count	del_count
+582	166
+internal_count	del_count
+581	164
+internal_count	del_count
+580	162
+internal_count	del_count
+579	160
+internal_count	del_count
+578	158
+internal_count	del_count
+577	156
+internal_count	del_count
+576	154
+internal_count	del_count
+575	152
+internal_count	del_count
+574	150
+internal_count	del_count
+573	148
+internal_count	del_count
+572	146
+internal_count	del_count
+571	144
+internal_count	del_count
+570	142
+internal_count	del_count
+569	140
+internal_count	del_count
+568	138
+internal_count	del_count
+567	136
+internal_count	del_count
+566	134
+internal_count	del_count
+565	132
+internal_count	del_count
+564	130
+internal_count	del_count
+563	128
+internal_count	del_count
+562	126
+internal_count	del_count
+561	124
+internal_count	del_count
+560	122
+internal_count	del_count
+559	120
+internal_count	del_count
+558	118
+internal_count	del_count
+557	116
+internal_count	del_count
+556	114
+internal_count	del_count
+555	112
+internal_count	del_count
+554	110
+internal_count	del_count
+553	108
+internal_count	del_count
+552	106
+internal_count	del_count
+551	104
+internal_count	del_count
+550	102
+internal_count	del_count
+549	100
+internal_count	del_count
+548	98
+internal_count	del_count
+547	96
+internal_count	del_count
+546	94
+internal_count	del_count
+545	92
+internal_count	del_count
+544	90
+internal_count	del_count
+543	88
+internal_count	del_count
+542	86
+internal_count	del_count
+541	84
+internal_count	del_count
+540	82
+internal_count	del_count
+539	80
+internal_count	del_count
+538	78
+internal_count	del_count
+537	76
+internal_count	del_count
+536	74
+internal_count	del_count
+535	72
+internal_count	del_count
+534	70
+internal_count	del_count
+533	68
+internal_count	del_count
+532	66
+internal_count	del_count
+531	64
+internal_count	del_count
+530	62
+internal_count	del_count
+529	60
+internal_count	del_count
+528	58
+internal_count	del_count
+527	56
+internal_count	del_count
+526	54
+internal_count	del_count
+525	52
+internal_count	del_count
+524	50
+internal_count	del_count
+523	48
+internal_count	del_count
+522	46
+internal_count	del_count
+521	44
+internal_count	del_count
+520	42
+internal_count	del_count
+519	40
+internal_count	del_count
+518	38
+internal_count	del_count
+517	36
+internal_count	del_count
+516	34
+internal_count	del_count
+515	32
+internal_count	del_count
+514	30
+internal_count	del_count
+513	28
+internal_count	del_count
+512	26
+internal_count	del_count
+511	24
+internal_count	del_count
+510	22
+internal_count	del_count
+509	20
+internal_count	del_count
+508	18
+internal_count	del_count
+507	16
+internal_count	del_count
+506	14
+internal_count	del_count
+505	12
+internal_count	del_count
+504	10
+internal_count	del_count
+503	8
+internal_count	del_count
+502	6
+internal_count	del_count
+501	4
+internal_count	del_count
+500	2
+select count(*) as Part from test.part_tbl;
+Part
+500
+DROP PROCEDURE test.proc_part;
+DROP TABLE test.part_tbl;

=== added file 'mysql-test/suite/innodb_plugin/r/innodb_bug42419.result'
--- a/mysql-test/suite/innodb_plugin/r/innodb_bug42419.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/innodb_plugin/r/innodb_bug42419.result	2010-06-03 09:48:59 +0000
@@ -0,0 +1,17 @@
+CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b INT) ENGINE = InnoDB;
+INSERT INTO t1 VALUES (1,1),(2,2),(3,3);
+COMMIT;
+SET AUTOCOMMIT = 0;
+CREATE TEMPORARY TABLE t1_tmp ( b INT );
+INSERT INTO t1_tmp (b) SELECT b FROM t1 WHERE a = 3;
+INSERT INTO t1_tmp (b) SELECT b FROM t1 WHERE a = 2;
+SET AUTOCOMMIT = 0;
+CREATE TEMPORARY TABLE t2_tmp ( a int, new_a int );
+INSERT INTO t2_tmp VALUES (1,51),(2,52),(3,53);
+UPDATE t1 SET a = (SELECT new_a FROM t2_tmp WHERE t2_tmp.a = t1.a) WHERE a = 1;
+UPDATE t1 SET a = (SELECT new_a FROM t2_tmp WHERE t2_tmp.a = t1.a) WHERE a = 2;
+INSERT INTO t1_tmp (b) SELECT b FROM t1 WHERE a = 1;
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+Reap the server message for connection user2 UPDATE t1 ...
+UPDATE t1 SET a = (SELECT new_a FROM t2_tmp WHERE t2_tmp.a = t1.a) WHERE a = 3;
+DROP TABLE t1;

=== modified file 'mysql-test/suite/innodb_plugin/r/innodb_bug46000.result'
--- a/mysql-test/suite/innodb_plugin/r/innodb_bug46000.result	2010-04-09 12:56:51 +0000
+++ b/mysql-test/suite/innodb_plugin/r/innodb_bug46000.result	2010-08-03 21:26:17 +0000
@@ -14,6 +14,5 @@ show warnings;
 Level	Code	Message
 Warning	1280	Cannot Create Index with name 'GEN_CLUST_INDEX'. The name is reserved for the system default primary index.
 Error	1280	Incorrect index name 'GEN_CLUST_INDEX'
-Error	1030	Got error -1 from storage engine
 create index idx on bug46000(id);
 drop table bug46000;

=== added file 'mysql-test/suite/innodb_plugin/r/innodb_bug48024.result'
--- a/mysql-test/suite/innodb_plugin/r/innodb_bug48024.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/innodb_plugin/r/innodb_bug48024.result	2010-05-14 13:08:15 +0000
@@ -0,0 +1,10 @@
+CREATE TABLE bug48024(a int PRIMARY KEY,b int NOT NULL,KEY(b)) ENGINE=InnoDB;
+CREATE TABLE bug48024_b(b int PRIMARY KEY) ENGINE=InnoDB;
+ALTER TABLE bug48024 /*/ADD CONSTRAINT FOREIGN KEY(c) REFERENCES(a),/*/
+ADD CONSTRAINT FOREIGN KEY(b) REFERENCES bug48024_b(b);
+DROP TABLE bug48024,bug48024_b;
+CREATE TABLE bug48024(a int PRIMARY KEY,b int NOT NULL,KEY(b)) ENGINE=InnoDB;
+CREATE TABLE bug48024_b(b int PRIMARY KEY) ENGINE=InnoDB;
+ALTER TABLE bug48024 /*/ADD CONSTRAINT FOREIGN KEY(c) REFERENCES(a),/*/
+ADD CONSTRAINT FOREIGN KEY(b) REFERENCES bug48024_b(b)|
+DROP TABLE bug48024,bug48024_b;

=== added file 'mysql-test/suite/innodb_plugin/r/innodb_bug49164-xb.result'
--- a/mysql-test/suite/innodb_plugin/r/innodb_bug49164-xb.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/innodb_plugin/r/innodb_bug49164-xb.result	2010-08-03 21:26:17 +0000
@@ -0,0 +1,42 @@
+SET tx_isolation = 'READ-COMMITTED';
+CREATE TABLE bug49164 (a INT, b BIGINT, c TINYINT, PRIMARY KEY (a, b))
+ENGINE=InnoDB;
+insert into bug49164 values (1,1,1), (2,2,2), (3,3,3);
+begin;
+update bug49164 set c=7;
+select * from bug49164;
+a	b	c
+1	1	7
+2	2	7
+3	3	7
+rollback;
+select * from bug49164;
+a	b	c
+1	1	1
+2	2	2
+3	3	3
+begin;
+update bug49164 set c=7;
+SET tx_isolation = 'READ-COMMITTED';
+begin;
+select * from bug49164;
+a	b	c
+1	1	1
+2	2	2
+3	3	3
+commit;
+begin;
+update bug49164 set c=6 where a=1 and b=1;
+rollback;
+select * from bug49164;
+a	b	c
+1	1	1
+2	2	2
+3	3	3
+commit;
+select * from bug49164;
+a	b	c
+1	1	6
+2	2	2
+3	3	3
+drop table bug49164;

=== added file 'mysql-test/suite/innodb_plugin/r/innodb_bug49164.result'
--- a/mysql-test/suite/innodb_plugin/r/innodb_bug49164.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/innodb_plugin/r/innodb_bug49164.result	2010-08-05 11:40:54 +0000
@@ -0,0 +1,42 @@
+SET tx_isolation = 'READ-COMMITTED';
+CREATE TABLE bug49164 (a INT, b BIGINT, c TINYINT, PRIMARY KEY (a, b))
+ENGINE=InnoDB;
+insert into bug49164 values (1,1,1), (2,2,2), (3,3,3);
+begin;
+update bug49164 set c=7;
+select * from bug49164;
+a	b	c
+1	1	7
+2	2	7
+3	3	7
+rollback;
+select * from bug49164;
+a	b	c
+1	1	1
+2	2	2
+3	3	3
+begin;
+update bug49164 set c=7;
+SET tx_isolation = 'READ-COMMITTED';
+begin;
+select * from bug49164;
+a	b	c
+1	1	1
+2	2	2
+3	3	3
+commit;
+begin;
+update bug49164 set c=6 where a=1 and b=1;
+rollback;
+select * from bug49164;
+a	b	c
+1	1	1
+2	2	2
+3	3	3
+commit;
+select * from bug49164;
+a	b	c
+1	1	6
+2	2	2
+3	3	3
+drop table bug49164;

=== added file 'mysql-test/suite/innodb_plugin/r/innodb_bug53290.result'
--- a/mysql-test/suite/innodb_plugin/r/innodb_bug53290.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/innodb_plugin/r/innodb_bug53290.result	2010-05-05 12:39:01 +0000
@@ -0,0 +1,17 @@
+create table bug53290 (x bigint) engine=innodb;
+insert into bug53290 () values (),(),(),(),(),(),(),(),(),(),(),();
+insert into bug53290 select * from bug53290;
+insert into bug53290 select * from bug53290;
+insert into bug53290 select * from bug53290;
+insert into bug53290 select * from bug53290;
+insert into bug53290 select * from bug53290;
+insert into bug53290 select * from bug53290;
+insert into bug53290 select * from bug53290;
+insert into bug53290 select * from bug53290;
+insert into bug53290 select * from bug53290;
+insert into bug53290 select * from bug53290;
+insert into bug53290 select * from bug53290;
+insert into bug53290 select * from bug53290;
+insert into bug53290 select * from bug53290;
+alter table bug53290 add unique index `idx` (x);
+drop table bug53290;

=== added file 'mysql-test/suite/innodb_plugin/r/innodb_bug53591.result'
--- a/mysql-test/suite/innodb_plugin/r/innodb_bug53591.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/innodb_plugin/r/innodb_bug53591.result	2010-08-03 21:26:17 +0000
@@ -0,0 +1,15 @@
+SET GLOBAL innodb_file_format='Barracuda';
+SET GLOBAL innodb_file_per_table=on;
+set old_alter_table=0;
+CREATE TABLE bug53591(a text charset utf8 not null)
+ENGINE=InnoDB KEY_BLOCK_SIZE=1;
+ALTER TABLE bug53591 ADD PRIMARY KEY(a(220));
+ERROR HY000: Too big row
+SHOW WARNINGS;
+Level	Code	Message
+Error	139	Too big row
+Error	1118	Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. You have to change some columns to TEXT or BLOBs
+DROP TABLE bug53591;
+SET GLOBAL innodb_file_format=Antelope;
+SET GLOBAL innodb_file_format_check=Antelope;
+SET GLOBAL innodb_file_per_table=0;

=== added file 'mysql-test/suite/innodb_plugin/r/innodb_bug53592.result'
--- a/mysql-test/suite/innodb_plugin/r/innodb_bug53592.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/innodb_plugin/r/innodb_bug53592.result	2010-05-26 05:31:27 +0000
@@ -0,0 +1,26 @@
+set old_alter_table=0;
+create table bug53592(a int) engine=innodb row_format=compact;
+alter table bug53592 add column b text charset utf8;
+alter table bug53592 add column c blob not null;
+create index bug53592_b on bug53592(b(81));
+create unique index bug53592_c on bug53592(c(1));
+replace into bug53592 values (),();
+Warnings:
+Warning	1364	Field 'c' doesn't have a default value
+check table bug53592;
+Table	Op	Msg_type	Msg_text
+test.bug53592	check	status	OK
+drop table bug53592;
+set old_alter_table=1;
+create table bug53592(a int) engine=innodb row_format=compact;
+alter table bug53592 add column b text charset utf8;
+alter table bug53592 add column c blob not null;
+create index bug53592_b on bug53592(b(81));
+create unique index bug53592_c on bug53592(c(1));
+replace into bug53592 values (),();
+Warnings:
+Warning	1364	Field 'c' doesn't have a default value
+check table bug53592;
+Table	Op	Msg_type	Msg_text
+test.bug53592	check	status	OK
+drop table bug53592;

=== added file 'mysql-test/suite/innodb_plugin/r/innodb_bug53674.result'
--- a/mysql-test/suite/innodb_plugin/r/innodb_bug53674.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/innodb_plugin/r/innodb_bug53674.result	2010-06-02 10:37:14 +0000
@@ -0,0 +1,11 @@
+create table bug53674(a int)engine=innodb;
+insert into bug53674 values (1),(2);
+start transaction;
+select * from bug53674 for update;
+a
+1
+2
+select * from bug53674 where a=(select a from bug53674 where a > 1);
+a
+2
+drop table bug53674;

=== added file 'mysql-test/suite/innodb_plugin/r/innodb_bug54044.result'
--- a/mysql-test/suite/innodb_plugin/r/innodb_bug54044.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/innodb_plugin/r/innodb_bug54044.result	2010-06-29 07:13:18 +0000
@@ -0,0 +1,3 @@
+CREATE TEMPORARY TABLE table_54044 ENGINE = INNODB
+AS SELECT IF(NULL  IS NOT NULL, NULL, NULL);
+ERROR HY000: Can't create table 'test.table_54044' (errno: -1)

=== added file 'mysql-test/suite/innodb_plugin/r/innodb_bug54679.result'
--- a/mysql-test/suite/innodb_plugin/r/innodb_bug54679.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/innodb_plugin/r/innodb_bug54679.result	2010-08-03 21:26:17 +0000
@@ -0,0 +1,91 @@
+SET GLOBAL innodb_file_format='Barracuda';
+SET GLOBAL innodb_file_per_table=ON;
+SET innodb_strict_mode=ON;
+CREATE TABLE bug54679 (a INT) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables
+WHERE TABLE_NAME='bug54679';
+TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
+bug54679	Compressed	row_format=COMPRESSED
+ALTER TABLE bug54679 ADD COLUMN b INT;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables
+WHERE TABLE_NAME='bug54679';
+TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
+bug54679	Compressed	row_format=COMPRESSED
+DROP TABLE bug54679;
+CREATE TABLE bug54679 (a INT) ENGINE=InnoDB;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables
+WHERE TABLE_NAME='bug54679';
+TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
+bug54679	Compact	
+ALTER TABLE bug54679 KEY_BLOCK_SIZE=1;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables
+WHERE TABLE_NAME='bug54679';
+TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
+bug54679	Compressed	key_block_size=1
+ALTER TABLE bug54679 ROW_FORMAT=REDUNDANT;
+ERROR HY000: Can't create table '#sql-temporary' (errno: 1478)
+SHOW WARNINGS;
+Level	Code	Message
+Warning	1478	InnoDB: cannot specify ROW_FORMAT = REDUNDANT with KEY_BLOCK_SIZE.
+Error	1005	Can't create table '#sql-temporary' (errno: 1478)
+DROP TABLE bug54679;
+CREATE TABLE bug54679 (a INT) ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables
+WHERE TABLE_NAME='bug54679';
+TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
+bug54679	Redundant	row_format=REDUNDANT
+ALTER TABLE bug54679 KEY_BLOCK_SIZE=2;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables
+WHERE TABLE_NAME='bug54679';
+TABLE_NAME	ROW_FORMAT	CREATE_OPTIONS
+bug54679	Compressed	row_format=REDUNDANT key_block_size=2
+SET GLOBAL innodb_file_format=Antelope;
+ALTER TABLE bug54679 KEY_BLOCK_SIZE=4;
+ERROR HY000: Can't create table '#sql-temporary' (errno: 1478)
+SHOW WARNINGS;
+Level	Code	Message
+Warning	1478	InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
+Error	1005	Can't create table '#sql-temporary' (errno: 1478)
+ALTER TABLE bug54679 ROW_FORMAT=DYNAMIC;
+ERROR HY000: Can't create table '#sql-temporary' (errno: 1478)
+SHOW WARNINGS;
+Level	Code	Message
+Warning	1478	InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
+Warning	1478	InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_format > Antelope.
+Warning	1478	InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE.
+Error	1005	Can't create table '#sql-temporary' (errno: 1478)
+DROP TABLE bug54679;
+CREATE TABLE bug54679 (a INT) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+ERROR HY000: Can't create table 'test.bug54679' (errno: 1478)
+SHOW WARNINGS;
+Level	Code	Message
+Warning	1478	InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_format > Antelope.
+Error	1005	Can't create table 'test.bug54679' (errno: 1478)
+CREATE TABLE bug54679 (a INT) ENGINE=InnoDB;
+SET GLOBAL innodb_file_format=Barracuda;
+SET GLOBAL innodb_file_per_table=OFF;
+ALTER TABLE bug54679 KEY_BLOCK_SIZE=4;
+ERROR HY000: Can't create table '#sql-temporary' (errno: 1478)
+SHOW WARNINGS;
+Level	Code	Message
+Warning	1478	InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
+Error	1005	Can't create table '#sql-temporary' (errno: 1478)
+ALTER TABLE bug54679 ROW_FORMAT=DYNAMIC;
+ERROR HY000: Can't create table '#sql-temporary' (errno: 1478)
+SHOW WARNINGS;
+Level	Code	Message
+Warning	1478	InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_per_table.
+Error	1005	Can't create table '#sql-temporary' (errno: 1478)
+DROP TABLE bug54679;
+CREATE TABLE bug54679 (a INT) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+ERROR HY000: Can't create table 'test.bug54679' (errno: 1478)
+SHOW WARNINGS;
+Level	Code	Message
+Warning	1478	InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_per_table.
+Error	1005	Can't create table 'test.bug54679' (errno: 1478)
+SET GLOBAL innodb_file_per_table=ON;
+CREATE TABLE bug54679 (a INT) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+DROP TABLE bug54679;
+SET GLOBAL innodb_file_format=Antelope;
+SET GLOBAL innodb_file_format_check=Antelope;
+SET GLOBAL innodb_file_per_table=0;

=== added file 'mysql-test/suite/innodb_plugin/r/innodb_gis.result'
--- a/mysql-test/suite/innodb_plugin/r/innodb_gis.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/innodb_plugin/r/innodb_gis.result	2010-06-03 09:48:59 +0000
@@ -0,0 +1,589 @@
+SET storage_engine=innodb;
+DROP TABLE IF EXISTS t1, gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry;
+CREATE TABLE gis_point  (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g POINT);
+CREATE TABLE gis_line  (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g LINESTRING);
+CREATE TABLE gis_polygon   (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g POLYGON);
+CREATE TABLE gis_multi_point (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g MULTIPOINT);
+CREATE TABLE gis_multi_line (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g MULTILINESTRING);
+CREATE TABLE gis_multi_polygon  (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g MULTIPOLYGON);
+CREATE TABLE gis_geometrycollection  (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g GEOMETRYCOLLECTION);
+CREATE TABLE gis_geometry (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g GEOMETRY);
+SHOW CREATE TABLE gis_point;
+Table	Create Table
+gis_point	CREATE TABLE `gis_point` (
+  `fid` int(11) NOT NULL AUTO_INCREMENT,
+  `g` point DEFAULT NULL,
+  PRIMARY KEY (`fid`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SHOW FIELDS FROM gis_point;
+Field	Type	Null	Key	Default	Extra
+fid	int(11)	NO	PRI	NULL	auto_increment
+g	point	YES		NULL	
+SHOW FIELDS FROM gis_line;
+Field	Type	Null	Key	Default	Extra
+fid	int(11)	NO	PRI	NULL	auto_increment
+g	linestring	YES		NULL	
+SHOW FIELDS FROM gis_polygon;
+Field	Type	Null	Key	Default	Extra
+fid	int(11)	NO	PRI	NULL	auto_increment
+g	polygon	YES		NULL	
+SHOW FIELDS FROM gis_multi_point;
+Field	Type	Null	Key	Default	Extra
+fid	int(11)	NO	PRI	NULL	auto_increment
+g	multipoint	YES		NULL	
+SHOW FIELDS FROM gis_multi_line;
+Field	Type	Null	Key	Default	Extra
+fid	int(11)	NO	PRI	NULL	auto_increment
+g	multilinestring	YES		NULL	
+SHOW FIELDS FROM gis_multi_polygon;
+Field	Type	Null	Key	Default	Extra
+fid	int(11)	NO	PRI	NULL	auto_increment
+g	multipolygon	YES		NULL	
+SHOW FIELDS FROM gis_geometrycollection;
+Field	Type	Null	Key	Default	Extra
+fid	int(11)	NO	PRI	NULL	auto_increment
+g	geometrycollection	YES		NULL	
+SHOW FIELDS FROM gis_geometry;
+Field	Type	Null	Key	Default	Extra
+fid	int(11)	NO	PRI	NULL	auto_increment
+g	geometry	YES		NULL	
+INSERT INTO gis_point VALUES 
+(101, PointFromText('POINT(10 10)')),
+(102, PointFromText('POINT(20 10)')),
+(103, PointFromText('POINT(20 20)')),
+(104, PointFromWKB(AsWKB(PointFromText('POINT(10 20)'))));
+INSERT INTO gis_line VALUES
+(105, LineFromText('LINESTRING(0 0,0 10,10 0)')),
+(106, LineStringFromText('LINESTRING(10 10,20 10,20 20,10 20,10 10)')),
+(107, LineStringFromWKB(LineString(Point(10, 10), Point(40, 10))));
+INSERT INTO gis_polygon VALUES
+(108, PolygonFromText('POLYGON((10 10,20 10,20 20,10 20,10 10))')),
+(109, PolyFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))')),
+(110, PolyFromWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(0, 0)))));
+INSERT INTO gis_multi_point VALUES
+(111, MultiPointFromText('MULTIPOINT(0 0,10 10,10 20,20 20)')),
+(112, MPointFromText('MULTIPOINT(1 1,11 11,11 21,21 21)')),
+(113, MPointFromWKB(MultiPoint(Point(3, 6), Point(4, 10))));
+INSERT INTO gis_multi_line VALUES
+(114, MultiLineStringFromText('MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))')),
+(115, MLineFromText('MULTILINESTRING((10 48,10 21,10 0))')),
+(116, MLineFromWKB(MultiLineString(LineString(Point(1, 2), Point(3, 5)), LineString(Point(2, 5), Point(5, 8), Point(21, 7)))));
+INSERT INTO gis_multi_polygon VALUES
+(117, MultiPolygonFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')),
+(118, MPolyFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')),
+(119, MPolyFromWKB(MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3))))));
+INSERT INTO gis_geometrycollection VALUES
+(120, GeomCollFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10 10))')),
+(121, GeometryFromWKB(GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9)))));
+INSERT into gis_geometry SELECT * FROM gis_point;
+INSERT into gis_geometry SELECT * FROM gis_line;
+INSERT into gis_geometry SELECT * FROM gis_polygon;
+INSERT into gis_geometry SELECT * FROM gis_multi_point;
+INSERT into gis_geometry SELECT * FROM gis_multi_line;
+INSERT into gis_geometry SELECT * FROM gis_multi_polygon;
+INSERT into gis_geometry SELECT * FROM gis_geometrycollection;
+SELECT fid, AsText(g) FROM gis_point ORDER by fid;
+fid	AsText(g)
+101	POINT(10 10)
+102	POINT(20 10)
+103	POINT(20 20)
+104	POINT(10 20)
+SELECT fid, AsText(g) FROM gis_line ORDER by fid;
+fid	AsText(g)
+105	LINESTRING(0 0,0 10,10 0)
+106	LINESTRING(10 10,20 10,20 20,10 20,10 10)
+107	LINESTRING(10 10,40 10)
+SELECT fid, AsText(g) FROM gis_polygon ORDER by fid;
+fid	AsText(g)
+108	POLYGON((10 10,20 10,20 20,10 20,10 10))
+109	POLYGON((0 0,50 0,50 50,0 50,0 0),(10 10,20 10,20 20,10 20,10 10))
+110	POLYGON((0 0,30 0,30 30,0 0))
+SELECT fid, AsText(g) FROM gis_multi_point ORDER by fid;
+fid	AsText(g)
+111	MULTIPOINT(0 0,10 10,10 20,20 20)
+112	MULTIPOINT(1 1,11 11,11 21,21 21)
+113	MULTIPOINT(3 6,4 10)
+SELECT fid, AsText(g) FROM gis_multi_line ORDER by fid;
+fid	AsText(g)
+114	MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))
+115	MULTILINESTRING((10 48,10 21,10 0))
+116	MULTILINESTRING((1 2,3 5),(2 5,5 8,21 7))
+SELECT fid, AsText(g) FROM gis_multi_polygon ORDER by fid;
+fid	AsText(g)
+117	MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))
+118	MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))
+119	MULTIPOLYGON(((0 3,3 3,3 0,0 3)))
+SELECT fid, AsText(g) FROM gis_geometrycollection ORDER by fid;
+fid	AsText(g)
+120	GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10))
+121	GEOMETRYCOLLECTION(POINT(44 6),LINESTRING(3 6,7 9))
+SELECT fid, AsText(g) FROM gis_geometry ORDER by fid;
+fid	AsText(g)
+101	POINT(10 10)
+102	POINT(20 10)
+103	POINT(20 20)
+104	POINT(10 20)
+105	LINESTRING(0 0,0 10,10 0)
+106	LINESTRING(10 10,20 10,20 20,10 20,10 10)
+107	LINESTRING(10 10,40 10)
+108	POLYGON((10 10,20 10,20 20,10 20,10 10))
+109	POLYGON((0 0,50 0,50 50,0 50,0 0),(10 10,20 10,20 20,10 20,10 10))
+110	POLYGON((0 0,30 0,30 30,0 0))
+111	MULTIPOINT(0 0,10 10,10 20,20 20)
+112	MULTIPOINT(1 1,11 11,11 21,21 21)
+113	MULTIPOINT(3 6,4 10)
+114	MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))
+115	MULTILINESTRING((10 48,10 21,10 0))
+116	MULTILINESTRING((1 2,3 5),(2 5,5 8,21 7))
+117	MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))
+118	MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))
+119	MULTIPOLYGON(((0 3,3 3,3 0,0 3)))
+120	GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10))
+121	GEOMETRYCOLLECTION(POINT(44 6),LINESTRING(3 6,7 9))
+SELECT fid, Dimension(g) FROM gis_geometry ORDER by fid;
+fid	Dimension(g)
+101	0
+102	0
+103	0
+104	0
+105	1
+106	1
+107	1
+108	2
+109	2
+110	2
+111	0
+112	0
+113	0
+114	1
+115	1
+116	1
+117	2
+118	2
+119	2
+120	1
+121	1
+SELECT fid, GeometryType(g) FROM gis_geometry ORDER by fid;
+fid	GeometryType(g)
+101	POINT
+102	POINT
+103	POINT
+104	POINT
+105	LINESTRING
+106	LINESTRING
+107	LINESTRING
+108	POLYGON
+109	POLYGON
+110	POLYGON
+111	MULTIPOINT
+112	MULTIPOINT
+113	MULTIPOINT
+114	MULTILINESTRING
+115	MULTILINESTRING
+116	MULTILINESTRING
+117	MULTIPOLYGON
+118	MULTIPOLYGON
+119	MULTIPOLYGON
+120	GEOMETRYCOLLECTION
+121	GEOMETRYCOLLECTION
+SELECT fid, IsEmpty(g) FROM gis_geometry ORDER by fid;
+fid	IsEmpty(g)
+101	0
+102	0
+103	0
+104	0
+105	0
+106	0
+107	0
+108	0
+109	0
+110	0
+111	0
+112	0
+113	0
+114	0
+115	0
+116	0
+117	0
+118	0
+119	0
+120	0
+121	0
+SELECT fid, AsText(Envelope(g)) FROM gis_geometry ORDER by fid;
+fid	AsText(Envelope(g))
+101	POLYGON((10 10,10 10,10 10,10 10,10 10))
+102	POLYGON((20 10,20 10,20 10,20 10,20 10))
+103	POLYGON((20 20,20 20,20 20,20 20,20 20))
+104	POLYGON((10 20,10 20,10 20,10 20,10 20))
+105	POLYGON((0 0,10 0,10 10,0 10,0 0))
+106	POLYGON((10 10,20 10,20 20,10 20,10 10))
+107	POLYGON((10 10,40 10,40 10,10 10,10 10))
+108	POLYGON((10 10,20 10,20 20,10 20,10 10))
+109	POLYGON((0 0,50 0,50 50,0 50,0 0))
+110	POLYGON((0 0,30 0,30 30,0 30,0 0))
+111	POLYGON((0 0,20 0,20 20,0 20,0 0))
+112	POLYGON((1 1,21 1,21 21,1 21,1 1))
+113	POLYGON((3 6,4 6,4 10,3 10,3 6))
+114	POLYGON((10 0,16 0,16 48,10 48,10 0))
+115	POLYGON((10 0,10 0,10 48,10 48,10 0))
+116	POLYGON((1 2,21 2,21 8,1 8,1 2))
+117	POLYGON((28 0,84 0,84 42,28 42,28 0))
+118	POLYGON((28 0,84 0,84 42,28 42,28 0))
+119	POLYGON((0 0,3 0,3 3,0 3,0 0))
+120	POLYGON((0 0,10 0,10 10,0 10,0 0))
+121	POLYGON((3 6,44 6,44 9,3 9,3 6))
+explain extended select Dimension(g), GeometryType(g), IsEmpty(g), AsText(Envelope(g)) from gis_geometry;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
+1	SIMPLE	gis_geometry	ALL	NULL	NULL	NULL	NULL	21	100.00	
+Warnings:
+Note	1003	select dimension(`test`.`gis_geometry`.`g`) AS `Dimension(g)`,geometrytype(`test`.`gis_geometry`.`g`) AS `GeometryType(g)`,isempty(`test`.`gis_geometry`.`g`) AS `IsEmpty(g)`,astext(envelope(`test`.`gis_geometry`.`g`)) AS `AsText(Envelope(g))` from `test`.`gis_geometry`
+SELECT fid, X(g) FROM gis_point ORDER by fid;
+fid	X(g)
+101	10
+102	20
+103	20
+104	10
+SELECT fid, Y(g) FROM gis_point ORDER by fid;
+fid	Y(g)
+101	10
+102	10
+103	20
+104	20
+explain extended select X(g),Y(g) FROM gis_point;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
+1	SIMPLE	gis_point	ALL	NULL	NULL	NULL	NULL	4	100.00	
+Warnings:
+Note	1003	select x(`test`.`gis_point`.`g`) AS `X(g)`,y(`test`.`gis_point`.`g`) AS `Y(g)` from `test`.`gis_point`
+SELECT fid, AsText(StartPoint(g)) FROM gis_line ORDER by fid;
+fid	AsText(StartPoint(g))
+105	POINT(0 0)
+106	POINT(10 10)
+107	POINT(10 10)
+SELECT fid, AsText(EndPoint(g)) FROM gis_line ORDER by fid;
+fid	AsText(EndPoint(g))
+105	POINT(10 0)
+106	POINT(10 10)
+107	POINT(40 10)
+SELECT fid, GLength(g) FROM gis_line ORDER by fid;
+fid	GLength(g)
+105	24.142135623731
+106	40
+107	30
+SELECT fid, NumPoints(g) FROM gis_line ORDER by fid;
+fid	NumPoints(g)
+105	3
+106	5
+107	2
+SELECT fid, AsText(PointN(g, 2)) FROM gis_line ORDER by fid;
+fid	AsText(PointN(g, 2))
+105	POINT(0 10)
+106	POINT(20 10)
+107	POINT(40 10)
+SELECT fid, IsClosed(g) FROM gis_line ORDER by fid;
+fid	IsClosed(g)
+105	0
+106	1
+107	0
+explain extended select AsText(StartPoint(g)),AsText(EndPoint(g)),GLength(g),NumPoints(g),AsText(PointN(g, 2)),IsClosed(g) FROM gis_line;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
+1	SIMPLE	gis_line	ALL	NULL	NULL	NULL	NULL	3	100.00	
+Warnings:
+Note	1003	select astext(startpoint(`test`.`gis_line`.`g`)) AS `AsText(StartPoint(g))`,astext(endpoint(`test`.`gis_line`.`g`)) AS `AsText(EndPoint(g))`,glength(`test`.`gis_line`.`g`) AS `GLength(g)`,numpoints(`test`.`gis_line`.`g`) AS `NumPoints(g)`,astext(pointn(`test`.`gis_line`.`g`,2)) AS `AsText(PointN(g, 2))`,isclosed(`test`.`gis_line`.`g`) AS `IsClosed(g)` from `test`.`gis_line`
+SELECT fid, AsText(Centroid(g)) FROM gis_polygon ORDER by fid;
+fid	AsText(Centroid(g))
+108	POINT(15 15)
+109	POINT(25.4166666666667 25.4166666666667)
+110	POINT(20 10)
+SELECT fid, Area(g) FROM gis_polygon ORDER by fid;
+fid	Area(g)
+108	100
+109	2400
+110	450
+SELECT fid, AsText(ExteriorRing(g)) FROM gis_polygon ORDER by fid;
+fid	AsText(ExteriorRing(g))
+108	LINESTRING(10 10,20 10,20 20,10 20,10 10)
+109	LINESTRING(0 0,50 0,50 50,0 50,0 0)
+110	LINESTRING(0 0,30 0,30 30,0 0)
+SELECT fid, NumInteriorRings(g) FROM gis_polygon ORDER by fid;
+fid	NumInteriorRings(g)
+108	0
+109	1
+110	0
+SELECT fid, AsText(InteriorRingN(g, 1)) FROM gis_polygon ORDER by fid;
+fid	AsText(InteriorRingN(g, 1))
+108	NULL
+109	LINESTRING(10 10,20 10,20 20,10 20,10 10)
+110	NULL
+explain extended select AsText(Centroid(g)),Area(g),AsText(ExteriorRing(g)),NumInteriorRings(g),AsText(InteriorRingN(g, 1)) FROM gis_polygon;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
+1	SIMPLE	gis_polygon	ALL	NULL	NULL	NULL	NULL	3	100.00	
+Warnings:
+Note	1003	select astext(centroid(`test`.`gis_polygon`.`g`)) AS `AsText(Centroid(g))`,area(`test`.`gis_polygon`.`g`) AS `Area(g)`,astext(exteriorring(`test`.`gis_polygon`.`g`)) AS `AsText(ExteriorRing(g))`,numinteriorrings(`test`.`gis_polygon`.`g`) AS `NumInteriorRings(g)`,astext(interiorringn(`test`.`gis_polygon`.`g`,1)) AS `AsText(InteriorRingN(g, 1))` from `test`.`gis_polygon`
+SELECT fid, IsClosed(g) FROM gis_multi_line ORDER by fid;
+fid	IsClosed(g)
+114	0
+115	0
+116	0
+SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon ORDER by fid;
+fid	AsText(Centroid(g))
+117	POINT(55.5885277530424 17.426536064114)
+118	POINT(55.5885277530424 17.426536064114)
+119	POINT(2 2)
+SELECT fid, Area(g) FROM gis_multi_polygon ORDER by fid;
+fid	Area(g)
+117	1684.5
+118	1684.5
+119	4.5
+SELECT fid, NumGeometries(g) from gis_multi_point ORDER by fid;
+fid	NumGeometries(g)
+111	4
+112	4
+113	2
+SELECT fid, NumGeometries(g) from gis_multi_line ORDER by fid;
+fid	NumGeometries(g)
+114	2
+115	1
+116	2
+SELECT fid, NumGeometries(g) from gis_multi_polygon ORDER by fid;
+fid	NumGeometries(g)
+117	2
+118	2
+119	1
+SELECT fid, NumGeometries(g) from gis_geometrycollection ORDER by fid;
+fid	NumGeometries(g)
+120	2
+121	2
+explain extended SELECT fid, NumGeometries(g) from gis_multi_point;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
+1	SIMPLE	gis_multi_point	ALL	NULL	NULL	NULL	NULL	3	100.00	
+Warnings:
+Note	1003	select `test`.`gis_multi_point`.`fid` AS `fid`,numgeometries(`test`.`gis_multi_point`.`g`) AS `NumGeometries(g)` from `test`.`gis_multi_point`
+SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point ORDER by fid;
+fid	AsText(GeometryN(g, 2))
+111	POINT(10 10)
+112	POINT(11 11)
+113	POINT(4 10)
+SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_line ORDER by fid;
+fid	AsText(GeometryN(g, 2))
+114	LINESTRING(16 0,16 23,16 48)
+115	NULL
+116	LINESTRING(2 5,5 8,21 7)
+SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_polygon ORDER by fid;
+fid	AsText(GeometryN(g, 2))
+117	POLYGON((59 18,67 18,67 13,59 13,59 18))
+118	POLYGON((59 18,67 18,67 13,59 13,59 18))
+119	NULL
+SELECT fid, AsText(GeometryN(g, 2)) from gis_geometrycollection ORDER by fid;
+fid	AsText(GeometryN(g, 2))
+120	LINESTRING(0 0,10 10)
+121	LINESTRING(3 6,7 9)
+SELECT fid, AsText(GeometryN(g, 1)) from gis_geometrycollection ORDER by fid;
+fid	AsText(GeometryN(g, 1))
+120	POINT(0 0)
+121	POINT(44 6)
+explain extended SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
+1	SIMPLE	gis_multi_point	ALL	NULL	NULL	NULL	NULL	3	100.00	
+Warnings:
+Note	1003	select `test`.`gis_multi_point`.`fid` AS `fid`,astext(geometryn(`test`.`gis_multi_point`.`g`,2)) AS `AsText(GeometryN(g, 2))` from `test`.`gis_multi_point`
+SELECT g1.fid as first, g2.fid as second,
+Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o,
+Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
+Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
+FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;
+first	second	w	c	o	e	d	t	i	r
+120	120	1	1	0	1	0	0	1	0
+120	121	0	0	1	0	0	0	1	0
+121	120	0	0	1	0	0	0	1	0
+121	121	1	1	0	1	0	0	1	0
+explain extended SELECT g1.fid as first, g2.fid as second,
+Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o,
+Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
+Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
+FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
+1	SIMPLE	g1	ALL	NULL	NULL	NULL	NULL	2	100.00	Using temporary; Using filesort
+1	SIMPLE	g2	ALL	NULL	NULL	NULL	NULL	2	100.00	Using join buffer
+Warnings:
+Note	1003	select `test`.`g1`.`fid` AS `first`,`test`.`g2`.`fid` AS `second`,within(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `w`,contains(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `c`,overlaps(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `o`,equals(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `e`,disjoint(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `d`,touches(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `t`,intersects(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `i`,crosses(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `r` from `test`.`gis_geometrycollection` `g1` join `test`.`gis_geometrycollection` `g2` order by `test`.`g1`.`fid`,`test`.`g2`.`fid`
+DROP TABLE gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry;
+CREATE TABLE t1 (
+a INTEGER PRIMARY KEY AUTO_INCREMENT,
+gp  point,
+ln  linestring,
+pg  polygon,
+mp  multipoint,
+mln multilinestring,
+mpg multipolygon,
+gc  geometrycollection,
+gm  geometry
+);
+SHOW FIELDS FROM t1;
+Field	Type	Null	Key	Default	Extra
+a	int(11)	NO	PRI	NULL	auto_increment
+gp	point	YES		NULL	
+ln	linestring	YES		NULL	
+pg	polygon	YES		NULL	
+mp	multipoint	YES		NULL	
+mln	multilinestring	YES		NULL	
+mpg	multipolygon	YES		NULL	
+gc	geometrycollection	YES		NULL	
+gm	geometry	YES		NULL	
+ALTER TABLE t1 ADD fid INT;
+SHOW FIELDS FROM t1;
+Field	Type	Null	Key	Default	Extra
+a	int(11)	NO	PRI	NULL	auto_increment
+gp	point	YES		NULL	
+ln	linestring	YES		NULL	
+pg	polygon	YES		NULL	
+mp	multipoint	YES		NULL	
+mln	multilinestring	YES		NULL	
+mpg	multipolygon	YES		NULL	
+gc	geometrycollection	YES		NULL	
+gm	geometry	YES		NULL	
+fid	int(11)	YES		NULL	
+DROP TABLE t1;
+create table t1 (pk integer primary key auto_increment, a geometry not null);
+insert into t1 (a) values (GeomFromText('Point(1 2)'));
+insert into t1 (a) values ('Garbage');
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+insert IGNORE into t1 (a) values ('Garbage');
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+drop table t1;
+create table t1 (pk integer primary key auto_increment, fl geometry not null);
+insert into t1 (fl) values (1);
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+insert into t1 (fl) values (1.11);
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+insert into t1 (fl) values ("qwerty");
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+insert into t1 (fl) values (pointfromtext('point(1,1)'));
+ERROR 23000: Column 'fl' cannot be null
+drop table t1;
+End of 4.1 tests
+CREATE TABLE t1 (name VARCHAR(100), square GEOMETRY);
+INSERT INTO t1 VALUES("center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))'));
+INSERT INTO t1 VALUES("small",  GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))'));
+INSERT INTO t1 VALUES("big",    GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))'));
+INSERT INTO t1 VALUES("up",     GeomFromText('POLYGON (( 0 1, 0 3, 2 3, 2 1, 0 1))'));
+INSERT INTO t1 VALUES("up2",    GeomFromText('POLYGON (( 0 2, 0 4, 2 4, 2 2, 0 2))'));
+INSERT INTO t1 VALUES("up3",    GeomFromText('POLYGON (( 0 3, 0 5, 2 5, 2 3, 0 3))'));
+INSERT INTO t1 VALUES("down",   GeomFromText('POLYGON (( 0 -1, 0  1, 2  1, 2 -1, 0 -1))'));
+INSERT INTO t1 VALUES("down2",  GeomFromText('POLYGON (( 0 -2, 0  0, 2  0, 2 -2, 0 -2))'));
+INSERT INTO t1 VALUES("down3",  GeomFromText('POLYGON (( 0 -3, 0 -1, 2 -1, 2 -3, 0 -3))'));
+INSERT INTO t1 VALUES("right",  GeomFromText('POLYGON (( 1 0, 1 2, 3 2, 3 0, 1 0))'));
+INSERT INTO t1 VALUES("right2", GeomFromText('POLYGON (( 2 0, 2 2, 4 2, 4 0, 2 0))'));
+INSERT INTO t1 VALUES("right3", GeomFromText('POLYGON (( 3 0, 3 2, 5 2, 5 0, 3 0))'));
+INSERT INTO t1 VALUES("left",   GeomFromText('POLYGON (( -1 0, -1 2,  1 2,  1 0, -1 0))'));
+INSERT INTO t1 VALUES("left2",  GeomFromText('POLYGON (( -2 0, -2 2,  0 2,  0 0, -2 0))'));
+INSERT INTO t1 VALUES("left3",  GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1 0, -3 0))'));
+SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrcontains  FROM t1 a1 JOIN t1 a2 ON MBRContains(   a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
+mbrcontains
+center,small
+SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrdisjoint  FROM t1 a1 JOIN t1 a2 ON MBRDisjoint(   a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
+mbrdisjoint
+down3,left3,right3,up3
+SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrequal     FROM t1 a1 JOIN t1 a2 ON MBREqual(      a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
+mbrequal
+center
+SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrintersect FROM t1 a1 JOIN t1 a2 ON MBRIntersects( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
+mbrintersect
+big,center,down,down2,left,left2,right,right2,small,up,up2
+SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbroverlaps  FROM t1 a1 JOIN t1 a2 ON MBROverlaps(   a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
+mbroverlaps
+down,left,right,up
+SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrtouches   FROM t1 a1 JOIN t1 a2 ON MBRTouches(    a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
+mbrtouches
+down2,left2,right2,up2
+SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrwithin    FROM t1 a1 JOIN t1 a2 ON MBRWithin(     a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
+mbrwithin
+big,center
+SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS contains     FROM t1 a1 JOIN t1 a2 ON Contains(      a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
+contains
+center,small
+SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS disjoint     FROM t1 a1 JOIN t1 a2 ON Disjoint(      a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
+disjoint
+down3,left3,right3,up3
+SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS equals       FROM t1 a1 JOIN t1 a2 ON Equals(        a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
+equals
+center
+SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS intersect    FROM t1 a1 JOIN t1 a2 ON Intersects(    a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
+intersect
+big,center,down,down2,left,left2,right,right2,small,up,up2
+SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS overlaps     FROM t1 a1 JOIN t1 a2 ON Overlaps(      a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
+overlaps
+down,left,right,up
+SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS touches      FROM t1 a1 JOIN t1 a2 ON Touches(       a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
+touches
+down2,left2,right2,up2
+SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS within       FROM t1 a1 JOIN t1 a2 ON Within(        a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name;
+within
+big,center
+SET @vert1   = GeomFromText('POLYGON ((0 -2, 0 2, 0 -2))');
+SET @horiz1  = GeomFromText('POLYGON ((-2 0, 2 0, -2 0))');
+SET @horiz2 = GeomFromText('POLYGON ((-1 0, 3 0, -1 0))');
+SET @horiz3 = GeomFromText('POLYGON ((2 0, 3 0, 2 0))');
+SET @point1 = GeomFromText('POLYGON ((0 0))');
+SET @point2 = GeomFromText('POLYGON ((-2 0))');
+SELECT GROUP_CONCAT(a1.name ORDER BY a1.name) AS overlaps FROM t1 a1 WHERE Overlaps(a1.square, @vert1) GROUP BY a1.name;
+overlaps
+SELECT GROUP_CONCAT(a1.name ORDER BY a1.name) AS overlaps FROM t1 a1 WHERE Overlaps(a1.square, @horiz1) GROUP BY a1.name;
+overlaps
+SELECT Overlaps(@horiz1, @vert1) FROM DUAL;
+Overlaps(@horiz1, @vert1)
+0
+SELECT Overlaps(@horiz1, @horiz2) FROM DUAL;
+Overlaps(@horiz1, @horiz2)
+1
+SELECT Overlaps(@horiz1, @horiz3) FROM DUAL;
+Overlaps(@horiz1, @horiz3)
+0
+SELECT Overlaps(@horiz1, @point1) FROM DUAL;
+Overlaps(@horiz1, @point1)
+0
+SELECT Overlaps(@horiz1, @point2) FROM DUAL;
+Overlaps(@horiz1, @point2)
+0
+DROP TABLE t1;
+End of 5.0 tests
+CREATE TABLE t1 (p POINT);
+CREATE TABLE t2 (p POINT, INDEX(p));
+INSERT INTO t1 VALUES (POINTFROMTEXT('POINT(1 2)'));
+INSERT INTO t2 VALUES (POINTFROMTEXT('POINT(1 2)'));
+SELECT COUNT(*) FROM t1 WHERE p=POINTFROMTEXT('POINT(1 2)');
+COUNT(*)
+1
+EXPLAIN 
+SELECT COUNT(*) FROM t2 WHERE p=POINTFROMTEXT('POINT(1 2)');
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t2	ref	p	p	28	const	1	Using where
+SELECT COUNT(*) FROM t2 WHERE p=POINTFROMTEXT('POINT(1 2)');
+COUNT(*)
+1
+INSERT INTO t1 VALUES (POINTFROMTEXT('POINT(1 2)'));
+INSERT INTO t2 VALUES (POINTFROMTEXT('POINT(1 2)'));
+EXPLAIN 
+SELECT COUNT(*) FROM t1 WHERE p=POINTFROMTEXT('POINT(1 2)');
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	2	Using where
+SELECT COUNT(*) FROM t1 WHERE p=POINTFROMTEXT('POINT(1 2)');
+COUNT(*)
+2
+EXPLAIN 
+SELECT COUNT(*) FROM t2 WHERE p=POINTFROMTEXT('POINT(1 2)');
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t2	ref	p	p	28	const	1	Using where
+SELECT COUNT(*) FROM t2 WHERE p=POINTFROMTEXT('POINT(1 2)');
+COUNT(*)
+2
+EXPLAIN 
+SELECT COUNT(*) FROM t2 IGNORE INDEX(p) WHERE p=POINTFROMTEXT('POINT(1 2)');
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	2	Using where
+SELECT COUNT(*) FROM t2 IGNORE INDEX(p) WHERE p=POINTFROMTEXT('POINT(1 2)');
+COUNT(*)
+2
+DROP TABLE t1, t2;
+End of 5.0 tests
+create table t1 (g geometry not null, spatial gk(g)) engine=innodb;
+ERROR HY000: The used table type doesn't support SPATIAL indexes

=== added file 'mysql-test/suite/innodb_plugin/r/innodb_lock_wait_timeout_1.result'
--- a/mysql-test/suite/innodb_plugin/r/innodb_lock_wait_timeout_1.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/innodb_plugin/r/innodb_lock_wait_timeout_1.result	2010-06-03 09:48:59 +0000
@@ -0,0 +1,375 @@
+#
+# Bug #40113: Embedded SELECT inside UPDATE or DELETE can timeout 
+#  without error
+#
+CREATE TABLE t1 (a int, b int, PRIMARY KEY  (a,b)) ENGINE=InnoDB;
+INSERT INTO t1 (a,b) VALUES (1070109,99);
+CREATE TABLE t2 (b int, a int, PRIMARY KEY (b)) ENGINE=InnoDB;
+INSERT INTO t2 (b,a) VALUES (7,1070109);
+SELECT * FROM t1;
+a	b
+1070109	99
+BEGIN;
+SELECT b FROM t2 WHERE b=7 FOR UPDATE;
+b
+7
+BEGIN;
+SELECT b FROM t2 WHERE b=7 FOR UPDATE;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+INSERT INTO t1 (a) VALUES ((SELECT a FROM t2 WHERE b=7));
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+UPDATE t1 SET a='7000000' WHERE a=(SELECT a FROM t2 WHERE b=7);
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+DELETE FROM t1 WHERE a=(SELECT a FROM t2 WHERE b=7);
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+SELECT * FROM t1;
+a	b
+1070109	99
+DROP TABLE t2, t1;
+# End of 5.0 tests
+#
+# Bug#46539 Various crashes on INSERT IGNORE SELECT + SELECT
+#           FOR UPDATE
+#
+drop table if exists t1;
+create table t1 (a int primary key auto_increment,
+b int, index(b)) engine=innodb;
+insert into t1 (b) values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+set autocommit=0;
+begin;
+select * from t1 where b=5 for update;
+a	b
+5	5
+insert ignore into t1 (b) select a as b from t1;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+# Cleanup
+#
+commit;
+set autocommit=default;
+drop table t1;
+#
+# Bug #37183 insert ignore into .. select ... hangs 
+#            after deadlock was encountered
+#
+create table t1(id int primary key,v int)engine=innodb;
+insert into t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7);
+create table t2 like t1;
+begin;
+update t1 set v=id*2 where id=1;
+begin;
+update t1 set v=id*2 where id=2;
+update t1 set v=id*2 where id=2;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+insert ignore into t2 select * from t1 where id=1;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+rollback;
+rollback;
+drop table t1, t2;
+#
+# Bug#41756 Strange error messages about locks from InnoDB
+#
+drop table if exists t1;
+# In the default transaction isolation mode, and/or with
+# innodb_locks_unsafe_for_binlog=OFF, handler::unlock_row()
+# in InnoDB does nothing.
+# Thus in order to reproduce the condition that led to the
+# warning, one needs to relax isolation by either
+# setting a weaker tx_isolation value, or by turning on
+# the unsafe replication switch.
+# For testing purposes, choose to tweak the isolation level,
+# since it's settable at runtime, unlike
+# innodb_locks_unsafe_for_binlog, which is
+# only a command-line switch.
+#
+set @@session.tx_isolation="read-committed";
+# Prepare data. We need a table with a unique index,
+# for join_read_key to be used. The other column
+# allows to control what passes WHERE clause filter.
+create table t1 (a int primary key, b int) engine=innodb;
+# Let's make sure t1 has sufficient amount of rows
+# to exclude JT_ALL access method when reading it,
+# i.e. make sure that JT_EQ_REF(a) is always preferred.
+insert into t1 values (1,1), (2,null), (3,1), (4,1),
+(5,1), (6,1), (7,1), (8,1), (9,1), (10,1),
+(11,1), (12,1), (13,1), (14,1), (15,1),
+(16,1), (17,1), (18,1), (19,1), (20,1);
+#
+# Demonstrate that for the SELECT statement
+# used later in the test JT_EQ_REF access method is used.
+#
+explain
+select 1 from t1 natural join (select 2 as a, 1 as b union all
+select 2 as a, 2 as b) as t2 for update;
+id	1
+select_type	PRIMARY
+table	<derived2>
+type	ALL
+possible_keys	NULL
+key	NULL
+key_len	NULL
+ref	NULL
+rows	2
+Extra	
+id	1
+select_type	PRIMARY
+table	t1
+type	eq_ref
+possible_keys	PRIMARY
+key	PRIMARY
+key_len	4
+ref	t2.a
+rows	1
+Extra	Using where
+id	2
+select_type	DERIVED
+table	NULL
+type	NULL
+possible_keys	NULL
+key	NULL
+key_len	NULL
+ref	NULL
+rows	NULL
+Extra	No tables used
+id	3
+select_type	UNION
+table	NULL
+type	NULL
+possible_keys	NULL
+key	NULL
+key_len	NULL
+ref	NULL
+rows	NULL
+Extra	No tables used
+id	NULL
+select_type	UNION RESULT
+table	<union2,3>
+type	ALL
+possible_keys	NULL
+key	NULL
+key_len	NULL
+ref	NULL
+rows	NULL
+Extra	
+#
+# Demonstrate that the reported SELECT statement
+# no longer produces warnings.
+#
+select 1 from t1 natural join (select 2 as a, 1 as b union all
+select 2 as a, 2 as b) as t2 for update;
+1
+commit;
+# 
+# Demonstrate that due to lack of inter-sweep "reset" function,
+# we keep some non-matching records locked, even though we know
+# we could unlock them.
+# To do that, show that if there is only one distinct value
+# for a in t2 (a=2), we will keep record (2,null) in t1 locked.
+# But if we add another value for "a" to t2, say 6,
+# join_read_key cache will be pruned at least once, 
+# and thus record (2, null) in t1 will get unlocked.
+#
+begin;
+select 1 from t1 natural join (select 2 as a, 1 as b union all
+select 2 as a, 2 as b) as t2 for update;
+1
+#
+# Switching to connection con1
+# We should be able to delete all records from t1 except (2, null),
+# since they were not locked.
+begin;
+# Delete in series of 3 records so that full scan
+# is not used and we're not blocked on record (2,null)
+delete from t1 where a in (1,3,4);
+delete from t1 where a in (5,6,7);
+delete from t1 where a in (8,9,10);
+delete from t1 where a in (11,12,13);
+delete from t1 where a in (14,15,16);
+delete from t1 where a in (17,18);
+delete from t1 where a in (19,20);
+# 
+# Record (2, null) is locked. This is actually unnecessary, 
+# because the previous select returned no rows. 
+# Just demonstrate the effect.
+#
+delete from t1;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+rollback;
+#
+# Switching to connection default
+#
+# Show that the original contents of t1 is intact:
+select * from t1;
+a	b
+1	1
+2	NULL
+3	1
+4	1
+5	1
+6	1
+7	1
+8	1
+9	1
+10	1
+11	1
+12	1
+13	1
+14	1
+15	1
+16	1
+17	1
+18	1
+19	1
+20	1
+commit;
+#
+# Have a one more record in t2 to show that 
+# if join_read_key cache is purned, the current
+# row under the cursor is unlocked (provided, this row didn't 
+# match the partial WHERE clause, of course).
+# Sic: the result of this test dependent on the order of retrieval
+# of records --echo # from the derived table, if !
+# We use DELETE to disable the JOIN CACHE. This DELETE modifies no
+# records. It also should leave no InnoDB row locks.
+#
+begin;
+delete t1.* from t1 natural join (select 2 as a, 2 as b union all
+select 0 as a, 0 as b) as t2;
+# Demonstrate that nothing was deleted form t1
+select * from t1;
+a	b
+1	1
+2	NULL
+3	1
+4	1
+5	1
+6	1
+7	1
+8	1
+9	1
+10	1
+11	1
+12	1
+13	1
+14	1
+15	1
+16	1
+17	1
+18	1
+19	1
+20	1
+#
+# Switching to connection con1
+begin;
+# Since there is another distinct record in the derived table
+# the previous matching record in t1 -- (2,null) -- was unlocked.
+delete from t1;
+# We will need the contents of the table again.
+rollback;
+select * from t1;
+a	b
+1	1
+2	NULL
+3	1
+4	1
+5	1
+6	1
+7	1
+8	1
+9	1
+10	1
+11	1
+12	1
+13	1
+14	1
+15	1
+16	1
+17	1
+18	1
+19	1
+20	1
+commit;
+#
+# Switching to connection default
+rollback;
+begin;
+#
+# Before this patch, we could wrongly unlock a record
+# that was cached and later used in a join. Demonstrate that
+# this is no longer the case.
+# Sic: this test is also order-dependent (i.e. the
+# the bug would show up only if the first record in the union
+# is retreived and processed first.
+#
+# Verify that JT_EQ_REF is used.
+explain
+select 1 from t1 natural join (select 3 as a, 2 as b union all
+select 3 as a, 1 as b) as t2 for update;
+id	1
+select_type	PRIMARY
+table	<derived2>
+type	ALL
+possible_keys	NULL
+key	NULL
+key_len	NULL
+ref	NULL
+rows	2
+Extra	
+id	1
+select_type	PRIMARY
+table	t1
+type	eq_ref
+possible_keys	PRIMARY
+key	PRIMARY
+key_len	4
+ref	t2.a
+rows	1
+Extra	Using where
+id	2
+select_type	DERIVED
+table	NULL
+type	NULL
+possible_keys	NULL
+key	NULL
+key_len	NULL
+ref	NULL
+rows	NULL
+Extra	No tables used
+id	3
+select_type	UNION
+table	NULL
+type	NULL
+possible_keys	NULL
+key	NULL
+key_len	NULL
+ref	NULL
+rows	NULL
+Extra	No tables used
+id	NULL
+select_type	UNION RESULT
+table	<union2,3>
+type	ALL
+possible_keys	NULL
+key	NULL
+key_len	NULL
+ref	NULL
+rows	NULL
+Extra	
+# Lock the record.
+select 1 from t1 natural join (select 3 as a, 2 as b union all
+select 3 as a, 1 as b) as t2 for update;
+1
+1
+# Switching to connection con1
+#
+# We should not be able to delete record (3,1) from t1,
+# (previously it was possible).
+#
+delete from t1 where a=3;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+# Switching to connection default
+commit;
+set @@session.tx_isolation=default;
+drop table t1;
+#
+# End of 5.1 tests
+#

=== added file 'mysql-test/suite/innodb_plugin/r/innodb_multi_update.result'
--- a/mysql-test/suite/innodb_plugin/r/innodb_multi_update.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/innodb_plugin/r/innodb_multi_update.result	2010-05-05 10:44:25 +0000
@@ -0,0 +1,76 @@
+CREATE TABLE bug38999_1 (a int not null primary key, b int not null, key (b)) engine=innodb;
+CREATE TABLE bug38999_2 (a int not null primary key, b int not null, key (b)) engine=innodb;
+INSERT INTO bug38999_1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9),(10,10),(11,11),(12,12);
+INSERT INTO bug38999_2 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
+update bug38999_1,bug38999_2 set bug38999_1.a=bug38999_1.a+100;
+select * from bug38999_1;
+a	b
+101	1
+102	2
+103	3
+104	4
+105	5
+106	6
+107	7
+108	8
+109	9
+110	10
+111	11
+112	12
+update bug38999_1,bug38999_2 set bug38999_1.a=bug38999_1.a+100 where bug38999_1.a=101;
+select * from bug38999_1;
+a	b
+201	1
+102	2
+103	3
+104	4
+105	5
+106	6
+107	7
+108	8
+109	9
+110	10
+111	11
+112	12
+update bug38999_1,bug38999_2 set bug38999_1.b=bug38999_1.b+10 where bug38999_1.b=2;
+select * from bug38999_1;
+a	b
+201	1
+103	3
+104	4
+105	5
+106	6
+107	7
+108	8
+109	9
+110	10
+111	11
+102	12
+112	12
+update bug38999_1,bug38999_2 set bug38999_1.b=bug38999_1.b+2,bug38999_2.b=bug38999_1.b+10 where bug38999_1.b between 3 and 5 and bug38999_1.a=bug38999_2.a+100;
+select * from bug38999_1;
+a	b
+201	1
+103	5
+104	6
+106	6
+105	7
+107	7
+108	8
+109	9
+110	10
+111	11
+102	12
+112	12
+select * from bug38999_2;
+a	b
+1	1
+2	2
+6	6
+7	7
+8	8
+9	9
+3	13
+4	14
+5	15
+drop table bug38999_1,bug38999_2;

=== added file 'mysql-test/suite/innodb_plugin/r/innodb_mysql.result'
--- a/mysql-test/suite/innodb_plugin/r/innodb_mysql.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/innodb_plugin/r/innodb_mysql.result	2010-08-03 21:26:17 +0000
@@ -0,0 +1,2393 @@
+set global innodb_support_xa=default;
+set session innodb_support_xa=default;
+SET SESSION STORAGE_ENGINE = InnoDB;
+drop table if exists t1,t2,t3,t1m,t1i,t2m,t2i,t4;
+drop procedure if exists p1;
+create table t1 (
+c_id int(11) not null default '0',
+org_id int(11) default null,
+unique key contacts$c_id (c_id),
+key contacts$org_id (org_id)
+);
+insert into t1 values
+(2,null),(120,null),(141,null),(218,7), (128,1),
+(151,2),(234,2),(236,2),(243,2),(255,2),(259,2),(232,3),(235,3),(238,3),
+(246,3),(253,3),(269,3),(285,3),(291,3),(293,3),(131,4),(230,4),(231,4);
+create table t2 (
+slai_id int(11) not null default '0',
+owner_tbl int(11) default null,
+owner_id int(11) default null,
+sla_id int(11) default null,
+inc_web int(11) default null,
+inc_email int(11) default null,
+inc_chat int(11) default null,
+inc_csr int(11) default null,
+inc_total int(11) default null,
+time_billed int(11) default null,
+activedate timestamp null default null,
+expiredate timestamp null default null,
+state int(11) default null,
+sla_set int(11) default null,
+unique key t2$slai_id (slai_id),
+key t2$owner_id (owner_id),
+key t2$sla_id (sla_id)
+);
+insert into t2(slai_id, owner_tbl, owner_id, sla_id) values
+(1,3,1,1), (3,3,10,2), (4,3,3,6), (5,3,2,5), (6,3,8,3), (7,3,9,7),
+(8,3,6,8), (9,3,4,9), (10,3,5,10), (11,3,11,11), (12,3,7,12);
+flush tables;
+select si.slai_id
+from t1 c join t2 si on
+((si.owner_tbl = 3 and si.owner_id = c.org_id) or
+( si.owner_tbl = 2 and si.owner_id = c.c_id))
+where
+c.c_id = 218 and expiredate is null;
+slai_id
+12
+select * from t1 where org_id is null;
+c_id	org_id
+2	NULL
+120	NULL
+141	NULL
+select si.slai_id
+from t1 c join t2 si on
+((si.owner_tbl = 3 and si.owner_id = c.org_id) or
+( si.owner_tbl = 2 and si.owner_id = c.c_id))
+where
+c.c_id = 218 and expiredate is null;
+slai_id
+12
+drop table t1, t2;
+CREATE TABLE t1 (a int, b int, KEY b (b));
+CREATE TABLE t2 (a int, b int, PRIMARY KEY  (a,b));
+CREATE TABLE t3 (a int, b int, c int, PRIMARY KEY  (a),
+UNIQUE KEY b (b,c), KEY a (a,b,c));
+INSERT INTO t1 VALUES (1, 1);
+INSERT INTO t1 SELECT a + 1, b + 1 FROM t1;
+INSERT INTO t1 SELECT a + 2, b + 2 FROM t1;
+INSERT INTO t2 VALUES (1,1),(1,2),(1,3),(1,4),(1,5),(1,6),(1,7),(1,8);
+INSERT INTO t2 SELECT a + 1, b FROM t2;
+DELETE FROM t2 WHERE a = 1 AND b < 2;
+INSERT INTO t3 VALUES (1,1,1),(2,1,2);
+INSERT INTO t3 SELECT a + 2, a + 2, 3 FROM t3;
+INSERT INTO t3 SELECT a + 4, a + 4, 3 FROM t3;
+SELECT STRAIGHT_JOIN SQL_NO_CACHE t1.b, t1.a FROM t1, t3, t2 WHERE
+t3.a = t2.a AND t2.b = t1.a AND t3.b = 1 AND t3.c IN (1, 2)
+ORDER BY t1.b LIMIT 2;
+b	a
+1	1
+2	2
+SELECT STRAIGHT_JOIN SQL_NO_CACHE t1.b, t1.a FROM t1, t3, t2 WHERE
+t3.a = t2.a AND t2.b = t1.a AND t3.b = 1 AND t3.c IN (1, 2)
+ORDER BY t1.b LIMIT 5;
+b	a
+1	1
+2	2
+2	2
+3	3
+3	3
+DROP TABLE t1, t2, t3;
+CREATE TABLE `t1` (`id1` INT) ;
+INSERT INTO `t1` (`id1`) VALUES (1),(5),(2);
+CREATE TABLE `t2` (
+`id1` INT,
+`id2` INT NOT NULL,
+`id3` INT,
+`id4` INT NOT NULL,
+UNIQUE (`id2`,`id4`),
+KEY (`id1`)
+);
+INSERT INTO `t2`(`id1`,`id2`,`id3`,`id4`) VALUES
+(1,1,1,0),
+(1,1,2,1),
+(5,1,2,2),
+(6,1,2,3),
+(1,2,2,2),
+(1,2,1,1);
+SELECT `id1` FROM `t1` WHERE `id1` NOT IN (SELECT `id1` FROM `t2` WHERE `id2` = 1 AND `id3` = 2);
+id1
+2
+DROP TABLE t1, t2;
+create table t1 (c1 int) engine=innodb;
+handler t1 open;
+handler t1 read first;
+c1
+Before and after comparison
+0
+drop table t1;
+CREATE TABLE t1(c1 TEXT, UNIQUE (c1(1)), cnt INT DEFAULT 1)
+ENGINE=INNODB CHARACTER SET UTF8;
+INSERT INTO t1 (c1) VALUES ('1a');
+SELECT * FROM t1;
+c1	cnt
+1a	1
+INSERT INTO t1 (c1) VALUES ('1b') ON DUPLICATE KEY UPDATE cnt=cnt+1;
+SELECT * FROM t1;
+c1	cnt
+1a	2
+DROP TABLE t1;
+CREATE TABLE t1(c1 VARCHAR(2), UNIQUE (c1(1)), cnt INT DEFAULT 1)
+ENGINE=INNODB CHARACTER SET UTF8;
+INSERT INTO t1 (c1) VALUES ('1a');
+SELECT * FROM t1;
+c1	cnt
+1a	1
+INSERT INTO t1 (c1) VALUES ('1b') ON DUPLICATE KEY UPDATE cnt=cnt+1;
+SELECT * FROM t1;
+c1	cnt
+1a	2
+DROP TABLE t1;
+CREATE TABLE t1(c1 CHAR(2), UNIQUE (c1(1)), cnt INT DEFAULT 1)
+ENGINE=INNODB CHARACTER SET UTF8;
+INSERT INTO t1 (c1) VALUES ('1a');
+SELECT * FROM t1;
+c1	cnt
+1a	1
+INSERT INTO t1 (c1) VALUES ('1b') ON DUPLICATE KEY UPDATE cnt=cnt+1;
+SELECT * FROM t1;
+c1	cnt
+1a	2
+DROP TABLE t1;
+CREATE TABLE t1 (
+a1 decimal(10,0) DEFAULT NULL,
+a2 blob,
+a3 time DEFAULT NULL,
+a4 blob,
+a5 char(175) DEFAULT NULL,
+a6 timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
+a7 tinyblob,
+INDEX idx (a6,a7(239),a5)
+) ENGINE=InnoDB;
+EXPLAIN SELECT a4 FROM t1 WHERE
+a6=NULL AND
+a4='UNcT5pIde4I6c2SheTo4gt92OV1jgJCVkXmzyf325R1DwLURkbYHwhydANIZMbKTgdcR5xS';
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	Impossible WHERE noticed after reading const tables
+EXPLAIN SELECT t1.a4 FROM t1, t1 t WHERE
+t.a6=t.a6 AND t1.a6=NULL AND
+t1.a4='UNcT5pIde4I6c2SheTo4gt92OV1jgJCVkXmzyf325R1DwLURkbYHwhydANIZMbKTgdcR5xS';
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	Impossible WHERE noticed after reading const tables
+DROP TABLE t1;
+create table t1m (a int) engine = MEMORY;
+create table t1i (a int);
+create table t2m (a int) engine = MEMORY;
+create table t2i (a int);
+insert into t2m values (5);
+insert into t2i values (5);
+select min(a) from t1i;
+min(a)
+NULL
+select min(7) from t1i;
+min(7)
+NULL
+select min(7) from DUAL;
+min(7)
+7
+explain select min(7) from t2i join t1i;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t2i	ALL	NULL	NULL	NULL	NULL	1	
+1	SIMPLE	t1i	ALL	NULL	NULL	NULL	NULL	1	Using join buffer
+select min(7) from t2i join t1i;
+min(7)
+NULL
+select max(a) from t1i;
+max(a)
+NULL
+select max(7) from t1i;
+max(7)
+NULL
+select max(7) from DUAL;
+max(7)
+7
+explain select max(7) from t2i join t1i;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t2i	ALL	NULL	NULL	NULL	NULL	1	
+1	SIMPLE	t1i	ALL	NULL	NULL	NULL	NULL	1	Using join buffer
+select max(7) from t2i join t1i;
+max(7)
+NULL
+select 1, min(a) from t1i where a=99;
+1	min(a)
+1	NULL
+select 1, min(a) from t1i where 1=99;
+1	min(a)
+1	NULL
+select 1, min(1) from t1i where a=99;
+1	min(1)
+1	NULL
+select 1, min(1) from t1i where 1=99;
+1	min(1)
+1	NULL
+select 1, max(a) from t1i where a=99;
+1	max(a)
+1	NULL
+select 1, max(a) from t1i where 1=99;
+1	max(a)
+1	NULL
+select 1, max(1) from t1i where a=99;
+1	max(1)
+1	NULL
+select 1, max(1) from t1i where 1=99;
+1	max(1)
+1	NULL
+explain select count(*), min(7), max(7) from t1m, t1i;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1m	system	NULL	NULL	NULL	NULL	0	const row not found
+1	SIMPLE	t1i	ALL	NULL	NULL	NULL	NULL	1	
+select count(*), min(7), max(7) from t1m, t1i;
+count(*)	min(7)	max(7)
+0	NULL	NULL
+explain select count(*), min(7), max(7) from t1m, t2i;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1m	system	NULL	NULL	NULL	NULL	0	const row not found
+1	SIMPLE	t2i	ALL	NULL	NULL	NULL	NULL	1	
+select count(*), min(7), max(7) from t1m, t2i;
+count(*)	min(7)	max(7)
+0	NULL	NULL
+explain select count(*), min(7), max(7) from t2m, t1i;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t2m	system	NULL	NULL	NULL	NULL	1	
+1	SIMPLE	t1i	ALL	NULL	NULL	NULL	NULL	1	
+select count(*), min(7), max(7) from t2m, t1i;
+count(*)	min(7)	max(7)
+0	NULL	NULL
+drop table t1m, t1i, t2m, t2i;
+create table t1 (
+a1 char(64), a2 char(64), b char(16), c char(16) not null, d char(16), dummy char(64) default ' '
+) ENGINE = MEMORY;
+insert into t1 (a1, a2, b, c, d) values
+('a','a','a','a111','xy1'),('a','a','a','b111','xy2'),('a','a','a','c111','xy3'),('a','a','a','d111','xy4'),
+('a','a','b','e112','xy1'),('a','a','b','f112','xy2'),('a','a','b','g112','xy3'),('a','a','b','h112','xy4'),
+('a','b','a','i121','xy1'),('a','b','a','j121','xy2'),('a','b','a','k121','xy3'),('a','b','a','l121','xy4'),
+('a','b','b','m122','xy1'),('a','b','b','n122','xy2'),('a','b','b','o122','xy3'),('a','b','b','p122','xy4'),
+('b','a','a','a211','xy1'),('b','a','a','b211','xy2'),('b','a','a','c211','xy3'),('b','a','a','d211','xy4'),
+('b','a','b','e212','xy1'),('b','a','b','f212','xy2'),('b','a','b','g212','xy3'),('b','a','b','h212','xy4'),
+('b','b','a','i221','xy1'),('b','b','a','j221','xy2'),('b','b','a','k221','xy3'),('b','b','a','l221','xy4'),
+('b','b','b','m222','xy1'),('b','b','b','n222','xy2'),('b','b','b','o222','xy3'),('b','b','b','p222','xy4'),
+('c','a','a','a311','xy1'),('c','a','a','b311','xy2'),('c','a','a','c311','xy3'),('c','a','a','d311','xy4'),
+('c','a','b','e312','xy1'),('c','a','b','f312','xy2'),('c','a','b','g312','xy3'),('c','a','b','h312','xy4'),
+('c','b','a','i321','xy1'),('c','b','a','j321','xy2'),('c','b','a','k321','xy3'),('c','b','a','l321','xy4'),
+('c','b','b','m322','xy1'),('c','b','b','n322','xy2'),('c','b','b','o322','xy3'),('c','b','b','p322','xy4'),
+('d','a','a','a411','xy1'),('d','a','a','b411','xy2'),('d','a','a','c411','xy3'),('d','a','a','d411','xy4'),
+('d','a','b','e412','xy1'),('d','a','b','f412','xy2'),('d','a','b','g412','xy3'),('d','a','b','h412','xy4'),
+('d','b','a','i421','xy1'),('d','b','a','j421','xy2'),('d','b','a','k421','xy3'),('d','b','a','l421','xy4'),
+('d','b','b','m422','xy1'),('d','b','b','n422','xy2'),('d','b','b','o422','xy3'),('d','b','b','p422','xy4'),
+('a','a','a','a111','xy1'),('a','a','a','b111','xy2'),('a','a','a','c111','xy3'),('a','a','a','d111','xy4'),
+('a','a','b','e112','xy1'),('a','a','b','f112','xy2'),('a','a','b','g112','xy3'),('a','a','b','h112','xy4'),
+('a','b','a','i121','xy1'),('a','b','a','j121','xy2'),('a','b','a','k121','xy3'),('a','b','a','l121','xy4'),
+('a','b','b','m122','xy1'),('a','b','b','n122','xy2'),('a','b','b','o122','xy3'),('a','b','b','p122','xy4'),
+('b','a','a','a211','xy1'),('b','a','a','b211','xy2'),('b','a','a','c211','xy3'),('b','a','a','d211','xy4'),
+('b','a','b','e212','xy1'),('b','a','b','f212','xy2'),('b','a','b','g212','xy3'),('b','a','b','h212','xy4'),
+('b','b','a','i221','xy1'),('b','b','a','j221','xy2'),('b','b','a','k221','xy3'),('b','b','a','l221','xy4'),
+('b','b','b','m222','xy1'),('b','b','b','n222','xy2'),('b','b','b','o222','xy3'),('b','b','b','p222','xy4'),
+('c','a','a','a311','xy1'),('c','a','a','b311','xy2'),('c','a','a','c311','xy3'),('c','a','a','d311','xy4'),
+('c','a','b','e312','xy1'),('c','a','b','f312','xy2'),('c','a','b','g312','xy3'),('c','a','b','h312','xy4'),
+('c','b','a','i321','xy1'),('c','b','a','j321','xy2'),('c','b','a','k321','xy3'),('c','b','a','l321','xy4'),
+('c','b','b','m322','xy1'),('c','b','b','n322','xy2'),('c','b','b','o322','xy3'),('c','b','b','p322','xy4'),
+('d','a','a','a411','xy1'),('d','a','a','b411','xy2'),('d','a','a','c411','xy3'),('d','a','a','d411','xy4'),
+('d','a','b','e412','xy1'),('d','a','b','f412','xy2'),('d','a','b','g412','xy3'),('d','a','b','h412','xy4'),
+('d','b','a','i421','xy1'),('d','b','a','j421','xy2'),('d','b','a','k421','xy3'),('d','b','a','l421','xy4'),
+('d','b','b','m422','xy1'),('d','b','b','n422','xy2'),('d','b','b','o422','xy3'),('d','b','b','p422','xy4');
+create table t4 (
+pk_col int auto_increment primary key, a1 char(64), a2 char(64), b char(16), c char(16) not null, d char(16), dummy char(64) default ' '
+);
+insert into t4 (a1, a2, b, c, d, dummy) select * from t1;
+create index idx12672_0 on t4 (a1);
+create index idx12672_1 on t4 (a1,a2,b,c);
+create index idx12672_2 on t4 (a1,a2,b);
+analyze table t4;
+Table	Op	Msg_type	Msg_text
+test.t4	analyze	status	OK
+select distinct a1 from t4 where pk_col not in (1,2,3,4);
+a1
+a
+b
+c
+d
+drop table t1,t4;
+DROP TABLE IF EXISTS t2, t1;
+CREATE TABLE t1 (i INT NOT NULL PRIMARY KEY) ENGINE= InnoDB;
+CREATE TABLE t2 (
+i INT NOT NULL,
+FOREIGN KEY (i) REFERENCES t1 (i) ON DELETE NO ACTION
+) ENGINE= InnoDB;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+DELETE IGNORE FROM t1 WHERE i = 1;
+Warnings:
+Error	1451	Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`i`) REFERENCES `t1` (`i`) ON DELETE NO ACTION)
+SELECT * FROM t1, t2;
+i	i
+1	1
+DROP TABLE t2, t1;
+End of 4.1 tests.
+create table t1 (
+a varchar(30), b varchar(30), primary key(a), key(b)
+);
+select distinct a from t1;
+a
+drop table t1;
+create table t1(a int, key(a));
+insert into t1 values(1);
+select a, count(a) from t1 group by a with rollup;
+a	count(a)
+1	1
+NULL	1
+drop table t1;
+create table t1 (f1 int, f2 char(1), primary key(f1,f2));
+insert into t1 values ( 1,"e"),(2,"a"),( 3,"c"),(4,"d");
+alter table t1 drop primary key, add primary key (f2, f1);
+explain select distinct f1 a, f1 b from t1;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	index	NULL	PRIMARY	5	NULL	4	Using index; Using temporary
+explain select distinct f1, f2 from t1;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	range	NULL	PRIMARY	5	NULL	3	Using index for group-by; Using temporary
+drop table t1;
+CREATE TABLE t1 (id int(11) NOT NULL PRIMARY KEY, name varchar(20),
+INDEX (name));
+CREATE TABLE t2 (id int(11) NOT NULL PRIMARY KEY, fkey int(11));
+ALTER TABLE t2 ADD FOREIGN KEY (fkey) REFERENCES t2(id);
+INSERT INTO t1 VALUES (1,'A1'),(2,'A2'),(3,'B');
+INSERT INTO t2 VALUES (1,1),(2,2),(3,2),(4,3),(5,3);
+EXPLAIN
+SELECT COUNT(*) FROM t2 LEFT JOIN t1 ON t2.fkey = t1.id
+WHERE t1.name LIKE 'A%';
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	index	PRIMARY,name	name	23	NULL	3	Using where; Using index
+1	SIMPLE	t2	ref	fkey	fkey	5	test.t1.id	1	Using where; Using index
+EXPLAIN
+SELECT COUNT(*) FROM t2 LEFT JOIN t1 ON t2.fkey = t1.id
+WHERE t1.name LIKE 'A%' OR FALSE;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t2	index	NULL	fkey	5	NULL	5	Using index
+1	SIMPLE	t1	eq_ref	PRIMARY	PRIMARY	4	test.t2.fkey	1	Using where
+DROP TABLE t1,t2;
+CREATE TABLE t1 (
+id int NOT NULL,
+name varchar(20) NOT NULL,
+dept varchar(20) NOT NULL,
+age tinyint(3) unsigned NOT NULL,
+PRIMARY KEY (id),
+INDEX (name,dept)
+) ENGINE=InnoDB;
+INSERT INTO t1(id, dept, age, name) VALUES
+(3987, 'cs1', 10, 'rs1'), (3988, 'cs2', 20, 'rs1'), (3995, 'cs3', 10, 'rs2'),
+(3996, 'cs4', 20, 'rs2'), (4003, 'cs5', 10, 'rs3'), (4004, 'cs6', 20, 'rs3'),
+(4011, 'cs7', 10, 'rs4'), (4012, 'cs8', 20, 'rs4'), (4019, 'cs9', 10, 'rs5'),
+(4020, 'cs10', 20, 'rs5'),(4027, 'cs11', 10, 'rs6'),(4028, 'cs12', 20, 'rs6');
+EXPLAIN SELECT DISTINCT t1.name, t1.dept FROM t1 WHERE t1.name='rs5';
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	range	name	name	44	NULL	2	Using where; Using index for group-by
+SELECT DISTINCT t1.name, t1.dept FROM t1 WHERE t1.name='rs5';
+name	dept
+rs5	cs10
+rs5	cs9
+DELETE FROM t1;
+# Masking (#) number in "rows" column of the following EXPLAIN output, as it may vary (bug#47746).
+EXPLAIN SELECT DISTINCT t1.name, t1.dept FROM t1 WHERE t1.name='rs5';
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	range	name	name	44	NULL	#	Using where; Using index for group-by
+SELECT DISTINCT t1.name, t1.dept FROM t1 WHERE t1.name='rs5';
+name	dept
+DROP TABLE t1;
+drop table if exists t1;
+show variables like 'innodb_rollback_on_timeout';
+Variable_name	Value
+innodb_rollback_on_timeout	OFF
+create table t1 (a int unsigned not null primary key) engine = innodb;
+insert into t1 values (1);
+commit;
+begin work;
+insert into t1 values (2);
+select * from t1;
+a
+1
+2
+begin work;
+insert into t1 values (5);
+select * from t1;
+a
+1
+5
+insert into t1 values (2);
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+select * from t1;
+a
+1
+5
+commit;
+select * from t1;
+a
+1
+2
+commit;
+select * from t1;
+a
+1
+2
+5
+drop table t1;
+set @save_qcache_size=@@global.query_cache_size;
+set @save_qcache_type=@@global.query_cache_type;
+set global query_cache_size=10*1024*1024;
+set global query_cache_type=1;
+drop table if exists `test`;
+Warnings:
+Note	1051	Unknown table 'test'
+CREATE TABLE `test` (`test1` varchar(3) NOT NULL,
+`test2` varchar(4) NOT NULL,PRIMARY KEY  (`test1`))
+ENGINE=InnoDB DEFAULT CHARSET=latin1;
+INSERT INTO `test` (`test1`, `test2`) VALUES ('tes', '5678');
+select * from test;
+test1	test2
+tes	5678
+INSERT INTO `test` (`test1`, `test2`) VALUES ('tes', '1234')
+ON DUPLICATE KEY UPDATE `test2` = '1234';
+select * from test;
+test1	test2
+tes	1234
+flush tables;
+select * from test;
+test1	test2
+tes	1234
+drop table test;
+set global query_cache_type=@save_qcache_type;
+set global query_cache_size=@save_qcache_size;
+drop table if exists t1;
+show variables like 'innodb_rollback_on_timeout';
+Variable_name	Value
+innodb_rollback_on_timeout	OFF
+create table t1 (a int unsigned not null primary key) engine = innodb;
+insert into t1 values (1);
+commit;
+begin work;
+insert into t1 values (2);
+select * from t1;
+a
+1
+2
+begin work;
+insert into t1 values (5);
+select * from t1;
+a
+1
+5
+insert into t1 values (2);
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+select * from t1;
+a
+1
+5
+commit;
+select * from t1;
+a
+1
+2
+commit;
+select * from t1;
+a
+1
+2
+5
+drop table t1;
+create table t1(
+id int auto_increment,
+c char(1) not null,
+counter int not null default 1,
+primary key (id),
+unique key (c)
+) engine=innodb;
+insert into t1 (id, c) values
+(NULL, 'a'),
+(NULL, 'a')
+on duplicate key update id = values(id), counter = counter + 1;
+select * from t1;
+id	c	counter
+2	a	2
+insert into t1 (id, c) values
+(NULL, 'b')
+on duplicate key update id = values(id), counter = counter + 1;
+select * from t1;
+id	c	counter
+2	a	2
+3	b	1
+truncate table t1;
+insert into t1 (id, c) values (NULL, 'a');
+select * from t1;
+id	c	counter
+1	a	1
+insert into t1 (id, c) values (NULL, 'b'), (NULL, 'b')
+on duplicate key update id = values(id), c = values(c), counter = counter + 1;
+select * from t1;
+id	c	counter
+1	a	1
+3	b	2
+insert into t1 (id, c) values (NULL, 'a')
+on duplicate key update id = values(id), c = values(c), counter = counter + 1;
+select * from t1;
+id	c	counter
+3	b	2
+4	a	2
+drop table t1;
+CREATE TABLE t1(
+id int AUTO_INCREMENT PRIMARY KEY,
+stat_id int NOT NULL,
+acct_id int DEFAULT NULL,
+INDEX idx1 (stat_id, acct_id),
+INDEX idx2 (acct_id)
+) ENGINE=MyISAM;
+CREATE TABLE t2(
+id int AUTO_INCREMENT PRIMARY KEY,
+stat_id int NOT NULL,
+acct_id int DEFAULT NULL,
+INDEX idx1 (stat_id, acct_id),
+INDEX idx2 (acct_id)
+) ENGINE=InnoDB;
+INSERT INTO t1(stat_id,acct_id) VALUES
+(1,759), (2,831), (3,785), (4,854), (1,921),
+(1,553), (2,589), (3,743), (2,827), (2,545),
+(4,779), (4,783), (1,597), (1,785), (4,832),
+(1,741), (1,833), (3,788), (2,973), (1,907);
+INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
+UPDATE t1 SET acct_id=785 
+WHERE MOD(stat_id,2)=0 AND MOD(id,stat_id)=MOD(acct_id,stat_id);
+OPTIMIZE TABLE t1;
+Table	Op	Msg_type	Msg_text
+test.t1	optimize	status	OK
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+40960
+SELECT COUNT(*) FROM t1 WHERE acct_id=785;
+COUNT(*)
+8702
+EXPLAIN SELECT COUNT(*) FROM t1 WHERE stat_id IN (1,3) AND acct_id=785;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	range	idx1,idx2	idx1	9	NULL	2	Using where; Using index
+INSERT INTO t2 SELECT * FROM t1;
+OPTIMIZE TABLE t2;
+Table	Op	Msg_type	Msg_text
+test.t2	optimize	note	Table does not support optimize, doing recreate + analyze instead
+test.t2	optimize	status	OK
+EXPLAIN SELECT COUNT(*) FROM t2 WHERE stat_id IN (1,3) AND acct_id=785;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t2	range	idx1,idx2	idx1	9	NULL	2	Using where; Using index
+DROP TABLE t1,t2;
+create table t1(a int) engine=innodb;
+alter table t1 comment '123';
+show create table t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='123'
+drop table t1;
+CREATE TABLE t1 (a CHAR(2), KEY (a)) ENGINE = InnoDB DEFAULT CHARSET=UTF8;
+INSERT INTO t1 VALUES ('uk'),('bg');
+SELECT * FROM t1 WHERE a = 'uk';
+a
+uk
+DELETE FROM t1 WHERE a = 'uk';
+SELECT * FROM t1 WHERE a = 'uk';
+a
+UPDATE t1 SET a = 'us' WHERE a = 'uk';
+SELECT * FROM t1 WHERE a = 'uk';
+a
+CREATE TABLE t2 (a CHAR(2), KEY (a)) ENGINE = InnoDB;
+INSERT INTO t2 VALUES ('uk'),('bg');
+SELECT * FROM t2 WHERE a = 'uk';
+a
+uk
+DELETE FROM t2 WHERE a = 'uk';
+SELECT * FROM t2 WHERE a = 'uk';
+a
+INSERT INTO t2 VALUES ('uk');
+UPDATE t2 SET a = 'us' WHERE a = 'uk';
+SELECT * FROM t2 WHERE a = 'uk';
+a
+CREATE TABLE t3 (a CHAR(2), KEY (a)) ENGINE = MyISAM;
+INSERT INTO t3 VALUES ('uk'),('bg');
+SELECT * FROM t3 WHERE a = 'uk';
+a
+uk
+DELETE FROM t3 WHERE a = 'uk';
+SELECT * FROM t3 WHERE a = 'uk';
+a
+INSERT INTO t3 VALUES ('uk');
+UPDATE t3 SET a = 'us' WHERE a = 'uk';
+SELECT * FROM t3 WHERE a = 'uk';
+a
+DROP TABLE t1,t2,t3;
+create table t1 (a int) engine=innodb;
+select * from bug29807;
+ERROR 42S02: Table 'test.bug29807' doesn't exist
+drop table t1;
+drop table bug29807;
+ERROR 42S02: Unknown table 'bug29807'
+create table bug29807 (a int);
+drop table bug29807;
+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
+CREATE TABLE t2 (a INT) ENGINE=InnoDB;
+switch to connection c1
+SET AUTOCOMMIT=0;
+INSERT INTO t2 VALUES (1);
+switch to connection c2
+SET AUTOCOMMIT=0;
+LOCK TABLES t1 READ, t2 READ;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+switch to connection c1
+COMMIT;
+INSERT INTO t1 VALUES (1);
+switch to connection default
+SET AUTOCOMMIT=default;
+DROP TABLE t1,t2;
+CREATE TABLE t1 (
+id int NOT NULL auto_increment PRIMARY KEY,
+b int NOT NULL,
+c datetime NOT NULL,
+INDEX idx_b(b),
+INDEX idx_c(c)
+) ENGINE=InnoDB;
+CREATE TABLE t2 (
+b int NOT NULL auto_increment PRIMARY KEY,
+c datetime NOT NULL
+) ENGINE= MyISAM;
+INSERT INTO t2(c) VALUES ('2007-01-01');
+INSERT INTO t2(c) SELECT c FROM t2;
+INSERT INTO t2(c) SELECT c FROM t2;
+INSERT INTO t2(c) SELECT c FROM t2;
+INSERT INTO t2(c) SELECT c FROM t2;
+INSERT INTO t2(c) SELECT c FROM t2;
+INSERT INTO t2(c) SELECT c FROM t2;
+INSERT INTO t2(c) SELECT c FROM t2;
+INSERT INTO t2(c) SELECT c FROM t2;
+INSERT INTO t2(c) SELECT c FROM t2;
+INSERT INTO t2(c) SELECT c FROM t2;
+INSERT INTO t1(b,c) SELECT b,c FROM t2;
+UPDATE t2 SET c='2007-01-02';
+INSERT INTO t1(b,c) SELECT b,c FROM t2;
+UPDATE t2 SET c='2007-01-03';
+INSERT INTO t1(b,c) SELECT b,c FROM t2;
+set @@sort_buffer_size=8192;
+Warnings:
+Warning	1292	Truncated incorrect sort_buffer_size value: '8192'
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+3072
+EXPLAIN 
+SELECT COUNT(*) FROM t1 
+WHERE (c >= '2007-01-02' AND c <= '2007-01-03') OR b >= 1;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ALL	idx_b,idx_c	NULL	NULL	NULL	#	Using where
+SELECT COUNT(*) FROM t1 
+WHERE (c >= '2007-01-02' AND c <= '2007-01-03') OR b >= 1;
+COUNT(*)
+3072
+EXPLAIN 
+SELECT COUNT(*) FROM t1 FORCE INDEX(idx_b, idx_c) 
+WHERE (c >= '2007-01-02' AND c <= '2007-01-03') OR b >= 1;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	index_merge	idx_b,idx_c	idx_c,idx_b	8,4	NULL	#	Using sort_union(idx_c,idx_b); Using where
+SELECT COUNT(*) FROM t1 FORCE INDEX(idx_b, idx_c)
+WHERE (c >= '2007-01-02' AND c <= '2007-01-03') OR b >= 1;
+COUNT(*)
+3072
+set @@sort_buffer_size=default;
+DROP TABLE t1,t2;
+CREATE TABLE t1 (a int, b int);
+insert into t1 values (1,1),(1,2);
+CREATE TABLE t2 (primary key (a)) select * from t1;
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+drop table if exists t2;
+Warnings:
+Note	1051	Unknown table 't2'
+CREATE TEMPORARY TABLE t2 (primary key (a)) select * from t1;
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+drop table if exists t2;
+Warnings:
+Note	1051	Unknown table 't2'
+CREATE TABLE t2 (a int, b int, primary key (a));
+BEGIN;
+INSERT INTO t2 values(100,100);
+CREATE TABLE IF NOT EXISTS t2 (primary key (a)) select * from t1;
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+SELECT * from t2;
+a	b
+100	100
+ROLLBACK;
+SELECT * from t2;
+a	b
+100	100
+TRUNCATE table t2;
+INSERT INTO t2 select * from t1;
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+SELECT * from t2;
+a	b
+drop table t2;
+CREATE TEMPORARY TABLE t2 (a int, b int, primary key (a));
+BEGIN;
+INSERT INTO t2 values(100,100);
+CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) select * from t1;
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+SELECT * from t2;
+a	b
+100	100
+COMMIT;
+BEGIN;
+INSERT INTO t2 values(101,101);
+CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) select * from t1;
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+SELECT * from t2;
+a	b
+100	100
+101	101
+ROLLBACK;
+SELECT * from t2;
+a	b
+100	100
+TRUNCATE table t2;
+INSERT INTO t2 select * from t1;
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+SELECT * from t2;
+a	b
+drop table t1,t2;
+create table t1(f1 varchar(800) binary not null, key(f1))
+character set utf8 collate utf8_general_ci;
+Warnings:
+Warning	1071	Specified key was too long; max key length is 767 bytes
+insert into t1 values('aaa');
+drop table t1;
+CREATE TABLE t1 (a INT PRIMARY KEY, b INT, c FLOAT, KEY b(b)) ENGINE = INNODB;
+INSERT INTO t1 VALUES (    1 , 1              , 1);
+INSERT INTO t1 SELECT  a + 1 , MOD(a + 1 , 20), 1 FROM t1;
+INSERT INTO t1 SELECT  a + 2 , MOD(a + 2 , 20), 1 FROM t1;
+INSERT INTO t1 SELECT  a + 4 , MOD(a + 4 , 20), 1 FROM t1;
+INSERT INTO t1 SELECT  a + 8 , MOD(a + 8 , 20), 1 FROM t1;
+INSERT INTO t1 SELECT  a + 16, MOD(a + 16, 20), 1 FROM t1;
+INSERT INTO t1 SELECT  a + 32, MOD(a + 32, 20), 1 FROM t1;
+INSERT INTO t1 SELECT  a + 64, MOD(a + 64, 20), 1 FROM t1;
+EXPLAIN SELECT b, SUM(c) FROM t1 GROUP BY b;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	index	NULL	b	5	NULL	128	
+EXPLAIN SELECT SQL_BIG_RESULT b, SUM(c) FROM t1 GROUP BY b;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	128	Using filesort
+DROP TABLE t1;
+drop table if exists t1;
+show variables like 'innodb_rollback_on_timeout';
+Variable_name	Value
+innodb_rollback_on_timeout	OFF
+create table t1 (a int unsigned not null primary key) engine = innodb;
+insert into t1 values (1);
+commit;
+begin work;
+insert into t1 values (2);
+select * from t1;
+a
+1
+2
+begin work;
+insert into t1 values (5);
+select * from t1;
+a
+1
+5
+insert into t1 values (2);
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+select * from t1;
+a
+1
+5
+commit;
+select * from t1;
+a
+1
+2
+commit;
+select * from t1;
+a
+1
+2
+5
+drop table t1;
+drop table if exists t1;
+create table t1 (a int) engine=innodb;
+alter table t1 alter a set default 1;
+drop table t1;
+
+Bug#24918 drop table and lock / inconsistent between 
+perm and temp tables
+
+Check transactional tables under LOCK TABLES
+
+drop table if exists t24918, t24918_tmp, t24918_trans, t24918_trans_tmp, 
+t24918_access;
+create table t24918_access (id int);
+create table t24918 (id int) engine=myisam;
+create temporary table t24918_tmp (id int) engine=myisam;
+create table t24918_trans (id int) engine=innodb;
+create temporary table t24918_trans_tmp (id int) engine=innodb;
+lock table t24918 write, t24918_tmp write, t24918_trans write, t24918_trans_tmp write;
+drop table t24918;
+select * from t24918_access;
+ERROR HY000: Table 't24918_access' was not locked with LOCK TABLES
+drop table t24918_trans;
+select * from t24918_access;
+ERROR HY000: Table 't24918_access' was not locked with LOCK TABLES
+drop table t24918_trans_tmp;
+select * from t24918_access;
+ERROR HY000: Table 't24918_access' was not locked with LOCK TABLES
+drop table t24918_tmp;
+select * from t24918_access;
+ERROR HY000: Table 't24918_access' was not locked with LOCK TABLES
+unlock tables;
+drop table t24918_access;
+CREATE TABLE t1 (a int, b int, PRIMARY KEY (a), KEY bkey (b)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1,2),(3,2),(2,2),(4,2),(5,2),(6,2),(7,2),(8,2);
+INSERT INTO t1 SELECT a + 8, 2 FROM t1;
+INSERT INTO t1 SELECT a + 16, 1 FROM t1;
+EXPLAIN SELECT * FROM t1 WHERE b=2 ORDER BY a;
+id	1
+select_type	SIMPLE
+table	t1
+type	ref
+possible_keys	bkey
+key	bkey
+key_len	5
+ref	const
+rows	16
+Extra	Using where; Using index
+SELECT * FROM t1 WHERE b=2 ORDER BY a;
+a	b
+1	2
+2	2
+3	2
+4	2
+5	2
+6	2
+7	2
+8	2
+9	2
+10	2
+11	2
+12	2
+13	2
+14	2
+15	2
+16	2
+EXPLAIN SELECT * FROM t1 WHERE b BETWEEN 1 AND 2 ORDER BY a;
+id	1
+select_type	SIMPLE
+table	t1
+type	range
+possible_keys	bkey
+key	bkey
+key_len	5
+ref	NULL
+rows	16
+Extra	Using where; Using index; Using filesort
+SELECT * FROM t1 WHERE b BETWEEN 1 AND 2 ORDER BY a;
+a	b
+1	2
+2	2
+3	2
+4	2
+5	2
+6	2
+7	2
+8	2
+9	2
+10	2
+11	2
+12	2
+13	2
+14	2
+15	2
+16	2
+17	1
+18	1
+19	1
+20	1
+21	1
+22	1
+23	1
+24	1
+25	1
+26	1
+27	1
+28	1
+29	1
+30	1
+31	1
+32	1
+EXPLAIN SELECT * FROM t1 WHERE b BETWEEN 1 AND 2 ORDER BY b,a;
+id	1
+select_type	SIMPLE
+table	t1
+type	range
+possible_keys	bkey
+key	bkey
+key_len	5
+ref	NULL
+rows	16
+Extra	Using where; Using index
+SELECT * FROM t1 WHERE b BETWEEN 1 AND 2 ORDER BY b,a;
+a	b
+17	1
+18	1
+19	1
+20	1
+21	1
+22	1
+23	1
+24	1
+25	1
+26	1
+27	1
+28	1
+29	1
+30	1
+31	1
+32	1
+1	2
+2	2
+3	2
+4	2
+5	2
+6	2
+7	2
+8	2
+9	2
+10	2
+11	2
+12	2
+13	2
+14	2
+15	2
+16	2
+CREATE TABLE t2 (a int, b int, c int, PRIMARY KEY (a), KEY bkey (b,c))
+ENGINE=InnoDB;
+INSERT INTO t2 VALUES (1,1,1),(3,1,1),(2,1,1),(4,1,1);
+INSERT INTO t2 SELECT a + 4, 1, 1 FROM t2;
+INSERT INTO t2 SELECT a + 8, 1, 1 FROM t2;
+EXPLAIN SELECT * FROM t2 WHERE b=1 ORDER BY a;
+id	1
+select_type	SIMPLE
+table	t2
+type	ref
+possible_keys	bkey
+key	bkey
+key_len	5
+ref	const
+rows	8
+Extra	Using where; Using index; Using filesort
+SELECT * FROM t2 WHERE b=1 ORDER BY a;
+a	b	c
+1	1	1
+2	1	1
+3	1	1
+4	1	1
+5	1	1
+6	1	1
+7	1	1
+8	1	1
+9	1	1
+10	1	1
+11	1	1
+12	1	1
+13	1	1
+14	1	1
+15	1	1
+16	1	1
+EXPLAIN SELECT * FROM t2 WHERE b=1 AND c=1 ORDER BY a;
+id	1
+select_type	SIMPLE
+table	t2
+type	ref
+possible_keys	bkey
+key	bkey
+key_len	10
+ref	const,const
+rows	8
+Extra	Using where; Using index
+SELECT * FROM t2 WHERE b=1 AND c=1 ORDER BY a;
+a	b	c
+1	1	1
+2	1	1
+3	1	1
+4	1	1
+5	1	1
+6	1	1
+7	1	1
+8	1	1
+9	1	1
+10	1	1
+11	1	1
+12	1	1
+13	1	1
+14	1	1
+15	1	1
+16	1	1
+EXPLAIN SELECT * FROM t2 WHERE b=1 AND c=1 ORDER BY b,c,a;
+id	1
+select_type	SIMPLE
+table	t2
+type	ref
+possible_keys	bkey
+key	bkey
+key_len	10
+ref	const,const
+rows	8
+Extra	Using where; Using index
+SELECT * FROM t2 WHERE b=1 AND c=1 ORDER BY b,c,a;
+a	b	c
+1	1	1
+2	1	1
+3	1	1
+4	1	1
+5	1	1
+6	1	1
+7	1	1
+8	1	1
+9	1	1
+10	1	1
+11	1	1
+12	1	1
+13	1	1
+14	1	1
+15	1	1
+16	1	1
+EXPLAIN SELECT * FROM t2 WHERE b=1 AND c=1 ORDER BY c,a;
+id	1
+select_type	SIMPLE
+table	t2
+type	ref
+possible_keys	bkey
+key	bkey
+key_len	10
+ref	const,const
+rows	8
+Extra	Using where; Using index
+SELECT * FROM t2 WHERE b=1 AND c=1 ORDER BY c,a;
+a	b	c
+1	1	1
+2	1	1
+3	1	1
+4	1	1
+5	1	1
+6	1	1
+7	1	1
+8	1	1
+9	1	1
+10	1	1
+11	1	1
+12	1	1
+13	1	1
+14	1	1
+15	1	1
+16	1	1
+DROP TABLE t1,t2;
+CREATE TABLE t1 (a INT, PRIMARY KEY (a)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8);
+INSERT INTO t1 SELECT a + 8  FROM t1;
+INSERT INTO t1 SELECT a + 16 FROM t1;
+CREATE PROCEDURE p1 ()
+BEGIN
+DECLARE i INT DEFAULT 50;
+DECLARE cnt INT;
+START TRANSACTION;
+ALTER TABLE t1 ENGINE=InnoDB;
+COMMIT;
+START TRANSACTION;
+WHILE (i > 0) DO
+SET i = i - 1;
+SELECT COUNT(*) INTO cnt FROM t1 LOCK IN SHARE MODE;
+END WHILE;
+COMMIT;
+END;|
+CALL p1();
+CALL p1();
+CALL p1();
+DROP PROCEDURE p1;
+DROP TABLE t1;
+create table t1(a text) engine=innodb default charset=utf8;
+insert into t1 values('aaa');
+alter table t1 add index(a(1024));
+Warnings:
+Warning	1071	Specified key was too long; max key length is 767 bytes
+Warning	1071	Specified key was too long; max key length is 767 bytes
+show create table t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` text,
+  KEY `a` (`a`(255))
+) ENGINE=InnoDB DEFAULT CHARSET=utf8
+drop table t1;
+CREATE TABLE t1 (
+a INT,
+b INT,
+KEY (b)
+) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1,10), (2,10), (2,20), (3,30);
+START TRANSACTION;
+SELECT * FROM t1 WHERE b=20 FOR UPDATE;
+a	b
+2	20
+START TRANSACTION;
+SELECT * FROM t1 WHERE b=10 ORDER BY A FOR UPDATE;
+a	b
+1	10
+2	10
+ROLLBACK;
+ROLLBACK;
+DROP TABLE t1;
+CREATE TABLE t1(
+a INT, 
+b INT NOT NULL, 
+c INT NOT NULL, 
+d INT, 
+UNIQUE KEY (c,b)
+) engine=innodb;
+INSERT INTO t1 VALUES (1,1,1,50), (1,2,3,40), (2,1,3,4);
+EXPLAIN SELECT c,b,d FROM t1 GROUP BY c,b,d;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	3	Using filesort
+SELECT c,b,d FROM t1 GROUP BY c,b,d;
+c	b	d
+1	1	50
+3	1	4
+3	2	40
+EXPLAIN SELECT c,b,d FROM t1 GROUP BY c,b,d ORDER BY NULL;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	3	
+SELECT c,b,d FROM t1 GROUP BY c,b,d ORDER BY NULL;
+c	b	d
+1	1	50
+3	1	4
+3	2	40
+EXPLAIN SELECT c,b,d FROM t1 ORDER BY c,b,d;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	3	Using filesort
+SELECT c,b,d FROM t1 ORDER BY c,b,d;
+c	b	d
+1	1	50
+3	1	4
+3	2	40
+EXPLAIN SELECT c,b,d FROM t1 GROUP BY c,b;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	index	NULL	c	8	NULL	3	
+SELECT c,b,d FROM t1 GROUP BY c,b;
+c	b	d
+1	1	50
+3	1	4
+3	2	40
+EXPLAIN SELECT c,b   FROM t1 GROUP BY c,b;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	index	NULL	c	8	NULL	3	Using index
+SELECT c,b   FROM t1 GROUP BY c,b;
+c	b
+1	1
+3	1
+3	2
+DROP TABLE t1;
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a), INDEX b (b)) ENGINE=InnoDB;
+INSERT INTO t1(a,b) VALUES (1,1), (2,2), (3,2);
+EXPLAIN SELECT * FROM t1 WHERE b=2 ORDER BY a ASC;
+id	1
+select_type	SIMPLE
+table	t1
+type	ref
+possible_keys	b
+key	b
+key_len	5
+ref	const
+rows	1
+Extra	Using where; Using index
+SELECT * FROM t1 WHERE b=2 ORDER BY a ASC;
+a	b
+2	2
+3	2
+EXPLAIN SELECT * FROM t1 WHERE b=2 ORDER BY a DESC;
+id	1
+select_type	SIMPLE
+table	t1
+type	ref
+possible_keys	b
+key	b
+key_len	5
+ref	const
+rows	1
+Extra	Using where; Using index
+SELECT * FROM t1 WHERE b=2 ORDER BY a DESC;
+a	b
+3	2
+2	2
+EXPLAIN SELECT * FROM t1 ORDER BY b ASC, a ASC;
+id	1
+select_type	SIMPLE
+table	t1
+type	index
+possible_keys	NULL
+key	b
+key_len	5
+ref	NULL
+rows	3
+Extra	Using index
+SELECT * FROM t1 ORDER BY b ASC, a ASC;
+a	b
+1	1
+2	2
+3	2
+EXPLAIN SELECT * FROM t1 ORDER