List:Commits« Previous MessageNext Message »
From:Christopher Powers Date:October 27 2011 9:19pm
Subject:bzr push into mysql-trunk-wl5908 branch (chris.powers:3429 to 3430)
View as plain text  
 3430 Christopher Powers	2011-10-27 [merge]
      downmerge from mysql-trunk

    removed:
      mysql-test/suite/rpl/r/rpl_mixed_crash_safe.result.THIS
      mysql-test/suite/rpl/t/rpl_mixed_crash_safe.test.THIS
    modified:
      mysql-test/r/compare.result
      mysql-test/r/index_merge_innodb.result
      mysql-test/r/plugin.result
      mysql-test/r/sp-error.result
      mysql-test/r/user_var.result
      mysql-test/suite/perfschema/r/func_file_io.result
      mysql-test/suite/perfschema/r/pfs_upgrade.result
      mysql-test/suite/perfschema/r/schema.result
      mysql-test/suite/perfschema/r/start_server_nothing.result
      mysql-test/suite/perfschema/r/table_schema.result
      mysql-test/suite/rpl/r/rpl_alter_repository.result
      mysql-test/suite/rpl/t/rpl_alter_repository.test
      mysql-test/t/compare.test
      mysql-test/t/index_merge_innodb.test
      mysql-test/t/plugin.test
      mysql-test/t/sp-error.test
      mysql-test/t/user_var.test
      scripts/mysql_system_tables.sql
      sql/event_db_repository.cc
      sql/events.cc
      sql/item_cmpfunc.cc
      sql/opt_range.cc
      sql/records.cc
      sql/records.h
      sql/rpl_slave.cc
      sql/sp_head.cc
      sql/sp_rcontext.cc
      sql/sql_acl.cc
      sql/sql_class.h
      sql/sql_delete.cc
      sql/sql_help.cc
      sql/sql_plugin.cc
      sql/sql_select.cc
      sql/sql_servers.cc
      sql/sql_table.cc
      sql/sql_udf.cc
      sql/sql_update.cc
      storage/innobase/buf/buf0buf.c
      storage/innobase/dict/dict0dict.c
      storage/innobase/fil/fil0fil.c
      storage/innobase/fsp/fsp0fsp.c
      storage/innobase/handler/ha_innodb.cc
      storage/innobase/include/buf0buf.h
      storage/innobase/include/fil0fil.h
      storage/innobase/include/fsp0fsp.h
      storage/innobase/include/sync0rw.ic
      storage/innobase/row/row0mysql.c
      storage/innobase/row/row0umod.c
      storage/innobase/srv/srv0start.c
      storage/perfschema/pfs.cc
      storage/perfschema/pfs_events.h
      storage/perfschema/pfs_instr.cc
      storage/perfschema/table_events_stages.cc
      storage/perfschema/table_events_stages.h
      storage/perfschema/table_events_statements.cc
      storage/perfschema/table_events_statements.h
      storage/perfschema/table_events_waits.cc
      storage/perfschema/table_events_waits.h
 3429 Marc Alff	2011-10-26 [merge]
      Merge mysql-trunk --> mysql-trunk-wl5908

    removed:
      mysql-test/std_data/bug11747887-bin.000002
      mysql-test/suite/rpl/r/binlog-hexdump.result
      mysql-test/suite/rpl/t/binlog-hexdump.test
    added:
      cmd-line-utils/libedit/chartype.c
      cmd-line-utils/libedit/chartype.h
      cmd-line-utils/libedit/eln.c
      cmd-line-utils/libedit/historyn.c
      cmd-line-utils/libedit/np/wcsdup.c
      cmd-line-utils/libedit/tokenizern.c
      mysql-test/r/get_diagnostics.result
      mysql-test/suite/rpl/r/rpl_alter_repository.result
      mysql-test/suite/rpl/t/rpl_alter_repository.test
      mysql-test/t/get_diagnostics.test
      sql/sql_get_diagnostics.cc
      sql/sql_get_diagnostics.h
      unittest/gunit/get_diagnostics-t.cc
    renamed:
      cmd-line-utils/libedit/el_term.h => cmd-line-utils/libedit/el_terminal.h
      cmd-line-utils/libedit/key.c => cmd-line-utils/libedit/keymacro.c
      cmd-line-utils/libedit/key.h => cmd-line-utils/libedit/keymacro.h
      cmd-line-utils/libedit/term.c => cmd-line-utils/libedit/terminal.c
    modified:
      client/mysql_plugin.c
      client/mysqldump.c
      client/mysqltest.cc
      cmd-line-utils/libedit/CMakeLists.txt
      cmd-line-utils/libedit/README
      cmd-line-utils/libedit/chared.c
      cmd-line-utils/libedit/chared.h
      cmd-line-utils/libedit/common.c
      cmd-line-utils/libedit/config.h
      cmd-line-utils/libedit/el.c
      cmd-line-utils/libedit/el.h
      cmd-line-utils/libedit/emacs.c
      cmd-line-utils/libedit/filecomplete.c
      cmd-line-utils/libedit/filecomplete.h
      cmd-line-utils/libedit/hist.c
      cmd-line-utils/libedit/hist.h
      cmd-line-utils/libedit/histedit.h
      cmd-line-utils/libedit/history.c
      cmd-line-utils/libedit/makelist.sh
      cmd-line-utils/libedit/map.c
      cmd-line-utils/libedit/map.h
      cmd-line-utils/libedit/np/strlcpy.c
      cmd-line-utils/libedit/np/unvis.c
      cmd-line-utils/libedit/np/vis.c
      cmd-line-utils/libedit/np/vis.h
      cmd-line-utils/libedit/parse.c
      cmd-line-utils/libedit/parse.h
      cmd-line-utils/libedit/prompt.c
      cmd-line-utils/libedit/prompt.h
      cmd-line-utils/libedit/read.c
      cmd-line-utils/libedit/read.h
      cmd-line-utils/libedit/readline.c
      cmd-line-utils/libedit/readline/readline.h
      cmd-line-utils/libedit/refresh.c
      cmd-line-utils/libedit/refresh.h
      cmd-line-utils/libedit/search.c
      cmd-line-utils/libedit/search.h
      cmd-line-utils/libedit/sig.c
      cmd-line-utils/libedit/sig.h
      cmd-line-utils/libedit/sys.h
      cmd-line-utils/libedit/tokenizer.c
      cmd-line-utils/libedit/tty.c
      cmd-line-utils/libedit/tty.h
      cmd-line-utils/libedit/vi.c
      man/CMakeLists.txt
      mysql-test/extra/rpl_tests/rpl_loaddata.test
      mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test
      mysql-test/include/subquery_sj.inc
      mysql-test/mysql-test-run.pl
      mysql-test/r/archive.result
      mysql-test/r/cast.result
      mysql-test/r/explain.result
      mysql-test/r/fulltext.result
      mysql-test/r/group_by.result
      mysql-test/r/innodb_icp_all.result
      mysql-test/r/join_outer.result
      mysql-test/r/join_outer_bka.result
      mysql-test/r/join_outer_bka_nixbnl.result
      mysql-test/r/myisam.result
      mysql-test/r/myisam_icp_all.result
      mysql-test/r/mysql_plugin.result
      mysql-test/r/mysqld--help-notwin.result
      mysql-test/r/mysqld--help-win.result
      mysql-test/r/mysqltest.result
      mysql-test/r/packet.result
      mysql-test/r/ps.result
      mysql-test/r/read_only_innodb.result
      mysql-test/r/shm.result
      mysql-test/r/signal.result
      mysql-test/r/sp-code.result
      mysql-test/r/sp-error.result
      mysql-test/r/sp.result
      mysql-test/r/subquery_all.result
      mysql-test/r/subquery_all_bka.result
      mysql-test/r/subquery_all_bka_nixbnl.result
      mysql-test/r/subquery_mat_none.result
      mysql-test/r/subquery_nomat_nosj.result
      mysql-test/r/subquery_nomat_nosj_bka.result
      mysql-test/r/subquery_nomat_nosj_bka_nixbnl.result
      mysql-test/r/subquery_none.result
      mysql-test/r/subquery_none_bka.result
      mysql-test/r/subquery_none_bka_nixbnl.result
      mysql-test/r/subquery_sj_all.result
      mysql-test/r/subquery_sj_all_bka.result
      mysql-test/r/subquery_sj_all_bka_nixbnl.result
      mysql-test/r/subquery_sj_all_bkaunique.result
      mysql-test/r/subquery_sj_dupsweed.result
      mysql-test/r/subquery_sj_dupsweed_bka.result
      mysql-test/r/subquery_sj_dupsweed_bka_nixbnl.result
      mysql-test/r/subquery_sj_dupsweed_bkaunique.result
      mysql-test/r/subquery_sj_firstmatch.result
      mysql-test/r/subquery_sj_firstmatch_bka.result
      mysql-test/r/subquery_sj_firstmatch_bka_nixbnl.result
      mysql-test/r/subquery_sj_firstmatch_bkaunique.result
      mysql-test/r/subquery_sj_loosescan.result
      mysql-test/r/subquery_sj_loosescan_bka.result
      mysql-test/r/subquery_sj_loosescan_bka_nixbnl.result
      mysql-test/r/subquery_sj_loosescan_bkaunique.result
      mysql-test/r/subquery_sj_mat.result
      mysql-test/r/subquery_sj_mat_bka.result
      mysql-test/r/subquery_sj_mat_bka_nixbnl.result
      mysql-test/r/subquery_sj_mat_bkaunique.result
      mysql-test/r/subquery_sj_mat_nosj.result
      mysql-test/r/subquery_sj_none.result
      mysql-test/r/subquery_sj_none_bka.result
      mysql-test/r/subquery_sj_none_bka_nixbnl.result
      mysql-test/r/subquery_sj_none_bkaunique.result
      mysql-test/r/variables-notembedded.result
      mysql-test/r/variables.result
      mysql-test/suite/funcs_1/r/innodb_storedproc_02.result
      mysql-test/suite/funcs_1/r/memory_storedproc_02.result
      mysql-test/suite/funcs_1/r/myisam_storedproc_02.result
      mysql-test/suite/funcs_1/r/storedproc.result
      mysql-test/suite/innodb/r/innodb_monitor.result
      mysql-test/suite/innodb/r/innodb_mysql.result
      mysql-test/suite/innodb/t/innodb_monitor.test
      mysql-test/suite/opt_trace/include/range.inc
      mysql-test/suite/opt_trace/include/subquery.inc
      mysql-test/suite/opt_trace/r/filesort_pq.result
      mysql-test/suite/opt_trace/r/general2_no_prot.result
      mysql-test/suite/opt_trace/r/general2_ps_prot.result
      mysql-test/suite/opt_trace/r/general_no_prot_all.result
      mysql-test/suite/opt_trace/r/general_no_prot_none.result
      mysql-test/suite/opt_trace/r/general_ps_prot_all.result
      mysql-test/suite/opt_trace/r/general_ps_prot_none.result
      mysql-test/suite/opt_trace/r/range_no_prot.result
      mysql-test/suite/opt_trace/r/range_ps_prot.result
      mysql-test/suite/opt_trace/r/subquery_no_prot.result
      mysql-test/suite/opt_trace/r/subquery_ps_prot.result
      mysql-test/suite/perfschema/include/binlog_common.inc
      mysql-test/suite/perfschema/include/cleanup_helper.inc
      mysql-test/suite/perfschema/include/connection_cleanup.inc
      mysql-test/suite/perfschema/include/connection_load.inc
      mysql-test/suite/perfschema/include/connection_setup.inc
      mysql-test/suite/perfschema/include/event_aggregate_cleanup.inc
      mysql-test/suite/perfschema/include/event_aggregate_load.inc
      mysql-test/suite/perfschema/include/event_aggregate_setup.inc
      mysql-test/suite/perfschema/include/no_protocol.inc
      mysql-test/suite/perfschema/include/pfs_upgrade.inc
      mysql-test/suite/perfschema/include/privilege.inc
      mysql-test/suite/perfschema/include/schema.inc
      mysql-test/suite/perfschema/include/setup_helper.inc
      mysql-test/suite/perfschema/include/socket_check1.inc
      mysql-test/suite/perfschema/include/socket_event.inc
      mysql-test/suite/perfschema/include/socket_event_dbg.inc
      mysql-test/suite/perfschema/include/socket_ipv6.inc
      mysql-test/suite/perfschema/include/socket_summary_check.inc
      mysql-test/suite/perfschema/include/socket_summary_check_dbg.inc
      mysql-test/suite/perfschema/include/stage_cleanup.inc
      mysql-test/suite/perfschema/include/stage_setup.inc
      mysql-test/suite/perfschema/include/start_server_common.inc
      mysql-test/suite/perfschema/include/table_aggregate_cleanup.inc
      mysql-test/suite/perfschema/include/table_aggregate_load.inc
      mysql-test/suite/perfschema/include/table_aggregate_setup.inc
      mysql-test/suite/perfschema/include/table_io_basic_dml.inc
      mysql-test/suite/perfschema/include/table_io_cleanup_helper.inc
      mysql-test/suite/perfschema/include/table_io_result_helper.inc
      mysql-test/suite/perfschema/include/table_io_setup_helper.inc
      mysql-test/suite/perfschema/include/upgrade_check.inc
      mysql-test/suite/perfschema/include/wait_for_pfs_thread_count.inc
      mysql-test/suite/perfschema/include/wait_till_sleep.inc
      mysql-test/suite/perfschema/r/ortho_iter.result
      mysql-test/suite/perfschema/r/privilege_table_io.result
      mysql-test/suite/perfschema/r/start_server_innodb.result
      mysql-test/suite/perfschema/r/start_server_no_account.result
      mysql-test/suite/perfschema/r/start_server_no_cond_class.result
      mysql-test/suite/perfschema/r/start_server_no_cond_inst.result
      mysql-test/suite/perfschema/r/start_server_no_file_class.result
      mysql-test/suite/perfschema/r/start_server_no_file_inst.result
      mysql-test/suite/perfschema/r/start_server_no_host.result
      mysql-test/suite/perfschema/r/start_server_no_mutex_class.result
      mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result
      mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result
      mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result
      mysql-test/suite/perfschema/r/start_server_no_setup_actors.result
      mysql-test/suite/perfschema/r/start_server_no_setup_objects.result
      mysql-test/suite/perfschema/r/start_server_no_socket_class.result
      mysql-test/suite/perfschema/r/start_server_no_socket_inst.result
      mysql-test/suite/perfschema/r/start_server_no_stage_class.result
      mysql-test/suite/perfschema/r/start_server_no_stages_history.result
      mysql-test/suite/perfschema/r/start_server_no_stages_history_long.result
      mysql-test/suite/perfschema/r/start_server_no_statements_history.result
      mysql-test/suite/perfschema/r/start_server_no_statements_history_long.result
      mysql-test/suite/perfschema/r/start_server_no_table_hdl.result
      mysql-test/suite/perfschema/r/start_server_no_table_inst.result
      mysql-test/suite/perfschema/r/start_server_no_thread_class.result
      mysql-test/suite/perfschema/r/start_server_no_thread_inst.result
      mysql-test/suite/perfschema/r/start_server_no_user.result
      mysql-test/suite/perfschema/r/start_server_no_waits_history.result
      mysql-test/suite/perfschema/r/start_server_no_waits_history_long.result
      mysql-test/suite/perfschema/r/start_server_off.result
      mysql-test/suite/perfschema/r/start_server_on.result
      mysql-test/suite/perfschema/r/table_aggregate_global_2u_2t.result
      mysql-test/suite/perfschema/r/table_aggregate_global_2u_3t.result
      mysql-test/suite/perfschema/r/table_aggregate_global_4u_2t.result
      mysql-test/suite/perfschema/r/table_aggregate_global_4u_3t.result
      mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result
      mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result
      mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result
      mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result
      mysql-test/suite/perfschema/r/table_aggregate_off.result
      mysql-test/suite/perfschema/r/table_aggregate_thread_2u_2t.result
      mysql-test/suite/perfschema/r/table_aggregate_thread_2u_3t.result
      mysql-test/suite/perfschema/r/table_aggregate_thread_4u_2t.result
      mysql-test/suite/perfschema/r/table_aggregate_thread_4u_3t.result
      mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_2t.result
      mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_3t.result
      mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_2t.result
      mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_3t.result
      mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_2t.result
      mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_3t.result
      mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_2t.result
      mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_3t.result
      mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_2t.result
      mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_3t.result
      mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_2t.result
      mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_3t.result
      mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_2t.result
      mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_3t.result
      mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_2t.result
      mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_3t.result
      mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_2t.result
      mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_3t.result
      mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_2t.result
      mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_3t.result
      mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_2t.result
      mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_3t.result
      mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_2t.result
      mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_3t.result
      mysql-test/suite/perfschema/t/aggregate.test
      mysql-test/suite/perfschema/t/all_tests.test
      mysql-test/suite/perfschema/t/bad_option_1.test
      mysql-test/suite/perfschema/t/bad_option_2.test
      mysql-test/suite/perfschema/t/bad_option_3.test
      mysql-test/suite/perfschema/t/bad_option_4.test
      mysql-test/suite/perfschema/t/bad_option_5.test
      mysql-test/suite/perfschema/t/binlog_mix.test
      mysql-test/suite/perfschema/t/binlog_row.test
      mysql-test/suite/perfschema/t/binlog_stmt.test
      mysql-test/suite/perfschema/t/checksum.test
      mysql-test/suite/perfschema/t/cnf_option.cnf
      mysql-test/suite/perfschema/t/cnf_option.test
      mysql-test/suite/perfschema/t/column_privilege.test
      mysql-test/suite/perfschema/t/connection.test
      mysql-test/suite/perfschema/t/connection_3a.test
      mysql-test/suite/perfschema/t/connection_3a_3u.test
      mysql-test/suite/perfschema/t/connection_3u.test
      mysql-test/suite/perfschema/t/csv_table_io.test
      mysql-test/suite/perfschema/t/ddl_accounts.test
      mysql-test/suite/perfschema/t/ddl_cond_instances.test
      mysql-test/suite/perfschema/t/ddl_esgs_by_account_by_event_name.test
      mysql-test/suite/perfschema/t/ddl_esgs_by_host_by_event_name.test
      mysql-test/suite/perfschema/t/ddl_esgs_by_thread_by_event_name.test
      mysql-test/suite/perfschema/t/ddl_esgs_by_user_by_event_name.test
      mysql-test/suite/perfschema/t/ddl_esgs_global_by_event_name.test
      mysql-test/suite/perfschema/t/ddl_esms_by_account_by_event_name.test
      mysql-test/suite/perfschema/t/ddl_esms_by_host_by_event_name.test
      mysql-test/suite/perfschema/t/ddl_esms_by_thread_by_event_name.test
      mysql-test/suite/perfschema/t/ddl_esms_by_user_by_event_name.test
      mysql-test/suite/perfschema/t/ddl_esms_global_by_event_name.test
      mysql-test/suite/perfschema/t/ddl_events_stages_current.test
      mysql-test/suite/perfschema/t/ddl_events_stages_history.test
      mysql-test/suite/perfschema/t/ddl_events_stages_history_long.test
      mysql-test/suite/perfschema/t/ddl_events_statements_current.test
      mysql-test/suite/perfschema/t/ddl_events_statements_history.test
      mysql-test/suite/perfschema/t/ddl_events_statements_history_long.test
      mysql-test/suite/perfschema/t/ddl_events_waits_current.test
      mysql-test/suite/perfschema/t/ddl_events_waits_history.test
      mysql-test/suite/perfschema/t/ddl_events_waits_history_long.test
      mysql-test/suite/perfschema/t/ddl_ews_by_account_by_event_name.test
      mysql-test/suite/perfschema/t/ddl_ews_by_host_by_event_name.test
      mysql-test/suite/perfschema/t/ddl_ews_by_instance.test
      mysql-test/suite/perfschema/t/ddl_ews_by_thread_by_event_name.test
      mysql-test/suite/perfschema/t/ddl_ews_by_user_by_event_name.test
      mysql-test/suite/perfschema/t/ddl_ews_global_by_event_name.test
      mysql-test/suite/perfschema/t/ddl_file_instances.test
      mysql-test/suite/perfschema/t/ddl_fs_by_event_name.test
      mysql-test/suite/perfschema/t/ddl_fs_by_instance.test
      mysql-test/suite/perfschema/t/ddl_hosts.test
      mysql-test/suite/perfschema/t/ddl_mutex_instances.test
      mysql-test/suite/perfschema/t/ddl_os_global_by_type.test
      mysql-test/suite/perfschema/t/ddl_performance_timers.test
      mysql-test/suite/perfschema/t/ddl_rwlock_instances.test
      mysql-test/suite/perfschema/t/ddl_setup_actors.test
      mysql-test/suite/perfschema/t/ddl_setup_consumers.test
      mysql-test/suite/perfschema/t/ddl_setup_instruments.test
      mysql-test/suite/perfschema/t/ddl_setup_objects.test
      mysql-test/suite/perfschema/t/ddl_setup_timers.test
      mysql-test/suite/perfschema/t/ddl_socket_instances.test
      mysql-test/suite/perfschema/t/ddl_socket_summary_by_event_name.test
      mysql-test/suite/perfschema/t/ddl_socket_summary_by_instance.test
      mysql-test/suite/perfschema/t/ddl_threads.test
      mysql-test/suite/perfschema/t/ddl_tiws_by_index_usage.test
      mysql-test/suite/perfschema/t/ddl_tiws_by_table.test
      mysql-test/suite/perfschema/t/ddl_tlws_by_table.test
      mysql-test/suite/perfschema/t/ddl_users.test
      mysql-test/suite/perfschema/t/disabled.def
      mysql-test/suite/perfschema/t/dml_accounts.test
      mysql-test/suite/perfschema/t/dml_cond_instances.test
      mysql-test/suite/perfschema/t/dml_esgs_by_account_by_event_name.test
      mysql-test/suite/perfschema/t/dml_esgs_by_host_by_event_name.test
      mysql-test/suite/perfschema/t/dml_esgs_by_thread_by_event_name.test
      mysql-test/suite/perfschema/t/dml_esgs_by_user_by_event_name.test
      mysql-test/suite/perfschema/t/dml_esgs_global_by_event_name.test
      mysql-test/suite/perfschema/t/dml_esms_by_account_by_event_name.test
      mysql-test/suite/perfschema/t/dml_esms_by_host_by_event_name.test
      mysql-test/suite/perfschema/t/dml_esms_by_thread_by_event_name.test
      mysql-test/suite/perfschema/t/dml_esms_by_user_by_event_name.test
      mysql-test/suite/perfschema/t/dml_esms_global_by_event_name.test
      mysql-test/suite/perfschema/t/dml_events_stages_current.test
      mysql-test/suite/perfschema/t/dml_events_stages_history.test
      mysql-test/suite/perfschema/t/dml_events_stages_history_long.test
      mysql-test/suite/perfschema/t/dml_events_statements_current.test
      mysql-test/suite/perfschema/t/dml_events_statements_history.test
      mysql-test/suite/perfschema/t/dml_events_statements_history_long.test
      mysql-test/suite/perfschema/t/dml_events_waits_current.test
      mysql-test/suite/perfschema/t/dml_events_waits_history.test
      mysql-test/suite/perfschema/t/dml_events_waits_history_long.test
      mysql-test/suite/perfschema/t/dml_ews_by_account_by_event_name.test
      mysql-test/suite/perfschema/t/dml_ews_by_host_by_event_name.test
      mysql-test/suite/perfschema/t/dml_ews_by_instance.test
      mysql-test/suite/perfschema/t/dml_ews_by_thread_by_event_name.test
      mysql-test/suite/perfschema/t/dml_ews_by_user_by_event_name.test
      mysql-test/suite/perfschema/t/dml_ews_global_by_event_name.test
      mysql-test/suite/perfschema/t/dml_file_instances.test
      mysql-test/suite/perfschema/t/dml_fs_by_event_name.test
      mysql-test/suite/perfschema/t/dml_fs_by_instance.test
      mysql-test/suite/perfschema/t/dml_handler.test
      mysql-test/suite/perfschema/t/dml_hosts.test
      mysql-test/suite/perfschema/t/dml_mutex_instances.test
      mysql-test/suite/perfschema/t/dml_os_global_by_type.test
      mysql-test/suite/perfschema/t/dml_performance_timers.test
      mysql-test/suite/perfschema/t/dml_rwlock_instances.test
      mysql-test/suite/perfschema/t/dml_setup_actors.test
      mysql-test/suite/perfschema/t/dml_setup_consumers.test
      mysql-test/suite/perfschema/t/dml_setup_instruments.test
      mysql-test/suite/perfschema/t/dml_setup_objects.test
      mysql-test/suite/perfschema/t/dml_setup_timers.test
      mysql-test/suite/perfschema/t/dml_socket_instances.test
      mysql-test/suite/perfschema/t/dml_socket_summary_by_event_name.test
      mysql-test/suite/perfschema/t/dml_socket_summary_by_instance.test
      mysql-test/suite/perfschema/t/dml_threads.test
      mysql-test/suite/perfschema/t/dml_tiws_by_index_usage.test
      mysql-test/suite/perfschema/t/dml_tiws_by_table.test
      mysql-test/suite/perfschema/t/dml_tlws_by_table.test
      mysql-test/suite/perfschema/t/dml_users.test
      mysql-test/suite/perfschema/t/event_aggregate.test
      mysql-test/suite/perfschema/t/event_aggregate_no_a.test
      mysql-test/suite/perfschema/t/event_aggregate_no_a_no_h.test
      mysql-test/suite/perfschema/t/event_aggregate_no_a_no_u.test
      mysql-test/suite/perfschema/t/event_aggregate_no_a_no_u_no_h.test
      mysql-test/suite/perfschema/t/event_aggregate_no_h.test
      mysql-test/suite/perfschema/t/event_aggregate_no_u.test
      mysql-test/suite/perfschema/t/event_aggregate_no_u_no_h.test
      mysql-test/suite/perfschema/t/func_file_io.test
      mysql-test/suite/perfschema/t/func_mutex.test
      mysql-test/suite/perfschema/t/global_read_lock.test
      mysql-test/suite/perfschema/t/indexed_table_io.test
      mysql-test/suite/perfschema/t/information_schema.test
      mysql-test/suite/perfschema/t/innodb_table_io.test
      mysql-test/suite/perfschema/t/memory_table_io.test
      mysql-test/suite/perfschema/t/merge_table_io.test
      mysql-test/suite/perfschema/t/misc.test
      mysql-test/suite/perfschema/t/multi_table_io.test
      mysql-test/suite/perfschema/t/myisam_file_io.test
      mysql-test/suite/perfschema/t/myisam_table_io.test
      mysql-test/suite/perfschema/t/no_threads.test
      mysql-test/suite/perfschema/t/one_thread_per_con.test
      mysql-test/suite/perfschema/t/ortho_iter.test
      mysql-test/suite/perfschema/t/part_table_io.test
      mysql-test/suite/perfschema/t/pfs_upgrade.test
      mysql-test/suite/perfschema/t/privilege.test
      mysql-test/suite/perfschema/t/privilege_table_io.test
      mysql-test/suite/perfschema/t/query_cache.test
      mysql-test/suite/perfschema/t/read_only.test
      mysql-test/suite/perfschema/t/relaylog.test
      mysql-test/suite/perfschema/t/rollback_table_io.test
      mysql-test/suite/perfschema/t/schema.test
      mysql-test/suite/perfschema/t/selects.test
      mysql-test/suite/perfschema/t/server_init.test
      mysql-test/suite/perfschema/t/setup_actors.test
      mysql-test/suite/perfschema/t/setup_objects.test
      mysql-test/suite/perfschema/t/short_option_1.test
      mysql-test/suite/perfschema/t/short_option_2.test
      mysql-test/suite/perfschema/t/socket_connect.test
      mysql-test/suite/perfschema/t/socket_instances_func.test
      mysql-test/suite/perfschema/t/socket_instances_func_win.test
      mysql-test/suite/perfschema/t/socket_summary_by_event_name_func.test
      mysql-test/suite/perfschema/t/socket_summary_by_instance_func.test
      mysql-test/suite/perfschema/t/socket_summary_by_instance_func_win.test
      mysql-test/suite/perfschema/t/stage_mdl_function.test
      mysql-test/suite/perfschema/t/stage_mdl_global.test
      mysql-test/suite/perfschema/t/stage_mdl_procedure.test
      mysql-test/suite/perfschema/t/stage_mdl_table.test
      mysql-test/suite/perfschema/t/start_server_innodb.test
      mysql-test/suite/perfschema/t/start_server_no_account.test
      mysql-test/suite/perfschema/t/start_server_no_cond_class.test
      mysql-test/suite/perfschema/t/start_server_no_cond_inst.test
      mysql-test/suite/perfschema/t/start_server_no_file_class.test
      mysql-test/suite/perfschema/t/start_server_no_file_inst.test
      mysql-test/suite/perfschema/t/start_server_no_host.test
      mysql-test/suite/perfschema/t/start_server_no_mutex_class.test
      mysql-test/suite/perfschema/t/start_server_no_mutex_inst.test
      mysql-test/suite/perfschema/t/start_server_no_rwlock_class.test
      mysql-test/suite/perfschema/t/start_server_no_rwlock_inst.test
      mysql-test/suite/perfschema/t/start_server_no_setup_actors.test
      mysql-test/suite/perfschema/t/start_server_no_setup_objects.test
      mysql-test/suite/perfschema/t/start_server_no_socket_class.test
      mysql-test/suite/perfschema/t/start_server_no_socket_inst.test
      mysql-test/suite/perfschema/t/start_server_no_stage_class.test
      mysql-test/suite/perfschema/t/start_server_no_stages_history.test
      mysql-test/suite/perfschema/t/start_server_no_stages_history_long.test
      mysql-test/suite/perfschema/t/start_server_no_statement_class.test
      mysql-test/suite/perfschema/t/start_server_no_statements_history.test
      mysql-test/suite/perfschema/t/start_server_no_statements_history_long.test
      mysql-test/suite/perfschema/t/start_server_no_table_hdl.test
      mysql-test/suite/perfschema/t/start_server_no_table_inst.test
      mysql-test/suite/perfschema/t/start_server_no_thread_class.test
      mysql-test/suite/perfschema/t/start_server_no_thread_inst.test
      mysql-test/suite/perfschema/t/start_server_no_user.test
      mysql-test/suite/perfschema/t/start_server_no_waits_history.test
      mysql-test/suite/perfschema/t/start_server_no_waits_history_long.test
      mysql-test/suite/perfschema/t/start_server_nothing.test
      mysql-test/suite/perfschema/t/start_server_off.test
      mysql-test/suite/perfschema/t/start_server_on.test
      mysql-test/suite/perfschema/t/table_aggregate_global_2u_2t.test
      mysql-test/suite/perfschema/t/table_aggregate_global_2u_3t.test
      mysql-test/suite/perfschema/t/table_aggregate_global_4u_2t.test
      mysql-test/suite/perfschema/t/table_aggregate_global_4u_3t.test
      mysql-test/suite/perfschema/t/table_aggregate_hist_2u_2t.test
      mysql-test/suite/perfschema/t/table_aggregate_hist_2u_3t.test
      mysql-test/suite/perfschema/t/table_aggregate_hist_4u_2t.test
      mysql-test/suite/perfschema/t/table_aggregate_hist_4u_3t.test
      mysql-test/suite/perfschema/t/table_aggregate_off.test
      mysql-test/suite/perfschema/t/table_aggregate_thread_2u_2t.test
      mysql-test/suite/perfschema/t/table_aggregate_thread_2u_3t.test
      mysql-test/suite/perfschema/t/table_aggregate_thread_4u_2t.test
      mysql-test/suite/perfschema/t/table_aggregate_thread_4u_3t.test
      mysql-test/suite/perfschema/t/table_io_aggregate_global_2u_2t.test
      mysql-test/suite/perfschema/t/table_io_aggregate_global_2u_3t.test
      mysql-test/suite/perfschema/t/table_io_aggregate_global_4u_2t.test
      mysql-test/suite/perfschema/t/table_io_aggregate_global_4u_3t.test
      mysql-test/suite/perfschema/t/table_io_aggregate_hist_2u_2t.test
      mysql-test/suite/perfschema/t/table_io_aggregate_hist_2u_3t.test
      mysql-test/suite/perfschema/t/table_io_aggregate_hist_4u_2t.test
      mysql-test/suite/perfschema/t/table_io_aggregate_hist_4u_3t.test
      mysql-test/suite/perfschema/t/table_io_aggregate_thread_2u_2t.test
      mysql-test/suite/perfschema/t/table_io_aggregate_thread_2u_3t.test
      mysql-test/suite/perfschema/t/table_io_aggregate_thread_4u_2t.test
      mysql-test/suite/perfschema/t/table_io_aggregate_thread_4u_3t.test
      mysql-test/suite/perfschema/t/table_lock_aggregate_global_2u_2t.test
      mysql-test/suite/perfschema/t/table_lock_aggregate_global_2u_3t.test
      mysql-test/suite/perfschema/t/table_lock_aggregate_global_4u_2t.test
      mysql-test/suite/perfschema/t/table_lock_aggregate_global_4u_3t.test
      mysql-test/suite/perfschema/t/table_lock_aggregate_hist_2u_2t.test
      mysql-test/suite/perfschema/t/table_lock_aggregate_hist_2u_3t.test
      mysql-test/suite/perfschema/t/table_lock_aggregate_hist_4u_2t.test
      mysql-test/suite/perfschema/t/table_lock_aggregate_hist_4u_3t.test
      mysql-test/suite/perfschema/t/table_lock_aggregate_thread_2u_2t.test
      mysql-test/suite/perfschema/t/table_lock_aggregate_thread_2u_3t.test
      mysql-test/suite/perfschema/t/table_lock_aggregate_thread_4u_2t.test
      mysql-test/suite/perfschema/t/table_lock_aggregate_thread_4u_3t.test
      mysql-test/suite/perfschema/t/table_schema.test
      mysql-test/suite/perfschema/t/tampered_perfschema_table1.test
      mysql-test/suite/perfschema/t/temp_table_io.test
      mysql-test/suite/perfschema/t/thread_cache.test
      mysql-test/suite/perfschema/t/threads_innodb.test
      mysql-test/suite/perfschema/t/threads_insert_delayed.test
      mysql-test/suite/perfschema/t/threads_mysql.test
      mysql-test/suite/perfschema/t/trigger_table_io.test
      mysql-test/suite/perfschema/t/view_table_io.test
      mysql-test/suite/perfschema_stress/README
      mysql-test/suite/perfschema_stress/include/settings.inc
      mysql-test/suite/perfschema_stress/t/modify.test
      mysql-test/suite/perfschema_stress/t/read.test
      mysql-test/suite/perfschema_stress/t/setup.test
      mysql-test/suite/perfschema_stress/t/work.test
      mysql-test/suite/rpl/r/rpl_loaddata.result
      mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result
      mysql-test/suite/rpl/r/rpl_packet.result
      mysql-test/suite/rpl/r/rpl_parallel_ddl.result
      mysql-test/suite/rpl/r/rpl_parallel_start_stop.result
      mysql-test/suite/rpl/r/rpl_row_binlog_max_cache_size.result
      mysql-test/suite/rpl/r/rpl_stm_EE_err2.result
      mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result
      mysql-test/suite/rpl/r/rpl_stm_loaddata_concurrent.result
      mysql-test/suite/rpl/r/rpl_stm_user_variables.result
      mysql-test/suite/rpl/t/rpl_ip_mix.test
      mysql-test/suite/rpl/t/rpl_ip_mix2.test
      mysql-test/suite/rpl/t/rpl_ipv4_as_ipv6.test
      mysql-test/suite/rpl/t/rpl_ipv6.test
      mysql-test/suite/rpl/t/rpl_parallel_ddl.test
      mysql-test/suite/rpl/t/rpl_parallel_start_stop.test
      mysql-test/suite/rpl/t/rpl_rotate_logs.test
      mysql-test/suite/rpl/t/rpl_stm_user_variables.test
      mysql-test/suite/sys_vars/r/innodb_monitor_disable_basic.result
      mysql-test/suite/sys_vars/r/innodb_monitor_enable_basic.result
      mysql-test/suite/sys_vars/r/innodb_monitor_reset_all_basic.result
      mysql-test/suite/sys_vars/r/innodb_monitor_reset_basic.result
      mysql-test/suite/sys_vars/r/max_allowed_packet_basic.result
      mysql-test/suite/sys_vars/r/max_allowed_packet_func.result
      mysql-test/suite/sys_vars/r/max_binlog_stmt_cache_size_basic.result
      mysql-test/suite/sys_vars/t/all_vars.test
      mysql-test/suite/sys_vars/t/innodb_monitor_disable_basic.test
      mysql-test/suite/sys_vars/t/innodb_monitor_enable_basic.test
      mysql-test/suite/sys_vars/t/innodb_monitor_reset_all_basic.test
      mysql-test/suite/sys_vars/t/innodb_monitor_reset_basic.test
      mysql-test/suite/sys_vars/t/performance_schema_basic.test
      mysql-test/suite/sys_vars/t/pfs_accounts_size_basic.test
      mysql-test/suite/sys_vars/t/pfs_events_stages_history_long_size_basic.test
      mysql-test/suite/sys_vars/t/pfs_events_stages_history_size_basic.test
      mysql-test/suite/sys_vars/t/pfs_events_statements_history_long_size_basic.test
      mysql-test/suite/sys_vars/t/pfs_events_statements_history_size_basic.test
      mysql-test/suite/sys_vars/t/pfs_events_waits_history_long_size_basic.test
      mysql-test/suite/sys_vars/t/pfs_events_waits_history_size_basic.test
      mysql-test/suite/sys_vars/t/pfs_hosts_size_basic.test
      mysql-test/suite/sys_vars/t/pfs_max_cond_classes_basic.test
      mysql-test/suite/sys_vars/t/pfs_max_cond_instances_basic.test
      mysql-test/suite/sys_vars/t/pfs_max_file_classes_basic.test
      mysql-test/suite/sys_vars/t/pfs_max_file_handles_basic.test
      mysql-test/suite/sys_vars/t/pfs_max_file_instances_basic.test
      mysql-test/suite/sys_vars/t/pfs_max_mutex_classes_basic.test
      mysql-test/suite/sys_vars/t/pfs_max_mutex_instances_basic.test
      mysql-test/suite/sys_vars/t/pfs_max_rwlock_classes_basic.test
      mysql-test/suite/sys_vars/t/pfs_max_rwlock_instances_basic.test
      mysql-test/suite/sys_vars/t/pfs_max_socket_classes_basic.test
      mysql-test/suite/sys_vars/t/pfs_max_socket_instances_basic.test
      mysql-test/suite/sys_vars/t/pfs_max_stage_classes_basic.test
      mysql-test/suite/sys_vars/t/pfs_max_statement_classes_basic.test
      mysql-test/suite/sys_vars/t/pfs_max_table_handles_basic.test
      mysql-test/suite/sys_vars/t/pfs_max_table_instances_basic.test
      mysql-test/suite/sys_vars/t/pfs_max_thread_classes_basic.test
      mysql-test/suite/sys_vars/t/pfs_max_thread_instances_basic.test
      mysql-test/suite/sys_vars/t/pfs_setup_actors_size_basic.test
      mysql-test/suite/sys_vars/t/pfs_setup_objects_size_basic.test
      mysql-test/suite/sys_vars/t/pfs_users_size_basic.test
      mysql-test/t/archive.test
      mysql-test/t/audit_plugin.test
      mysql-test/t/fulltext.test
      mysql-test/t/group_by.test
      mysql-test/t/handler_read_last.test
      mysql-test/t/ipv4_as_ipv6.test
      mysql-test/t/ipv6.test
      mysql-test/t/join_outer.test
      mysql-test/t/myisam.test
      mysql-test/t/mysql_plugin.test
      mysql-test/t/mysqld--help-notwin.test
      mysql-test/t/mysqld--help-win.test
      mysql-test/t/mysqltest.test
      mysql-test/t/parser_stack.test
      mysql-test/t/ps.test
      mysql-test/t/show_check.test
      mysql-test/t/signal.test
      mysql-test/t/signal_code.test
      mysql-test/t/signal_demo1.test
      mysql-test/t/signal_demo2.test
      mysql-test/t/signal_demo3.test
      mysql-test/t/signal_sqlmode.test
      mysql-test/t/sp-error.test
      mysql-test/t/sp-lock.test
      mysql-test/t/sp.test
      sql/CMakeLists.txt
      sql/filesort.cc
      sql/item.cc
      sql/item.h
      sql/item_cmpfunc.cc
      sql/item_create.cc
      sql/item_subselect.cc
      sql/item_xmlfunc.cc
      sql/lex.h
      sql/lock.cc
      sql/log_event.cc
      sql/mysqld.cc
      sql/opt_trace.h
      sql/rpl_info.h
      sql/rpl_info_dummy.cc
      sql/rpl_info_dummy.h
      sql/rpl_info_factory.cc
      sql/rpl_info_file.cc
      sql/rpl_info_file.h
      sql/rpl_info_handler.h
      sql/rpl_info_table.cc
      sql/rpl_info_table.h
      sql/rpl_info_table_access.cc
      sql/rpl_master.cc
      sql/rpl_mi.cc
      sql/rpl_rli.cc
      sql/rpl_rli.h
      sql/rpl_rli_pdb.cc
      sql/rpl_slave.cc
      sql/share/errmsg-utf8.txt
      sql/sp_head.cc
      sql/sp_head.h
      sql/sp_pcontext.cc
      sql/sp_pcontext.h
      sql/sp_rcontext.cc
      sql/sp_rcontext.h
      sql/sql_array.h
      sql/sql_base.cc
      sql/sql_class.cc
      sql/sql_class.h
      sql/sql_cmd.h
      sql/sql_error.cc
      sql/sql_error.h
      sql/sql_lex.cc
      sql/sql_lex.h
      sql/sql_parse.cc
      sql/sql_parse.h
      sql/sql_select.cc
      sql/sql_signal.cc
      sql/sql_yacc.yy
      sql/table.cc
      sql/table.h
      storage/archive/ha_archive.cc
      storage/innobase/btr/btr0cur.c
      storage/innobase/buf/buf0buf.c
      storage/innobase/dict/dict0boot.c
      storage/innobase/dict/dict0crea.c
      storage/innobase/dict/dict0load.c
      storage/innobase/dict/dict0mem.c
      storage/innobase/fil/fil0fil.c
      storage/innobase/fsp/fsp0fsp.c
      storage/innobase/handler/ha_innodb.cc
      storage/innobase/handler/i_s.cc
      storage/innobase/ibuf/ibuf0ibuf.c
      storage/innobase/include/db0err.h
      storage/innobase/include/dict0dict.h
      storage/innobase/include/dict0dict.ic
      storage/innobase/include/dict0mem.h
      storage/innobase/include/fsp0fsp.h
      storage/innobase/include/fsp0fsp.ic
      storage/innobase/include/page0types.h
      storage/innobase/include/page0zip.ic
      storage/innobase/include/rem0types.h
      storage/innobase/include/univ.i
      storage/innobase/page/page0zip.c
      storage/innobase/row/row0ext.c
      storage/innobase/row/row0mysql.c
      storage/innobase/row/row0sel.c
      storage/myisam/ha_myisam.cc
      storage/myisam/mi_delete_all.c
      storage/perfschema/pfs_instr.cc
      storage/perfschema/pfs_instr_class.cc
      storage/perfschema/pfs_instr_class.h
      storage/perfschema/table_setup_instruments.cc
      support-files/mysql.spec.sh
      unittest/gunit/CMakeLists.txt
      unittest/gunit/bounds_checked_array-t.cc
      cmd-line-utils/libedit/el_terminal.h
      cmd-line-utils/libedit/keymacro.c
      cmd-line-utils/libedit/keymacro.h
      cmd-line-utils/libedit/terminal.c
=== modified file 'mysql-test/r/compare.result'
--- a/mysql-test/r/compare.result	2011-07-19 15:11:15 +0000
+++ b/mysql-test/r/compare.result	2011-10-27 07:03:49 +0000
@@ -96,3 +96,7 @@ SELECT * FROM t1 WHERE a > '2008-01-01'
 a
 DROP TABLE t1;
 End of 5.0 tests
+CREATE TABLE t1(a INT ZEROFILL);
+SELECT 1 FROM t1 WHERE t1.a IN (1, t1.a) AND t1.a=2;
+1
+DROP TABLE t1;

=== modified file 'mysql-test/r/index_merge_innodb.result'
--- a/mysql-test/r/index_merge_innodb.result	2010-12-02 13:11:15 +0000
+++ b/mysql-test/r/index_merge_innodb.result	2011-10-27 08:40:40 +0000
@@ -273,3 +273,21 @@ id	select_type	table	type	possible_keys
 1	PRIMARY	t1	const	PRIMARY	PRIMARY	4	const	1	Using index
 2	DEPENDENT SUBQUERY	t2	index_merge	f2,f3	f3,f2	2,5	NULL	1	Using intersect(f3,f2); Using where; Using index
 DROP TABLE t1,t2;
+#
+# Bug#11747423 32254: INDEX MERGE USED UNNECESSARILY
+#
+CREATE TABLE t1 (
+id INT NOT NULL PRIMARY KEY,
+id2 INT NOT NULL,
+id3 INT NOT NULL,
+KEY (id2),
+KEY (id3),
+KEY covering_index (id2,id3)
+) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (0, 0, 0), (1, 1, 1), (2, 2, 2), (3, 3, 3), (4, 4, 4), (5, 5, 5), (6, 6, 6), (7, 7, 7);
+INSERT INTO t1 SELECT id + 8, id2 + 8, id3 +8 FROM t1;
+INSERT INTO t1 SELECT id + 16, 7, 0 FROM t1;
+EXPLAIN SELECT SQL_NO_CACHE count(*) FROM t1 WHERE id2=7 AND id3=0;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ref	id2,id3,covering_index	covering_index	8	const,const	16	Using index
+DROP TABLE t1;

=== modified file 'mysql-test/r/plugin.result'
--- a/mysql-test/r/plugin.result	2009-12-22 11:02:52 +0000
+++ b/mysql-test/r/plugin.result	2011-10-27 08:43:56 +0000
@@ -10,7 +10,7 @@ UNINSTALL PLUGIN example;
 INSTALL PLUGIN example SONAME 'ha_example.so';
 CREATE TABLE t1(a int) ENGINE=EXAMPLE;
 SELECT * FROM t1;
-a
+ERROR HY000: Table storage engine for 't1' doesn't have this option
 DROP TABLE t1;
 set global example_ulong_var=500;
 set global example_enum_var= e1;

=== modified file 'mysql-test/r/sp-error.result'
--- a/mysql-test/r/sp-error.result	2011-10-14 15:04:41 +0000
+++ b/mysql-test/r/sp-error.result	2011-10-27 09:26:31 +0000
@@ -2820,3 +2820,29 @@ H2
 
 DROP PROCEDURE p1;
 DROP PROCEDURE p2;
+#
+# Bug#13113222 RQG_SIGNAL_RESIGNAL FAILED WITH ASSERTION.
+#
+DROP PROCEDURE IF EXISTS p1;
+DROP PROCEDURE IF EXISTS p2;
+CREATE PROCEDURE p1()
+BEGIN
+DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SELECT 'triggered p1';
+# This will trigger an error.
+SIGNAL SQLSTATE 'HY000';
+END|
+CREATE PROCEDURE p2()
+BEGIN
+DECLARE CONTINUE HANDLER FOR SQLWARNING SELECT 'triggered p2';
+# This will trigger a warning.
+SIGNAL SQLSTATE '01000';
+END|
+SET @old_max_error_count=  @@session.max_error_count;
+SET SESSION max_error_count= 0;
+CALL p1();
+triggered p1
+triggered p1
+CALL p2();
+SET SESSION max_error_count= @old_max_error_count;
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;

=== modified file 'mysql-test/r/user_var.result'
--- a/mysql-test/r/user_var.result	2011-03-08 19:14:42 +0000
+++ b/mysql-test/r/user_var.result	2011-10-27 08:08:46 +0000
@@ -486,3 +486,10 @@ f1	f2
 DROP TRIGGER trg1;
 DROP TABLE t1;
 End of 5.5 tests
+CREATE TABLE t1(a int);
+INSERT INTO t1 VALUES (1), (2);
+SELECT DISTINCT @a:=MIN(t1.a) FROM t1, t1 AS t2
+GROUP BY @b:=(SELECT COUNT(*) > t2.a);
+@a:=MIN(t1.a)
+1
+DROP TABLE t1;

=== modified file 'mysql-test/suite/perfschema/r/func_file_io.result'
--- a/mysql-test/suite/perfschema/r/func_file_io.result	2011-02-14 14:23:55 +0000
+++ b/mysql-test/suite/perfschema/r/func_file_io.result	2011-08-26 08:42:40 +0000
@@ -67,17 +67,17 @@ SELECT * FROM performance_schema.events_
 WHERE TIMER_WAIT != NULL
 OR TIMER_START != NULL
 OR TIMER_END != NULL;
-THREAD_ID	EVENT_ID	EVENT_NAME	SOURCE	TIMER_START	TIMER_END	TIMER_WAIT	SPINS	OBJECT_SCHEMA	OBJECT_NAME	INDEX_NAME	OBJECT_TYPE	OBJECT_INSTANCE_BEGIN	NESTING_EVENT_ID	NESTING_EVENT_TYPE	OPERATION	NUMBER_OF_BYTES	FLAGS
+THREAD_ID	EVENT_ID	END_EVENT_ID	EVENT_NAME	SOURCE	TIMER_START	TIMER_END	TIMER_WAIT	SPINS	OBJECT_SCHEMA	OBJECT_NAME	INDEX_NAME	OBJECT_TYPE	OBJECT_INSTANCE_BEGIN	NESTING_EVENT_ID	NESTING_EVENT_TYPE	OPERATION	NUMBER_OF_BYTES	FLAGS
 SELECT * FROM performance_schema.events_waits_history
 WHERE TIMER_WAIT != NULL
 OR TIMER_START != NULL
 OR TIMER_END != NULL;
-THREAD_ID	EVENT_ID	EVENT_NAME	SOURCE	TIMER_START	TIMER_END	TIMER_WAIT	SPINS	OBJECT_SCHEMA	OBJECT_NAME	INDEX_NAME	OBJECT_TYPE	OBJECT_INSTANCE_BEGIN	NESTING_EVENT_ID	NESTING_EVENT_TYPE	OPERATION	NUMBER_OF_BYTES	FLAGS
+THREAD_ID	EVENT_ID	END_EVENT_ID	EVENT_NAME	SOURCE	TIMER_START	TIMER_END	TIMER_WAIT	SPINS	OBJECT_SCHEMA	OBJECT_NAME	INDEX_NAME	OBJECT_TYPE	OBJECT_INSTANCE_BEGIN	NESTING_EVENT_ID	NESTING_EVENT_TYPE	OPERATION	NUMBER_OF_BYTES	FLAGS
 SELECT * FROM performance_schema.events_waits_current
 WHERE TIMER_WAIT != NULL
 OR TIMER_START != NULL
 OR TIMER_END != NULL;
-THREAD_ID	EVENT_ID	EVENT_NAME	SOURCE	TIMER_START	TIMER_END	TIMER_WAIT	SPINS	OBJECT_SCHEMA	OBJECT_NAME	INDEX_NAME	OBJECT_TYPE	OBJECT_INSTANCE_BEGIN	NESTING_EVENT_ID	NESTING_EVENT_TYPE	OPERATION	NUMBER_OF_BYTES	FLAGS
+THREAD_ID	EVENT_ID	END_EVENT_ID	EVENT_NAME	SOURCE	TIMER_START	TIMER_END	TIMER_WAIT	SPINS	OBJECT_SCHEMA	OBJECT_NAME	INDEX_NAME	OBJECT_TYPE	OBJECT_INSTANCE_BEGIN	NESTING_EVENT_ID	NESTING_EVENT_TYPE	OPERATION	NUMBER_OF_BYTES	FLAGS
 UPDATE performance_schema.setup_instruments SET timed = 'YES';
 SELECT * FROM t1 WHERE id < 4;
 id	b

=== modified file 'mysql-test/suite/perfschema/r/pfs_upgrade.result'
--- a/mysql-test/suite/perfschema/r/pfs_upgrade.result	2011-09-21 12:47:15 +0000
+++ b/mysql-test/suite/perfschema/r/pfs_upgrade.result	2011-10-27 21:18:19 +0000
@@ -9,54 +9,54 @@ show tables like "user_table";
 Tables_in_performance_schema (user_table)
 user_table
 ERROR 1050 (42S01) at line 100: Table 'cond_instances' already exists
-ERROR 1050 (42S01) at line 124: Table 'events_waits_current' already exists
-ERROR 1050 (42S01) at line 148: Table 'events_waits_history' already exists
-ERROR 1050 (42S01) at line 172: Table 'events_waits_history_long' already exists
-ERROR 1050 (42S01) at line 185: Table 'events_waits_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 198: Table 'events_waits_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 211: Table 'events_waits_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 225: Table 'events_waits_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 238: Table 'events_waits_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 250: Table 'events_waits_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 259: Table 'file_instances' already exists
-ERROR 1050 (42S01) at line 288: Table 'file_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 319: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 332: Table 'socket_instances' already exists
-ERROR 1050 (42S01) at line 362: Table 'socket_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 391: Table 'socket_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 400: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line 414: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line 424: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 434: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 443: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line 451: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 460: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 471: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 479: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 524: Table 'table_io_waits_summary_by_index_usage' already exists
-ERROR 1050 (42S01) at line 568: Table 'table_io_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 647: Table 'table_lock_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 667: Table 'threads' already exists
-ERROR 1050 (42S01) at line 682: Table 'events_stages_current' already exists
-ERROR 1050 (42S01) at line 697: Table 'events_stages_history' already exists
-ERROR 1050 (42S01) at line 712: Table 'events_stages_history_long' already exists
-ERROR 1050 (42S01) at line 725: Table 'events_stages_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 738: Table 'events_stages_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 751: Table 'events_stages_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 765: Table 'events_stages_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 777: Table 'events_stages_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 820: Table 'events_statements_current' already exists
-ERROR 1050 (42S01) at line 863: Table 'events_statements_history' already exists
-ERROR 1050 (42S01) at line 906: Table 'events_statements_history_long' already exists
-ERROR 1050 (42S01) at line 938: Table 'events_statements_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 970: Table 'events_statements_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 1002: Table 'events_statements_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 1035: Table 'events_statements_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 1066: Table 'events_statements_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 1075: Table 'hosts' already exists
-ERROR 1050 (42S01) at line 1084: Table 'users' already exists
-ERROR 1050 (42S01) at line 1094: Table 'accounts' already exists
-ERROR 1644 (HY000) at line 1514: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 125: Table 'events_waits_current' already exists
+ERROR 1050 (42S01) at line 150: Table 'events_waits_history' already exists
+ERROR 1050 (42S01) at line 175: Table 'events_waits_history_long' already exists
+ERROR 1050 (42S01) at line 188: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 201: Table 'events_waits_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 214: Table 'events_waits_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 228: Table 'events_waits_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 241: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 253: Table 'events_waits_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 262: Table 'file_instances' already exists
+ERROR 1050 (42S01) at line 291: Table 'file_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 322: Table 'file_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 335: Table 'socket_instances' already exists
+ERROR 1050 (42S01) at line 365: Table 'socket_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 394: Table 'socket_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 403: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 417: Table 'objects_summary_global_by_type' already exists
+ERROR 1050 (42S01) at line 427: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 437: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 446: Table 'setup_actors' already exists
+ERROR 1050 (42S01) at line 454: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 463: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 474: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 482: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 527: Table 'table_io_waits_summary_by_index_usage' already exists
+ERROR 1050 (42S01) at line 571: Table 'table_io_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 650: Table 'table_lock_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 670: Table 'threads' already exists
+ERROR 1050 (42S01) at line 686: Table 'events_stages_current' already exists
+ERROR 1050 (42S01) at line 702: Table 'events_stages_history' already exists
+ERROR 1050 (42S01) at line 718: Table 'events_stages_history_long' already exists
+ERROR 1050 (42S01) at line 731: Table 'events_stages_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 744: Table 'events_stages_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 757: Table 'events_stages_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 771: Table 'events_stages_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 783: Table 'events_stages_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 827: Table 'events_statements_current' already exists
+ERROR 1050 (42S01) at line 871: Table 'events_statements_history' already exists
+ERROR 1050 (42S01) at line 915: Table 'events_statements_history_long' already exists
+ERROR 1050 (42S01) at line 947: Table 'events_statements_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 979: Table 'events_statements_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 1011: Table 'events_statements_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 1044: Table 'events_statements_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 1075: Table 'events_statements_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 1084: Table 'hosts' already exists
+ERROR 1050 (42S01) at line 1093: Table 'users' already exists
+ERROR 1050 (42S01) at line 1103: Table 'accounts' already exists
+ERROR 1644 (HY000) at line 1523: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 show tables like "user_table";
 Tables_in_performance_schema (user_table)
@@ -70,54 +70,54 @@ show tables like "user_view";
 Tables_in_performance_schema (user_view)
 user_view
 ERROR 1050 (42S01) at line 100: Table 'cond_instances' already exists
-ERROR 1050 (42S01) at line 124: Table 'events_waits_current' already exists
-ERROR 1050 (42S01) at line 148: Table 'events_waits_history' already exists
-ERROR 1050 (42S01) at line 172: Table 'events_waits_history_long' already exists
-ERROR 1050 (42S01) at line 185: Table 'events_waits_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 198: Table 'events_waits_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 211: Table 'events_waits_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 225: Table 'events_waits_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 238: Table 'events_waits_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 250: Table 'events_waits_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 259: Table 'file_instances' already exists
-ERROR 1050 (42S01) at line 288: Table 'file_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 319: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 332: Table 'socket_instances' already exists
-ERROR 1050 (42S01) at line 362: Table 'socket_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 391: Table 'socket_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 400: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line 414: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line 424: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 434: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 443: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line 451: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 460: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 471: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 479: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 524: Table 'table_io_waits_summary_by_index_usage' already exists
-ERROR 1050 (42S01) at line 568: Table 'table_io_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 647: Table 'table_lock_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 667: Table 'threads' already exists
-ERROR 1050 (42S01) at line 682: Table 'events_stages_current' already exists
-ERROR 1050 (42S01) at line 697: Table 'events_stages_history' already exists
-ERROR 1050 (42S01) at line 712: Table 'events_stages_history_long' already exists
-ERROR 1050 (42S01) at line 725: Table 'events_stages_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 738: Table 'events_stages_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 751: Table 'events_stages_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 765: Table 'events_stages_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 777: Table 'events_stages_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 820: Table 'events_statements_current' already exists
-ERROR 1050 (42S01) at line 863: Table 'events_statements_history' already exists
-ERROR 1050 (42S01) at line 906: Table 'events_statements_history_long' already exists
-ERROR 1050 (42S01) at line 938: Table 'events_statements_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 970: Table 'events_statements_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 1002: Table 'events_statements_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 1035: Table 'events_statements_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 1066: Table 'events_statements_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 1075: Table 'hosts' already exists
-ERROR 1050 (42S01) at line 1084: Table 'users' already exists
-ERROR 1050 (42S01) at line 1094: Table 'accounts' already exists
-ERROR 1644 (HY000) at line 1514: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 125: Table 'events_waits_current' already exists
+ERROR 1050 (42S01) at line 150: Table 'events_waits_history' already exists
+ERROR 1050 (42S01) at line 175: Table 'events_waits_history_long' already exists
+ERROR 1050 (42S01) at line 188: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 201: Table 'events_waits_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 214: Table 'events_waits_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 228: Table 'events_waits_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 241: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 253: Table 'events_waits_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 262: Table 'file_instances' already exists
+ERROR 1050 (42S01) at line 291: Table 'file_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 322: Table 'file_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 335: Table 'socket_instances' already exists
+ERROR 1050 (42S01) at line 365: Table 'socket_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 394: Table 'socket_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 403: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 417: Table 'objects_summary_global_by_type' already exists
+ERROR 1050 (42S01) at line 427: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 437: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 446: Table 'setup_actors' already exists
+ERROR 1050 (42S01) at line 454: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 463: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 474: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 482: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 527: Table 'table_io_waits_summary_by_index_usage' already exists
+ERROR 1050 (42S01) at line 571: Table 'table_io_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 650: Table 'table_lock_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 670: Table 'threads' already exists
+ERROR 1050 (42S01) at line 686: Table 'events_stages_current' already exists
+ERROR 1050 (42S01) at line 702: Table 'events_stages_history' already exists
+ERROR 1050 (42S01) at line 718: Table 'events_stages_history_long' already exists
+ERROR 1050 (42S01) at line 731: Table 'events_stages_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 744: Table 'events_stages_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 757: Table 'events_stages_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 771: Table 'events_stages_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 783: Table 'events_stages_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 827: Table 'events_statements_current' already exists
+ERROR 1050 (42S01) at line 871: Table 'events_statements_history' already exists
+ERROR 1050 (42S01) at line 915: Table 'events_statements_history_long' already exists
+ERROR 1050 (42S01) at line 947: Table 'events_statements_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 979: Table 'events_statements_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 1011: Table 'events_statements_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 1044: Table 'events_statements_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 1075: Table 'events_statements_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 1084: Table 'hosts' already exists
+ERROR 1050 (42S01) at line 1093: Table 'users' already exists
+ERROR 1050 (42S01) at line 1103: Table 'accounts' already exists
+ERROR 1644 (HY000) at line 1523: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 show tables like "user_view";
 Tables_in_performance_schema (user_view)
@@ -129,54 +129,54 @@ create procedure test.user_proc()
 select "Not supposed to be here";
 update mysql.proc set db='performance_schema' where name='user_proc';
 ERROR 1050 (42S01) at line 100: Table 'cond_instances' already exists
-ERROR 1050 (42S01) at line 124: Table 'events_waits_current' already exists
-ERROR 1050 (42S01) at line 148: Table 'events_waits_history' already exists
-ERROR 1050 (42S01) at line 172: Table 'events_waits_history_long' already exists
-ERROR 1050 (42S01) at line 185: Table 'events_waits_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 198: Table 'events_waits_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 211: Table 'events_waits_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 225: Table 'events_waits_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 238: Table 'events_waits_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 250: Table 'events_waits_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 259: Table 'file_instances' already exists
-ERROR 1050 (42S01) at line 288: Table 'file_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 319: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 332: Table 'socket_instances' already exists
-ERROR 1050 (42S01) at line 362: Table 'socket_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 391: Table 'socket_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 400: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line 414: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line 424: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 434: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 443: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line 451: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 460: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 471: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 479: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 524: Table 'table_io_waits_summary_by_index_usage' already exists
-ERROR 1050 (42S01) at line 568: Table 'table_io_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 647: Table 'table_lock_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 667: Table 'threads' already exists
-ERROR 1050 (42S01) at line 682: Table 'events_stages_current' already exists
-ERROR 1050 (42S01) at line 697: Table 'events_stages_history' already exists
-ERROR 1050 (42S01) at line 712: Table 'events_stages_history_long' already exists
-ERROR 1050 (42S01) at line 725: Table 'events_stages_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 738: Table 'events_stages_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 751: Table 'events_stages_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 765: Table 'events_stages_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 777: Table 'events_stages_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 820: Table 'events_statements_current' already exists
-ERROR 1050 (42S01) at line 863: Table 'events_statements_history' already exists
-ERROR 1050 (42S01) at line 906: Table 'events_statements_history_long' already exists
-ERROR 1050 (42S01) at line 938: Table 'events_statements_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 970: Table 'events_statements_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 1002: Table 'events_statements_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 1035: Table 'events_statements_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 1066: Table 'events_statements_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 1075: Table 'hosts' already exists
-ERROR 1050 (42S01) at line 1084: Table 'users' already exists
-ERROR 1050 (42S01) at line 1094: Table 'accounts' already exists
-ERROR 1644 (HY000) at line 1514: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 125: Table 'events_waits_current' already exists
+ERROR 1050 (42S01) at line 150: Table 'events_waits_history' already exists
+ERROR 1050 (42S01) at line 175: Table 'events_waits_history_long' already exists
+ERROR 1050 (42S01) at line 188: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 201: Table 'events_waits_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 214: Table 'events_waits_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 228: Table 'events_waits_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 241: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 253: Table 'events_waits_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 262: Table 'file_instances' already exists
+ERROR 1050 (42S01) at line 291: Table 'file_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 322: Table 'file_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 335: Table 'socket_instances' already exists
+ERROR 1050 (42S01) at line 365: Table 'socket_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 394: Table 'socket_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 403: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 417: Table 'objects_summary_global_by_type' already exists
+ERROR 1050 (42S01) at line 427: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 437: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 446: Table 'setup_actors' already exists
+ERROR 1050 (42S01) at line 454: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 463: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 474: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 482: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 527: Table 'table_io_waits_summary_by_index_usage' already exists
+ERROR 1050 (42S01) at line 571: Table 'table_io_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 650: Table 'table_lock_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 670: Table 'threads' already exists
+ERROR 1050 (42S01) at line 686: Table 'events_stages_current' already exists
+ERROR 1050 (42S01) at line 702: Table 'events_stages_history' already exists
+ERROR 1050 (42S01) at line 718: Table 'events_stages_history_long' already exists
+ERROR 1050 (42S01) at line 731: Table 'events_stages_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 744: Table 'events_stages_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 757: Table 'events_stages_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 771: Table 'events_stages_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 783: Table 'events_stages_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 827: Table 'events_statements_current' already exists
+ERROR 1050 (42S01) at line 871: Table 'events_statements_history' already exists
+ERROR 1050 (42S01) at line 915: Table 'events_statements_history_long' already exists
+ERROR 1050 (42S01) at line 947: Table 'events_statements_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 979: Table 'events_statements_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 1011: Table 'events_statements_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 1044: Table 'events_statements_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 1075: Table 'events_statements_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 1084: Table 'hosts' already exists
+ERROR 1050 (42S01) at line 1093: Table 'users' already exists
+ERROR 1050 (42S01) at line 1103: Table 'accounts' already exists
+ERROR 1644 (HY000) at line 1523: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 select name from mysql.proc where db='performance_schema';
 name
@@ -188,54 +188,54 @@ create function test.user_func() returns
 return 0;
 update mysql.proc set db='performance_schema' where name='user_func';
 ERROR 1050 (42S01) at line 100: Table 'cond_instances' already exists
-ERROR 1050 (42S01) at line 124: Table 'events_waits_current' already exists
-ERROR 1050 (42S01) at line 148: Table 'events_waits_history' already exists
-ERROR 1050 (42S01) at line 172: Table 'events_waits_history_long' already exists
-ERROR 1050 (42S01) at line 185: Table 'events_waits_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 198: Table 'events_waits_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 211: Table 'events_waits_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 225: Table 'events_waits_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 238: Table 'events_waits_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 250: Table 'events_waits_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 259: Table 'file_instances' already exists
-ERROR 1050 (42S01) at line 288: Table 'file_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 319: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 332: Table 'socket_instances' already exists
-ERROR 1050 (42S01) at line 362: Table 'socket_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 391: Table 'socket_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 400: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line 414: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line 424: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 434: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 443: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line 451: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 460: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 471: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 479: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 524: Table 'table_io_waits_summary_by_index_usage' already exists
-ERROR 1050 (42S01) at line 568: Table 'table_io_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 647: Table 'table_lock_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 667: Table 'threads' already exists
-ERROR 1050 (42S01) at line 682: Table 'events_stages_current' already exists
-ERROR 1050 (42S01) at line 697: Table 'events_stages_history' already exists
-ERROR 1050 (42S01) at line 712: Table 'events_stages_history_long' already exists
-ERROR 1050 (42S01) at line 725: Table 'events_stages_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 738: Table 'events_stages_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 751: Table 'events_stages_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 765: Table 'events_stages_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 777: Table 'events_stages_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 820: Table 'events_statements_current' already exists
-ERROR 1050 (42S01) at line 863: Table 'events_statements_history' already exists
-ERROR 1050 (42S01) at line 906: Table 'events_statements_history_long' already exists
-ERROR 1050 (42S01) at line 938: Table 'events_statements_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 970: Table 'events_statements_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 1002: Table 'events_statements_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 1035: Table 'events_statements_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 1066: Table 'events_statements_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 1075: Table 'hosts' already exists
-ERROR 1050 (42S01) at line 1084: Table 'users' already exists
-ERROR 1050 (42S01) at line 1094: Table 'accounts' already exists
-ERROR 1644 (HY000) at line 1514: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 125: Table 'events_waits_current' already exists
+ERROR 1050 (42S01) at line 150: Table 'events_waits_history' already exists
+ERROR 1050 (42S01) at line 175: Table 'events_waits_history_long' already exists
+ERROR 1050 (42S01) at line 188: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 201: Table 'events_waits_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 214: Table 'events_waits_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 228: Table 'events_waits_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 241: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 253: Table 'events_waits_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 262: Table 'file_instances' already exists
+ERROR 1050 (42S01) at line 291: Table 'file_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 322: Table 'file_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 335: Table 'socket_instances' already exists
+ERROR 1050 (42S01) at line 365: Table 'socket_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 394: Table 'socket_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 403: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 417: Table 'objects_summary_global_by_type' already exists
+ERROR 1050 (42S01) at line 427: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 437: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 446: Table 'setup_actors' already exists
+ERROR 1050 (42S01) at line 454: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 463: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 474: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 482: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 527: Table 'table_io_waits_summary_by_index_usage' already exists
+ERROR 1050 (42S01) at line 571: Table 'table_io_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 650: Table 'table_lock_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 670: Table 'threads' already exists
+ERROR 1050 (42S01) at line 686: Table 'events_stages_current' already exists
+ERROR 1050 (42S01) at line 702: Table 'events_stages_history' already exists
+ERROR 1050 (42S01) at line 718: Table 'events_stages_history_long' already exists
+ERROR 1050 (42S01) at line 731: Table 'events_stages_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 744: Table 'events_stages_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 757: Table 'events_stages_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 771: Table 'events_stages_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 783: Table 'events_stages_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 827: Table 'events_statements_current' already exists
+ERROR 1050 (42S01) at line 871: Table 'events_statements_history' already exists
+ERROR 1050 (42S01) at line 915: Table 'events_statements_history_long' already exists
+ERROR 1050 (42S01) at line 947: Table 'events_statements_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 979: Table 'events_statements_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 1011: Table 'events_statements_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 1044: Table 'events_statements_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 1075: Table 'events_statements_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 1084: Table 'hosts' already exists
+ERROR 1050 (42S01) at line 1093: Table 'users' already exists
+ERROR 1050 (42S01) at line 1103: Table 'accounts' already exists
+ERROR 1644 (HY000) at line 1523: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 select name from mysql.proc where db='performance_schema';
 name
@@ -247,54 +247,54 @@ create event test.user_event on schedule
 select "not supposed to be here";
 update mysql.event set db='performance_schema' where name='user_event';
 ERROR 1050 (42S01) at line 100: Table 'cond_instances' already exists
-ERROR 1050 (42S01) at line 124: Table 'events_waits_current' already exists
-ERROR 1050 (42S01) at line 148: Table 'events_waits_history' already exists
-ERROR 1050 (42S01) at line 172: Table 'events_waits_history_long' already exists
-ERROR 1050 (42S01) at line 185: Table 'events_waits_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 198: Table 'events_waits_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 211: Table 'events_waits_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 225: Table 'events_waits_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 238: Table 'events_waits_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 250: Table 'events_waits_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 259: Table 'file_instances' already exists
-ERROR 1050 (42S01) at line 288: Table 'file_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 319: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 332: Table 'socket_instances' already exists
-ERROR 1050 (42S01) at line 362: Table 'socket_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 391: Table 'socket_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 400: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line 414: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line 424: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 434: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 443: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line 451: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 460: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 471: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 479: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 524: Table 'table_io_waits_summary_by_index_usage' already exists
-ERROR 1050 (42S01) at line 568: Table 'table_io_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 647: Table 'table_lock_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 667: Table 'threads' already exists
-ERROR 1050 (42S01) at line 682: Table 'events_stages_current' already exists
-ERROR 1050 (42S01) at line 697: Table 'events_stages_history' already exists
-ERROR 1050 (42S01) at line 712: Table 'events_stages_history_long' already exists
-ERROR 1050 (42S01) at line 725: Table 'events_stages_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 738: Table 'events_stages_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 751: Table 'events_stages_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 765: Table 'events_stages_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 777: Table 'events_stages_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 820: Table 'events_statements_current' already exists
-ERROR 1050 (42S01) at line 863: Table 'events_statements_history' already exists
-ERROR 1050 (42S01) at line 906: Table 'events_statements_history_long' already exists
-ERROR 1050 (42S01) at line 938: Table 'events_statements_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 970: Table 'events_statements_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 1002: Table 'events_statements_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 1035: Table 'events_statements_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 1066: Table 'events_statements_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 1075: Table 'hosts' already exists
-ERROR 1050 (42S01) at line 1084: Table 'users' already exists
-ERROR 1050 (42S01) at line 1094: Table 'accounts' already exists
-ERROR 1644 (HY000) at line 1514: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 125: Table 'events_waits_current' already exists
+ERROR 1050 (42S01) at line 150: Table 'events_waits_history' already exists
+ERROR 1050 (42S01) at line 175: Table 'events_waits_history_long' already exists
+ERROR 1050 (42S01) at line 188: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 201: Table 'events_waits_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 214: Table 'events_waits_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 228: Table 'events_waits_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 241: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 253: Table 'events_waits_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 262: Table 'file_instances' already exists
+ERROR 1050 (42S01) at line 291: Table 'file_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 322: Table 'file_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 335: Table 'socket_instances' already exists
+ERROR 1050 (42S01) at line 365: Table 'socket_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 394: Table 'socket_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 403: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 417: Table 'objects_summary_global_by_type' already exists
+ERROR 1050 (42S01) at line 427: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 437: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 446: Table 'setup_actors' already exists
+ERROR 1050 (42S01) at line 454: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 463: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 474: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 482: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 527: Table 'table_io_waits_summary_by_index_usage' already exists
+ERROR 1050 (42S01) at line 571: Table 'table_io_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 650: Table 'table_lock_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 670: Table 'threads' already exists
+ERROR 1050 (42S01) at line 686: Table 'events_stages_current' already exists
+ERROR 1050 (42S01) at line 702: Table 'events_stages_history' already exists
+ERROR 1050 (42S01) at line 718: Table 'events_stages_history_long' already exists
+ERROR 1050 (42S01) at line 731: Table 'events_stages_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 744: Table 'events_stages_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 757: Table 'events_stages_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 771: Table 'events_stages_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 783: Table 'events_stages_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 827: Table 'events_statements_current' already exists
+ERROR 1050 (42S01) at line 871: Table 'events_statements_history' already exists
+ERROR 1050 (42S01) at line 915: Table 'events_statements_history_long' already exists
+ERROR 1050 (42S01) at line 947: Table 'events_statements_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 979: Table 'events_statements_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 1011: Table 'events_statements_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 1044: Table 'events_statements_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 1075: Table 'events_statements_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 1084: Table 'hosts' already exists
+ERROR 1050 (42S01) at line 1093: Table 'users' already exists
+ERROR 1050 (42S01) at line 1103: Table 'accounts' already exists
+ERROR 1644 (HY000) at line 1523: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 select name from mysql.event where db='performance_schema';
 name

=== modified file 'mysql-test/suite/perfschema/r/schema.result'
--- a/mysql-test/suite/perfschema/r/schema.result	2011-10-12 20:32:02 +0000
+++ b/mysql-test/suite/perfschema/r/schema.result	2011-10-27 21:18:19 +0000
@@ -74,6 +74,7 @@ Table	Create Table
 events_stages_current	CREATE TABLE `events_stages_current` (
   `THREAD_ID` int(11) NOT NULL,
   `EVENT_ID` bigint(20) unsigned NOT NULL,
+  `END_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
   `EVENT_NAME` varchar(128) NOT NULL,
   `SOURCE` varchar(64) DEFAULT NULL,
   `TIMER_START` bigint(20) unsigned DEFAULT NULL,
@@ -87,6 +88,7 @@ Table	Create Table
 events_stages_history	CREATE TABLE `events_stages_history` (
   `THREAD_ID` int(11) NOT NULL,
   `EVENT_ID` bigint(20) unsigned NOT NULL,
+  `END_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
   `EVENT_NAME` varchar(128) NOT NULL,
   `SOURCE` varchar(64) DEFAULT NULL,
   `TIMER_START` bigint(20) unsigned DEFAULT NULL,
@@ -100,6 +102,7 @@ Table	Create Table
 events_stages_history_long	CREATE TABLE `events_stages_history_long` (
   `THREAD_ID` int(11) NOT NULL,
   `EVENT_ID` bigint(20) unsigned NOT NULL,
+  `END_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
   `EVENT_NAME` varchar(128) NOT NULL,
   `SOURCE` varchar(64) DEFAULT NULL,
   `TIMER_START` bigint(20) unsigned DEFAULT NULL,
@@ -168,6 +171,7 @@ Table	Create Table
 events_statements_current	CREATE TABLE `events_statements_current` (
   `THREAD_ID` int(11) NOT NULL,
   `EVENT_ID` bigint(20) unsigned NOT NULL,
+  `END_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
   `EVENT_NAME` varchar(128) NOT NULL,
   `SOURCE` varchar(64) DEFAULT NULL,
   `TIMER_START` bigint(20) unsigned DEFAULT NULL,
@@ -209,6 +213,7 @@ Table	Create Table
 events_statements_history	CREATE TABLE `events_statements_history` (
   `THREAD_ID` int(11) NOT NULL,
   `EVENT_ID` bigint(20) unsigned NOT NULL,
+  `END_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
   `EVENT_NAME` varchar(128) NOT NULL,
   `SOURCE` varchar(64) DEFAULT NULL,
   `TIMER_START` bigint(20) unsigned DEFAULT NULL,
@@ -250,6 +255,7 @@ Table	Create Table
 events_statements_history_long	CREATE TABLE `events_statements_history_long` (
   `THREAD_ID` int(11) NOT NULL,
   `EVENT_ID` bigint(20) unsigned NOT NULL,
+  `END_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
   `EVENT_NAME` varchar(128) NOT NULL,
   `SOURCE` varchar(64) DEFAULT NULL,
   `TIMER_START` bigint(20) unsigned DEFAULT NULL,
@@ -441,6 +447,7 @@ Table	Create Table
 events_waits_current	CREATE TABLE `events_waits_current` (
   `THREAD_ID` int(11) NOT NULL,
   `EVENT_ID` bigint(20) unsigned NOT NULL,
+  `END_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
   `EVENT_NAME` varchar(128) NOT NULL,
   `SOURCE` varchar(64) DEFAULT NULL,
   `TIMER_START` bigint(20) unsigned DEFAULT NULL,
@@ -463,6 +470,7 @@ Table	Create Table
 events_waits_history	CREATE TABLE `events_waits_history` (
   `THREAD_ID` int(11) NOT NULL,
   `EVENT_ID` bigint(20) unsigned NOT NULL,
+  `END_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
   `EVENT_NAME` varchar(128) NOT NULL,
   `SOURCE` varchar(64) DEFAULT NULL,
   `TIMER_START` bigint(20) unsigned DEFAULT NULL,
@@ -485,6 +493,7 @@ Table	Create Table
 events_waits_history_long	CREATE TABLE `events_waits_history_long` (
   `THREAD_ID` int(11) NOT NULL,
   `EVENT_ID` bigint(20) unsigned NOT NULL,
+  `END_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
   `EVENT_NAME` varchar(128) NOT NULL,
   `SOURCE` varchar(64) DEFAULT NULL,
   `TIMER_START` bigint(20) unsigned DEFAULT NULL,

=== modified file 'mysql-test/suite/perfschema/r/start_server_nothing.result'
--- a/mysql-test/suite/perfschema/r/start_server_nothing.result	2011-09-02 20:03:36 +0000
+++ b/mysql-test/suite/perfschema/r/start_server_nothing.result	2011-10-27 21:18:19 +0000
@@ -165,11 +165,11 @@ USER	HOST	CURRENT_CONNECTIONS	TOTAL_CONN
 select * from performance_schema.cond_instances;
 NAME	OBJECT_INSTANCE_BEGIN
 select * from performance_schema.events_stages_current;
-THREAD_ID	EVENT_ID	EVENT_NAME	SOURCE	TIMER_START	TIMER_END	TIMER_WAIT	NESTING_EVENT_ID	NESTING_EVENT_TYPE
+THREAD_ID	EVENT_ID	END_EVENT_ID	EVENT_NAME	SOURCE	TIMER_START	TIMER_END	TIMER_WAIT	NESTING_EVENT_ID	NESTING_EVENT_TYPE
 select * from performance_schema.events_stages_history;
-THREAD_ID	EVENT_ID	EVENT_NAME	SOURCE	TIMER_START	TIMER_END	TIMER_WAIT	NESTING_EVENT_ID	NESTING_EVENT_TYPE
+THREAD_ID	EVENT_ID	END_EVENT_ID	EVENT_NAME	SOURCE	TIMER_START	TIMER_END	TIMER_WAIT	NESTING_EVENT_ID	NESTING_EVENT_TYPE
 select * from performance_schema.events_stages_history_long;
-THREAD_ID	EVENT_ID	EVENT_NAME	SOURCE	TIMER_START	TIMER_END	TIMER_WAIT	NESTING_EVENT_ID	NESTING_EVENT_TYPE
+THREAD_ID	EVENT_ID	END_EVENT_ID	EVENT_NAME	SOURCE	TIMER_START	TIMER_END	TIMER_WAIT	NESTING_EVENT_ID	NESTING_EVENT_TYPE
 select * from performance_schema.events_stages_summary_by_account_by_event_name;
 USER	HOST	EVENT_NAME	COUNT_STAR	SUM_TIMER_WAIT	MIN_TIMER_WAIT	AVG_TIMER_WAIT	MAX_TIMER_WAIT
 select * from performance_schema.events_stages_summary_by_host_by_event_name;
@@ -181,11 +181,11 @@ USER	EVENT_NAME	COUNT_STAR	SUM_TIMER_WAI
 select * from performance_schema.events_stages_summary_global_by_event_name;
 EVENT_NAME	COUNT_STAR	SUM_TIMER_WAIT	MIN_TIMER_WAIT	AVG_TIMER_WAIT	MAX_TIMER_WAIT
 select * from performance_schema.events_statements_current;
-THREAD_ID	EVENT_ID	EVENT_NAME	SOURCE	TIMER_START	TIMER_END	TIMER_WAIT	LOCK_TIME	SQL_TEXT	CURRENT_SCHEMA	OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	OBJECT_INSTANCE_BEGIN	MYSQL_ERRNO	RETURNED_SQLSTATE	MESSAGE_TEXT	ERRORS	WARNINGS	ROWS_AFFECTED	ROWS_SENT	ROWS_EXAMINED	CREATED_TMP_DISK_TABLES	CREATED_TMP_TABLES	SELECT_FULL_JOIN	SELECT_FULL_RANGE_JOIN	SELECT_RANGE	SELECT_RANGE_CHECK	SELECT_SCAN	SORT_MERGE_PASSES	SORT_RANGE	SORT_ROWS	SORT_SCAN	NO_INDEX_USED	NO_GOOD_INDEX_USED	NESTING_EVENT_ID	NESTING_EVENT_TYPE
+THREAD_ID	EVENT_ID	END_EVENT_ID	EVENT_NAME	SOURCE	TIMER_START	TIMER_END	TIMER_WAIT	LOCK_TIME	SQL_TEXT	CURRENT_SCHEMA	OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	OBJECT_INSTANCE_BEGIN	MYSQL_ERRNO	RETURNED_SQLSTATE	MESSAGE_TEXT	ERRORS	WARNINGS	ROWS_AFFECTED	ROWS_SENT	ROWS_EXAMINED	CREATED_TMP_DISK_TABLES	CREATED_TMP_TABLES	SELECT_FULL_JOIN	SELECT_FULL_RANGE_JOIN	SELECT_RANGE	SELECT_RANGE_CHECK	SELECT_SCAN	SORT_MERGE_PASSES	SORT_RANGE	SORT_ROWS	SORT_SCAN	NO_INDEX_USED	NO_GOOD_INDEX_USED	NESTING_EVENT_ID	NESTING_EVENT_TYPE
 select * from performance_schema.events_statements_history;
-THREAD_ID	EVENT_ID	EVENT_NAME	SOURCE	TIMER_START	TIMER_END	TIMER_WAIT	LOCK_TIME	SQL_TEXT	CURRENT_SCHEMA	OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	OBJECT_INSTANCE_BEGIN	MYSQL_ERRNO	RETURNED_SQLSTATE	MESSAGE_TEXT	ERRORS	WARNINGS	ROWS_AFFECTED	ROWS_SENT	ROWS_EXAMINED	CREATED_TMP_DISK_TABLES	CREATED_TMP_TABLES	SELECT_FULL_JOIN	SELECT_FULL_RANGE_JOIN	SELECT_RANGE	SELECT_RANGE_CHECK	SELECT_SCAN	SORT_MERGE_PASSES	SORT_RANGE	SORT_ROWS	SORT_SCAN	NO_INDEX_USED	NO_GOOD_INDEX_USED	NESTING_EVENT_ID	NESTING_EVENT_TYPE
+THREAD_ID	EVENT_ID	END_EVENT_ID	EVENT_NAME	SOURCE	TIMER_START	TIMER_END	TIMER_WAIT	LOCK_TIME	SQL_TEXT	CURRENT_SCHEMA	OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	OBJECT_INSTANCE_BEGIN	MYSQL_ERRNO	RETURNED_SQLSTATE	MESSAGE_TEXT	ERRORS	WARNINGS	ROWS_AFFECTED	ROWS_SENT	ROWS_EXAMINED	CREATED_TMP_DISK_TABLES	CREATED_TMP_TABLES	SELECT_FULL_JOIN	SELECT_FULL_RANGE_JOIN	SELECT_RANGE	SELECT_RANGE_CHECK	SELECT_SCAN	SORT_MERGE_PASSES	SORT_RANGE	SORT_ROWS	SORT_SCAN	NO_INDEX_USED	NO_GOOD_INDEX_USED	NESTING_EVENT_ID	NESTING_EVENT_TYPE
 select * from performance_schema.events_statements_history_long;
-THREAD_ID	EVENT_ID	EVENT_NAME	SOURCE	TIMER_START	TIMER_END	TIMER_WAIT	LOCK_TIME	SQL_TEXT	CURRENT_SCHEMA	OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	OBJECT_INSTANCE_BEGIN	MYSQL_ERRNO	RETURNED_SQLSTATE	MESSAGE_TEXT	ERRORS	WARNINGS	ROWS_AFFECTED	ROWS_SENT	ROWS_EXAMINED	CREATED_TMP_DISK_TABLES	CREATED_TMP_TABLES	SELECT_FULL_JOIN	SELECT_FULL_RANGE_JOIN	SELECT_RANGE	SELECT_RANGE_CHECK	SELECT_SCAN	SORT_MERGE_PASSES	SORT_RANGE	SORT_ROWS	SORT_SCAN	NO_INDEX_USED	NO_GOOD_INDEX_USED	NESTING_EVENT_ID	NESTING_EVENT_TYPE
+THREAD_ID	EVENT_ID	END_EVENT_ID	EVENT_NAME	SOURCE	TIMER_START	TIMER_END	TIMER_WAIT	LOCK_TIME	SQL_TEXT	CURRENT_SCHEMA	OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	OBJECT_INSTANCE_BEGIN	MYSQL_ERRNO	RETURNED_SQLSTATE	MESSAGE_TEXT	ERRORS	WARNINGS	ROWS_AFFECTED	ROWS_SENT	ROWS_EXAMINED	CREATED_TMP_DISK_TABLES	CREATED_TMP_TABLES	SELECT_FULL_JOIN	SELECT_FULL_RANGE_JOIN	SELECT_RANGE	SELECT_RANGE_CHECK	SELECT_SCAN	SORT_MERGE_PASSES	SORT_RANGE	SORT_ROWS	SORT_SCAN	NO_INDEX_USED	NO_GOOD_INDEX_USED	NESTING_EVENT_ID	NESTING_EVENT_TYPE
 select * from performance_schema.events_statements_summary_by_account_by_event_name;
 USER	HOST	EVENT_NAME	COUNT_STAR	SUM_TIMER_WAIT	MIN_TIMER_WAIT	AVG_TIMER_WAIT	MAX_TIMER_WAIT	SUM_LOCK_TIME	SUM_ERRORS	SUM_WARNINGS	SUM_ROWS_AFFECTED	SUM_ROWS_SENT	SUM_ROWS_EXAMINED	SUM_CREATED_TMP_DISK_TABLES	SUM_CREATED_TMP_TABLES	SUM_SELECT_FULL_JOIN	SUM_SELECT_FULL_RANGE_JOIN	SUM_SELECT_RANGE	SUM_SELECT_RANGE_CHECK	SUM_SELECT_SCAN	SUM_SORT_MERGE_PASSES	SUM_SORT_RANGE	SUM_SORT_ROWS	SUM_SORT_SCAN	SUM_NO_INDEX_USED	SUM_NO_GOOD_INDEX_USED
 select * from performance_schema.events_statements_summary_by_host_by_event_name;
@@ -197,11 +197,11 @@ USER	EVENT_NAME	COUNT_STAR	SUM_TIMER_WAI
 select * from performance_schema.events_statements_summary_global_by_event_name;
 EVENT_NAME	COUNT_STAR	SUM_TIMER_WAIT	MIN_TIMER_WAIT	AVG_TIMER_WAIT	MAX_TIMER_WAIT	SUM_LOCK_TIME	SUM_ERRORS	SUM_WARNINGS	SUM_ROWS_AFFECTED	SUM_ROWS_SENT	SUM_ROWS_EXAMINED	SUM_CREATED_TMP_DISK_TABLES	SUM_CREATED_TMP_TABLES	SUM_SELECT_FULL_JOIN	SUM_SELECT_FULL_RANGE_JOIN	SUM_SELECT_RANGE	SUM_SELECT_RANGE_CHECK	SUM_SELECT_SCAN	SUM_SORT_MERGE_PASSES	SUM_SORT_RANGE	SUM_SORT_ROWS	SUM_SORT_SCAN	SUM_NO_INDEX_USED	SUM_NO_GOOD_INDEX_USED
 select * from performance_schema.events_waits_current;
-THREAD_ID	EVENT_ID	EVENT_NAME	SOURCE	TIMER_START	TIMER_END	TIMER_WAIT	SPINS	OBJECT_SCHEMA	OBJECT_NAME	INDEX_NAME	OBJECT_TYPE	OBJECT_INSTANCE_BEGIN	NESTING_EVENT_ID	NESTING_EVENT_TYPE	OPERATION	NUMBER_OF_BYTES	FLAGS
+THREAD_ID	EVENT_ID	END_EVENT_ID	EVENT_NAME	SOURCE	TIMER_START	TIMER_END	TIMER_WAIT	SPINS	OBJECT_SCHEMA	OBJECT_NAME	INDEX_NAME	OBJECT_TYPE	OBJECT_INSTANCE_BEGIN	NESTING_EVENT_ID	NESTING_EVENT_TYPE	OPERATION	NUMBER_OF_BYTES	FLAGS
 select * from performance_schema.events_waits_history;
-THREAD_ID	EVENT_ID	EVENT_NAME	SOURCE	TIMER_START	TIMER_END	TIMER_WAIT	SPINS	OBJECT_SCHEMA	OBJECT_NAME	INDEX_NAME	OBJECT_TYPE	OBJECT_INSTANCE_BEGIN	NESTING_EVENT_ID	NESTING_EVENT_TYPE	OPERATION	NUMBER_OF_BYTES	FLAGS
+THREAD_ID	EVENT_ID	END_EVENT_ID	EVENT_NAME	SOURCE	TIMER_START	TIMER_END	TIMER_WAIT	SPINS	OBJECT_SCHEMA	OBJECT_NAME	INDEX_NAME	OBJECT_TYPE	OBJECT_INSTANCE_BEGIN	NESTING_EVENT_ID	NESTING_EVENT_TYPE	OPERATION	NUMBER_OF_BYTES	FLAGS
 select * from performance_schema.events_waits_history_long;
-THREAD_ID	EVENT_ID	EVENT_NAME	SOURCE	TIMER_START	TIMER_END	TIMER_WAIT	SPINS	OBJECT_SCHEMA	OBJECT_NAME	INDEX_NAME	OBJECT_TYPE	OBJECT_INSTANCE_BEGIN	NESTING_EVENT_ID	NESTING_EVENT_TYPE	OPERATION	NUMBER_OF_BYTES	FLAGS
+THREAD_ID	EVENT_ID	END_EVENT_ID	EVENT_NAME	SOURCE	TIMER_START	TIMER_END	TIMER_WAIT	SPINS	OBJECT_SCHEMA	OBJECT_NAME	INDEX_NAME	OBJECT_TYPE	OBJECT_INSTANCE_BEGIN	NESTING_EVENT_ID	NESTING_EVENT_TYPE	OPERATION	NUMBER_OF_BYTES	FLAGS
 select * from performance_schema.events_waits_summary_by_account_by_event_name;
 USER	HOST	EVENT_NAME	COUNT_STAR	SUM_TIMER_WAIT	MIN_TIMER_WAIT	AVG_TIMER_WAIT	MAX_TIMER_WAIT
 select * from performance_schema.events_waits_summary_by_host_by_event_name;

=== modified file 'mysql-test/suite/perfschema/r/table_schema.result'
--- a/mysql-test/suite/perfschema/r/table_schema.result	2011-10-12 20:32:02 +0000
+++ b/mysql-test/suite/perfschema/r/table_schema.result	2011-10-27 21:18:19 +0000
@@ -9,31 +9,34 @@ def	performance_schema	cond_instances	NA
 def	performance_schema	cond_instances	OBJECT_INSTANCE_BEGIN	2	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
 def	performance_schema	events_stages_current	THREAD_ID	1	NULL	NO	int	NULL	NULL	10	0	NULL	NULL	int(11)			select,insert,update,references	
 def	performance_schema	events_stages_current	EVENT_ID	2	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_stages_current	EVENT_NAME	3	NULL	NO	varchar	128	384	NULL	NULL	utf8	utf8_general_ci	varchar(128)			select,insert,update,references	
-def	performance_schema	events_stages_current	SOURCE	4	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
-def	performance_schema	events_stages_current	TIMER_START	5	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_stages_current	TIMER_END	6	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_stages_current	TIMER_WAIT	7	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_stages_current	NESTING_EVENT_ID	8	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_stages_current	NESTING_EVENT_TYPE	9	NULL	YES	enum	9	27	NULL	NULL	utf8	utf8_general_ci	enum('STATEMENT','STAGE','WAIT')			select,insert,update,references	
+def	performance_schema	events_stages_current	END_EVENT_ID	3	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_stages_current	EVENT_NAME	4	NULL	NO	varchar	128	384	NULL	NULL	utf8	utf8_general_ci	varchar(128)			select,insert,update,references	
+def	performance_schema	events_stages_current	SOURCE	5	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
+def	performance_schema	events_stages_current	TIMER_START	6	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_stages_current	TIMER_END	7	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_stages_current	TIMER_WAIT	8	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_stages_current	NESTING_EVENT_ID	9	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_stages_current	NESTING_EVENT_TYPE	10	NULL	YES	enum	9	27	NULL	NULL	utf8	utf8_general_ci	enum('STATEMENT','STAGE','WAIT')			select,insert,update,references	
 def	performance_schema	events_stages_history	THREAD_ID	1	NULL	NO	int	NULL	NULL	10	0	NULL	NULL	int(11)			select,insert,update,references	
 def	performance_schema	events_stages_history	EVENT_ID	2	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_stages_history	EVENT_NAME	3	NULL	NO	varchar	128	384	NULL	NULL	utf8	utf8_general_ci	varchar(128)			select,insert,update,references	
-def	performance_schema	events_stages_history	SOURCE	4	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
-def	performance_schema	events_stages_history	TIMER_START	5	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_stages_history	TIMER_END	6	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_stages_history	TIMER_WAIT	7	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_stages_history	NESTING_EVENT_ID	8	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_stages_history	NESTING_EVENT_TYPE	9	NULL	YES	enum	9	27	NULL	NULL	utf8	utf8_general_ci	enum('STATEMENT','STAGE','WAIT')			select,insert,update,references	
+def	performance_schema	events_stages_history	END_EVENT_ID	3	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_stages_history	EVENT_NAME	4	NULL	NO	varchar	128	384	NULL	NULL	utf8	utf8_general_ci	varchar(128)			select,insert,update,references	
+def	performance_schema	events_stages_history	SOURCE	5	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
+def	performance_schema	events_stages_history	TIMER_START	6	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_stages_history	TIMER_END	7	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_stages_history	TIMER_WAIT	8	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_stages_history	NESTING_EVENT_ID	9	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_stages_history	NESTING_EVENT_TYPE	10	NULL	YES	enum	9	27	NULL	NULL	utf8	utf8_general_ci	enum('STATEMENT','STAGE','WAIT')			select,insert,update,references	
 def	performance_schema	events_stages_history_long	THREAD_ID	1	NULL	NO	int	NULL	NULL	10	0	NULL	NULL	int(11)			select,insert,update,references	
 def	performance_schema	events_stages_history_long	EVENT_ID	2	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_stages_history_long	EVENT_NAME	3	NULL	NO	varchar	128	384	NULL	NULL	utf8	utf8_general_ci	varchar(128)			select,insert,update,references	
-def	performance_schema	events_stages_history_long	SOURCE	4	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
-def	performance_schema	events_stages_history_long	TIMER_START	5	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_stages_history_long	TIMER_END	6	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_stages_history_long	TIMER_WAIT	7	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_stages_history_long	NESTING_EVENT_ID	8	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_stages_history_long	NESTING_EVENT_TYPE	9	NULL	YES	enum	9	27	NULL	NULL	utf8	utf8_general_ci	enum('STATEMENT','STAGE','WAIT')			select,insert,update,references	
+def	performance_schema	events_stages_history_long	END_EVENT_ID	3	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_stages_history_long	EVENT_NAME	4	NULL	NO	varchar	128	384	NULL	NULL	utf8	utf8_general_ci	varchar(128)			select,insert,update,references	
+def	performance_schema	events_stages_history_long	SOURCE	5	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
+def	performance_schema	events_stages_history_long	TIMER_START	6	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_stages_history_long	TIMER_END	7	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_stages_history_long	TIMER_WAIT	8	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_stages_history_long	NESTING_EVENT_ID	9	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_stages_history_long	NESTING_EVENT_TYPE	10	NULL	YES	enum	9	27	NULL	NULL	utf8	utf8_general_ci	enum('STATEMENT','STAGE','WAIT')			select,insert,update,references	
 def	performance_schema	events_stages_summary_by_account_by_event_name	USER	1	NULL	YES	char	16	48	NULL	NULL	utf8	utf8_bin	char(16)			select,insert,update,references	
 def	performance_schema	events_stages_summary_by_account_by_event_name	HOST	2	NULL	YES	char	60	180	NULL	NULL	utf8	utf8_bin	char(60)			select,insert,update,references	
 def	performance_schema	events_stages_summary_by_account_by_event_name	EVENT_NAME	3	NULL	NO	varchar	128	384	NULL	NULL	utf8	utf8_general_ci	varchar(128)			select,insert,update,references	
@@ -71,115 +74,118 @@ def	performance_schema	events_stages_sum
 def	performance_schema	events_stages_summary_global_by_event_name	MAX_TIMER_WAIT	6	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
 def	performance_schema	events_statements_current	THREAD_ID	1	NULL	NO	int	NULL	NULL	10	0	NULL	NULL	int(11)			select,insert,update,references	
 def	performance_schema	events_statements_current	EVENT_ID	2	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_current	EVENT_NAME	3	NULL	NO	varchar	128	384	NULL	NULL	utf8	utf8_general_ci	varchar(128)			select,insert,update,references	
-def	performance_schema	events_statements_current	SOURCE	4	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
-def	performance_schema	events_statements_current	TIMER_START	5	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_current	TIMER_END	6	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_current	TIMER_WAIT	7	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_current	LOCK_TIME	8	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_current	SQL_TEXT	9	NULL	YES	longtext	4294967295	4294967295	NULL	NULL	utf8	utf8_general_ci	longtext			select,insert,update,references	
-def	performance_schema	events_statements_current	CURRENT_SCHEMA	10	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
-def	performance_schema	events_statements_current	OBJECT_TYPE	11	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
-def	performance_schema	events_statements_current	OBJECT_SCHEMA	12	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
-def	performance_schema	events_statements_current	OBJECT_NAME	13	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
-def	performance_schema	events_statements_current	OBJECT_INSTANCE_BEGIN	14	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_current	MYSQL_ERRNO	15	NULL	YES	int	NULL	NULL	10	0	NULL	NULL	int(11)			select,insert,update,references	
-def	performance_schema	events_statements_current	RETURNED_SQLSTATE	16	NULL	YES	varchar	5	15	NULL	NULL	utf8	utf8_general_ci	varchar(5)			select,insert,update,references	
-def	performance_schema	events_statements_current	MESSAGE_TEXT	17	NULL	YES	varchar	128	384	NULL	NULL	utf8	utf8_general_ci	varchar(128)			select,insert,update,references	
-def	performance_schema	events_statements_current	ERRORS	18	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_current	WARNINGS	19	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_current	ROWS_AFFECTED	20	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_current	ROWS_SENT	21	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_current	ROWS_EXAMINED	22	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_current	CREATED_TMP_DISK_TABLES	23	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_current	CREATED_TMP_TABLES	24	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_current	SELECT_FULL_JOIN	25	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_current	SELECT_FULL_RANGE_JOIN	26	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_current	SELECT_RANGE	27	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_current	SELECT_RANGE_CHECK	28	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_current	SELECT_SCAN	29	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_current	SORT_MERGE_PASSES	30	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_current	SORT_RANGE	31	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_current	SORT_ROWS	32	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_current	SORT_SCAN	33	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_current	NO_INDEX_USED	34	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_current	NO_GOOD_INDEX_USED	35	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_current	NESTING_EVENT_ID	36	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_current	NESTING_EVENT_TYPE	37	NULL	YES	enum	9	27	NULL	NULL	utf8	utf8_general_ci	enum('STATEMENT','STAGE','WAIT')			select,insert,update,references	
+def	performance_schema	events_statements_current	END_EVENT_ID	3	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_current	EVENT_NAME	4	NULL	NO	varchar	128	384	NULL	NULL	utf8	utf8_general_ci	varchar(128)			select,insert,update,references	
+def	performance_schema	events_statements_current	SOURCE	5	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
+def	performance_schema	events_statements_current	TIMER_START	6	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_current	TIMER_END	7	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_current	TIMER_WAIT	8	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_current	LOCK_TIME	9	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_current	SQL_TEXT	10	NULL	YES	longtext	4294967295	4294967295	NULL	NULL	utf8	utf8_general_ci	longtext			select,insert,update,references	
+def	performance_schema	events_statements_current	CURRENT_SCHEMA	11	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
+def	performance_schema	events_statements_current	OBJECT_TYPE	12	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
+def	performance_schema	events_statements_current	OBJECT_SCHEMA	13	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
+def	performance_schema	events_statements_current	OBJECT_NAME	14	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
+def	performance_schema	events_statements_current	OBJECT_INSTANCE_BEGIN	15	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_current	MYSQL_ERRNO	16	NULL	YES	int	NULL	NULL	10	0	NULL	NULL	int(11)			select,insert,update,references	
+def	performance_schema	events_statements_current	RETURNED_SQLSTATE	17	NULL	YES	varchar	5	15	NULL	NULL	utf8	utf8_general_ci	varchar(5)			select,insert,update,references	
+def	performance_schema	events_statements_current	MESSAGE_TEXT	18	NULL	YES	varchar	128	384	NULL	NULL	utf8	utf8_general_ci	varchar(128)			select,insert,update,references	
+def	performance_schema	events_statements_current	ERRORS	19	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_current	WARNINGS	20	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_current	ROWS_AFFECTED	21	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_current	ROWS_SENT	22	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_current	ROWS_EXAMINED	23	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_current	CREATED_TMP_DISK_TABLES	24	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_current	CREATED_TMP_TABLES	25	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_current	SELECT_FULL_JOIN	26	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_current	SELECT_FULL_RANGE_JOIN	27	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_current	SELECT_RANGE	28	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_current	SELECT_RANGE_CHECK	29	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_current	SELECT_SCAN	30	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_current	SORT_MERGE_PASSES	31	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_current	SORT_RANGE	32	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_current	SORT_ROWS	33	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_current	SORT_SCAN	34	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_current	NO_INDEX_USED	35	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_current	NO_GOOD_INDEX_USED	36	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_current	NESTING_EVENT_ID	37	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_current	NESTING_EVENT_TYPE	38	NULL	YES	enum	9	27	NULL	NULL	utf8	utf8_general_ci	enum('STATEMENT','STAGE','WAIT')			select,insert,update,references	
 def	performance_schema	events_statements_history	THREAD_ID	1	NULL	NO	int	NULL	NULL	10	0	NULL	NULL	int(11)			select,insert,update,references	
 def	performance_schema	events_statements_history	EVENT_ID	2	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history	EVENT_NAME	3	NULL	NO	varchar	128	384	NULL	NULL	utf8	utf8_general_ci	varchar(128)			select,insert,update,references	
-def	performance_schema	events_statements_history	SOURCE	4	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
-def	performance_schema	events_statements_history	TIMER_START	5	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history	TIMER_END	6	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history	TIMER_WAIT	7	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history	LOCK_TIME	8	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history	SQL_TEXT	9	NULL	YES	longtext	4294967295	4294967295	NULL	NULL	utf8	utf8_general_ci	longtext			select,insert,update,references	
-def	performance_schema	events_statements_history	CURRENT_SCHEMA	10	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
-def	performance_schema	events_statements_history	OBJECT_TYPE	11	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
-def	performance_schema	events_statements_history	OBJECT_SCHEMA	12	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
-def	performance_schema	events_statements_history	OBJECT_NAME	13	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
-def	performance_schema	events_statements_history	OBJECT_INSTANCE_BEGIN	14	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history	MYSQL_ERRNO	15	NULL	YES	int	NULL	NULL	10	0	NULL	NULL	int(11)			select,insert,update,references	
-def	performance_schema	events_statements_history	RETURNED_SQLSTATE	16	NULL	YES	varchar	5	15	NULL	NULL	utf8	utf8_general_ci	varchar(5)			select,insert,update,references	
-def	performance_schema	events_statements_history	MESSAGE_TEXT	17	NULL	YES	varchar	128	384	NULL	NULL	utf8	utf8_general_ci	varchar(128)			select,insert,update,references	
-def	performance_schema	events_statements_history	ERRORS	18	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history	WARNINGS	19	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history	ROWS_AFFECTED	20	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history	ROWS_SENT	21	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history	ROWS_EXAMINED	22	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history	CREATED_TMP_DISK_TABLES	23	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history	CREATED_TMP_TABLES	24	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history	SELECT_FULL_JOIN	25	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history	SELECT_FULL_RANGE_JOIN	26	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history	SELECT_RANGE	27	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history	SELECT_RANGE_CHECK	28	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history	SELECT_SCAN	29	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history	SORT_MERGE_PASSES	30	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history	SORT_RANGE	31	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history	SORT_ROWS	32	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history	SORT_SCAN	33	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history	NO_INDEX_USED	34	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history	NO_GOOD_INDEX_USED	35	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history	NESTING_EVENT_ID	36	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history	NESTING_EVENT_TYPE	37	NULL	YES	enum	9	27	NULL	NULL	utf8	utf8_general_ci	enum('STATEMENT','STAGE','WAIT')			select,insert,update,references	
+def	performance_schema	events_statements_history	END_EVENT_ID	3	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history	EVENT_NAME	4	NULL	NO	varchar	128	384	NULL	NULL	utf8	utf8_general_ci	varchar(128)			select,insert,update,references	
+def	performance_schema	events_statements_history	SOURCE	5	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
+def	performance_schema	events_statements_history	TIMER_START	6	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history	TIMER_END	7	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history	TIMER_WAIT	8	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history	LOCK_TIME	9	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history	SQL_TEXT	10	NULL	YES	longtext	4294967295	4294967295	NULL	NULL	utf8	utf8_general_ci	longtext			select,insert,update,references	
+def	performance_schema	events_statements_history	CURRENT_SCHEMA	11	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
+def	performance_schema	events_statements_history	OBJECT_TYPE	12	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
+def	performance_schema	events_statements_history	OBJECT_SCHEMA	13	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
+def	performance_schema	events_statements_history	OBJECT_NAME	14	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
+def	performance_schema	events_statements_history	OBJECT_INSTANCE_BEGIN	15	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history	MYSQL_ERRNO	16	NULL	YES	int	NULL	NULL	10	0	NULL	NULL	int(11)			select,insert,update,references	
+def	performance_schema	events_statements_history	RETURNED_SQLSTATE	17	NULL	YES	varchar	5	15	NULL	NULL	utf8	utf8_general_ci	varchar(5)			select,insert,update,references	
+def	performance_schema	events_statements_history	MESSAGE_TEXT	18	NULL	YES	varchar	128	384	NULL	NULL	utf8	utf8_general_ci	varchar(128)			select,insert,update,references	
+def	performance_schema	events_statements_history	ERRORS	19	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history	WARNINGS	20	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history	ROWS_AFFECTED	21	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history	ROWS_SENT	22	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history	ROWS_EXAMINED	23	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history	CREATED_TMP_DISK_TABLES	24	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history	CREATED_TMP_TABLES	25	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history	SELECT_FULL_JOIN	26	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history	SELECT_FULL_RANGE_JOIN	27	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history	SELECT_RANGE	28	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history	SELECT_RANGE_CHECK	29	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history	SELECT_SCAN	30	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history	SORT_MERGE_PASSES	31	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history	SORT_RANGE	32	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history	SORT_ROWS	33	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history	SORT_SCAN	34	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history	NO_INDEX_USED	35	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history	NO_GOOD_INDEX_USED	36	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history	NESTING_EVENT_ID	37	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history	NESTING_EVENT_TYPE	38	NULL	YES	enum	9	27	NULL	NULL	utf8	utf8_general_ci	enum('STATEMENT','STAGE','WAIT')			select,insert,update,references	
 def	performance_schema	events_statements_history_long	THREAD_ID	1	NULL	NO	int	NULL	NULL	10	0	NULL	NULL	int(11)			select,insert,update,references	
 def	performance_schema	events_statements_history_long	EVENT_ID	2	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history_long	EVENT_NAME	3	NULL	NO	varchar	128	384	NULL	NULL	utf8	utf8_general_ci	varchar(128)			select,insert,update,references	
-def	performance_schema	events_statements_history_long	SOURCE	4	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
-def	performance_schema	events_statements_history_long	TIMER_START	5	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history_long	TIMER_END	6	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history_long	TIMER_WAIT	7	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history_long	LOCK_TIME	8	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history_long	SQL_TEXT	9	NULL	YES	longtext	4294967295	4294967295	NULL	NULL	utf8	utf8_general_ci	longtext			select,insert,update,references	
-def	performance_schema	events_statements_history_long	CURRENT_SCHEMA	10	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
-def	performance_schema	events_statements_history_long	OBJECT_TYPE	11	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
-def	performance_schema	events_statements_history_long	OBJECT_SCHEMA	12	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
-def	performance_schema	events_statements_history_long	OBJECT_NAME	13	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
-def	performance_schema	events_statements_history_long	OBJECT_INSTANCE_BEGIN	14	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history_long	MYSQL_ERRNO	15	NULL	YES	int	NULL	NULL	10	0	NULL	NULL	int(11)			select,insert,update,references	
-def	performance_schema	events_statements_history_long	RETURNED_SQLSTATE	16	NULL	YES	varchar	5	15	NULL	NULL	utf8	utf8_general_ci	varchar(5)			select,insert,update,references	
-def	performance_schema	events_statements_history_long	MESSAGE_TEXT	17	NULL	YES	varchar	128	384	NULL	NULL	utf8	utf8_general_ci	varchar(128)			select,insert,update,references	
-def	performance_schema	events_statements_history_long	ERRORS	18	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history_long	WARNINGS	19	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history_long	ROWS_AFFECTED	20	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history_long	ROWS_SENT	21	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history_long	ROWS_EXAMINED	22	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history_long	CREATED_TMP_DISK_TABLES	23	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history_long	CREATED_TMP_TABLES	24	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history_long	SELECT_FULL_JOIN	25	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history_long	SELECT_FULL_RANGE_JOIN	26	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history_long	SELECT_RANGE	27	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history_long	SELECT_RANGE_CHECK	28	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history_long	SELECT_SCAN	29	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history_long	SORT_MERGE_PASSES	30	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history_long	SORT_RANGE	31	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history_long	SORT_ROWS	32	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history_long	SORT_SCAN	33	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history_long	NO_INDEX_USED	34	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history_long	NO_GOOD_INDEX_USED	35	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history_long	NESTING_EVENT_ID	36	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_statements_history_long	NESTING_EVENT_TYPE	37	NULL	YES	enum	9	27	NULL	NULL	utf8	utf8_general_ci	enum('STATEMENT','STAGE','WAIT')			select,insert,update,references	
+def	performance_schema	events_statements_history_long	END_EVENT_ID	3	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history_long	EVENT_NAME	4	NULL	NO	varchar	128	384	NULL	NULL	utf8	utf8_general_ci	varchar(128)			select,insert,update,references	
+def	performance_schema	events_statements_history_long	SOURCE	5	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
+def	performance_schema	events_statements_history_long	TIMER_START	6	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history_long	TIMER_END	7	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history_long	TIMER_WAIT	8	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history_long	LOCK_TIME	9	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history_long	SQL_TEXT	10	NULL	YES	longtext	4294967295	4294967295	NULL	NULL	utf8	utf8_general_ci	longtext			select,insert,update,references	
+def	performance_schema	events_statements_history_long	CURRENT_SCHEMA	11	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
+def	performance_schema	events_statements_history_long	OBJECT_TYPE	12	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
+def	performance_schema	events_statements_history_long	OBJECT_SCHEMA	13	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
+def	performance_schema	events_statements_history_long	OBJECT_NAME	14	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
+def	performance_schema	events_statements_history_long	OBJECT_INSTANCE_BEGIN	15	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history_long	MYSQL_ERRNO	16	NULL	YES	int	NULL	NULL	10	0	NULL	NULL	int(11)			select,insert,update,references	
+def	performance_schema	events_statements_history_long	RETURNED_SQLSTATE	17	NULL	YES	varchar	5	15	NULL	NULL	utf8	utf8_general_ci	varchar(5)			select,insert,update,references	
+def	performance_schema	events_statements_history_long	MESSAGE_TEXT	18	NULL	YES	varchar	128	384	NULL	NULL	utf8	utf8_general_ci	varchar(128)			select,insert,update,references	
+def	performance_schema	events_statements_history_long	ERRORS	19	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history_long	WARNINGS	20	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history_long	ROWS_AFFECTED	21	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history_long	ROWS_SENT	22	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history_long	ROWS_EXAMINED	23	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history_long	CREATED_TMP_DISK_TABLES	24	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history_long	CREATED_TMP_TABLES	25	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history_long	SELECT_FULL_JOIN	26	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history_long	SELECT_FULL_RANGE_JOIN	27	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history_long	SELECT_RANGE	28	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history_long	SELECT_RANGE_CHECK	29	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history_long	SELECT_SCAN	30	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history_long	SORT_MERGE_PASSES	31	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history_long	SORT_RANGE	32	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history_long	SORT_ROWS	33	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history_long	SORT_SCAN	34	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history_long	NO_INDEX_USED	35	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history_long	NO_GOOD_INDEX_USED	36	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history_long	NESTING_EVENT_ID	37	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_statements_history_long	NESTING_EVENT_TYPE	38	NULL	YES	enum	9	27	NULL	NULL	utf8	utf8_general_ci	enum('STATEMENT','STAGE','WAIT')			select,insert,update,references	
 def	performance_schema	events_statements_summary_by_account_by_event_name	USER	1	NULL	YES	char	16	48	NULL	NULL	utf8	utf8_bin	char(16)			select,insert,update,references	
 def	performance_schema	events_statements_summary_by_account_by_event_name	HOST	2	NULL	YES	char	60	180	NULL	NULL	utf8	utf8_bin	char(60)			select,insert,update,references	
 def	performance_schema	events_statements_summary_by_account_by_event_name	EVENT_NAME	3	NULL	NO	varchar	128	384	NULL	NULL	utf8	utf8_general_ci	varchar(128)			select,insert,update,references	
@@ -312,58 +318,61 @@ def	performance_schema	events_statements
 def	performance_schema	events_statements_summary_global_by_event_name	SUM_NO_GOOD_INDEX_USED	25	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
 def	performance_schema	events_waits_current	THREAD_ID	1	NULL	NO	int	NULL	NULL	10	0	NULL	NULL	int(11)			select,insert,update,references	
 def	performance_schema	events_waits_current	EVENT_ID	2	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_waits_current	EVENT_NAME	3	NULL	NO	varchar	128	384	NULL	NULL	utf8	utf8_general_ci	varchar(128)			select,insert,update,references	
-def	performance_schema	events_waits_current	SOURCE	4	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
-def	performance_schema	events_waits_current	TIMER_START	5	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_waits_current	TIMER_END	6	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_waits_current	TIMER_WAIT	7	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_waits_current	SPINS	8	NULL	YES	int	NULL	NULL	10	0	NULL	NULL	int(10) unsigned			select,insert,update,references	
-def	performance_schema	events_waits_current	OBJECT_SCHEMA	9	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
-def	performance_schema	events_waits_current	OBJECT_NAME	10	NULL	YES	varchar	512	1536	NULL	NULL	utf8	utf8_general_ci	varchar(512)			select,insert,update,references	
-def	performance_schema	events_waits_current	INDEX_NAME	11	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
-def	performance_schema	events_waits_current	OBJECT_TYPE	12	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
-def	performance_schema	events_waits_current	OBJECT_INSTANCE_BEGIN	13	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_waits_current	NESTING_EVENT_ID	14	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_waits_current	NESTING_EVENT_TYPE	15	NULL	YES	enum	9	27	NULL	NULL	utf8	utf8_general_ci	enum('STATEMENT','STAGE','WAIT')			select,insert,update,references	
-def	performance_schema	events_waits_current	OPERATION	16	NULL	NO	varchar	32	96	NULL	NULL	utf8	utf8_general_ci	varchar(32)			select,insert,update,references	
-def	performance_schema	events_waits_current	NUMBER_OF_BYTES	17	NULL	YES	bigint	NULL	NULL	19	0	NULL	NULL	bigint(20)			select,insert,update,references	
-def	performance_schema	events_waits_current	FLAGS	18	NULL	YES	int	NULL	NULL	10	0	NULL	NULL	int(10) unsigned			select,insert,update,references	
+def	performance_schema	events_waits_current	END_EVENT_ID	3	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_waits_current	EVENT_NAME	4	NULL	NO	varchar	128	384	NULL	NULL	utf8	utf8_general_ci	varchar(128)			select,insert,update,references	
+def	performance_schema	events_waits_current	SOURCE	5	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
+def	performance_schema	events_waits_current	TIMER_START	6	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_waits_current	TIMER_END	7	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_waits_current	TIMER_WAIT	8	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_waits_current	SPINS	9	NULL	YES	int	NULL	NULL	10	0	NULL	NULL	int(10) unsigned			select,insert,update,references	
+def	performance_schema	events_waits_current	OBJECT_SCHEMA	10	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
+def	performance_schema	events_waits_current	OBJECT_NAME	11	NULL	YES	varchar	512	1536	NULL	NULL	utf8	utf8_general_ci	varchar(512)			select,insert,update,references	
+def	performance_schema	events_waits_current	INDEX_NAME	12	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
+def	performance_schema	events_waits_current	OBJECT_TYPE	13	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
+def	performance_schema	events_waits_current	OBJECT_INSTANCE_BEGIN	14	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_waits_current	NESTING_EVENT_ID	15	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_waits_current	NESTING_EVENT_TYPE	16	NULL	YES	enum	9	27	NULL	NULL	utf8	utf8_general_ci	enum('STATEMENT','STAGE','WAIT')			select,insert,update,references	
+def	performance_schema	events_waits_current	OPERATION	17	NULL	NO	varchar	32	96	NULL	NULL	utf8	utf8_general_ci	varchar(32)			select,insert,update,references	
+def	performance_schema	events_waits_current	NUMBER_OF_BYTES	18	NULL	YES	bigint	NULL	NULL	19	0	NULL	NULL	bigint(20)			select,insert,update,references	
+def	performance_schema	events_waits_current	FLAGS	19	NULL	YES	int	NULL	NULL	10	0	NULL	NULL	int(10) unsigned			select,insert,update,references	
 def	performance_schema	events_waits_history	THREAD_ID	1	NULL	NO	int	NULL	NULL	10	0	NULL	NULL	int(11)			select,insert,update,references	
 def	performance_schema	events_waits_history	EVENT_ID	2	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_waits_history	EVENT_NAME	3	NULL	NO	varchar	128	384	NULL	NULL	utf8	utf8_general_ci	varchar(128)			select,insert,update,references	
-def	performance_schema	events_waits_history	SOURCE	4	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
-def	performance_schema	events_waits_history	TIMER_START	5	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_waits_history	TIMER_END	6	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_waits_history	TIMER_WAIT	7	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_waits_history	SPINS	8	NULL	YES	int	NULL	NULL	10	0	NULL	NULL	int(10) unsigned			select,insert,update,references	
-def	performance_schema	events_waits_history	OBJECT_SCHEMA	9	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
-def	performance_schema	events_waits_history	OBJECT_NAME	10	NULL	YES	varchar	512	1536	NULL	NULL	utf8	utf8_general_ci	varchar(512)			select,insert,update,references	
-def	performance_schema	events_waits_history	INDEX_NAME	11	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
-def	performance_schema	events_waits_history	OBJECT_TYPE	12	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
-def	performance_schema	events_waits_history	OBJECT_INSTANCE_BEGIN	13	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_waits_history	NESTING_EVENT_ID	14	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_waits_history	NESTING_EVENT_TYPE	15	NULL	YES	enum	9	27	NULL	NULL	utf8	utf8_general_ci	enum('STATEMENT','STAGE','WAIT')			select,insert,update,references	
-def	performance_schema	events_waits_history	OPERATION	16	NULL	NO	varchar	32	96	NULL	NULL	utf8	utf8_general_ci	varchar(32)			select,insert,update,references	
-def	performance_schema	events_waits_history	NUMBER_OF_BYTES	17	NULL	YES	bigint	NULL	NULL	19	0	NULL	NULL	bigint(20)			select,insert,update,references	
-def	performance_schema	events_waits_history	FLAGS	18	NULL	YES	int	NULL	NULL	10	0	NULL	NULL	int(10) unsigned			select,insert,update,references	
+def	performance_schema	events_waits_history	END_EVENT_ID	3	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_waits_history	EVENT_NAME	4	NULL	NO	varchar	128	384	NULL	NULL	utf8	utf8_general_ci	varchar(128)			select,insert,update,references	
+def	performance_schema	events_waits_history	SOURCE	5	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
+def	performance_schema	events_waits_history	TIMER_START	6	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_waits_history	TIMER_END	7	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_waits_history	TIMER_WAIT	8	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_waits_history	SPINS	9	NULL	YES	int	NULL	NULL	10	0	NULL	NULL	int(10) unsigned			select,insert,update,references	
+def	performance_schema	events_waits_history	OBJECT_SCHEMA	10	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
+def	performance_schema	events_waits_history	OBJECT_NAME	11	NULL	YES	varchar	512	1536	NULL	NULL	utf8	utf8_general_ci	varchar(512)			select,insert,update,references	
+def	performance_schema	events_waits_history	INDEX_NAME	12	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
+def	performance_schema	events_waits_history	OBJECT_TYPE	13	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
+def	performance_schema	events_waits_history	OBJECT_INSTANCE_BEGIN	14	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_waits_history	NESTING_EVENT_ID	15	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_waits_history	NESTING_EVENT_TYPE	16	NULL	YES	enum	9	27	NULL	NULL	utf8	utf8_general_ci	enum('STATEMENT','STAGE','WAIT')			select,insert,update,references	
+def	performance_schema	events_waits_history	OPERATION	17	NULL	NO	varchar	32	96	NULL	NULL	utf8	utf8_general_ci	varchar(32)			select,insert,update,references	
+def	performance_schema	events_waits_history	NUMBER_OF_BYTES	18	NULL	YES	bigint	NULL	NULL	19	0	NULL	NULL	bigint(20)			select,insert,update,references	
+def	performance_schema	events_waits_history	FLAGS	19	NULL	YES	int	NULL	NULL	10	0	NULL	NULL	int(10) unsigned			select,insert,update,references	
 def	performance_schema	events_waits_history_long	THREAD_ID	1	NULL	NO	int	NULL	NULL	10	0	NULL	NULL	int(11)			select,insert,update,references	
 def	performance_schema	events_waits_history_long	EVENT_ID	2	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_waits_history_long	EVENT_NAME	3	NULL	NO	varchar	128	384	NULL	NULL	utf8	utf8_general_ci	varchar(128)			select,insert,update,references	
-def	performance_schema	events_waits_history_long	SOURCE	4	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
-def	performance_schema	events_waits_history_long	TIMER_START	5	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_waits_history_long	TIMER_END	6	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_waits_history_long	TIMER_WAIT	7	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_waits_history_long	SPINS	8	NULL	YES	int	NULL	NULL	10	0	NULL	NULL	int(10) unsigned			select,insert,update,references	
-def	performance_schema	events_waits_history_long	OBJECT_SCHEMA	9	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
-def	performance_schema	events_waits_history_long	OBJECT_NAME	10	NULL	YES	varchar	512	1536	NULL	NULL	utf8	utf8_general_ci	varchar(512)			select,insert,update,references	
-def	performance_schema	events_waits_history_long	INDEX_NAME	11	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
-def	performance_schema	events_waits_history_long	OBJECT_TYPE	12	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
-def	performance_schema	events_waits_history_long	OBJECT_INSTANCE_BEGIN	13	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_waits_history_long	NESTING_EVENT_ID	14	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
-def	performance_schema	events_waits_history_long	NESTING_EVENT_TYPE	15	NULL	YES	enum	9	27	NULL	NULL	utf8	utf8_general_ci	enum('STATEMENT','STAGE','WAIT')			select,insert,update,references	
-def	performance_schema	events_waits_history_long	OPERATION	16	NULL	NO	varchar	32	96	NULL	NULL	utf8	utf8_general_ci	varchar(32)			select,insert,update,references	
-def	performance_schema	events_waits_history_long	NUMBER_OF_BYTES	17	NULL	YES	bigint	NULL	NULL	19	0	NULL	NULL	bigint(20)			select,insert,update,references	
-def	performance_schema	events_waits_history_long	FLAGS	18	NULL	YES	int	NULL	NULL	10	0	NULL	NULL	int(10) unsigned			select,insert,update,references	
+def	performance_schema	events_waits_history_long	END_EVENT_ID	3	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_waits_history_long	EVENT_NAME	4	NULL	NO	varchar	128	384	NULL	NULL	utf8	utf8_general_ci	varchar(128)			select,insert,update,references	
+def	performance_schema	events_waits_history_long	SOURCE	5	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
+def	performance_schema	events_waits_history_long	TIMER_START	6	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_waits_history_long	TIMER_END	7	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_waits_history_long	TIMER_WAIT	8	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_waits_history_long	SPINS	9	NULL	YES	int	NULL	NULL	10	0	NULL	NULL	int(10) unsigned			select,insert,update,references	
+def	performance_schema	events_waits_history_long	OBJECT_SCHEMA	10	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
+def	performance_schema	events_waits_history_long	OBJECT_NAME	11	NULL	YES	varchar	512	1536	NULL	NULL	utf8	utf8_general_ci	varchar(512)			select,insert,update,references	
+def	performance_schema	events_waits_history_long	INDEX_NAME	12	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
+def	performance_schema	events_waits_history_long	OBJECT_TYPE	13	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
+def	performance_schema	events_waits_history_long	OBJECT_INSTANCE_BEGIN	14	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_waits_history_long	NESTING_EVENT_ID	15	NULL	YES	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	performance_schema	events_waits_history_long	NESTING_EVENT_TYPE	16	NULL	YES	enum	9	27	NULL	NULL	utf8	utf8_general_ci	enum('STATEMENT','STAGE','WAIT')			select,insert,update,references	
+def	performance_schema	events_waits_history_long	OPERATION	17	NULL	NO	varchar	32	96	NULL	NULL	utf8	utf8_general_ci	varchar(32)			select,insert,update,references	
+def	performance_schema	events_waits_history_long	NUMBER_OF_BYTES	18	NULL	YES	bigint	NULL	NULL	19	0	NULL	NULL	bigint(20)			select,insert,update,references	
+def	performance_schema	events_waits_history_long	FLAGS	19	NULL	YES	int	NULL	NULL	10	0	NULL	NULL	int(10) unsigned			select,insert,update,references	
 def	performance_schema	events_waits_summary_by_account_by_event_name	USER	1	NULL	YES	char	16	48	NULL	NULL	utf8	utf8_bin	char(16)			select,insert,update,references	
 def	performance_schema	events_waits_summary_by_account_by_event_name	HOST	2	NULL	YES	char	60	180	NULL	NULL	utf8	utf8_bin	char(60)			select,insert,update,references	
 def	performance_schema	events_waits_summary_by_account_by_event_name	EVENT_NAME	3	NULL	NO	varchar	128	384	NULL	NULL	utf8	utf8_general_ci	varchar(128)			select,insert,update,references	

=== modified file 'mysql-test/suite/rpl/r/rpl_alter_repository.result'
--- a/mysql-test/suite/rpl/r/rpl_alter_repository.result	2011-10-13 14:01:50 +0000
+++ b/mysql-test/suite/rpl/r/rpl_alter_repository.result	2011-10-20 09:01:41 +0000
@@ -152,8 +152,5 @@ slave_relay_log_info	CREATE TABLE `slave
 - Occurrences: 1
 DROP TABLE t_innodb;
 include/stop_slave.inc
-SET @@global.relay_log_info_repository=FILE;
-SET @@global.master_info_repository=FILE;
-SET @@global.sync_master_info=0;
 include/start_slave.inc
 include/rpl_end.inc

=== removed file 'mysql-test/suite/rpl/r/rpl_mixed_crash_safe.result.THIS'
--- a/mysql-test/suite/rpl/r/rpl_mixed_crash_safe.result.THIS	2011-08-19 13:04:28 +0000
+++ b/mysql-test/suite/rpl/r/rpl_mixed_crash_safe.result.THIS	1970-01-01 00:00:00 +0000
@@ -1,1180 +0,0 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
-call mtr.add_suppression('Attempting backtrace');
-call mtr.add_suppression("Recovery from master pos .* and file master-bin.000001");
-call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
-call mtr.add_suppression(".*  InnoDB: Warning: allocated tablespace .*, old maximum was .*");
-call mtr.add_suppression(".*int __cxa_pure_virtual().*");
-###################################################################################
-#                               PREPARE EXECUTION
-###################################################################################
-SET @verbose= 'Y';
-SET @commands= 'configure';
-SHOW CREATE TABLE mysql.slave_relay_log_info;
-Table	Create Table
-slave_relay_log_info	CREATE TABLE `slave_relay_log_info` (
-  `Master_id` int(10) unsigned NOT NULL,
-  `Number_of_lines` int(10) unsigned NOT NULL,
-  `Relay_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
-  `Relay_log_pos` bigint(20) unsigned NOT NULL,
-  `Master_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
-  `Master_log_pos` bigint(20) unsigned NOT NULL,
-  `Sql_delay` int(11) NOT NULL,
-  `Number_of_workers` int(10) unsigned NOT NULL,
-  PRIMARY KEY (`Master_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Relay Log Information'
-CREATE TABLE nt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
-CREATE TABLE nt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
-CREATE TABLE nt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
-CREATE TABLE nt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
-CREATE TABLE nt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
-CREATE TABLE nt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
-CREATE TABLE tt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-CREATE TABLE tt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-CREATE TABLE tt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-CREATE TABLE tt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-CREATE TABLE tt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-CREATE TABLE tt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb;
-INSERT INTO nt_1(trans_id, stmt_id) VALUES(1,1);
-INSERT INTO nt_2(trans_id, stmt_id) VALUES(1,1);
-INSERT INTO nt_3(trans_id, stmt_id) VALUES(1,1);
-INSERT INTO nt_4(trans_id, stmt_id) VALUES(1,1);
-INSERT INTO nt_5(trans_id, stmt_id) VALUES(1,1);
-INSERT INTO nt_6(trans_id, stmt_id) VALUES(1,1);
-INSERT INTO tt_1(trans_id, stmt_id) VALUES(1,1);
-INSERT INTO tt_2(trans_id, stmt_id) VALUES(1,1);
-INSERT INTO tt_3(trans_id, stmt_id) VALUES(1,1);
-INSERT INTO tt_4(trans_id, stmt_id) VALUES(1,1);
-INSERT INTO tt_5(trans_id, stmt_id) VALUES(1,1);
-INSERT INTO tt_6(trans_id, stmt_id) VALUES(1,1);
-CREATE PROCEDURE pc_i_tt_5_suc (IN p_trans_id INTEGER, IN p_stmt_id INTEGER)
-BEGIN
-DECLARE in_stmt_id INTEGER;
-SELECT max(stmt_id) INTO in_stmt_id FROM tt_5 WHERE trans_id= p_trans_id;
-SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id;
-INSERT INTO tt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id);
-INSERT INTO tt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id + 1);
-END|
-CREATE PROCEDURE pc_i_nt_5_suc (IN p_trans_id INTEGER, IN p_stmt_id INTEGER)
-BEGIN
-DECLARE in_stmt_id INTEGER;
-SELECT max(stmt_id) INTO in_stmt_id FROM nt_5 WHERE trans_id= p_trans_id;
-SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id;
-INSERT INTO nt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id);
-INSERT INTO nt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id + 1);
-END|
-CREATE FUNCTION fc_i_tt_5_suc (p_trans_id INTEGER, p_stmt_id INTEGER) RETURNS VARCHAR(64)
-BEGIN
-DECLARE in_stmt_id INTEGER;
-SELECT max(stmt_id) INTO in_stmt_id FROM tt_5 WHERE trans_id= p_trans_id;
-SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id;
-INSERT INTO tt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id);
-INSERT INTO tt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id + 1);
-RETURN "fc_i_tt_5_suc";
-END|
-CREATE FUNCTION fc_i_nt_5_suc (p_trans_id INTEGER, p_stmt_id INTEGER) RETURNS VARCHAR(64)
-BEGIN
-DECLARE in_stmt_id INTEGER;
-SELECT max(stmt_id) INTO in_stmt_id FROM nt_5 WHERE trans_id= p_trans_id;
-SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id;
-INSERT INTO nt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id);
-INSERT INTO nt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id + 1);
-RETURN "fc_i_nt_5_suc";
-END|
-CREATE TRIGGER tr_i_tt_3_to_nt_3 AFTER INSERT ON tt_3 FOR EACH ROW
-BEGIN
-DECLARE in_stmt_id INTEGER;
-SELECT max(stmt_id) INTO in_stmt_id FROM nt_3 WHERE trans_id= NEW.trans_id;
-SELECT COALESCE(greatest(in_stmt_id + 1, NEW.stmt_id), 1) INTO in_stmt_id;
-INSERT INTO nt_3(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id);
-INSERT INTO nt_3(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id + 1);
-END|
-CREATE TRIGGER tr_i_nt_4_to_tt_4 AFTER INSERT ON nt_4 FOR EACH ROW
-BEGIN
-DECLARE in_stmt_id INTEGER;
-SELECT max(stmt_id) INTO in_stmt_id FROM tt_4 WHERE trans_id= NEW.trans_id;
-SELECT COALESCE(greatest(in_stmt_id + 1, NEW.stmt_id), 1) INTO in_stmt_id;
-INSERT INTO tt_4(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id);
-INSERT INTO tt_4(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id + 1);
-END|
-CREATE TRIGGER tr_i_tt_5_to_tt_6 AFTER INSERT ON tt_5 FOR EACH ROW
-BEGIN
-DECLARE in_stmt_id INTEGER;
-SELECT max(stmt_id) INTO in_stmt_id FROM tt_6 WHERE trans_id= NEW.trans_id;
-SELECT COALESCE(greatest(in_stmt_id + 1, NEW.stmt_id, 1), 1) INTO in_stmt_id;
-INSERT INTO tt_6(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id);
-INSERT INTO tt_6(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id + 1);
-END|
-CREATE TRIGGER tr_i_nt_5_to_nt_6 AFTER INSERT ON nt_5 FOR EACH ROW
-BEGIN
-DECLARE in_stmt_id INTEGER;
-SELECT max(stmt_id) INTO in_stmt_id FROM nt_6 WHERE trans_id= NEW.trans_id;
-SELECT COALESCE(greatest(in_stmt_id + 1, NEW.stmt_id), 1) INTO in_stmt_id;
-INSERT INTO nt_6(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id);
-INSERT INTO nt_6(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id + 1);
-END|
-SET @commands= '';
-###################################################################################
-#                         EXECUTE CASES CRASHING THE XID
-###################################################################################
-SET @failures= 'd,crash_after_apply d,crash_before_update_pos d,crash_after_update_pos_before_apply';
-
-
-
-SET @commands= 'T';
-STOP SLAVE SQL_THREAD;
-SET GLOBAL debug="d,crash_after_apply";;
-FAILURE d,crash_after_apply and OUTCOME O2
--b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(trans_id, stmt_id) VALUES (7, 1);
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (7, 1)
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (7, 1)
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
-
-START SLAVE;
-
-
-
-SET @commands= 'T-trig';
-STOP SLAVE SQL_THREAD;
-SET GLOBAL debug="d,crash_after_apply";;
-FAILURE d,crash_after_apply and OUTCOME O2
--b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_5(trans_id, stmt_id) VALUES (8, 1);
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (8, 1)
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (8, 1)
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e-
-
-START SLAVE;
-
-
-
-SET @commands= 'T-func';
-STOP SLAVE SQL_THREAD;
-SET GLOBAL debug="d,crash_after_apply";;
-FAILURE d,crash_after_apply and OUTCOME O2
--b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b-
-SELECT fc_i_tt_5_suc (9, 1);
-fc_i_tt_5_suc (9, 1)
-fc_i_tt_5_suc
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(9,1)
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(9,1)
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e-
-
-START SLAVE;
-
-
-
-SET @commands= 'T-proc';
-STOP SLAVE SQL_THREAD;
-SET GLOBAL debug="d,crash_after_apply";;
-FAILURE d,crash_after_apply and OUTCOME O2
--b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b-
-CALL pc_i_tt_5_suc (10, 1);
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',10),  NAME_CONST('in_stmt_id',1))
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',10),  NAME_CONST('in_stmt_id',1) + 1)
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',10),  NAME_CONST('in_stmt_id',1))
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',10),  NAME_CONST('in_stmt_id',1) + 1)
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e-
-
-START SLAVE;
-
-
-
-SET @commands= 'B T T-trig C';
-STOP SLAVE SQL_THREAD;
-SET GLOBAL debug="d,crash_after_apply";;
-FAILURE d,crash_after_apply and OUTCOME O2
--b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
-BEGIN;
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(trans_id, stmt_id) VALUES (11, 2);
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_5(trans_id, stmt_id) VALUES (11, 4);
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
-COMMIT;
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (11, 2)
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (11, 4)
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> B T T-trig C << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (11, 2)
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (11, 4)
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> B T T-trig C << -e-e-e-e-e-e-e-e-e-e-e-
-
-START SLAVE;
-
-
-
-SET @commands= 'B T T-func C';
-STOP SLAVE SQL_THREAD;
-SET GLOBAL debug="d,crash_after_apply";;
-FAILURE d,crash_after_apply and OUTCOME O2
--b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
-BEGIN;
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(trans_id, stmt_id) VALUES (12, 2);
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b-
-SELECT fc_i_tt_5_suc (12, 4);
-fc_i_tt_5_suc (12, 4)
-fc_i_tt_5_suc
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
-COMMIT;
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (12, 2)
-master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(12,4)
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> B T T-func C << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (12, 2)
-master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(12,4)
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> B T T-func C << -e-e-e-e-e-e-e-e-e-e-e-
-
-START SLAVE;
-
-
-
-SET @commands= 'B T T-proc C';
-STOP SLAVE SQL_THREAD;
-SET GLOBAL debug="d,crash_after_apply";;
-FAILURE d,crash_after_apply and OUTCOME O2
--b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
-BEGIN;
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(trans_id, stmt_id) VALUES (13, 2);
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b-
-CALL pc_i_tt_5_suc (13, 4);
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
-COMMIT;
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (13, 2)
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',13),  NAME_CONST('in_stmt_id',1))
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',13),  NAME_CONST('in_stmt_id',1) + 1)
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> B T T-proc C << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (13, 2)
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',13),  NAME_CONST('in_stmt_id',1))
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',13),  NAME_CONST('in_stmt_id',1) + 1)
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> B T T-proc C << -e-e-e-e-e-e-e-e-e-e-e-
-
-START SLAVE;
-
-
-
-SET @commands= 'B T-trig T C';
-STOP SLAVE SQL_THREAD;
-SET GLOBAL debug="d,crash_after_apply";;
-FAILURE d,crash_after_apply and OUTCOME O2
--b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
-BEGIN;
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_5(trans_id, stmt_id) VALUES (14, 2);
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(trans_id, stmt_id) VALUES (14, 4);
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
-COMMIT;
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (14, 2)
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (14, 4)
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> B T-trig T C << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (14, 2)
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (14, 4)
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> B T-trig T C << -e-e-e-e-e-e-e-e-e-e-e-
-
-START SLAVE;
-
-
-
-SET @commands= 'B T-func T C';
-STOP SLAVE SQL_THREAD;
-SET GLOBAL debug="d,crash_after_apply";;
-FAILURE d,crash_after_apply and OUTCOME O2
--b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
-BEGIN;
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b-
-SELECT fc_i_tt_5_suc (15, 2);
-fc_i_tt_5_suc (15, 2)
-fc_i_tt_5_suc
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(trans_id, stmt_id) VALUES (15, 4);
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
-COMMIT;
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(15,2)
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (15, 4)
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> B T-func T C << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(15,2)
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (15, 4)
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> B T-func T C << -e-e-e-e-e-e-e-e-e-e-e-
-
-START SLAVE;
-
-
-
-SET @commands= 'B T-proc T C';
-STOP SLAVE SQL_THREAD;
-SET GLOBAL debug="d,crash_after_apply";;
-FAILURE d,crash_after_apply and OUTCOME O2
--b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
-BEGIN;
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b-
-CALL pc_i_tt_5_suc (16, 2);
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(trans_id, stmt_id) VALUES (16, 4);
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
-COMMIT;
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',16),  NAME_CONST('in_stmt_id',1))
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',16),  NAME_CONST('in_stmt_id',1) + 1)
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (16, 4)
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> B T-proc T C << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',16),  NAME_CONST('in_stmt_id',1))
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',16),  NAME_CONST('in_stmt_id',1) + 1)
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (16, 4)
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> B T-proc T C << -e-e-e-e-e-e-e-e-e-e-e-
-
-START SLAVE;
-
-
-
-SET @commands= 'T';
-STOP SLAVE SQL_THREAD;
-SET GLOBAL debug="d,crash_before_update_pos";;
-FAILURE d,crash_before_update_pos and OUTCOME O1
--b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(trans_id, stmt_id) VALUES (17, 1);
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (17, 1)
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (17, 1)
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
-
-START SLAVE;
-
-
-
-SET @commands= 'T-trig';
-STOP SLAVE SQL_THREAD;
-SET GLOBAL debug="d,crash_before_update_pos";;
-FAILURE d,crash_before_update_pos and OUTCOME O1
--b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_5(trans_id, stmt_id) VALUES (18, 1);
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (18, 1)
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (18, 1)
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e-
-
-START SLAVE;
-
-
-
-SET @commands= 'T-func';
-STOP SLAVE SQL_THREAD;
-SET GLOBAL debug="d,crash_before_update_pos";;
-FAILURE d,crash_before_update_pos and OUTCOME O1
--b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b-
-SELECT fc_i_tt_5_suc (19, 1);
-fc_i_tt_5_suc (19, 1)
-fc_i_tt_5_suc
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(19,1)
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(19,1)
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e-
-
-START SLAVE;
-
-
-
-SET @commands= 'T-proc';
-STOP SLAVE SQL_THREAD;
-SET GLOBAL debug="d,crash_before_update_pos";;
-FAILURE d,crash_before_update_pos and OUTCOME O1
--b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b-
-CALL pc_i_tt_5_suc (20, 1);
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',20),  NAME_CONST('in_stmt_id',1))
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',20),  NAME_CONST('in_stmt_id',1) + 1)
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',20),  NAME_CONST('in_stmt_id',1))
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',20),  NAME_CONST('in_stmt_id',1) + 1)
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e-
-
-START SLAVE;
-
-
-
-SET @commands= 'B T T-trig C';
-STOP SLAVE SQL_THREAD;
-SET GLOBAL debug="d,crash_before_update_pos";;
-FAILURE d,crash_before_update_pos and OUTCOME O1
--b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
-BEGIN;
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(trans_id, stmt_id) VALUES (21, 2);
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_5(trans_id, stmt_id) VALUES (21, 4);
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
-COMMIT;
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (21, 2)
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (21, 4)
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> B T T-trig C << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (21, 2)
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (21, 4)
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> B T T-trig C << -e-e-e-e-e-e-e-e-e-e-e-
-
-START SLAVE;
-
-
-
-SET @commands= 'B T T-func C';
-STOP SLAVE SQL_THREAD;
-SET GLOBAL debug="d,crash_before_update_pos";;
-FAILURE d,crash_before_update_pos and OUTCOME O1
--b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
-BEGIN;
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(trans_id, stmt_id) VALUES (22, 2);
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b-
-SELECT fc_i_tt_5_suc (22, 4);
-fc_i_tt_5_suc (22, 4)
-fc_i_tt_5_suc
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
-COMMIT;
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (22, 2)
-master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(22,4)
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> B T T-func C << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (22, 2)
-master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(22,4)
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> B T T-func C << -e-e-e-e-e-e-e-e-e-e-e-
-
-START SLAVE;
-
-
-
-SET @commands= 'B T T-proc C';
-STOP SLAVE SQL_THREAD;
-SET GLOBAL debug="d,crash_before_update_pos";;
-FAILURE d,crash_before_update_pos and OUTCOME O1
--b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
-BEGIN;
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(trans_id, stmt_id) VALUES (23, 2);
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b-
-CALL pc_i_tt_5_suc (23, 4);
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
-COMMIT;
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (23, 2)
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',23),  NAME_CONST('in_stmt_id',1))
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',23),  NAME_CONST('in_stmt_id',1) + 1)
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> B T T-proc C << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (23, 2)
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',23),  NAME_CONST('in_stmt_id',1))
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',23),  NAME_CONST('in_stmt_id',1) + 1)
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> B T T-proc C << -e-e-e-e-e-e-e-e-e-e-e-
-
-START SLAVE;
-
-
-
-SET @commands= 'B T-trig T C';
-STOP SLAVE SQL_THREAD;
-SET GLOBAL debug="d,crash_before_update_pos";;
-FAILURE d,crash_before_update_pos and OUTCOME O1
--b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
-BEGIN;
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_5(trans_id, stmt_id) VALUES (24, 2);
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(trans_id, stmt_id) VALUES (24, 4);
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
-COMMIT;
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (24, 2)
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (24, 4)
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> B T-trig T C << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (24, 2)
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (24, 4)
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> B T-trig T C << -e-e-e-e-e-e-e-e-e-e-e-
-
-START SLAVE;
-
-
-
-SET @commands= 'B T-func T C';
-STOP SLAVE SQL_THREAD;
-SET GLOBAL debug="d,crash_before_update_pos";;
-FAILURE d,crash_before_update_pos and OUTCOME O1
--b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
-BEGIN;
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b-
-SELECT fc_i_tt_5_suc (25, 2);
-fc_i_tt_5_suc (25, 2)
-fc_i_tt_5_suc
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(trans_id, stmt_id) VALUES (25, 4);
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
-COMMIT;
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(25,2)
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (25, 4)
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> B T-func T C << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(25,2)
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (25, 4)
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> B T-func T C << -e-e-e-e-e-e-e-e-e-e-e-
-
-START SLAVE;
-
-
-
-SET @commands= 'B T-proc T C';
-STOP SLAVE SQL_THREAD;
-SET GLOBAL debug="d,crash_before_update_pos";;
-FAILURE d,crash_before_update_pos and OUTCOME O1
--b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
-BEGIN;
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b-
-CALL pc_i_tt_5_suc (26, 2);
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(trans_id, stmt_id) VALUES (26, 4);
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
-COMMIT;
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',26),  NAME_CONST('in_stmt_id',1))
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',26),  NAME_CONST('in_stmt_id',1) + 1)
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (26, 4)
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> B T-proc T C << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',26),  NAME_CONST('in_stmt_id',1))
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',26),  NAME_CONST('in_stmt_id',1) + 1)
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (26, 4)
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> B T-proc T C << -e-e-e-e-e-e-e-e-e-e-e-
-
-START SLAVE;
-
-
-
-SET @commands= 'T';
-STOP SLAVE SQL_THREAD;
-SET GLOBAL debug="d,crash_after_update_pos_before_apply";;
-FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1
--b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(trans_id, stmt_id) VALUES (27, 1);
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (27, 1)
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (27, 1)
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
-
-START SLAVE;
-
-
-
-SET @commands= 'T-trig';
-STOP SLAVE SQL_THREAD;
-SET GLOBAL debug="d,crash_after_update_pos_before_apply";;
-FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1
--b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_5(trans_id, stmt_id) VALUES (28, 1);
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (28, 1)
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (28, 1)
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e-
-
-START SLAVE;
-
-
-
-SET @commands= 'T-func';
-STOP SLAVE SQL_THREAD;
-SET GLOBAL debug="d,crash_after_update_pos_before_apply";;
-FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1
--b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b-
-SELECT fc_i_tt_5_suc (29, 1);
-fc_i_tt_5_suc (29, 1)
-fc_i_tt_5_suc
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(29,1)
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(29,1)
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e-
-
-START SLAVE;
-
-
-
-SET @commands= 'T-proc';
-STOP SLAVE SQL_THREAD;
-SET GLOBAL debug="d,crash_after_update_pos_before_apply";;
-FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1
--b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b-
-CALL pc_i_tt_5_suc (30, 1);
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',30),  NAME_CONST('in_stmt_id',1))
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',30),  NAME_CONST('in_stmt_id',1) + 1)
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',30),  NAME_CONST('in_stmt_id',1))
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',30),  NAME_CONST('in_stmt_id',1) + 1)
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e-
-
-START SLAVE;
-
-
-
-SET @commands= 'B T T-trig C';
-STOP SLAVE SQL_THREAD;
-SET GLOBAL debug="d,crash_after_update_pos_before_apply";;
-FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1
--b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
-BEGIN;
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(trans_id, stmt_id) VALUES (31, 2);
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_5(trans_id, stmt_id) VALUES (31, 4);
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
-COMMIT;
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (31, 2)
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (31, 4)
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> B T T-trig C << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (31, 2)
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (31, 4)
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> B T T-trig C << -e-e-e-e-e-e-e-e-e-e-e-
-
-START SLAVE;
-
-
-
-SET @commands= 'B T T-func C';
-STOP SLAVE SQL_THREAD;
-SET GLOBAL debug="d,crash_after_update_pos_before_apply";;
-FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1
--b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
-BEGIN;
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(trans_id, stmt_id) VALUES (32, 2);
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b-
-SELECT fc_i_tt_5_suc (32, 4);
-fc_i_tt_5_suc (32, 4)
-fc_i_tt_5_suc
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
-COMMIT;
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (32, 2)
-master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(32,4)
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> B T T-func C << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (32, 2)
-master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(32,4)
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> B T T-func C << -e-e-e-e-e-e-e-e-e-e-e-
-
-START SLAVE;
-
-
-
-SET @commands= 'B T T-proc C';
-STOP SLAVE SQL_THREAD;
-SET GLOBAL debug="d,crash_after_update_pos_before_apply";;
-FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1
--b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
-BEGIN;
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(trans_id, stmt_id) VALUES (33, 2);
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b-
-CALL pc_i_tt_5_suc (33, 4);
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
-COMMIT;
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (33, 2)
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',33),  NAME_CONST('in_stmt_id',1))
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',33),  NAME_CONST('in_stmt_id',1) + 1)
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> B T T-proc C << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (33, 2)
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',33),  NAME_CONST('in_stmt_id',1))
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',33),  NAME_CONST('in_stmt_id',1) + 1)
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> B T T-proc C << -e-e-e-e-e-e-e-e-e-e-e-
-
-START SLAVE;
-
-
-
-SET @commands= 'B T-trig T C';
-STOP SLAVE SQL_THREAD;
-SET GLOBAL debug="d,crash_after_update_pos_before_apply";;
-FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1
--b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
-BEGIN;
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_5(trans_id, stmt_id) VALUES (34, 2);
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(trans_id, stmt_id) VALUES (34, 4);
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
-COMMIT;
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (34, 2)
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (34, 4)
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> B T-trig T C << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (34, 2)
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (34, 4)
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> B T-trig T C << -e-e-e-e-e-e-e-e-e-e-e-
-
-START SLAVE;
-
-
-
-SET @commands= 'B T-func T C';
-STOP SLAVE SQL_THREAD;
-SET GLOBAL debug="d,crash_after_update_pos_before_apply";;
-FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1
--b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
-BEGIN;
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b-
-SELECT fc_i_tt_5_suc (35, 2);
-fc_i_tt_5_suc (35, 2)
-fc_i_tt_5_suc
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(trans_id, stmt_id) VALUES (35, 4);
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
-COMMIT;
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(35,2)
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (35, 4)
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> B T-func T C << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_tt_5_suc`(35,2)
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (35, 4)
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> B T-func T C << -e-e-e-e-e-e-e-e-e-e-e-
-
-START SLAVE;
-
-
-
-SET @commands= 'B T-proc T C';
-STOP SLAVE SQL_THREAD;
-SET GLOBAL debug="d,crash_after_update_pos_before_apply";;
-FAILURE d,crash_after_update_pos_before_apply and OUTCOME O1
--b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b-
-BEGIN;
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b-
-CALL pc_i_tt_5_suc (36, 2);
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(trans_id, stmt_id) VALUES (36, 4);
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
--e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b-
-COMMIT;
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',36),  NAME_CONST('in_stmt_id',1))
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',36),  NAME_CONST('in_stmt_id',1) + 1)
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (36, 4)
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> B T-proc T C << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',36),  NAME_CONST('in_stmt_id',1))
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',36),  NAME_CONST('in_stmt_id',1) + 1)
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (36, 4)
-master-bin.000001	#	Xid	#	#	COMMIT /* XID */
--e-e-e-e-e-e-e-e-e-e-e- >> B T-proc T C << -e-e-e-e-e-e-e-e-e-e-e-
-
-START SLAVE;
-###################################################################################
-#                      EXECUTE CASES CRASHING THE BEGIN/COMMIT
-###################################################################################
-SET @failures= 'd,crash_after_commit_and_update_pos';
-
-
-
-SET @commands= 'N';
-STOP SLAVE SQL_THREAD;
-SET GLOBAL debug="d,crash_after_commit_and_update_pos";;
-FAILURE d,crash_after_commit_and_update_pos and OUTCOME O2
--b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO nt_1(trans_id, stmt_id) VALUES (37, 1);
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (37, 1)
-master-bin.000001	#	Query	#	#	COMMIT
--e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (37, 1)
-master-bin.000001	#	Query	#	#	COMMIT
--e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e-
-
-START SLAVE;
-
-
-
-SET @commands= 'N-trig';
-STOP SLAVE SQL_THREAD;
-SET GLOBAL debug="d,crash_after_commit_and_update_pos";;
-FAILURE d,crash_after_commit_and_update_pos and OUTCOME O2
--b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO nt_5(trans_id, stmt_id) VALUES (38, 1);
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (38, 1)
-master-bin.000001	#	Query	#	#	COMMIT
--e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (38, 1)
-master-bin.000001	#	Query	#	#	COMMIT
--e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e-
-
-START SLAVE;
-
-
-
-SET @commands= 'N-func';
-STOP SLAVE SQL_THREAD;
-SET GLOBAL debug="d,crash_after_commit_and_update_pos";;
-FAILURE d,crash_after_commit_and_update_pos and OUTCOME O2
--b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b-
-SELECT fc_i_nt_5_suc (39, 1);
-fc_i_nt_5_suc (39, 1)
-fc_i_nt_5_suc
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_nt_5_suc`(39,1)
-master-bin.000001	#	Query	#	#	COMMIT
--e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	BEGIN
-master-bin.000001	#	Query	#	#	use `test`; SELECT `test`.`fc_i_nt_5_suc`(39,1)
-master-bin.000001	#	Query	#	#	COMMIT
--e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e-
-
-START SLAVE;
-###################################################################################
-#                               CHECK CONSISTENCY
-###################################################################################
-###################################################################################
-#                                        CLEAN
-###################################################################################
-SET @commands= 'clean';
-DROP TABLE tt_1;
-DROP TABLE tt_2;
-DROP TABLE tt_3;
-DROP TABLE tt_4;
-DROP TABLE tt_5;
-DROP TABLE tt_6;
-DROP TABLE nt_1;
-DROP TABLE nt_2;
-DROP TABLE nt_3;
-DROP TABLE nt_4;
-DROP TABLE nt_5;
-DROP TABLE nt_6;
-DROP PROCEDURE pc_i_tt_5_suc;
-DROP PROCEDURE pc_i_nt_5_suc;
-DROP FUNCTION fc_i_tt_5_suc;
-DROP FUNCTION fc_i_nt_5_suc;
-SET @commands= '';

=== modified file 'mysql-test/suite/rpl/t/rpl_alter_repository.test'
--- a/mysql-test/suite/rpl/t/rpl_alter_repository.test	2011-10-13 14:01:50 +0000
+++ b/mysql-test/suite/rpl/t/rpl_alter_repository.test	2011-10-27 13:28:31 +0000
@@ -6,6 +6,7 @@
 
 --source include/master-slave.inc
 --source include/have_innodb.inc
+--source include/not_mts_slave_parallel_workers.inc
 --connection slave
 --source include/stop_slave.inc
 SHOW CREATE TABLE mysql.slave_relay_log_info;
@@ -228,7 +229,6 @@ SHOW CREATE TABLE mysql.slave_relay_log_
 --echo # Search for occurrences of slave_master_info in the output from mysqldump
 --let $MYSQLD_DATADIR= `select @@datadir`
 --exec $MYSQL_DUMP mysql slave_master_info slave_relay_log_info > $MYSQLTEST_VARDIR/tmp/accessing_repository.sql
---exec $MYSQL_DUMP mysql > accessing_repository.sql
 --let OUTF=$MYSQLTEST_VARDIR/tmp/accessing_repository.sql
 perl;
   use strict;
@@ -248,8 +248,11 @@ DROP TABLE t_innodb;
 --sync_slave_with_master
 
 --source include/stop_slave.inc
---eval SET @@global.relay_log_info_repository=$saved_relay_repo
---eval SET @@global.master_info_repository=$saved_master_repo
+
+--disable_query_log
+--eval SET @@global.relay_log_info_repository="$saved_relay_repo"
+--eval SET @@global.master_info_repository="$saved_master_repo"
 --eval SET @@global.sync_master_info=$saved_sync_master
+--enable_query_log
 --source include/start_slave.inc
 --source include/rpl_end.inc

=== removed file 'mysql-test/suite/rpl/t/rpl_mixed_crash_safe.test.THIS'
--- a/mysql-test/suite/rpl/t/rpl_mixed_crash_safe.test.THIS	2011-08-19 13:04:28 +0000
+++ b/mysql-test/suite/rpl/t/rpl_mixed_crash_safe.test.THIS	1970-01-01 00:00:00 +0000
@@ -1,15 +0,0 @@
---source include/master-slave.inc
---source include/not_embedded.inc
---source include/not_valgrind.inc
---source include/have_debug.inc
---source include/have_innodb.inc
---source include/have_binlog_format_mixed.inc
---source include/not_mts_slave_parallel_workers.inc
-
-call mtr.add_suppression('Attempting backtrace');
-call mtr.add_suppression("Recovery from master pos .* and file master-bin.000001");
-call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
-call mtr.add_suppression(".*  InnoDB: Warning: allocated tablespace .*, old maximum was .*");
-call mtr.add_suppression(".*int __cxa_pure_virtual().*");
-
---source extra/rpl_tests/rpl_crash_safe.test

=== modified file 'mysql-test/t/compare.test'
--- a/mysql-test/t/compare.test	2008-09-18 12:55:36 +0000
+++ b/mysql-test/t/compare.test	2011-10-27 07:03:49 +0000
@@ -86,3 +86,11 @@ SELECT * FROM t1 WHERE a > '2008-01-01'
 DROP TABLE t1;
 
 --echo End of 5.0 tests
+
+#
+# Bug #11764818 57692: Crash in item_func_in::val_int() with ZEROFILL
+#
+
+CREATE TABLE t1(a INT ZEROFILL);
+SELECT 1 FROM t1 WHERE t1.a IN (1, t1.a) AND t1.a=2;
+DROP TABLE t1;

=== modified file 'mysql-test/t/index_merge_innodb.test'
--- a/mysql-test/t/index_merge_innodb.test	2009-10-07 15:37:36 +0000
+++ b/mysql-test/t/index_merge_innodb.test	2011-10-27 08:40:40 +0000
@@ -28,3 +28,24 @@ let $merge_table_support= 0;
 
 --source include/index_merge_2sweeps.inc
 --source include/index_merge_ror_cpk.inc
+
+
+--echo #
+--echo # Bug#11747423 32254: INDEX MERGE USED UNNECESSARILY
+--echo #
+CREATE TABLE t1 (
+  id INT NOT NULL PRIMARY KEY,
+  id2 INT NOT NULL,
+  id3 INT NOT NULL,
+  KEY (id2),
+  KEY (id3),
+  KEY covering_index (id2,id3)
+) ENGINE=InnoDB;
+
+INSERT INTO t1 VALUES (0, 0, 0), (1, 1, 1), (2, 2, 2), (3, 3, 3), (4, 4, 4), (5, 5, 5), (6, 6, 6), (7, 7, 7);
+INSERT INTO t1 SELECT id + 8, id2 + 8, id3 +8 FROM t1;
+INSERT INTO t1 SELECT id + 16, 7, 0 FROM t1;
+
+EXPLAIN SELECT SQL_NO_CACHE count(*) FROM t1 WHERE id2=7 AND id3=0;
+
+DROP TABLE t1;

=== modified file 'mysql-test/t/plugin.test'
--- a/mysql-test/t/plugin.test	2011-01-11 13:27:03 +0000
+++ b/mysql-test/t/plugin.test	2011-10-27 08:43:56 +0000
@@ -17,7 +17,7 @@ eval INSTALL PLUGIN example SONAME '$EXA
 
 CREATE TABLE t1(a int) ENGINE=EXAMPLE;
 
-# Let's do some advanced ops with the example engine :)
+--error ER_ILLEGAL_HA
 SELECT * FROM t1;
 
 DROP TABLE t1;

=== modified file 'mysql-test/t/sp-error.test'
--- a/mysql-test/t/sp-error.test	2011-10-14 15:04:41 +0000
+++ b/mysql-test/t/sp-error.test	2011-10-27 09:26:31 +0000
@@ -3776,3 +3776,38 @@ delimiter ;|
 --echo
 DROP PROCEDURE p1;
 DROP PROCEDURE p2;
+
+
+--echo #
+--echo # Bug#13113222 RQG_SIGNAL_RESIGNAL FAILED WITH ASSERTION.
+--echo #
+
+--disable_warnings
+DROP PROCEDURE IF EXISTS p1;
+DROP PROCEDURE IF EXISTS p2;
+--enable_warnings
+
+delimiter |;
+CREATE PROCEDURE p1()
+BEGIN
+  DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SELECT 'triggered p1';
+  # This will trigger an error.
+  SIGNAL SQLSTATE 'HY000';
+END|
+
+CREATE PROCEDURE p2()
+BEGIN
+  DECLARE CONTINUE HANDLER FOR SQLWARNING SELECT 'triggered p2';
+  # This will trigger a warning.
+  SIGNAL SQLSTATE '01000';
+END|
+delimiter ;|
+
+SET @old_max_error_count=  @@session.max_error_count;
+SET SESSION max_error_count= 0;
+CALL p1();
+CALL p2();
+SET SESSION max_error_count= @old_max_error_count;
+
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;

=== modified file 'mysql-test/t/user_var.test'
--- a/mysql-test/t/user_var.test	2011-03-08 19:14:42 +0000
+++ b/mysql-test/t/user_var.test	2011-10-27 08:08:46 +0000
@@ -405,3 +405,13 @@ DROP TRIGGER trg1;
 DROP TABLE t1;
 
 --echo End of 5.5 tests
+
+#
+# Bug #11764372 57197: EVEN MORE USER VARIABLE CRASHING FUN
+#
+
+CREATE TABLE t1(a int);
+INSERT INTO t1 VALUES (1), (2);
+SELECT DISTINCT @a:=MIN(t1.a) FROM t1, t1 AS t2
+GROUP BY @b:=(SELECT COUNT(*) > t2.a);
+DROP TABLE t1;

=== modified file 'scripts/mysql_system_tables.sql'
--- a/scripts/mysql_system_tables.sql	2011-10-12 20:15:19 +0000
+++ b/scripts/mysql_system_tables.sql	2011-10-27 21:18:19 +0000
@@ -225,6 +225,7 @@ DROP PREPARE stmt;
 SET @cmd="CREATE TABLE performance_schema.events_waits_current("
   "THREAD_ID INTEGER not null,"
   "EVENT_ID BIGINT unsigned not null,"
+  "END_EVENT_ID BIGINT unsigned,"
   "EVENT_NAME VARCHAR(128) not null,"
   "SOURCE VARCHAR(64),"
   "TIMER_START BIGINT unsigned,"
@@ -255,6 +256,7 @@ DROP PREPARE stmt;
 SET @cmd="CREATE TABLE performance_schema.events_waits_history("
   "THREAD_ID INTEGER not null,"
   "EVENT_ID BIGINT unsigned not null,"
+  "END_EVENT_ID BIGINT unsigned,"
   "EVENT_NAME VARCHAR(128) not null,"
   "SOURCE VARCHAR(64),"
   "TIMER_START BIGINT unsigned,"
@@ -285,6 +287,7 @@ DROP PREPARE stmt;
 SET @cmd="CREATE TABLE performance_schema.events_waits_history_long("
   "THREAD_ID INTEGER not null,"
   "EVENT_ID BIGINT unsigned not null,"
+  "END_EVENT_ID BIGINT unsigned,"
   "EVENT_NAME VARCHAR(128) not null,"
   "SOURCE VARCHAR(64),"
   "TIMER_START BIGINT unsigned,"
@@ -961,6 +964,7 @@ DROP PREPARE stmt;
 SET @cmd="CREATE TABLE performance_schema.events_stages_current("
   "THREAD_ID INTEGER not null,"
   "EVENT_ID BIGINT unsigned not null,"
+  "END_EVENT_ID BIGINT unsigned,"
   "EVENT_NAME VARCHAR(128) not null,"
   "SOURCE VARCHAR(64),"
   "TIMER_START BIGINT unsigned,"
@@ -982,6 +986,7 @@ DROP PREPARE stmt;
 SET @cmd="CREATE TABLE performance_schema.events_stages_history("
   "THREAD_ID INTEGER not null,"
   "EVENT_ID BIGINT unsigned not null,"
+  "END_EVENT_ID BIGINT unsigned,"
   "EVENT_NAME VARCHAR(128) not null,"
   "SOURCE VARCHAR(64),"
   "TIMER_START BIGINT unsigned,"
@@ -1003,6 +1008,7 @@ DROP PREPARE stmt;
 SET @cmd="CREATE TABLE performance_schema.events_stages_history_long("
   "THREAD_ID INTEGER not null,"
   "EVENT_ID BIGINT unsigned not null,"
+  "END_EVENT_ID BIGINT unsigned,"
   "EVENT_NAME VARCHAR(128) not null,"
   "SOURCE VARCHAR(64),"
   "TIMER_START BIGINT unsigned,"
@@ -1119,6 +1125,7 @@ DROP PREPARE stmt;
 SET @cmd="CREATE TABLE performance_schema.events_statements_current("
   "THREAD_ID INTEGER not null,"
   "EVENT_ID BIGINT unsigned not null,"
+  "END_EVENT_ID BIGINT unsigned,"
   "EVENT_NAME VARCHAR(128) not null,"
   "SOURCE VARCHAR(64),"
   "TIMER_START BIGINT unsigned,"
@@ -1168,6 +1175,7 @@ DROP PREPARE stmt;
 SET @cmd="CREATE TABLE performance_schema.events_statements_history("
   "THREAD_ID INTEGER not null,"
   "EVENT_ID BIGINT unsigned not null,"
+  "END_EVENT_ID BIGINT unsigned,"
   "EVENT_NAME VARCHAR(128) not null,"
   "SOURCE VARCHAR(64),"
   "TIMER_START BIGINT unsigned,"
@@ -1217,6 +1225,7 @@ DROP PREPARE stmt;
 SET @cmd="CREATE TABLE performance_schema.events_statements_history_long("
   "THREAD_ID INTEGER not null,"
   "EVENT_ID BIGINT unsigned not null,"
+  "END_EVENT_ID BIGINT unsigned,"
   "EVENT_NAME VARCHAR(128) not null,"
   "SOURCE VARCHAR(64),"
   "TIMER_START BIGINT unsigned,"

=== modified file 'sql/event_db_repository.cc'
--- a/sql/event_db_repository.cc	2011-07-28 10:54:44 +0000
+++ b/sql/event_db_repository.cc	2011-10-27 08:43:56 +0000
@@ -490,7 +490,8 @@ Event_db_repository::table_scan_all_for_
   READ_RECORD read_record_info;
   DBUG_ENTER("Event_db_repository::table_scan_all_for_i_s");
 
-  init_read_record(&read_record_info, thd, event_table, NULL, 1, 0, FALSE);
+  if (init_read_record(&read_record_info, thd, event_table, NULL, 1, 1, FALSE))
+    DBUG_RETURN(TRUE);
 
   /*
     rr_sequential, in read_record(), returns 137==HA_ERR_END_OF_FILE,
@@ -508,7 +509,7 @@ Event_db_repository::table_scan_all_for_
   end_read_record(&read_record_info);
 
   /*  ret is guaranteed to be != 0 */
-  DBUG_RETURN(ret == -1? FALSE:TRUE);
+  DBUG_RETURN(ret == -1 ? FALSE : TRUE);
 }
 
 
@@ -994,7 +995,8 @@ Event_db_repository::drop_schema_events(
     DBUG_VOID_RETURN;
 
   /* only enabled events are in memory, so we go now and delete the rest */
-  init_read_record(&read_record_info, thd, table, NULL, 1, 0, FALSE);
+  if (init_read_record(&read_record_info, thd, table, NULL, 1, 1, FALSE))
+    DBUG_VOID_RETURN;
   while (!ret && !(read_record_info.read_record(&read_record_info)) )
   {
     char *et_field= get_field(thd->mem_root, table->field[field]);

=== modified file 'sql/events.cc'
--- a/sql/events.cc	2011-08-19 13:04:28 +0000
+++ b/sql/events.cc	2011-10-27 08:43:56 +0000
@@ -1100,7 +1100,11 @@ Events::load_events_from_db(THD *thd)
     DBUG_RETURN(TRUE);
   }
 
-  init_read_record(&read_record_info, thd, table, NULL, 0, 1, FALSE);
+  if (init_read_record(&read_record_info, thd, table, NULL, 0, 1, FALSE))
+  {
+    sql_print_error("Event Scheduler: Error while starting read of mysql.event");
+    DBUG_RETURN(TRUE);
+  }
   while (!(read_record_info.read_record(&read_record_info)))
   {
     Event_queue_element *et;

=== modified file 'sql/item_cmpfunc.cc'
--- a/sql/item_cmpfunc.cc	2011-10-18 13:45:29 +0000
+++ b/sql/item_cmpfunc.cc	2011-10-27 07:03:49 +0000
@@ -4242,6 +4242,16 @@ void Item_func_in::fix_length_and_dec()
       }
     }
   }
+  /*
+    Set cmp_context of all arguments. This prevents
+    Item_field::equal_fields_propagator() from transforming a zerofill integer
+    argument into a string constant. Such a change would require rebuilding
+    cmp_itmes.
+   */
+  for (arg= args + 1, arg_end= args + arg_count; arg != arg_end ; arg++)
+  {
+    arg[0]->cmp_context= item_cmp_type(left_result_type, arg[0]->result_type());
+  }
   max_length= 1;
 }
 

=== modified file 'sql/opt_range.cc'
--- a/sql/opt_range.cc	2011-10-12 12:09:14 +0000
+++ b/sql/opt_range.cc	2011-10-27 08:43:56 +0000
@@ -9350,7 +9350,8 @@ int QUICK_INDEX_MERGE_SELECT::read_keys_
   doing_pk_scan= FALSE;
   /* index_merge currently doesn't support "using index" at all */
   head->set_keyread(FALSE);
-  init_read_record(&read_record, thd, head, (SQL_SELECT*) 0, 1 , 1, TRUE);
+  if (init_read_record(&read_record, thd, head, (SQL_SELECT*) 0, 1, 1, TRUE))
+    DBUG_RETURN(1);
   DBUG_RETURN(result);
 }
 

=== modified file 'sql/records.cc'
--- a/sql/records.cc	2011-08-26 08:55:54 +0000
+++ b/sql/records.cc	2011-10-27 08:43:56 +0000
@@ -58,11 +58,15 @@ static int rr_index_desc(READ_RECORD *in
                       occurs (except for end-of-records error)
   @param idx          index to scan
   @param reverse      Scan in the reverse direction
+
+  @retval true   error
+  @retval false  success
 */
 
-void init_read_record_idx(READ_RECORD *info, THD *thd, TABLE *table,
+bool init_read_record_idx(READ_RECORD *info, THD *thd, TABLE *table,
                           bool print_error, uint idx, bool reverse)
 {
+  int error;
   empty_record(table);
   memset(info, 0, sizeof(*info));
   info->thd= thd;
@@ -72,10 +76,17 @@ void init_read_record_idx(READ_RECORD *i
   info->unlock_row= rr_unlock_row;
 
   table->status=0;			/* And it's always found */
-  if (!table->file->inited)
-    table->file->ha_index_init(idx, 1);
+  if (!table->file->inited &&
+      (error= table->file->ha_index_init(idx, 1)))
+  {
+    if (print_error)
+     table->file->print_error(error, MYF(0));
+    return true;
+  }
+
   /* read_record will be changed to rr_index in rr_index_first */
   info->read_record= reverse ? rr_index_last : rr_index_first;
+  return false;
 }
 
 
@@ -163,12 +174,16 @@ void init_read_record_idx(READ_RECORD *i
   --------------
     This is the most basic access method of a table using rnd_init,
     ha_rnd_next and rnd_end. No indexes are used.
+
+  @retval true   error
+  @retval false  success
 */
-void init_read_record(READ_RECORD *info,THD *thd, TABLE *table,
+bool init_read_record(READ_RECORD *info,THD *thd, TABLE *table,
 		      SQL_SELECT *select,
 		      int use_record_cache, bool print_error, 
                       bool disable_rr_cache)
 {
+  int error= 0;
   IO_CACHE *tempfile;
   DBUG_ENTER("init_read_record");
 
@@ -219,8 +234,9 @@ void init_read_record(READ_RECORD *info,
     info->io_cache=tempfile;
     reinit_io_cache(info->io_cache,READ_CACHE,0L,0,0);
     info->ref_pos=table->file->ref;
-    if (!table->file->inited)
-      table->file->ha_rnd_init(0);
+    if (!table->file->inited &&
+        (error= table->file->ha_rnd_init(0)))
+      goto err;
 
     /*
       table->sort.addon_field is checked because if we use addon fields,
@@ -242,11 +258,10 @@ void init_read_record(READ_RECORD *info,
 	!table->s->blob_fields &&
         info->ref_length <= MAX_REFLENGTH)
     {
-      if (! init_rr_cache(thd, info))
-      {
-	DBUG_PRINT("info",("using rr_from_cache"));
-	info->read_record=rr_from_cache;
-      }
+      if (init_rr_cache(thd, info))
+        DBUG_RETURN(true);
+      DBUG_PRINT("info",("using rr_from_cache"));
+      info->read_record=rr_from_cache;
     }
   }
   else if (select && select->quick)
@@ -257,7 +272,8 @@ void init_read_record(READ_RECORD *info,
   else if (table->sort.record_pointers)
   {
     DBUG_PRINT("info",("using record_pointers"));
-    table->file->ha_rnd_init(0);
+    if ((error= table->file->ha_rnd_init(0)))
+      goto err;
     info->cache_pos=table->sort.record_pointers;
     info->cache_end=info->cache_pos+ 
                     table->sort.found_records*info->ref_length;
@@ -268,7 +284,8 @@ void init_read_record(READ_RECORD *info,
   {
     DBUG_PRINT("info",("using rr_sequential"));
     info->read_record=rr_sequential;
-    table->file->ha_rnd_init(1);
+    if ((error= table->file->ha_rnd_init(1)))
+      goto err;
     /* We can use record cache if we don't update dynamic length tables */
     if (!table->no_cache &&
 	(use_record_cache > 0 ||
@@ -290,7 +307,12 @@ void init_read_record(READ_RECORD *info,
       !table->file->pushed_cond)
     table->file->cond_push(select->cond);
 
-  DBUG_VOID_RETURN;
+  DBUG_RETURN(false);
+
+err:
+  if (print_error)
+    table->file->print_error(error, MYF(0));     
+  DBUG_RETURN(true);
 } /* init_read_record */
 
 

=== modified file 'sql/records.h'
--- a/sql/records.h	2011-07-28 12:53:50 +0000
+++ b/sql/records.h	2011-10-27 08:43:56 +0000
@@ -28,13 +28,16 @@ class SQL_SELECT;
   index read, scan, etc, use of cache, etc.
 
   Use by:
+@code
   READ_RECORD read_record;
-  init_read_record(&read_record, ...);
+  if (init_read_record(&read_record, ...))
+    return TRUE;
   while (read_record.read_record())
   {
     ...
   }
   end_read_record();
+@endcode
 */
 
 class Copy_field;
@@ -70,10 +73,10 @@ public:
   READ_RECORD() {}
 };
 
-void init_read_record(READ_RECORD *info, THD *thd, TABLE *reg_form,
+bool init_read_record(READ_RECORD *info, THD *thd, TABLE *reg_form,
 		      SQL_SELECT *select, int use_record_cache,
                       bool print_errors, bool disable_rr_cache);
-void init_read_record_idx(READ_RECORD *info, THD *thd, TABLE *table,
+bool init_read_record_idx(READ_RECORD *info, THD *thd, TABLE *table,
                           bool print_error, uint idx, bool reverse);
 void end_read_record(READ_RECORD *info);
 

=== modified file 'sql/rpl_slave.cc'
--- a/sql/rpl_slave.cc	2011-10-13 14:01:50 +0000
+++ b/sql/rpl_slave.cc	2011-10-20 13:06:58 +0000
@@ -3952,6 +3952,9 @@ bool mts_recovery_groups(Relay_log_info
   LOG_INFO linfo;
   my_off_t offset= 0;
 
+  DBUG_ENTER("mts_recovery_groups");
+  DBUG_ASSERT(rli->recovery_parallel_workers > 0);
+
   /*
     Save relay log position to compare with worker's position.
   */
@@ -3961,8 +3964,10 @@ bool mts_recovery_groups(Relay_log_info
     rli->get_group_master_log_pos()
   };
 
-  DBUG_ENTER("mts_recovery_groups");
-  DBUG_ASSERT(rli->recovery_parallel_workers > 0);
+  Format_description_log_event fdle(BINLOG_VERSION), *p_fdle= &fdle;
+
+  if (!p_fdle->is_valid())
+    DBUG_RETURN(TRUE);
 
   /*
     Gathers information on valuable workers and stores it in 
@@ -3975,6 +3980,13 @@ bool mts_recovery_groups(Relay_log_info
   {
     Slave_worker *worker=
       Rpl_info_factory::create_worker(opt_rli_repository_id, id, rli);
+
+    if (!worker)
+    {
+      error= TRUE;
+      goto err;
+    }
+
     worker->init_info();
     LOG_POS_COORD w_last= { const_cast<char*>(worker->get_group_master_log_name()),
                             worker->get_group_master_log_pos() };
@@ -4019,13 +4031,6 @@ bool mts_recovery_groups(Relay_log_info
         while(!eof);
         continue;
   */
-  Format_description_log_event fdle(BINLOG_VERSION), *p_fdle= &fdle;
-
-  if (!p_fdle->is_valid())
-  {
-    error= TRUE;
-    goto err;
-  }
 
   bitmap_clear_all(groups);
   rli->mts_recovery_group_cnt= 0;

=== modified file 'sql/sp_head.cc'
--- a/sql/sp_head.cc	2011-10-14 15:04:41 +0000
+++ b/sql/sp_head.cc	2011-10-27 12:13:46 +0000
@@ -2916,11 +2916,16 @@ sp_lex_keeper::reset_lex_and_exec_core(T
     /*
       Check whenever we have access to tables for this statement
       and open and lock them before executing instructions core function.
+      If we are not opening any tables, we don't need to check permissions
+      either.
     */
-    res= (open_temporary_tables(thd, m_lex->query_tables) ||
-          check_table_access(thd, SELECT_ACL, m_lex->query_tables, FALSE,
-                             UINT_MAX, FALSE) ||
-          open_and_lock_tables(thd, m_lex->query_tables, TRUE, 0));
+    if (m_lex->query_tables)
+      res= (open_temporary_tables(thd, m_lex->query_tables) ||
+            check_table_access(thd, SELECT_ACL, m_lex->query_tables, false,
+                               UINT_MAX, false));
+
+    if (!res)
+      res= open_and_lock_tables(thd, m_lex->query_tables, true, 0);
 
     if (!res)
     {

=== modified file 'sql/sp_rcontext.cc'
--- a/sql/sp_rcontext.cc	2011-10-11 15:01:02 +0000
+++ b/sql/sp_rcontext.cc	2011-10-27 09:26:31 +0000
@@ -230,6 +230,23 @@ bool sp_rcontext::handle_sql_condition(T
 
     if (found_handler)
       found_condition= da->get_error_condition();
+
+    /*
+      Found condition can be NULL if the diagnostics area was full
+      when the error was raised. It can also be NULL if
+      Diagnostics_area::set_error_status(uint sql_error) was used.
+      In these cases, make a temporary Sql_condition here so the
+      error can be handled.
+    */
+    if (!found_condition)
+    {
+      Sql_condition *condition=
+        new (callers_arena->mem_root) Sql_condition(callers_arena->mem_root);
+      condition->set(da->sql_errno(), da->get_sqlstate(),
+                     Sql_condition::WARN_LEVEL_ERROR,
+                     da->message());
+      found_condition= condition;
+    }
   }
   else if (da->current_statement_warn_count())
   {

=== modified file 'sql/sql_acl.cc'
--- a/sql/sql_acl.cc	2011-09-21 11:49:00 +0000
+++ b/sql/sql_acl.cc	2011-10-27 08:43:56 +0000
@@ -713,8 +713,9 @@ static my_bool acl_load(THD *thd, TABLE_
   acl_cache->clear(1);				// Clear locked hostname cache
 
   init_sql_alloc(&mem, ACL_ALLOC_BLOCK_SIZE, 0);
-  init_read_record(&read_record_info,thd,table= tables[0].table,NULL,1,0, 
-                   FALSE);
+  if (init_read_record(&read_record_info, thd, table= tables[0].table,
+                       NULL, 1, 1, FALSE))
+    goto end;
   table->use_all_columns();
   (void) my_init_dynamic_array(&acl_hosts,sizeof(ACL_HOST),20,50);
   while (!(read_record_info.read_record(&read_record_info)))
@@ -763,7 +764,9 @@ static my_bool acl_load(THD *thd, TABLE_
   end_read_record(&read_record_info);
   freeze_size(&acl_hosts);
 
-  init_read_record(&read_record_info,thd,table=tables[1].table,NULL,1,0,FALSE);
+  if (init_read_record(&read_record_info, thd, table=tables[1].table,
+                       NULL, 1, 1, FALSE))
+    goto end;
   table->use_all_columns();
   (void) my_init_dynamic_array(&acl_users,sizeof(ACL_USER),50,100);
   password_length= table->field[2]->field_length /
@@ -968,7 +971,9 @@ static my_bool acl_load(THD *thd, TABLE_
   end_read_record(&read_record_info);
   freeze_size(&acl_users);
 
-  init_read_record(&read_record_info,thd,table=tables[2].table,NULL,1,0,FALSE);
+  if (init_read_record(&read_record_info, thd, table=tables[2].table,
+                       NULL, 1, 1, FALSE))
+    goto end;
   table->use_all_columns();
   (void) my_init_dynamic_array(&acl_dbs,sizeof(ACL_DB),50,100);
   while (!(read_record_info.read_record(&read_record_info)))
@@ -1031,8 +1036,9 @@ static my_bool acl_load(THD *thd, TABLE_
                                50, 100);
   if (tables[3].table)
   {
-    init_read_record(&read_record_info, thd, table= tables[3].table, NULL, 1, 
-                     0, FALSE);
+    if (init_read_record(&read_record_info, thd, table= tables[3].table,
+                         NULL, 1, 1, FALSE))
+      goto end;
     table->use_all_columns();
     while (!(read_record_info.read_record(&read_record_info)))
     {

=== modified file 'sql/sql_class.h'
--- a/sql/sql_class.h	2011-10-14 15:04:41 +0000
+++ b/sql/sql_class.h	2011-10-27 08:08:46 +0000
@@ -3722,7 +3722,8 @@ public:
     if (copy_field)				/* Fix for Intel compiler */
     {
       delete [] copy_field;
-      save_copy_field= copy_field= 0;
+      save_copy_field= copy_field= NULL;
+      save_copy_field_end= copy_field_end= NULL;
     }
   }
 };

=== modified file 'sql/sql_delete.cc'
--- a/sql/sql_delete.cc	2011-07-20 10:29:12 +0000
+++ b/sql/sql_delete.cc	2011-10-27 08:43:56 +0000
@@ -311,10 +311,22 @@ bool mysql_delete(THD *thd, TABLE_LIST *
     free_underlaid_joins(thd, select_lex);
     DBUG_RETURN(TRUE);
   }
+
   if (usable_index==MAX_KEY || (select && select->quick))
-    init_read_record(&info, thd, table, select, 1, 1, FALSE);
+    error= init_read_record(&info, thd, table, select, 1, 1, FALSE);
   else
-    init_read_record_idx(&info, thd, table, 1, usable_index, reverse);
+    error= init_read_record_idx(&info, thd, table, 1, usable_index, reverse);
+
+  if (error)
+  {
+    if (select)
+    {
+      delete select;
+      select= 0;
+    }
+    free_underlaid_joins(thd, select_lex);
+    DBUG_RETURN(TRUE);
+  }
 
   init_ftfuncs(thd, select_lex, 1);
   THD_STAGE_INFO(thd, stage_updating);
@@ -935,7 +947,8 @@ int multi_delete::do_table_deletes(TABLE
   READ_RECORD info;
   ha_rows last_deleted= deleted;
   DBUG_ENTER("do_deletes_for_table");
-  init_read_record(&info, thd, table, NULL, 0, 1, FALSE);
+  if (init_read_record(&info, thd, table, NULL, 0, 1, FALSE))
+    DBUG_RETURN(1);
   /*
     Ignore any rows not found in reference tables as they may already have
     been deleted by foreign key handling

=== modified file 'sql/sql_help.cc'
--- a/sql/sql_help.cc	2011-07-19 15:11:15 +0000
+++ b/sql/sql_help.cc	2011-10-27 08:43:56 +0000
@@ -189,11 +189,13 @@ int search_topics(THD *thd, TABLE *topic
 		  SQL_SELECT *select, List<String> *names,
 		  String *name, String *description, String *example)
 {
-  DBUG_ENTER("search_topics");
   int count= 0;
-
   READ_RECORD read_record_info;
-  init_read_record(&read_record_info, thd, topics, select, 1, 0, FALSE);
+  DBUG_ENTER("search_topics");
+
+  if (init_read_record(&read_record_info, thd, topics, select, 1, 0, FALSE))
+    DBUG_RETURN(0);
+
   while (!read_record_info.read_record(&read_record_info))
   {
     if (!select->cond->val_int())		// Doesn't match like
@@ -229,11 +231,13 @@ int search_topics(THD *thd, TABLE *topic
 int search_keyword(THD *thd, TABLE *keywords, struct st_find_field *find_fields,
                    SQL_SELECT *select, int *key_id)
 {
-  DBUG_ENTER("search_keyword");
   int count= 0;
-
   READ_RECORD read_record_info;
-  init_read_record(&read_record_info, thd, keywords, select, 1, 0, FALSE);
+  DBUG_ENTER("search_keyword");
+
+  if (init_read_record(&read_record_info, thd, keywords, select, 1, 0, FALSE))
+    DBUG_RETURN(0);
+
   while (!read_record_info.read_record(&read_record_info) && count<2)
   {
     if (!select->cond->val_int())		// Dosn't match like
@@ -359,7 +363,10 @@ int search_categories(THD *thd, TABLE *c
 
   DBUG_ENTER("search_categories");
 
-  init_read_record(&read_record_info, thd, categories, select,1,0,FALSE);
+  if (init_read_record(&read_record_info, thd, categories, select,
+                       1, 0, FALSE))
+    DBUG_RETURN(0);
+    
   while (!read_record_info.read_record(&read_record_info))
   {
     if (select && !select->cond->val_int())
@@ -390,10 +397,12 @@ int search_categories(THD *thd, TABLE *c
 void get_all_items_for_category(THD *thd, TABLE *items, Field *pfname,
 				SQL_SELECT *select, List<String> *res)
 {
+  READ_RECORD read_record_info;
   DBUG_ENTER("get_all_items_for_category");
 
-  READ_RECORD read_record_info;
-  init_read_record(&read_record_info, thd, items, select,1,0,FALSE);
+  if (init_read_record(&read_record_info, thd, items, select,
+                       1, 0, FALSE))
+    DBUG_VOID_RETURN;
   while (!read_record_info.read_record(&read_record_info))
   {
     if (!select->cond->val_int())

=== modified file 'sql/sql_plugin.cc'
--- a/sql/sql_plugin.cc	2011-09-21 11:01:41 +0000
+++ b/sql/sql_plugin.cc	2011-10-27 08:43:56 +0000
@@ -1493,7 +1493,8 @@ static void plugin_load(MEM_ROOT *tmp_ro
     goto end;
   }
   table= tables.table;
-  init_read_record(&read_record_info, new_thd, table, NULL, 1, 0, FALSE);
+  if (init_read_record(&read_record_info, new_thd, table, NULL, 1, 1, FALSE))
+    goto end;
   table->use_all_columns();
   /*
     there're no other threads running yet, so we don't need a mutex.

=== modified file 'sql/sql_select.cc'
--- a/sql/sql_select.cc	2011-10-19 06:13:35 +0000
+++ b/sql/sql_select.cc	2011-10-27 08:43:56 +0000
@@ -8018,7 +8018,10 @@ best_access_path(JOIN      *join,
     Don't do a table scan on InnoDB tables, if we can read the used
     parts of the row from any of the used index.
     This is because table scans uses index and we would not win
-    anything by using a table scan.
+    anything by using a table scan. The only exception is INDEX_MERGE
+    quick select. We can not say for sure that INDEX_MERGE quick select
+    is always faster than ref access. So it's necessary to check if
+    ref access is more expensive.
 
     A word for word translation of the below if-statement in sergefp's
     understanding: we check if we should use table scan if:
@@ -8058,8 +8061,11 @@ best_access_path(JOIN      *join,
     goto skip_table_scan;
   }
 
-  if (((s->table->file->ha_table_flags() & HA_TABLE_SCAN_ON_INDEX) &&    //(3)
-       !s->table->covering_keys.is_clear_all() && best_key && !s->quick))//(3)
+  if ((s->table->file->ha_table_flags() & HA_TABLE_SCAN_ON_INDEX) &&    //(3)
+      !s->table->covering_keys.is_clear_all() && best_key &&            //(3)
+      (!s->quick ||                                                     //(3)
+       !(s->quick->get_type() == QUICK_SELECT_I::QS_TYPE_INDEX_MERGE && //(3)
+         best > s->quick->read_time)))                                  //(3)
   {
     trace_access_scan.add_alnum("access_type", s->quick ? "range" : "scan").
       add_alnum("cause", "covering_index_better_than_full_scan");
@@ -18833,8 +18839,9 @@ sub_select_sjm(JOIN *join, JOIN_TAB *joi
     const READ_RECORD::Setup_func saved_rfr= last_tab->read_first_record;
 
     // Initialize full scan
-    init_read_record(&last_tab->read_record, join->thd,
-                     sjm->table, NULL, TRUE, TRUE, FALSE);
+    if (init_read_record(&last_tab->read_record, join->thd,
+                         sjm->table, NULL, TRUE, TRUE, FALSE))
+      DBUG_RETURN(NESTED_LOOP_ERROR);
 
     last_tab->read_first_record= join_read_record_no_init;
     last_tab->read_record.copy_field= sjm->copy_field;
@@ -20076,8 +20083,9 @@ int join_init_read_record(JOIN_TAB *tab)
     report_error(tab->table, error);
     return 1;
   }
-  init_read_record(&tab->read_record, tab->join->thd, tab->table,
-		   tab->select,1,1, FALSE);
+  if (init_read_record(&tab->read_record, tab->join->thd, tab->table,
+                       tab->select, 1, 1, FALSE))
+    return 1;
   return (*tab->read_record.read_record)(&tab->read_record);
 }
 
@@ -23622,7 +23630,9 @@ copy_fields(TMP_TABLE_PARAM *param)
   Copy_field *ptr=param->copy_field;
   Copy_field *end=param->copy_field_end;
 
-  for (; ptr != end; ptr++)
+  DBUG_ASSERT((ptr != NULL && end >= ptr) || (ptr == NULL && end == NULL));
+
+  for (; ptr < end; ptr++)
     (*ptr->do_copy)(ptr);
 
   List_iterator_fast<Item> it(param->copy_funcs);

=== modified file 'sql/sql_servers.cc'
--- a/sql/sql_servers.cc	2011-07-28 10:54:44 +0000
+++ b/sql/sql_servers.cc	2011-10-27 08:43:56 +0000
@@ -208,8 +208,10 @@ static bool servers_load(THD *thd, TABLE
   free_root(&mem, MYF(0));
   init_sql_alloc(&mem, ACL_ALLOC_BLOCK_SIZE, 0);
 
-  init_read_record(&read_record_info,thd,table=tables[0].table,NULL,1,0, 
-                   FALSE);
+  if (init_read_record(&read_record_info, thd, table=tables[0].table,
+                       NULL, 1, 1, FALSE))
+    DBUG_RETURN(TRUE);
+
   while (!(read_record_info.read_record(&read_record_info)))
   {
     /* return_val is already TRUE, so no need to set */

=== modified file 'sql/sql_table.cc'
--- a/sql/sql_table.cc	2011-10-07 14:20:21 +0000
+++ b/sql/sql_table.cc	2011-10-27 08:43:56 +0000
@@ -7367,7 +7367,11 @@ copy_data_between_tables(TABLE *from,TAB
 
   /* Tell handler that we have values for all columns in the to table */
   to->use_all_columns();
-  init_read_record(&info, thd, from, (SQL_SELECT *) 0, 1, 1, FALSE);
+  if (init_read_record(&info, thd, from, (SQL_SELECT *) 0, 1, 1, FALSE))
+  {
+    error= 1;
+    goto err;
+  }
   if (ignore)
     to->file->extra(HA_EXTRA_IGNORE_DUP_KEY);
   thd->get_stmt_da()->reset_current_row_for_warning();

=== modified file 'sql/sql_udf.cc'
--- a/sql/sql_udf.cc	2011-06-30 15:50:45 +0000
+++ b/sql/sql_udf.cc	2011-10-27 08:43:56 +0000
@@ -171,7 +171,8 @@ void udf_init()
   }
 
   table= tables.table;
-  init_read_record(&read_record_info, new_thd, table, NULL,1,0,FALSE);
+  if (init_read_record(&read_record_info, new_thd, table, NULL, 1, 1, FALSE))
+    goto end;
   table->use_all_columns();
   while (!(error= read_record_info.read_record(&read_record_info)))
   {

=== modified file 'sql/sql_update.cc'
--- a/sql/sql_update.cc	2011-09-14 15:03:55 +0000
+++ b/sql/sql_update.cc	2011-10-27 08:43:56 +0000
@@ -567,9 +567,12 @@ int mysql_update(THD *thd,
       */
 
       if (used_index == MAX_KEY || (select && select->quick))
-        init_read_record(&info, thd, table, select, 0, 1, FALSE);
+        error= init_read_record(&info, thd, table, select, 0, 1, FALSE);
       else
-        init_read_record_idx(&info, thd, table, 1, used_index, reverse);
+        error= init_read_record_idx(&info, thd, table, 1, used_index, reverse);
+
+      if (error)
+        goto exit_without_my_ok;
 
       THD_STAGE_INFO(thd, stage_searching_rows_for_update);
       ha_rows tmp_limit= limit;
@@ -640,7 +643,8 @@ int mysql_update(THD *thd,
   if (select && select->quick && select->quick->reset())
     goto exit_without_my_ok;
   table->file->try_semi_consistent_read(1);
-  init_read_record(&info, thd, table, select, 0, 1, FALSE);
+  if ((error= init_read_record(&info, thd, table, select, 0, 1, FALSE)))
+    goto exit_without_my_ok;
 
   updated= found= 0;
   /*

=== modified file 'storage/innobase/buf/buf0buf.c'
--- a/storage/innobase/buf/buf0buf.c	2011-10-21 01:15:11 +0000
+++ b/storage/innobase/buf/buf0buf.c	2011-10-25 16:32:23 +0000
@@ -2676,6 +2676,8 @@ wait_until_unfixed:
 			}
 
 			if (UNIV_LIKELY_NULL(block)) {
+				block_mutex = buf_page_get_mutex(
+					&block->page);
 				/* The page entered the buffer
 				pool for some reason. Try to
 				evict it again. */

=== modified file 'storage/innobase/dict/dict0dict.c'
--- a/storage/innobase/dict/dict0dict.c	2011-09-08 06:46:51 +0000
+++ b/storage/innobase/dict/dict0dict.c	2011-10-27 09:07:40 +0000
@@ -839,9 +839,22 @@ dict_table_open_on_name_low(
 	ut_ad(!table || table->cached);
 
 	if (table != NULL) {
+		/* If table is corrupted, return NULL */
+		if (ignore_err == DICT_ERR_IGNORE_NONE
+		    && table->corrupted) {
+			if (!dict_locked) {
+				mutex_exit(&dict_sys->mutex);
+			}
+
+			ut_print_timestamp(stderr);
 
-		ut_ad(ignore_err != DICT_ERR_IGNORE_NONE
-		      || table->corrupted == FALSE);
+			fprintf(stderr, "  InnoDB: table ");
+			ut_print_name(stderr, NULL, TRUE, table->name);
+			fprintf(stderr, "is corrupted. Please drop the table "
+				"and recreate\n");
+
+			return(NULL);
+		}
 
 		if (table->can_be_evicted) {
 			dict_move_to_mru(table);
@@ -5201,9 +5214,9 @@ dict_set_corrupted(
 		index->table->corrupted = TRUE;
 	}
 
-	if (UNIV_UNLIKELY(dict_index_is_corrupted(index))) {
+	if (index->type & DICT_CORRUPT) {
 		/* The index was already flagged corrupted. */
-		ut_ad(index->table->corrupted);
+		ut_ad(!dict_index_is_clust(index) || index->table->corrupted);
 		return;
 	}
 

=== modified file 'storage/innobase/fil/fil0fil.c'
--- a/storage/innobase/fil/fil0fil.c	2011-10-21 15:46:57 +0000
+++ b/storage/innobase/fil/fil0fil.c	2011-10-27 20:06:13 +0000
@@ -1834,25 +1834,25 @@ fil_read_flushed_lsn_and_arch_log_no(
 						parameters below already
 						contain sensible data */
 #ifdef UNIV_LOG_ARCHIVE
-	ulint*		min_arch_log_no,	/*!< in/out: */
-	ulint*		max_arch_log_no,	/*!< in/out: */
+	ulint*		min_arch_log_no,	/*!< out: */
+	ulint*		max_arch_log_no,	/*!< out: */
 #endif /* UNIV_LOG_ARCHIVE */
-	lsn_t*		min_flushed_lsn,	/*!< in/out: */
-	lsn_t*		max_flushed_lsn)	/*!< in/out: */
+	lsn_t*		min_flushed_lsn,	/*!< out: */
+	lsn_t*		max_flushed_lsn)	/*!< out: */
 {
 	byte*	buf;
-	byte*	buf2;
+	page_t*	page;
 	lsn_t	flushed_lsn;
 
-	buf2 = ut_malloc(2 * UNIV_PAGE_SIZE);
+	buf = ut_malloc(2 * UNIV_PAGE_SIZE);
 	/* Align the memory for a possible read from a raw device */
-	buf = ut_align(buf2, UNIV_PAGE_SIZE);
+	page = ut_align(buf, UNIV_PAGE_SIZE);
 
-	os_file_read(data_file, buf, 0, UNIV_PAGE_SIZE);
+	os_file_read(data_file, page, 0, UNIV_PAGE_SIZE);
 
-	flushed_lsn = mach_read_from_8(buf + FIL_PAGE_FILE_FLUSH_LSN);
+	flushed_lsn = mach_read_from_8(page + FIL_PAGE_FILE_FLUSH_LSN);
 
-	ut_free(buf2);
+	ut_free(buf);
 
 	if (!one_read_already) {
 		*min_flushed_lsn = flushed_lsn;

=== modified file 'storage/innobase/fsp/fsp0fsp.c'
--- a/storage/innobase/fsp/fsp0fsp.c	2011-10-21 15:46:57 +0000
+++ b/storage/innobase/fsp/fsp0fsp.c	2011-10-27 20:06:13 +0000
@@ -245,7 +245,7 @@ fsp_free_extent(
 	ulint		zip_size,/*!< in: compressed page size in bytes
 				or 0 for uncompressed pages */
 	ulint		page,	/*!< in: page offset in the extent */
-	mtr_t*		mtr);	/*!< in: mtr */
+	mtr_t*		mtr);	/*!< in/out: mini-transaction */
 /**********************************************************************//**
 Frees an extent of a segment to the space free list. */
 static
@@ -257,7 +257,7 @@ fseg_free_extent(
 	ulint		zip_size,/*!< in: compressed page size in bytes
 				or 0 for uncompressed pages */
 	ulint		page,	/*!< in: page offset in the extent */
-	mtr_t*		mtr);	/*!< in: mtr handle */
+	mtr_t*		mtr);	/*!< in/out: mini-transaction */
 /**********************************************************************//**
 Calculates the number of pages reserved by a segment, and how
 many pages are currently used.
@@ -269,7 +269,7 @@ fseg_n_reserved_pages_low(
 	fseg_inode_t*	header,	/*!< in: segment inode */
 	ulint*		used,	/*!< out: number of pages used (not
 				more than reserved) */
-	mtr_t*		mtr);	/*!< in: mtr handle */
+	mtr_t*		mtr);	/*!< in/out: mini-transaction */
 /********************************************************************//**
 Marks a page used. The page must reside within the extents of the given
 segment. */
@@ -282,7 +282,7 @@ fseg_mark_page_used(
 	ulint		zip_size,/*!< in: compressed page size in bytes
 				or 0 for uncompressed pages */
 	ulint		page,	/*!< in: page offset */
-	mtr_t*		mtr);	/*!< in: mtr */
+	mtr_t*		mtr);	/*!< in/out: mini-transaction */
 /**********************************************************************//**
 Returns the first extent descriptor for a segment. We think of the extent
 lists of the segment catenated in the order FSEG_FULL -> FSEG_NOT_FULL
@@ -296,7 +296,7 @@ fseg_get_first_extent(
 	ulint		space,	/*!< in: space id */
 	ulint		zip_size,/*!< in: compressed page size in bytes
 				or 0 for uncompressed pages */
-	mtr_t*		mtr);	/*!< in: mtr */
+	mtr_t*		mtr);	/*!< in/out: mini-transaction */
 /**********************************************************************//**
 Puts new extents to the free list if
 there are free extents above the free limit. If an extent happens
@@ -366,7 +366,7 @@ fsp_get_space_header(
 	ulint	id,	/*!< in: space id */
 	ulint	zip_size,/*!< in: compressed page size in bytes
 			or 0 for uncompressed pages */
-	mtr_t*	mtr)	/*!< in: mtr */
+	mtr_t*	mtr)	/*!< in/out: mini-transaction */
 {
 	buf_block_t*	block;
 	fsp_header_t*	header;
@@ -397,7 +397,7 @@ xdes_get_bit(
 	ulint		bit,	/*!< in: XDES_FREE_BIT or XDES_CLEAN_BIT */
 	ulint		offset,	/*!< in: page offset within extent:
 				0 ... FSP_EXTENT_SIZE - 1 */
-	mtr_t*		mtr)	/*!< in: mtr */
+	mtr_t*		mtr)	/*!< in/out: mini-transaction */
 {
 	ulint	index;
 	ulint	byte_index;
@@ -428,7 +428,7 @@ xdes_set_bit(
 	ulint	offset,	/*!< in: page offset within extent:
 			0 ... FSP_EXTENT_SIZE - 1 */
 	ibool	val,	/*!< in: bit value */
-	mtr_t*	mtr)	/*!< in: mtr */
+	mtr_t*	mtr)	/*!< in/out: mini-transaction */
 {
 	ulint	index;
 	ulint	byte_index;
@@ -465,7 +465,7 @@ xdes_find_bit(
 	ulint	bit,	/*!< in: XDES_FREE_BIT or XDES_CLEAN_BIT */
 	ibool	val,	/*!< in: desired bit value */
 	ulint	hint,	/*!< in: hint of which bit position would be desirable */
-	mtr_t*	mtr)	/*!< in: mtr */
+	mtr_t*	mtr)	/*!< in/out: mini-transaction */
 {
 	ulint	i;
 
@@ -502,7 +502,7 @@ xdes_find_bit_downward(
 	ulint	bit,	/*!< in: XDES_FREE_BIT or XDES_CLEAN_BIT */
 	ibool	val,	/*!< in: desired bit value */
 	ulint	hint,	/*!< in: hint of which bit position would be desirable */
-	mtr_t*	mtr)	/*!< in: mtr */
+	mtr_t*	mtr)	/*!< in/out: mini-transaction */
 {
 	ulint	i;
 
@@ -535,7 +535,7 @@ ulint
 xdes_get_n_used(
 /*============*/
 	const xdes_t*	descr,	/*!< in: descriptor */
-	mtr_t*		mtr)	/*!< in: mtr */
+	mtr_t*		mtr)	/*!< in/out: mini-transaction */
 {
 	ulint	i;
 	ulint	count	= 0;
@@ -559,7 +559,7 @@ ibool
 xdes_is_free(
 /*=========*/
 	const xdes_t*	descr,	/*!< in: descriptor */
-	mtr_t*		mtr)	/*!< in: mtr */
+	mtr_t*		mtr)	/*!< in/out: mini-transaction */
 {
 	if (0 == xdes_get_n_used(descr, mtr)) {
 
@@ -577,7 +577,7 @@ ibool
 xdes_is_full(
 /*=========*/
 	const xdes_t*	descr,	/*!< in: descriptor */
-	mtr_t*		mtr)	/*!< in: mtr */
+	mtr_t*		mtr)	/*!< in/out: mini-transaction */
 {
 	if (FSP_EXTENT_SIZE == xdes_get_n_used(descr, mtr)) {
 
@@ -595,7 +595,7 @@ xdes_set_state(
 /*===========*/
 	xdes_t*	descr,	/*!< in/out: descriptor */
 	ulint	state,	/*!< in: state to set */
-	mtr_t*	mtr)	/*!< in: mtr handle */
+	mtr_t*	mtr)	/*!< in/out: mini-transaction */
 {
 	ut_ad(descr && mtr);
 	ut_ad(state >= XDES_FREE);
@@ -613,7 +613,7 @@ ulint
 xdes_get_state(
 /*===========*/
 	const xdes_t*	descr,	/*!< in: descriptor */
-	mtr_t*		mtr)	/*!< in: mtr handle */
+	mtr_t*		mtr)	/*!< in/out: mini-transaction */
 {
 	ulint	state;
 
@@ -632,7 +632,7 @@ void
 xdes_init(
 /*======*/
 	xdes_t*	descr,	/*!< in: descriptor */
-	mtr_t*	mtr)	/*!< in: mtr */
+	mtr_t*	mtr)	/*!< in/out: mini-transaction */
 {
 	ulint	i;
 
@@ -815,7 +815,7 @@ xdes_lst_get_descriptor(
 				or 0 for uncompressed pages */
 	fil_addr_t	lst_node,/*!< in: file address of the list node
 				contained in the descriptor */
-	mtr_t*		mtr)	/*!< in: mtr handle */
+	mtr_t*		mtr)	/*!< in/out: mini-transaction */
 {
 	xdes_t*	descr;
 
@@ -889,7 +889,7 @@ void
 fsp_init_file_page(
 /*===============*/
 	buf_block_t*	block,	/*!< in: pointer to a page */
-	mtr_t*		mtr)	/*!< in: mtr */
+	mtr_t*		mtr)	/*!< in/out: mini-transaction */
 {
 	fsp_init_file_page_low(block);
 
@@ -959,7 +959,7 @@ fsp_header_init(
 /*============*/
 	ulint	space,		/*!< in: space id */
 	ulint	size,		/*!< in: current size in blocks */
-	mtr_t*	mtr)		/*!< in: mini-transaction handle */
+	mtr_t*	mtr)		/*!< in/out: mini-transaction */
 {
 	fsp_header_t*	header;
 	buf_block_t*	block;
@@ -1076,9 +1076,9 @@ UNIV_INTERN
 void
 fsp_header_inc_size(
 /*================*/
-	ulint	space,	/*!< in: space id */
-	ulint	size_inc,/*!< in: size increment in pages */
-	mtr_t*	mtr)	/*!< in: mini-transaction handle */
+	ulint	space,		/*!< in: space id */
+	ulint	size_inc,	/*!< in: size increment in pages */
+	mtr_t*	mtr)		/*!< in/out: mini-transaction */
 {
 	fsp_header_t*	header;
 	ulint		size;
@@ -1461,7 +1461,7 @@ fsp_alloc_free_extent(
 	ulint	hint,	/*!< in: hint of which extent would be desirable: any
 			page offset in the extent goes; the hint must not
 			be > FSP_FREE_LIMIT */
-	mtr_t*	mtr)	/*!< in: mtr */
+	mtr_t*	mtr)	/*!< in/out: mini-transaction */
 {
 	fsp_header_t*	header;
 	fil_addr_t	first;
@@ -1670,7 +1670,7 @@ fsp_free_page(
 	ulint	zip_size,/*!< in: compressed page size in bytes
 			or 0 for uncompressed pages */
 	ulint	page,	/*!< in: page offset */
-	mtr_t*	mtr)	/*!< in: mtr handle */
+	mtr_t*	mtr)	/*!< in/out: mini-transaction */
 {
 	fsp_header_t*	header;
 	xdes_t*		descr;
@@ -1760,7 +1760,7 @@ fsp_free_extent(
 	ulint	zip_size,/*!< in: compressed page size in bytes
 			or 0 for uncompressed pages */
 	ulint	page,	/*!< in: page offset in the extent */
-	mtr_t*	mtr)	/*!< in: mtr */
+	mtr_t*	mtr)	/*!< in/out: mini-transaction */
 {
 	fsp_header_t*	header;
 	xdes_t*		descr;
@@ -1796,7 +1796,7 @@ fsp_seg_inode_page_get_nth_inode(
 	ulint	zip_size __attribute__((unused)),
 			/*!< in: compressed page size, or 0 */
 	mtr_t*	mtr __attribute__((unused)))
-			/*!< in: mini-transaction handle */
+			/*!< in/out: mini-transaction */
 {
 	ut_ad(i < FSP_SEG_INODES_PER_PAGE(zip_size));
 	ut_ad(mtr_memo_contains_page(mtr, page, MTR_MEMO_PAGE_X_FIX));
@@ -1813,7 +1813,7 @@ fsp_seg_inode_page_find_used(
 /*=========================*/
 	page_t*	page,	/*!< in: segment inode page */
 	ulint	zip_size,/*!< in: compressed page size, or 0 */
-	mtr_t*	mtr)	/*!< in: mini-transaction handle */
+	mtr_t*	mtr)	/*!< in/out: mini-transaction */
 {
 	ulint		i;
 	fseg_inode_t*	inode;
@@ -1845,7 +1845,7 @@ fsp_seg_inode_page_find_free(
 	page_t*	page,	/*!< in: segment inode page */
 	ulint	i,	/*!< in: search forward starting from this index */
 	ulint	zip_size,/*!< in: compressed page size, or 0 */
-	mtr_t*	mtr)	/*!< in: mini-transaction handle */
+	mtr_t*	mtr)	/*!< in/out: mini-transaction */
 {
 	fseg_inode_t*	inode;
 
@@ -1875,7 +1875,7 @@ ibool
 fsp_alloc_seg_inode_page(
 /*=====================*/
 	fsp_header_t*	space_header,	/*!< in: space header */
-	mtr_t*		mtr)		/*!< in: mini-transaction handle */
+	mtr_t*		mtr)		/*!< in/out: mini-transaction */
 {
 	fseg_inode_t*	inode;
 	buf_block_t*	block;
@@ -1929,7 +1929,7 @@ fseg_inode_t*
 fsp_alloc_seg_inode(
 /*================*/
 	fsp_header_t*	space_header,	/*!< in: space header */
-	mtr_t*		mtr)		/*!< in: mini-transaction handle */
+	mtr_t*		mtr)		/*!< in/out: mini-transaction */
 {
 	ulint		page_no;
 	buf_block_t*	block;
@@ -1995,7 +1995,7 @@ fsp_free_seg_inode(
 	ulint		zip_size,/*!< in: compressed page size in bytes
 				or 0 for uncompressed pages */
 	fseg_inode_t*	inode,	/*!< in: segment inode */
-	mtr_t*		mtr)	/*!< in: mini-transaction handle */
+	mtr_t*		mtr)	/*!< in/out: mini-transaction */
 {
 	page_t*		page;
 	fsp_header_t*	space_header;
@@ -2044,7 +2044,7 @@ fseg_inode_try_get(
 	ulint		space,	/*!< in: space id */
 	ulint		zip_size,/*!< in: compressed page size in bytes
 				or 0 for uncompressed pages */
-	mtr_t*		mtr)	/*!< in: mtr handle */
+	mtr_t*		mtr)	/*!< in/out: mini-transaction */
 {
 	fil_addr_t	inode_addr;
 	fseg_inode_t*	inode;
@@ -2077,7 +2077,7 @@ fseg_inode_get(
 	ulint		space,	/*!< in: space id */
 	ulint		zip_size,/*!< in: compressed page size in bytes
 				or 0 for uncompressed pages */
-	mtr_t*		mtr)	/*!< in: mtr handle */
+	mtr_t*		mtr)	/*!< in/out: mini-transaction */
 {
 	fseg_inode_t*	inode
 		= fseg_inode_try_get(header, space, zip_size, mtr);
@@ -2094,7 +2094,8 @@ fseg_get_nth_frag_page_no(
 /*======================*/
 	fseg_inode_t*	inode,	/*!< in: segment inode */
 	ulint		n,	/*!< in: slot index */
-	mtr_t*		mtr __attribute__((unused))) /*!< in: mtr handle */
+	mtr_t*		mtr __attribute__((unused)))
+				/*!< in/out: mini-transaction */
 {
 	ut_ad(inode && mtr);
 	ut_ad(n < FSEG_FRAG_ARR_N_SLOTS);
@@ -2113,7 +2114,7 @@ fseg_set_nth_frag_page_no(
 	fseg_inode_t*	inode,	/*!< in: segment inode */
 	ulint		n,	/*!< in: slot index */
 	ulint		page_no,/*!< in: page number to set */
-	mtr_t*		mtr)	/*!< in: mtr handle */
+	mtr_t*		mtr)	/*!< in/out: mini-transaction */
 {
 	ut_ad(inode && mtr);
 	ut_ad(n < FSEG_FRAG_ARR_N_SLOTS);
@@ -2132,7 +2133,7 @@ ulint
 fseg_find_free_frag_page_slot(
 /*==========================*/
 	fseg_inode_t*	inode,	/*!< in: segment inode */
-	mtr_t*		mtr)	/*!< in: mtr handle */
+	mtr_t*		mtr)	/*!< in/out: mini-transaction */
 {
 	ulint	i;
 	ulint	page_no;
@@ -2159,7 +2160,7 @@ ulint
 fseg_find_last_used_frag_page_slot(
 /*===============================*/
 	fseg_inode_t*	inode,	/*!< in: segment inode */
-	mtr_t*		mtr)	/*!< in: mtr handle */
+	mtr_t*		mtr)	/*!< in/out: mini-transaction */
 {
 	ulint	i;
 	ulint	page_no;
@@ -2187,7 +2188,7 @@ ulint
 fseg_get_n_frag_pages(
 /*==================*/
 	fseg_inode_t*	inode,	/*!< in: segment inode */
-	mtr_t*		mtr)	/*!< in: mtr handle */
+	mtr_t*		mtr)	/*!< in/out: mini-transaction */
 {
 	ulint	i;
 	ulint	count	= 0;
@@ -2224,7 +2225,7 @@ fseg_create_general(
 			the inode and the other for the segment) then there is
 			no need to do the check for this individual
 			operation */
-	mtr_t*	mtr)	/*!< in: mtr */
+	mtr_t*	mtr)	/*!< in/out: mini-transaction */
 {
 	ulint		flags;
 	ulint		zip_size;
@@ -2348,7 +2349,7 @@ fseg_create(
 			will belong to the created segment */
 	ulint	byte_offset, /*!< in: byte offset of the created segment header
 			on the page */
-	mtr_t*	mtr)	/*!< in: mtr */
+	mtr_t*	mtr)	/*!< in/out: mini-transaction */
 {
 	return(fseg_create_general(space, page, byte_offset, FALSE, mtr));
 }
@@ -2364,7 +2365,7 @@ fseg_n_reserved_pages_low(
 	fseg_inode_t*	inode,	/*!< in: segment inode */
 	ulint*		used,	/*!< out: number of pages used (not
 				more than reserved) */
-	mtr_t*		mtr)	/*!< in: mtr handle */
+	mtr_t*		mtr)	/*!< in/out: mini-transaction */
 {
 	ulint	ret;
 
@@ -2393,7 +2394,7 @@ fseg_n_reserved_pages(
 /*==================*/
 	fseg_header_t*	header,	/*!< in: segment header */
 	ulint*		used,	/*!< out: number of pages used (<= reserved) */
-	mtr_t*		mtr)	/*!< in: mtr handle */
+	mtr_t*		mtr)	/*!< in/out: mini-transaction */
 {
 	ulint		ret;
 	fseg_inode_t*	inode;
@@ -2430,7 +2431,7 @@ fseg_fill_free_list(
 				or 0 for uncompressed pages */
 	ulint		hint,	/*!< in: hint which extent would be good as
 				the first extent */
-	mtr_t*		mtr)	/*!< in: mtr */
+	mtr_t*		mtr)	/*!< in/out: mini-transaction */
 {
 	xdes_t*	descr;
 	ulint	i;
@@ -2495,7 +2496,7 @@ fseg_alloc_free_extent(
 	ulint		space,	/*!< in: space id */
 	ulint		zip_size,/*!< in: compressed page size in bytes
 				or 0 for uncompressed pages */
-	mtr_t*		mtr)	/*!< in: mtr */
+	mtr_t*		mtr)	/*!< in/out: mini-transaction */
 {
 	xdes_t*		descr;
 	ib_id_t		seg_id;
@@ -2833,7 +2834,7 @@ fseg_alloc_free_page_general(
 				with fsp_reserve_free_extents, then there
 				is no need to do the check for this individual
 				page */
-	mtr_t*		mtr,	/*!< in/out: mini-transaction handle */
+	mtr_t*		mtr,	/*!< in/out: mini-transaction */
 	mtr_t*		init_mtr)/*!< in/out: mtr or another mini-transaction
 				in which the page should be initialized,
 				or NULL if this is a "fake allocation" of
@@ -2899,9 +2900,9 @@ fsp_reserve_free_pages(
 	ulint		space,		/*!< in: space id, must be != 0 */
 	fsp_header_t*	space_header,	/*!< in: header of that space,
 					x-latched */
-	ulint		size,		/*!< in: size of the tablespace in pages,
-					must be < FSP_EXTENT_SIZE / 2 */
-	mtr_t*		mtr)		/*!< in: mtr */
+	ulint		size,		/*!< in: size of the tablespace in
+					pages, must be < FSP_EXTENT_SIZE/2 */
+	mtr_t*		mtr)		/*!< in/out: mini-transaction */
 {
 	xdes_t*	descr;
 	ulint	n_used;
@@ -2960,7 +2961,7 @@ fsp_reserve_free_extents(
 	ulint	space,	/*!< in: space id */
 	ulint	n_ext,	/*!< in: number of extents to reserve */
 	ulint	alloc_type,/*!< in: FSP_NORMAL, FSP_UNDO, or FSP_CLEANING */
-	mtr_t*	mtr)	/*!< in: mtr */
+	mtr_t*	mtr)	/*!< in/out: mini-transaction */
 {
 	fsp_header_t*	space_header;
 	rw_lock_t*	latch;
@@ -3208,7 +3209,7 @@ fseg_mark_page_used(
 	ulint		zip_size,/*!< in: compressed page size in bytes
 				or 0 for uncompressed pages */
 	ulint		page,	/*!< in: page offset */
-	mtr_t*		mtr)	/*!< in: mtr */
+	mtr_t*		mtr)	/*!< in/out: mini-transaction */
 {
 	xdes_t*	descr;
 	ulint	not_full_n_used;
@@ -3267,7 +3268,7 @@ fseg_free_page_low(
 	ulint		zip_size,/*!< in: compressed page size in bytes
 				or 0 for uncompressed pages */
 	ulint		page,	/*!< in: page offset */
-	mtr_t*		mtr)	/*!< in: mtr handle */
+	mtr_t*		mtr)	/*!< in/out: mini-transaction */
 {
 	xdes_t*	descr;
 	ulint	not_full_n_used;
@@ -3400,7 +3401,7 @@ fseg_free_page(
 	fseg_header_t*	seg_header, /*!< in: segment header */
 	ulint		space,	/*!< in: space id */
 	ulint		page,	/*!< in: page offset */
-	mtr_t*		mtr)	/*!< in: mtr handle */
+	mtr_t*		mtr)	/*!< in/out: mini-transaction */
 {
 	ulint		flags;
 	ulint		zip_size;
@@ -3432,7 +3433,7 @@ fseg_free_extent(
 	ulint		zip_size,/*!< in: compressed page size in bytes
 				or 0 for uncompressed pages */
 	ulint		page,	/*!< in: a page in the extent */
-	mtr_t*		mtr)	/*!< in: mtr handle */
+	mtr_t*		mtr)	/*!< in/out: mini-transaction */
 {
 	ulint	first_page_in_extent;
 	xdes_t*	descr;
@@ -3507,7 +3508,7 @@ fseg_free_step(
 				resides on the first page of the frag list
 				of the segment, this pointer becomes obsolete
 				after the last freeing step */
-	mtr_t*		mtr)	/*!< in: mtr */
+	mtr_t*		mtr)	/*!< in/out: mini-transaction */
 {
 	ulint		n;
 	ulint		page;
@@ -3589,7 +3590,7 @@ fseg_free_step_not_header(
 /*======================*/
 	fseg_header_t*	header,	/*!< in: segment header which must reside on
 				the first fragment page of the segment */
-	mtr_t*		mtr)	/*!< in: mtr */
+	mtr_t*		mtr)	/*!< in/out: mini-transaction */
 {
 	ulint		n;
 	ulint		page;
@@ -3654,7 +3655,7 @@ fseg_get_first_extent(
 	ulint		space,	/*!< in: space id */
 	ulint		zip_size,/*!< in: compressed page size in bytes
 				or 0 for uncompressed pages */
-	mtr_t*		mtr)	/*!< in: mtr */
+	mtr_t*		mtr)	/*!< in/out: mini-transaction */
 {
 	fil_addr_t	first;
 	xdes_t*		descr;
@@ -3696,7 +3697,7 @@ ibool
 fseg_validate_low(
 /*==============*/
 	fseg_inode_t*	inode, /*!< in: segment inode */
-	mtr_t*		mtr2)	/*!< in: mtr */
+	mtr_t*		mtr2)	/*!< in/out: mini-transaction */
 {
 	ulint		space;
 	ib_id_t		seg_id;
@@ -3803,7 +3804,7 @@ ibool
 fseg_validate(
 /*==========*/
 	fseg_header_t*	header, /*!< in: segment header */
-	mtr_t*		mtr)	/*!< in: mtr */
+	mtr_t*		mtr)	/*!< in/out: mini-transaction */
 {
 	fseg_inode_t*	inode;
 	ibool		ret;
@@ -3831,7 +3832,7 @@ void
 fseg_print_low(
 /*===========*/
 	fseg_inode_t*	inode, /*!< in: segment inode */
-	mtr_t*		mtr)	/*!< in: mtr */
+	mtr_t*		mtr)	/*!< in/out: mini-transaction */
 {
 	ulint	space;
 	ulint	n_used;
@@ -3880,7 +3881,7 @@ void
 fseg_print(
 /*=======*/
 	fseg_header_t*	header, /*!< in: segment header */
-	mtr_t*		mtr)	/*!< in: mtr */
+	mtr_t*		mtr)	/*!< in/out: mini-transaction */
 {
 	fseg_inode_t*	inode;
 	ulint		space;

=== modified file 'storage/innobase/handler/ha_innodb.cc'
--- a/storage/innobase/handler/ha_innodb.cc	2011-10-21 15:46:57 +0000
+++ b/storage/innobase/handler/ha_innodb.cc	2011-10-27 08:20:56 +0000
@@ -3565,18 +3565,29 @@ ha_innobase::primary_key_is_clustered()
 	return(true);
 }
 
+/** Always normalize table name to lower case on Windows */
+#ifdef __WIN__
+#define normalize_table_name(norm_name, name)		\
+	normalize_table_name_low(norm_name, name, TRUE)
+#else
+#define normalize_table_name(norm_name, name)           \
+        normalize_table_name_low(norm_name, name, FALSE)
+#endif /* __WIN__ */
+
 /*****************************************************************//**
 Normalizes a table name string. A normalized name consists of the
 database name catenated to '/' and table name. An example:
 test/mytable. On Windows normalization puts both the database name and the
-table name always to lower case. */
+table name always to lower case if "set_lower_case" is set to TRUE. */
 static
 void
-normalize_table_name(
-/*=================*/
+normalize_table_name_low(
+/*=====================*/
 	char*		norm_name,	/*!< out: normalized name as a
 					null-terminated string */
-	const char*	name)		/*!< in: table name string */
+	const char*	name,		/*!< in: table name string */
+	ibool		set_lower_case)	/*!< in: TRUE if we want to set name
+					to lower case */
 {
 	char*	name_ptr;
 	char*	db_ptr;
@@ -3606,9 +3617,9 @@ normalize_table_name(
 
 	norm_name[name_ptr - db_ptr - 1] = '/';
 
-#ifdef __WIN__
-	innobase_casedn_str(norm_name);
-#endif
+	if (set_lower_case) {
+		innobase_casedn_str(norm_name);
+	}
 }
 
 /********************************************************************//**
@@ -4012,6 +4023,8 @@ ha_innobase::open(
 	THD*		thd;
 	ulint		retries = 0;
 	char*		is_part = NULL;
+	ibool		par_case_name_set = FALSE;
+	char		par_case_name[MAX_FULL_NAME_LEN + 1];
 
 	DBUG_ENTER("ha_innobase::open");
 
@@ -4058,16 +4071,88 @@ ha_innobase::open(
 	workaround for http://bugs.mysql.com/bug.php?id=33349. Look
 	at support issue https://support.mysql.com/view.php?id=21080
 	for more details. */
+#ifdef __WIN__
+	is_part = strstr(norm_name, "#p#");
+#else
 	is_part = strstr(norm_name, "#P#");
+#endif /* __WIN__ */
+
 retry:
 	/* Get pointer to a table object in InnoDB dictionary cache */
 	ib_table = dict_table_open_on_name(norm_name, FALSE);
 
 	if (NULL == ib_table) {
 		if (is_part && retries < 10) {
-			++retries;
-			os_thread_sleep(100000);
-			goto retry;
+			/* MySQL partition engine hard codes the file name
+			separator as "#P#". The text case is fixed even if
+			lower_case_table_names is set to 1 or 2. This is true
+			for sub-partition names as well. InnoDB always
+			normalises file names to lower case on Windows, this
+			can potentially cause problems when copying/moving
+			tables between platforms.
+
+			1) If boot against an installation from Windows
+			platform, then its partition table name could
+			be all be in lower case in system tables. So we
+			will need to check lower case name when load table.
+
+			2) If  we boot an installation from other case
+			sensitive platform in Windows, we might need to
+			check the existence of table name without lowering
+			case them in the system table. */
+			if (innobase_get_lower_case_table_names() == 1) {
+
+				if (!par_case_name_set) {
+#ifndef __WIN__
+					/* Check for the table using lower
+					case name, including the partition
+					separator "P" */
+					memcpy(par_case_name, norm_name,
+					       strlen(norm_name));
+					par_case_name[strlen(norm_name)] = 0;
+					innobase_casedn_str(par_case_name);
+#else
+					/* On Windows platfrom, check
+					whether there exists table name in
+					system table whose name is
+					not being normalized to lower case */
+					normalize_table_name_low(
+						par_case_name, name, FALSE);
+#endif
+					par_case_name_set = TRUE;
+				}
+
+				ib_table = dict_table_open_on_name(
+					par_case_name, FALSE);
+			}
+
+			if (!ib_table) {
+				++retries;
+				os_thread_sleep(100000);
+				goto retry;
+			} else {
+#ifndef __WIN__
+				sql_print_warning("Partition table %s opened "
+						  "after converting to lower "
+						  "case. The table may have "
+						  "been moved from a case "
+						  "in-sensitive file system. "
+						  "Please recreate table in "
+						  "the current file system\n",
+						  norm_name);
+#else
+				sql_print_warning("Partition table %s opened "
+						  "after skipping the step to "
+						  "lower case the table name. "
+						  "The table may have been "
+						  "moved from a case sensitive "
+						  "file system. Please "
+						  "recreate table in the "
+						  "current file system\n",
+						  norm_name);
+#endif
+				goto table_opened;
+			}
 		}
 
 		if (is_part) {
@@ -4098,6 +4183,8 @@ retry:
 		DBUG_RETURN(HA_ERR_NO_SUCH_TABLE);
 	}
 
+table_opened:
+
 	MONITOR_INC(MONITOR_TABLE_OPEN);
 
 	if (ib_table->ibd_file_missing && !thd_tablespace_op(thd)) {
@@ -6333,13 +6420,13 @@ ha_innobase::innobase_get_index(
 			table. Only print message if the index translation
 			table exists */
 			if (share->idx_trans_tbl.index_mapping) {
-				sql_print_error("InnoDB could not find "
-						"index %s key no %u for "
-						"table %s through its "
-						"index translation table",
-						key ? key->name : "NULL",
-						keynr,
-						prebuilt->table->name);
+				sql_print_warning("InnoDB could not find "
+						  "index %s key no %u for "
+						  "table %s through its "
+						  "index translation table",
+						  key ? key->name : "NULL",
+						  keynr,
+						  prebuilt->table->name);
 			}
 
 			index = dict_table_get_index_on_name(prebuilt->table,
@@ -7820,6 +7907,39 @@ ha_innobase::delete_table(
 					 thd_sql_command(thd)
 					 == SQLCOM_DROP_DB);
 
+
+	if (error == DB_TABLE_NOT_FOUND
+	    && innobase_get_lower_case_table_names() == 1) {
+		char*	is_part = NULL;
+#ifdef __WIN__
+		is_part = strstr(norm_name, "#p#");
+#else
+		is_part = strstr(norm_name, "#P#");
+#endif /* __WIN__ */
+
+		if (is_part) {
+			char	par_case_name[MAX_FULL_NAME_LEN + 1];
+
+#ifndef __WIN__
+			/* Check for the table using lower
+			case name, including the partition
+			separator "P" */
+			memcpy(par_case_name, norm_name, strlen(norm_name));
+			par_case_name[strlen(norm_name)] = 0;
+			innobase_casedn_str(par_case_name);
+#else
+			/* On Windows platfrom, check
+			whether there exists table name in
+			system table whose name is
+			not being normalized to lower case */
+			normalize_table_name_low(par_case_name, name, FALSE);
+#endif
+			error = row_drop_table_for_mysql(par_case_name, trx,
+							 thd_sql_command(thd)
+							 == SQLCOM_DROP_DB);
+		}
+	}
+
 	/* Flush the log to reduce probability that the .frm files and
 	the InnoDB data dictionary get out-of-sync if the user runs
 	with innodb_flush_log_at_trx_commit = 0 */
@@ -7945,13 +8065,67 @@ innobase_rename_table(
 		norm_from, norm_to, trx, lock_and_commit);
 
 	if (error != DB_SUCCESS) {
-		FILE* ef = dict_foreign_err_file;
+		if (error == DB_TABLE_NOT_FOUND
+		    && innobase_get_lower_case_table_names() == 1) {
+			char*	is_part = NULL;
+#ifdef __WIN__
+			is_part = strstr(norm_from, "#p#");
+#else
+			is_part = strstr(norm_from, "#P#");
+#endif /* __WIN__ */
+
+			if (is_part) {
+				char	par_case_name[MAX_FULL_NAME_LEN + 1];
+
+#ifndef __WIN__
+				/* Check for the table using lower
+				case name, including the partition
+				separator "P" */
+				memcpy(par_case_name, norm_from,
+				       strlen(norm_from));
+				par_case_name[strlen(norm_from)] = 0;
+				innobase_casedn_str(par_case_name);
+#else
+				/* On Windows platfrom, check
+				whether there exists table name in
+				system table whose name is
+				not being normalized to lower case */
+				normalize_table_name_low(par_case_name,
+							 from, FALSE);
+#endif
+				error = row_rename_table_for_mysql(
+					par_case_name, norm_to, trx,
+					lock_and_commit);
+
+			}
+		}
 
-		fputs("InnoDB: Renaming table ", ef);
-		ut_print_name(ef, trx, TRUE, norm_from);
-		fputs(" to ", ef);
-		ut_print_name(ef, trx, TRUE, norm_to);
-		fputs(" failed!\n", ef);
+		if (error != DB_SUCCESS) {
+			FILE* ef = dict_foreign_err_file;
+
+			fputs("InnoDB: Renaming table ", ef);
+			ut_print_name(ef, trx, TRUE, norm_from);
+			fputs(" to ", ef);
+			ut_print_name(ef, trx, TRUE, norm_to);
+			fputs(" failed!\n", ef);
+		} else {
+#ifndef __WIN__
+			sql_print_warning("Rename partition table %s "
+					  "succeeds after converting to lower "
+					  "case. The table may have "
+					  "been moved from a case "
+					  "in-sensitive file system.\n",
+					  norm_from);
+#else
+			sql_print_warning("Rename partition table %s "
+					  "succeeds after skipping the step to "
+					  "lower case the table name. "
+					  "The table may have been "
+					  "moved from a case sensitive "
+					  "file system.\n",
+					  norm_from);
+#endif /* __WIN__ */
+		}
 	}
 
 	if (lock_and_commit) {
@@ -8842,7 +9016,10 @@ ha_innobase::check(
 		putc('\n', stderr);
 #endif
 
-		if (!btr_validate_index(index, prebuilt->trx)) {
+		/* If this is an index being created, break */
+		if (*index->name == TEMP_INDEX_PREFIX) {
+			break;
+		}  else if (!btr_validate_index(index, prebuilt->trx)) {
 			is_ok = FALSE;
 
 			innobase_format_name(

=== modified file 'storage/innobase/include/buf0buf.h'
--- a/storage/innobase/include/buf0buf.h	2011-10-19 11:42:46 +0000
+++ b/storage/innobase/include/buf0buf.h	2011-10-27 20:06:13 +0000
@@ -1882,7 +1882,7 @@ struct buf_pool_struct{
 	buf_page_t*			watch;
 					/*!< Sentinel records for buffer
 					pool watches. Protected by
-				       	buf_pool->mutex. */
+					buf_pool->mutex. */
 
 #if BUF_BUDDY_HIGH != UNIV_PAGE_SIZE
 # error "BUF_BUDDY_HIGH != UNIV_PAGE_SIZE"

=== modified file 'storage/innobase/include/fil0fil.h'
--- a/storage/innobase/include/fil0fil.h	2011-03-09 07:32:36 +0000
+++ b/storage/innobase/include/fil0fil.h	2011-10-27 20:06:13 +0000
@@ -339,11 +339,11 @@ fil_read_flushed_lsn_and_arch_log_no(
 						parameters below already
 						contain sensible data */
 #ifdef UNIV_LOG_ARCHIVE
-	ulint*		min_arch_log_no,	/*!< in/out: */
-	ulint*		max_arch_log_no,	/*!< in/out: */
+	ulint*		min_arch_log_no,	/*!< out: */
+	ulint*		max_arch_log_no,	/*!< out: */
 #endif /* UNIV_LOG_ARCHIVE */
-	lsn_t*		min_flushed_lsn,	/*!< in/out: */
-	lsn_t*		max_flushed_lsn);	/*!< in/out: */
+	lsn_t*		min_flushed_lsn,	/*!< out: */
+	lsn_t*		max_flushed_lsn);	/*!< out: */
 /*******************************************************************//**
 Increments the count of pending insert buffer page merges, if space is not
 being deleted.

=== modified file 'storage/innobase/include/fsp0fsp.h'
--- a/storage/innobase/include/fsp0fsp.h	2011-10-21 15:46:57 +0000
+++ b/storage/innobase/include/fsp0fsp.h	2011-10-27 20:06:13 +0000
@@ -170,16 +170,16 @@ fsp_header_init(
 /*============*/
 	ulint	space,		/*!< in: space id */
 	ulint	size,		/*!< in: current size in blocks */
-	mtr_t*	mtr);		/*!< in: mini-transaction handle */
+	mtr_t*	mtr);		/*!< in/out: mini-transaction */
 /**********************************************************************//**
 Increases the space size field of a space. */
 UNIV_INTERN
 void
 fsp_header_inc_size(
 /*================*/
-	ulint	space,	/*!< in: space id */
-	ulint	size_inc,/*!< in: size increment in pages */
-	mtr_t*	mtr);	/*!< in: mini-transaction handle */
+	ulint	space,		/*!< in: space id */
+	ulint	size_inc,	/*!< in: size increment in pages */
+	mtr_t*	mtr);		/*!< in/out: mini-transaction */
 /**********************************************************************//**
 Creates a new segment.
 @return the block where the segment header is placed, x-latched, NULL
@@ -195,7 +195,7 @@ fseg_create(
 			will belong to the created segment */
 	ulint	byte_offset, /*!< in: byte offset of the created segment header
 			on the page */
-	mtr_t*	mtr);	/*!< in: mtr */
+	mtr_t*	mtr);	/*!< in/out: mini-transaction */
 /**********************************************************************//**
 Creates a new segment.
 @return the block where the segment header is placed, x-latched, NULL
@@ -217,7 +217,7 @@ fseg_create_general(
 			the inode and the other for the segment) then there is
 			no need to do the check for this individual
 			operation */
-	mtr_t*	mtr);	/*!< in: mtr */
+	mtr_t*	mtr);	/*!< in/out: mini-transaction */
 /**********************************************************************//**
 Calculates the number of pages reserved by a segment, and how many pages are
 currently used.
@@ -228,7 +228,7 @@ fseg_n_reserved_pages(
 /*==================*/
 	fseg_header_t*	header,	/*!< in: segment header */
 	ulint*		used,	/*!< out: number of pages used (<= reserved) */
-	mtr_t*		mtr);	/*!< in: mtr handle */
+	mtr_t*		mtr);	/*!< in/out: mini-transaction */
 /**********************************************************************//**
 Allocates a single free page from a segment. This function implements
 the intelligent allocation strategy which tries to minimize
@@ -308,7 +308,7 @@ fsp_reserve_free_extents(
 	ulint	space,	/*!< in: space id */
 	ulint	n_ext,	/*!< in: number of extents to reserve */
 	ulint	alloc_type,/*!< in: FSP_NORMAL, FSP_UNDO, or FSP_CLEANING */
-	mtr_t*	mtr);	/*!< in: mtr */
+	mtr_t*	mtr);	/*!< in: mini-transaction */
 /**********************************************************************//**
 This function should be used to get information on how much we still
 will be able to insert new data to the database without running out the
@@ -329,7 +329,7 @@ fseg_free_page(
 	fseg_header_t*	seg_header, /*!< in: segment header */
 	ulint		space,	/*!< in: space id */
 	ulint		page,	/*!< in: page offset */
-	mtr_t*		mtr);	/*!< in: mtr handle */
+	mtr_t*		mtr);	/*!< in/out: mini-transaction */
 /**********************************************************************//**
 Frees part of a segment. This function can be used to free a segment
 by repeatedly calling this function in different mini-transactions.
@@ -344,7 +344,7 @@ fseg_free_step(
 				resides on the first page of the frag list
 				of the segment, this pointer becomes obsolete
 				after the last freeing step */
-	mtr_t*		mtr);	/*!< in: mtr */
+	mtr_t*		mtr);	/*!< in/out: mini-transaction */
 /**********************************************************************//**
 Frees part of a segment. Differs from fseg_free_step because this function
 leaves the header page unfreed.
@@ -355,7 +355,7 @@ fseg_free_step_not_header(
 /*======================*/
 	fseg_header_t*	header,	/*!< in: segment header which must reside on
 				the first fragment page of the segment */
-	mtr_t*		mtr);	/*!< in: mtr */
+	mtr_t*		mtr);	/*!< in/out: mini-transaction */
 /***********************************************************************//**
 Checks if a page address is an extent descriptor page address.
 @return	TRUE if a descriptor page */
@@ -400,7 +400,7 @@ ibool
 fseg_validate(
 /*==========*/
 	fseg_header_t*	header, /*!< in: segment header */
-	mtr_t*		mtr);	/*!< in: mtr */
+	mtr_t*		mtr);	/*!< in/out: mini-transaction */
 #endif /* UNIV_DEBUG */
 #ifdef UNIV_BTR_PRINT
 /*******************************************************************//**
@@ -410,7 +410,7 @@ void
 fseg_print(
 /*=======*/
 	fseg_header_t*	header, /*!< in: segment header */
-	mtr_t*		mtr);	/*!< in: mtr */
+	mtr_t*		mtr);	/*!< in/out: mini-transaction */
 #endif /* UNIV_BTR_PRINT */
 
 /********************************************************************//**

=== modified file 'storage/innobase/include/sync0rw.ic'
--- a/storage/innobase/include/sync0rw.ic	2011-10-19 11:42:46 +0000
+++ b/storage/innobase/include/sync0rw.ic	2011-10-27 14:09:11 +0000
@@ -131,7 +131,7 @@ rw_lock_get_writer(
 	} else if (((-lock_word) % X_LOCK_DECR) == 0) {
 		return(RW_LOCK_EX);
 	} else {
-                ut_ad(lock_word > -X_LOCK_DECR);
+		ut_ad(lock_word > -X_LOCK_DECR);
 		return(RW_LOCK_WAIT_EX);
 	}
 }
@@ -200,7 +200,7 @@ rw_lock_lock_word_decr(
 	ulint		amount)		/*!< in: amount to decrement */
 {
 #ifdef INNODB_RW_LOCKS_USE_ATOMICS
-        lint local_lock_word = lock->lock_word;
+	lint local_lock_word = lock->lock_word;
 	while (local_lock_word > 0) {
 		if (os_compare_and_swap_lint(&lock->lock_word,
 					     local_lock_word,
@@ -244,7 +244,7 @@ rw_lock_lock_word_incr(
 
 	mutex_exit(&(lock->mutex));
 
-        return(local_lock_word);
+	return(local_lock_word);
 #endif /* INNODB_RW_LOCKS_USE_ATOMICS */
 }
 
@@ -318,7 +318,7 @@ rw_lock_s_lock_low(
 	rw_lock_add_debug_info(lock, pass, RW_LOCK_SHARED, file_name, line);
 #endif
 	/* These debugging values are not set safely: they may be incorrect
-        or even refer to a line that is invalid for the file name. */
+	or even refer to a line that is invalid for the file name. */
 	lock->last_s_file_name = file_name;
 	lock->last_s_line = line;
 
@@ -462,8 +462,12 @@ rw_lock_x_lock_func_nowait(
 		there is an exclusive writer and this is the writer thread. */
 		lock->lock_word -= X_LOCK_DECR;
 
+		/* Recursive x-locks must be multiples of X_LOCK_DECR. */
 		ut_ad(((-lock->lock_word) % X_LOCK_DECR) == 0);
 
+		/* Watch for too many recursive locks */
+		ut_ad(lock->lock_word < 0);
+
 	} else {
 		/* Failure */
 		return(FALSE);
@@ -502,8 +506,8 @@ rw_lock_s_unlock_func(
 	if (rw_lock_lock_word_incr(lock, 1) == 0) {
 
 		/* wait_ex waiter exists. It may not be asleep, but we signal
-                anyway. We do not wake other waiters, because they can't
-                exist without wait_ex waiter and wait_ex waiter goes first.*/
+		anyway. We do not wake other waiters, because they can't
+		exist without wait_ex waiter and wait_ex waiter goes first.*/
 		os_event_set(lock->wait_ex_event);
 		sync_array_object_signalled();
 
@@ -574,8 +578,8 @@ rw_lock_x_unlock_func(
 
 	if (rw_lock_lock_word_incr(lock, X_LOCK_DECR) == X_LOCK_DECR) {
 		/* Lock is now free. May have to signal read/write waiters.
-                We do not need to signal wait_ex waiters, since they cannot
-                exist when there is a writer. */
+		We do not need to signal wait_ex waiters, since they cannot
+		exist when there is a writer. */
 		if (lock->waiters) {
 			rw_lock_reset_waiter_flag(lock);
 			os_event_set(lock->event);
@@ -658,7 +662,7 @@ pfs_rw_lock_create_func(
 			    cmutex_name,
 # endif /* UNIV_DEBUG */
 			    cfile_name,
-		            cline);
+			    cline);
 }
 /******************************************************************//**
 Performance schema instrumented wrap function for rw_lock_x_lock_func()

=== modified file 'storage/innobase/row/row0mysql.c'
--- a/storage/innobase/row/row0mysql.c	2011-10-21 15:46:57 +0000
+++ b/storage/innobase/row/row0mysql.c	2011-10-27 12:39:16 +0000
@@ -4073,6 +4073,7 @@ end:
 			trx->error_state = DB_SUCCESS;
 			trx_rollback_to_savepoint(trx, NULL);
 			trx->error_state = DB_SUCCESS;
+			err = DB_ERROR;
 			goto funct_exit;
 		}
 

=== modified file 'storage/innobase/row/row0umod.c'
--- a/storage/innobase/row/row0umod.c	2011-08-19 13:41:27 +0000
+++ b/storage/innobase/row/row0umod.c	2011-10-27 20:06:13 +0000
@@ -751,7 +751,7 @@ row_undo_mod_upd_exist_sec(
 		}
 
 		mem_heap_empty(heap);
-	     	dict_table_next_uncorrupted_index(node->index);
+		dict_table_next_uncorrupted_index(node->index);
 	}
 
 	mem_heap_free(heap);

=== modified file 'storage/innobase/srv/srv0start.c'
--- a/storage/innobase/srv/srv0start.c	2011-10-05 13:16:38 +0000
+++ b/storage/innobase/srv/srv0start.c	2011-10-27 20:06:13 +0000
@@ -134,7 +134,7 @@ static os_fast_mutex_t	srv_os_test_mutex
 static char*	srv_monitor_file_name;
 #endif /* !UNIV_HOTBACKUP */
 
-/** Default undo  tablespace size in UNIV_PAGEs count (10MB). */
+/** Default undo tablespace size in UNIV_PAGEs count (10MB). */
 static const ulint SRV_UNDO_TABLESPACE_SIZE_IN_PAGES =
 	((1024 * 1024) * 10) / UNIV_PAGE_SIZE;
 

=== modified file 'storage/perfschema/pfs.cc'
--- a/storage/perfschema/pfs.cc	2011-10-12 20:15:19 +0000
+++ b/storage/perfschema/pfs.cc	2011-10-27 21:18:19 +0000
@@ -885,7 +885,7 @@ static inline int mysql_mutex_lock(...)
         | [2]
         |
         |-> pfs_socket_class(F.class)           =====>> [C], [D]
-        |   
+        |
         |-> pfs_thread(T).event_name(F)         =====>> [A]
         |
         ...
@@ -2092,6 +2092,7 @@ get_thread_mutex_locker_v1(PSI_mutex_loc
       wait->m_timer_end= 0;
       wait->m_object_instance_addr= pfs_mutex->m_identity;
       wait->m_event_id= pfs_thread->m_event_id++;
+      wait->m_end_event_id= 0;
       wait->m_operation= mutex_operation_map[(int) op];
       wait->m_wait_class= WAIT_CLASS_MUTEX;
 
@@ -2179,6 +2180,7 @@ get_thread_rwlock_locker_v1(PSI_rwlock_l
       wait->m_timer_end= 0;
       wait->m_object_instance_addr= pfs_rwlock->m_identity;
       wait->m_event_id= pfs_thread->m_event_id++;
+      wait->m_end_event_id= 0;
       wait->m_operation= rwlock_operation_map[static_cast<int> (op)];
       wait->m_wait_class= WAIT_CLASS_RWLOCK;
 
@@ -2283,6 +2285,7 @@ get_thread_cond_locker_v1(PSI_cond_locke
       wait->m_timer_end= 0;
       wait->m_object_instance_addr= pfs_cond->m_identity;
       wait->m_event_id= pfs_thread->m_event_id++;
+      wait->m_end_event_id= 0;
       wait->m_operation= cond_operation_map[static_cast<int> (op)];
       wait->m_wait_class= WAIT_CLASS_COND;
 
@@ -2412,6 +2415,7 @@ get_thread_table_io_locker_v1(PSI_table_
       wait->m_timer_end= 0;
       wait->m_object_instance_addr= pfs_table->m_identity;
       wait->m_event_id= pfs_thread->m_event_id++;
+      wait->m_end_event_id= 0;
       wait->m_operation= table_io_operation_map[static_cast<int> (op)];
       wait->m_flags= 0;
       wait->m_object_type= share->get_object_type();
@@ -2525,6 +2529,7 @@ get_thread_table_lock_locker_v1(PSI_tabl
       wait->m_timer_end= 0;
       wait->m_object_instance_addr= pfs_table->m_identity;
       wait->m_event_id= pfs_thread->m_event_id++;
+      wait->m_end_event_id= 0;
       wait->m_operation= table_lock_operation_map[lock_type];
       wait->m_flags= 0;
       wait->m_object_type= share->get_object_type();
@@ -2623,6 +2628,7 @@ get_thread_file_name_locker_v1(PSI_file_
     wait->m_weak_file= pfs_file;
     wait->m_weak_version= pfs_file->get_version();
     wait->m_event_id= pfs_thread->m_event_id++;
+    wait->m_end_event_id= 0;
     wait->m_operation= file_operation_map[static_cast<int> (op)];
     wait->m_wait_class= WAIT_CLASS_FILE;
 
@@ -2649,7 +2655,7 @@ get_thread_file_stream_locker_v1(PSI_fil
   DBUG_ASSERT(state != NULL);
 
   if (unlikely(pfs_file == NULL))
-    return NULL; 
+    return NULL;
   DBUG_ASSERT(pfs_file->m_class != NULL);
 
   if (! pfs_file->m_enabled)
@@ -2694,6 +2700,7 @@ get_thread_file_stream_locker_v1(PSI_fil
       wait->m_weak_file= pfs_file;
       wait->m_weak_version= pfs_file->get_version();
       wait->m_event_id= pfs_thread->m_event_id++;
+      wait->m_end_event_id= 0;
       wait->m_operation= file_operation_map[static_cast<int> (op)];
       wait->m_wait_class= WAIT_CLASS_FILE;
 
@@ -2794,6 +2801,7 @@ get_thread_file_descriptor_locker_v1(PSI
       wait->m_weak_file= pfs_file;
       wait->m_weak_version= pfs_file->get_version();
       wait->m_event_id= pfs_thread->m_event_id++;
+      wait->m_end_event_id= 0;
       wait->m_operation= file_operation_map[static_cast<int> (op)];
       wait->m_wait_class= WAIT_CLASS_FILE;
 
@@ -2888,6 +2896,7 @@ get_thread_socket_locker_v1(PSI_socket_l
       wait->m_weak_socket=  pfs_socket;
       wait->m_weak_version= pfs_socket->get_version();
       wait->m_event_id=     pfs_thread->m_event_id++;
+      wait->m_end_event_id= 0;
       wait->m_operation=    socket_operation_map[static_cast<int>(op)];
       wait->m_wait_class=   WAIT_CLASS_SOCKET;
 
@@ -3149,6 +3158,7 @@ start_idle_wait_v1(PSI_idle_locker_state
       wait->m_timer_start= timer_start;
       wait->m_timer_end= 0;
       wait->m_event_id= pfs_thread->m_event_id++;
+      wait->m_end_event_id= 0;
       wait->m_operation= OPERATION_TYPE_IDLE;
       wait->m_source_file= src_file;
       wait->m_source_line= src_line;
@@ -3214,6 +3224,7 @@ static void end_idle_wait_v1(PSI_idle_lo
       DBUG_ASSERT(wait != NULL);
 
       wait->m_timer_end= timer_end;
+      wait->m_end_event_id= thread->m_event_id;
       if (flag_events_waits_history)
         insert_events_waits_history(thread, wait);
       if (flag_events_waits_history_long)
@@ -3312,6 +3323,7 @@ static void end_mutex_wait_v1(PSI_mutex_
       DBUG_ASSERT(wait != NULL);
 
       wait->m_timer_end= timer_end;
+      wait->m_end_event_id= thread->m_event_id;
       if (flag_events_waits_history)
         insert_events_waits_history(thread, wait);
       if (flag_events_waits_history_long)
@@ -3416,6 +3428,7 @@ static void end_rwlock_rdwait_v1(PSI_rwl
       DBUG_ASSERT(wait != NULL);
 
       wait->m_timer_end= timer_end;
+      wait->m_end_event_id= thread->m_event_id;
       if (flag_events_waits_history)
         insert_events_waits_history(thread, wait);
       if (flag_events_waits_history_long)
@@ -3513,6 +3526,7 @@ static void end_rwlock_wrwait_v1(PSI_rwl
       DBUG_ASSERT(wait != NULL);
 
       wait->m_timer_end= timer_end;
+      wait->m_end_event_id= thread->m_event_id;
       if (flag_events_waits_history)
         insert_events_waits_history(thread, wait);
       if (flag_events_waits_history_long)
@@ -3603,6 +3617,7 @@ static void end_cond_wait_v1(PSI_cond_lo
       DBUG_ASSERT(wait != NULL);
 
       wait->m_timer_end= timer_end;
+      wait->m_end_event_id= thread->m_event_id;
       if (flag_events_waits_history)
         insert_events_waits_history(thread, wait);
       if (flag_events_waits_history_long)
@@ -3704,6 +3719,7 @@ static void end_table_io_wait_v1(PSI_tab
     DBUG_ASSERT(wait != NULL);
 
     wait->m_timer_end= timer_end;
+    wait->m_end_event_id= thread->m_event_id;
     if (flag_events_waits_history)
       insert_events_waits_history(thread, wait);
     if (flag_events_waits_history_long)
@@ -3783,6 +3799,7 @@ static void end_table_lock_wait_v1(PSI_t
     DBUG_ASSERT(wait != NULL);
 
     wait->m_timer_end= timer_end;
+    wait->m_end_event_id= thread->m_event_id;
     if (flag_events_waits_history)
       insert_events_waits_history(thread, wait);
     if (flag_events_waits_history_long)
@@ -3981,6 +3998,8 @@ static void end_file_wait_v1(PSI_file_lo
 
       wait->m_timer_end= timer_end;
       wait->m_number_of_bytes= bytes;
+      wait->m_end_event_id= thread->m_event_id;
+
       if (flag_events_waits_history)
         insert_events_waits_history(thread, wait);
       if (flag_events_waits_history_long)
@@ -4049,6 +4068,7 @@ static void start_stage_v1(PSI_stage_key
 
     if (flag_events_stages_current)
     {
+      pfs->m_end_event_id= pfs_thread->m_event_id;
       if (flag_events_stages_history)
         insert_events_stages_history(pfs_thread, pfs);
       if (flag_events_stages_history_long)
@@ -4090,6 +4110,7 @@ static void start_stage_v1(PSI_stage_key
     /* m_thread_internal_id is immutable and already set */
     DBUG_ASSERT(pfs->m_thread_internal_id == pfs_thread->m_thread_internal_id);
     pfs->m_event_id= pfs_thread->m_event_id++;
+    pfs->m_end_event_id= 0;
     pfs->m_source_file= src_file;
     pfs->m_source_line= src_line;
 
@@ -4140,6 +4161,7 @@ static void end_stage_v1()
 
     if (flag_events_stages_current)
     {
+      pfs->m_end_event_id= pfs_thread->m_event_id;
       if (flag_events_stages_history)
         insert_events_stages_history(pfs_thread, pfs);
       if (flag_events_stages_history_long)
@@ -4198,6 +4220,7 @@ get_thread_statement_locker_v1(PSI_state
       /* m_thread_internal_id is immutable and already set */
       DBUG_ASSERT(pfs->m_thread_internal_id == pfs_thread->m_thread_internal_id);
       pfs->m_event_id= event_id;
+      pfs->m_end_event_id= 0;
       pfs->m_class= klass;
       pfs->m_timer_start= 0;
       pfs->m_timer_end= 0;
@@ -4227,7 +4250,7 @@ get_thread_statement_locker_v1(PSI_state
       pfs->m_sort_scan= 0;
       pfs->m_no_index_used= 0;
       pfs->m_no_good_index_used= 0;
-      
+
       /* New stages will have this statement as parent */
       PFS_events_stages *child_stage= & pfs_thread->m_stage_current;
       child_stage->m_nesting_event_id= event_id;
@@ -4568,6 +4591,7 @@ static void end_statement_v1(PSI_stateme
       }
 
       pfs->m_timer_end= timer_end;
+      pfs->m_end_event_id= thread->m_event_id;
       if (flag_events_statements_history)
         insert_events_statements_history(thread, pfs);
       if (flag_events_statements_history_long)
@@ -4747,6 +4771,7 @@ static void end_socket_wait_v1(PSI_socke
     DBUG_ASSERT(wait != NULL);
 
     wait->m_timer_end= timer_end;
+    wait->m_end_event_id= thread->m_event_id;
     wait->m_number_of_bytes= bytes;
 
     if (flag_events_waits_history)
@@ -4789,11 +4814,11 @@ static void set_socket_info_v1(PSI_socke
   if (likely(addr != NULL && addr_len > 0))
   {
     pfs->m_addr_len= addr_len;
-  
+
     /** Restrict address length to size of struct */
     if (unlikely(pfs->m_addr_len > sizeof(sockaddr_storage)))
       pfs->m_addr_len= sizeof(struct sockaddr_storage);
-  
+
     memcpy(&pfs->m_sock_addr, addr, pfs->m_addr_len);
   }
 }
@@ -4908,7 +4933,7 @@ PSI_v1 PFS_v1=
   inc_statement_sort_scan_v1,
   set_statement_no_index_used_v1,
   set_statement_no_good_index_used_v1,
-  end_statement_v1, 
+  end_statement_v1,
   start_socket_wait_v1,
   end_socket_wait_v1,
   set_socket_state_v1,

=== modified file 'storage/perfschema/pfs_events.h'
--- a/storage/perfschema/pfs_events.h	2011-06-30 15:50:45 +0000
+++ b/storage/perfschema/pfs_events.h	2011-08-26 08:42:40 +0000
@@ -32,6 +32,8 @@ struct PFS_events
   ulong m_thread_internal_id;
   /** EVENT_ID. */
   ulonglong m_event_id;
+  /** END_EVENT_ID. */
+  ulonglong m_end_event_id;
   /** (EVENT_TYPE) */
   enum_event_type m_event_type;
   /** NESTING_EVENT_ID. */

=== modified file 'storage/perfschema/pfs_instr.cc'
--- a/storage/perfschema/pfs_instr.cc	2011-10-25 22:56:30 +0000
+++ b/storage/perfschema/pfs_instr.cc	2011-10-27 21:18:19 +0000
@@ -860,6 +860,7 @@ PFS_thread* create_thread(PFS_thread_cla
           child_wait= & pfs->m_events_waits_stack[index];
           child_wait->m_thread_internal_id= pfs->m_thread_internal_id;
           child_wait->m_event_id= 0;
+          child_wait->m_end_event_id= 0;
           child_wait->m_event_type= EVENT_TYPE_STATEMENT;
           child_wait->m_wait_class= NO_WAIT_CLASS;
         }
@@ -867,6 +868,7 @@ PFS_thread* create_thread(PFS_thread_cla
         PFS_events_stages *child_stage= & pfs->m_stage_current;
         child_stage->m_thread_internal_id= pfs->m_thread_internal_id;
         child_stage->m_event_id= 0;
+        child_stage->m_end_event_id= 0;
         child_stage->m_event_type= EVENT_TYPE_STATEMENT;
         child_stage->m_class= NULL;
         child_stage->m_timer_start= 0;
@@ -880,6 +882,7 @@ PFS_thread* create_thread(PFS_thread_cla
           child_statement= & pfs->m_statement_stack[index];
           child_statement->m_thread_internal_id= pfs->m_thread_internal_id;
           child_statement->m_event_id= 0;
+          child_statement->m_end_event_id= 0;
           child_statement->m_event_type= EVENT_TYPE_STATEMENT;
           child_statement->m_class= NULL;
           child_statement->m_timer_start= 0;

=== modified file 'storage/perfschema/table_events_stages.cc'
--- a/storage/perfschema/table_events_stages.cc	2011-06-30 15:50:45 +0000
+++ b/storage/perfschema/table_events_stages.cc	2011-08-26 08:42:40 +0000
@@ -41,6 +41,11 @@ static const TABLE_FIELD_TYPE field_type
     { NULL, 0}
   },
   {
+    { C_STRING_WITH_LEN("END_EVENT_ID") },
+    { C_STRING_WITH_LEN("bigint(20)") },
+    { NULL, 0}
+  },
+  {
     { C_STRING_WITH_LEN("EVENT_NAME") },
     { C_STRING_WITH_LEN("varchar(128)") },
     { NULL, 0}
@@ -79,7 +84,7 @@ static const TABLE_FIELD_TYPE field_type
 
 TABLE_FIELD_DEF
 table_events_stages_current::m_field_def=
-{9 , field_types };
+{10 , field_types };
 
 PFS_engine_table_share
 table_events_stages_current::m_share=
@@ -157,6 +162,7 @@ void table_events_stages_common::make_ro
 
   m_row.m_thread_internal_id= stage->m_thread_internal_id;
   m_row.m_event_id= stage->m_event_id;
+  m_row.m_end_event_id= stage->m_end_event_id;
   m_row.m_nesting_event_id= stage->m_nesting_event_id;
   m_row.m_nesting_event_type= stage->m_nesting_event_type;
 
@@ -207,37 +213,43 @@ int table_events_stages_common::read_row
       case 1: /* EVENT_ID */
         set_field_ulonglong(f, m_row.m_event_id);
         break;
-      case 2: /* EVENT_NAME */
+      case 2: /* END_EVENT_ID */
+        if (m_row.m_end_event_id > 0)
+          set_field_ulonglong(f, m_row.m_end_event_id - 1);
+        else
+          f->set_null();
+        break;
+      case 3: /* EVENT_NAME */
         set_field_varchar_utf8(f, m_row.m_name, m_row.m_name_length);
         break;
-      case 3: /* SOURCE */
+      case 4: /* SOURCE */
         set_field_varchar_utf8(f, m_row.m_source, m_row.m_source_length);
         break;
-      case 4: /* TIMER_START */
+      case 5: /* TIMER_START */
         if (m_row.m_timer_start != 0)
           set_field_ulonglong(f, m_row.m_timer_start);
         else
           f->set_null();
         break;
-      case 5: /* TIMER_END */
+      case 6: /* TIMER_END */
         if (m_row.m_timer_end != 0)
           set_field_ulonglong(f, m_row.m_timer_end);
         else
           f->set_null();
         break;
-      case 6: /* TIMER_WAIT */
+      case 7: /* TIMER_WAIT */
         if (m_row.m_timer_wait != 0)
           set_field_ulonglong(f, m_row.m_timer_wait);
         else
           f->set_null();
         break;
-      case 7: /* NESTING_EVENT_ID */
+      case 8: /* NESTING_EVENT_ID */
         if (m_row.m_nesting_event_id != 0)
           set_field_ulonglong(f, m_row.m_nesting_event_id);
         else
           f->set_null();
         break;
-      case 8: /* NESTING_EVENT_TYPE */
+      case 9: /* NESTING_EVENT_TYPE */
         if (m_row.m_nesting_event_id != 0)
           set_field_enum(f, m_row.m_nesting_event_type);
         else

=== modified file 'storage/perfschema/table_events_stages.h'
--- a/storage/perfschema/table_events_stages.h	2011-06-30 15:50:45 +0000
+++ b/storage/perfschema/table_events_stages.h	2011-08-26 08:42:40 +0000
@@ -39,6 +39,8 @@ struct row_events_stages
   ulong m_thread_internal_id;
   /** Column EVENT_ID. */
   ulonglong m_event_id;
+  /** Column END_EVENT_ID. */
+  ulonglong m_end_event_id;
   /** Column NESTING_EVENT_ID. */
   ulonglong m_nesting_event_id;
   /** Column NESTING_EVENT_TYPE. */

=== modified file 'storage/perfschema/table_events_statements.cc'
--- a/storage/perfschema/table_events_statements.cc	2011-06-30 15:50:45 +0000
+++ b/storage/perfschema/table_events_statements.cc	2011-08-26 08:42:40 +0000
@@ -43,6 +43,11 @@ static const TABLE_FIELD_TYPE field_type
     { NULL, 0}
   },
   {
+    { C_STRING_WITH_LEN("END_EVENT_ID") },
+    { C_STRING_WITH_LEN("bigint(20)") },
+    { NULL, 0}
+  },
+  {
     { C_STRING_WITH_LEN("EVENT_NAME") },
     { C_STRING_WITH_LEN("varchar(128)") },
     { NULL, 0}
@@ -221,7 +226,7 @@ static const TABLE_FIELD_TYPE field_type
 
 TABLE_FIELD_DEF
 table_events_statements_current::m_field_def=
-{37 , field_types };
+{38 , field_types };
 
 PFS_engine_table_share
 table_events_statements_current::m_share=
@@ -299,6 +304,7 @@ void table_events_statements_common::mak
 
   m_row.m_thread_internal_id= statement->m_thread_internal_id;
   m_row.m_event_id= statement->m_event_id;
+  m_row.m_end_event_id= statement->m_end_event_id;
   m_row.m_nesting_event_id= statement->m_nesting_event_id;
   m_row.m_nesting_event_type= statement->m_nesting_event_type;
 
@@ -383,137 +389,143 @@ int table_events_statements_common::read
       case 1: /* EVENT_ID */
         set_field_ulonglong(f, m_row.m_event_id);
         break;
-      case 2: /* EVENT_NAME */
+      case 2: /* END_EVENT_ID */
+        if (m_row.m_end_event_id > 0)
+          set_field_ulonglong(f, m_row.m_end_event_id - 1);
+        else
+          f->set_null();
+        break;
+      case 3: /* EVENT_NAME */
         set_field_varchar_utf8(f, m_row.m_name, m_row.m_name_length);
         break;
-      case 3: /* SOURCE */
+      case 4: /* SOURCE */
         set_field_varchar_utf8(f, m_row.m_source, m_row.m_source_length);
         break;
-      case 4: /* TIMER_START */
+      case 5: /* TIMER_START */
         if (m_row.m_timer_start != 0)
           set_field_ulonglong(f, m_row.m_timer_start);
         else
           f->set_null();
         break;
-      case 5: /* TIMER_END */
+      case 6: /* TIMER_END */
         if (m_row.m_timer_end != 0)
           set_field_ulonglong(f, m_row.m_timer_end);
         else
           f->set_null();
         break;
-      case 6: /* TIMER_WAIT */
+      case 7: /* TIMER_WAIT */
         if (m_row.m_timer_wait != 0)
           set_field_ulonglong(f, m_row.m_timer_wait);
         else
           f->set_null();
         break;
-      case 7: /* LOCK_TIME */
+      case 8: /* LOCK_TIME */
         if (m_row.m_lock_time != 0)
           set_field_ulonglong(f, m_row.m_lock_time);
         else
           f->set_null();
         break;
-      case 8: /* SQL_TEXT */
+      case 9: /* SQL_TEXT */
         if (m_row.m_sqltext_length)
           set_field_longtext_utf8(f, m_row.m_sqltext, m_row.m_sqltext_length);
         else
           f->set_null();
         break;
-      case 9: /* CURRENT_SCHEMA */
+      case 10: /* CURRENT_SCHEMA */
         if (m_row.m_current_schema_name_length)
           set_field_varchar_utf8(f, m_row.m_current_schema_name, m_row.m_current_schema_name_length);
         else
           f->set_null();
         break;
-      case 10: /* OBJECT_TYPE */
+      case 11: /* OBJECT_TYPE */
         f->set_null();
         break;
-      case 11: /* OBJECT_SCHEMA */
+      case 12: /* OBJECT_SCHEMA */
         f->set_null();
         break;
-      case 12: /* OBJECT_NAME */
+      case 13: /* OBJECT_NAME */
         f->set_null();
         break;
-      case 13: /* OBJECT_INSTANCE_BEGIN */
+      case 14: /* OBJECT_INSTANCE_BEGIN */
         f->set_null();
         break;
-      case 14: /* MYSQL_ERRNO */
+      case 15: /* MYSQL_ERRNO */
         set_field_ulong(f, m_row.m_sql_errno);
         break;
-      case 15: /* RETURNED_SQLSTATE */
+      case 16: /* RETURNED_SQLSTATE */
         if (m_row.m_sqlstate[0] != 0)
           set_field_varchar_utf8(f, m_row.m_sqlstate, SQLSTATE_LENGTH);
         else
           f->set_null();
         break;
-      case 16: /* MESSAGE_TEXT */
+      case 17: /* MESSAGE_TEXT */
         len= strlen(m_row.m_message_text);
         if (len)
           set_field_varchar_utf8(f, m_row.m_message_text, len);
         else
           f->set_null();
         break;
-      case 17: /* ERRORS */
+      case 18: /* ERRORS */
         set_field_ulonglong(f, m_row.m_error_count);
         break;
-      case 18: /* WARNINGS */
+      case 19: /* WARNINGS */
         set_field_ulonglong(f, m_row.m_warning_count);
         break;
-      case 19: /* ROWS_AFFECTED */
+      case 20: /* ROWS_AFFECTED */
         set_field_ulonglong(f, m_row.m_rows_affected);
         break;
-      case 20: /* ROWS_SENT */
+      case 21: /* ROWS_SENT */
         set_field_ulonglong(f, m_row.m_rows_sent);
         break;
-      case 21: /* ROWS_EXAMINED */
+      case 22: /* ROWS_EXAMINED */
         set_field_ulonglong(f, m_row.m_rows_examined);
         break;
-      case 22: /* CREATED_TMP_DISK_TABLES */
+      case 23: /* CREATED_TMP_DISK_TABLES */
         set_field_ulonglong(f, m_row.m_created_tmp_disk_tables);
         break;
-      case 23: /* CREATED_TMP_TABLES */
+      case 24: /* CREATED_TMP_TABLES */
         set_field_ulonglong(f, m_row.m_created_tmp_tables);
         break;
-      case 24: /* SELECT_FULL_JOIN */
+      case 25: /* SELECT_FULL_JOIN */
         set_field_ulonglong(f, m_row.m_select_full_join);
         break;
-      case 25: /* SELECT_FULL_RANGE_JOIN */
+      case 26: /* SELECT_FULL_RANGE_JOIN */
         set_field_ulonglong(f, m_row.m_select_full_range_join);
         break;
-      case 26: /* SELECT_RANGE */
+      case 27: /* SELECT_RANGE */
         set_field_ulonglong(f, m_row.m_select_range);
         break;
-      case 27: /* SELECT_RANGE_CHECK */
+      case 28: /* SELECT_RANGE_CHECK */
         set_field_ulonglong(f, m_row.m_select_range_check);
         break;
-      case 28: /* SELECT_SCAN */
+      case 29: /* SELECT_SCAN */
         set_field_ulonglong(f, m_row.m_select_scan);
         break;
-      case 29: /* SORT_MERGE_PASSES */
+      case 30: /* SORT_MERGE_PASSES */
         set_field_ulonglong(f, m_row.m_sort_merge_passes);
         break;
-      case 30: /* SORT_RANGE */
+      case 31: /* SORT_RANGE */
         set_field_ulonglong(f, m_row.m_sort_range);
         break;
-      case 31: /* SORT_ROWS */
+      case 32: /* SORT_ROWS */
         set_field_ulonglong(f, m_row.m_sort_rows);
         break;
-      case 32: /* SORT_SCAN */
+      case 33: /* SORT_SCAN */
         set_field_ulonglong(f, m_row.m_sort_scan);
         break;
-      case 33: /* NO_INDEX_USED */
+      case 34: /* NO_INDEX_USED */
         set_field_ulonglong(f, m_row.m_no_index_used);
         break;
-      case 34: /* NO_GOOD_INDEX_USED */
+      case 35: /* NO_GOOD_INDEX_USED */
         set_field_ulonglong(f, m_row.m_no_good_index_used);
         break;
-      case 35: /* NESTING_EVENT_ID */
+      case 36: /* NESTING_EVENT_ID */
         if (m_row.m_nesting_event_id != 0)
           set_field_ulonglong(f, m_row.m_nesting_event_id);
         else
           f->set_null();
         break;
-      case 36: /* NESTING_EVENT_TYPE */
+      case 37: /* NESTING_EVENT_TYPE */
         if (m_row.m_nesting_event_id != 0)
           set_field_enum(f, m_row.m_nesting_event_type);
         else

=== modified file 'storage/perfschema/table_events_statements.h'
--- a/storage/perfschema/table_events_statements.h	2011-06-30 15:50:45 +0000
+++ b/storage/perfschema/table_events_statements.h	2011-08-26 08:42:40 +0000
@@ -39,6 +39,8 @@ struct row_events_statements
   ulong m_thread_internal_id;
   /** Column EVENT_ID. */
   ulonglong m_event_id;
+  /** Column END_EVENT_ID. */
+  ulonglong m_end_event_id;
   /** Column NESTING_EVENT_ID. */
   ulonglong m_nesting_event_id;
   /** Column NESTING_EVENT_TYPE. */

=== modified file 'storage/perfschema/table_events_waits.cc'
--- a/storage/perfschema/table_events_waits.cc	2011-08-09 19:26:45 +0000
+++ b/storage/perfschema/table_events_waits.cc	2011-08-26 08:42:40 +0000
@@ -43,6 +43,11 @@ static const TABLE_FIELD_TYPE field_type
     { NULL, 0}
   },
   {
+    { C_STRING_WITH_LEN("END_EVENT_ID") },
+    { C_STRING_WITH_LEN("bigint(20)") },
+    { NULL, 0}
+  },
+  {
     { C_STRING_WITH_LEN("EVENT_NAME") },
     { C_STRING_WITH_LEN("varchar(128)") },
     { NULL, 0}
@@ -126,7 +131,7 @@ static const TABLE_FIELD_TYPE field_type
 
 TABLE_FIELD_DEF
 table_events_waits_current::m_field_def=
-{ 18, field_types };
+{ 19, field_types };
 
 PFS_engine_table_share
 table_events_waits_current::m_share=
@@ -433,6 +438,7 @@ void table_events_waits_common::make_row
 
   m_row.m_thread_internal_id= safe_thread->m_thread_internal_id;
   m_row.m_event_id= wait->m_event_id;
+  m_row.m_end_event_id= wait->m_end_event_id;
   m_row.m_nesting_event_id= wait->m_nesting_event_id;
   m_row.m_nesting_event_type= wait->m_nesting_event_type;
 
@@ -601,34 +607,40 @@ int table_events_waits_common::read_row_
       case 1: /* EVENT_ID */
         set_field_ulonglong(f, m_row.m_event_id);
         break;
-      case 2: /* EVENT_NAME */
+      case 2: /* END_EVENT_ID */
+        if (m_row.m_end_event_id > 0)
+          set_field_ulonglong(f, m_row.m_end_event_id - 1);
+        else
+          f->set_null();
+        break;
+      case 3: /* EVENT_NAME */
         set_field_varchar_utf8(f, m_row.m_name, m_row.m_name_length);
         break;
-      case 3: /* SOURCE */
+      case 4: /* SOURCE */
         set_field_varchar_utf8(f, m_row.m_source, m_row.m_source_length);
         break;
-      case 4: /* TIMER_START */
+      case 5: /* TIMER_START */
         if (m_row.m_timer_start != 0)
           set_field_ulonglong(f, m_row.m_timer_start);
         else
           f->set_null();
         break;
-      case 5: /* TIMER_END */
+      case 6: /* TIMER_END */
         if (m_row.m_timer_end != 0)
           set_field_ulonglong(f, m_row.m_timer_end);
         else
           f->set_null();
         break;
-      case 6: /* TIMER_WAIT */
+      case 7: /* TIMER_WAIT */
         if (m_row.m_timer_wait != 0)
           set_field_ulonglong(f, m_row.m_timer_wait);
         else
           f->set_null();
         break;
-      case 7: /* SPINS */
+      case 8: /* SPINS */
         f->set_null();
         break;
-      case 8: /* OBJECT_SCHEMA */
+      case 9: /* OBJECT_SCHEMA */
         if (m_row.m_object_schema_length > 0)
         {
           set_field_varchar_utf8(f, m_row.m_object_schema,
@@ -637,7 +649,7 @@ int table_events_waits_common::read_row_
         else
           f->set_null();
         break;
-      case 9: /* OBJECT_NAME */
+      case 10: /* OBJECT_NAME */
         if (m_row.m_object_name_length > 0)
         {
           set_field_varchar_utf8(f, m_row.m_object_name,
@@ -646,7 +658,7 @@ int table_events_waits_common::read_row_
         else
           f->set_null();
         break;
-      case 10: /* INDEX_NAME */
+      case 11: /* INDEX_NAME */
         if (m_row.m_index_name_length > 0)
         {
           set_field_varchar_utf8(f, m_row.m_index_name,
@@ -655,7 +667,7 @@ int table_events_waits_common::read_row_
         else
           f->set_null();
         break;
-      case 11: /* OBJECT_TYPE */
+      case 12: /* OBJECT_TYPE */
         if (m_row.m_object_type)
         {
           set_field_varchar_utf8(f, m_row.m_object_type,
@@ -664,26 +676,26 @@ int table_events_waits_common::read_row_
         else
           f->set_null();
         break;
-      case 12: /* OBJECT_INSTANCE */
+      case 13: /* OBJECT_INSTANCE */
         set_field_ulonglong(f, m_row.m_object_instance_addr);
         break;
-      case 13: /* NESTING_EVENT_ID */
+      case 14: /* NESTING_EVENT_ID */
         if (m_row.m_nesting_event_id != 0)
           set_field_ulonglong(f, m_row.m_nesting_event_id);
         else
           f->set_null();
         break;
-      case 14: /* NESTING_EVENT_TYPE */
+      case 15: /* NESTING_EVENT_TYPE */
         if (m_row.m_nesting_event_id != 0)
           set_field_enum(f, m_row.m_nesting_event_type);
         else
           f->set_null();
         break;
-      case 15: /* OPERATION */
+      case 16: /* OPERATION */
         operation= &operation_names_map[(int) m_row.m_operation - 1];
         set_field_varchar_utf8(f, operation->str, operation->length);
         break;
-      case 16: /* NUMBER_OF_BYTES */
+      case 17: /* NUMBER_OF_BYTES */
         if ((m_row.m_operation == OPERATION_TYPE_FILEREAD) ||
             (m_row.m_operation == OPERATION_TYPE_FILEWRITE) ||
             (m_row.m_operation == OPERATION_TYPE_FILECHSIZE) ||
@@ -695,7 +707,7 @@ int table_events_waits_common::read_row_
         else
           f->set_null();
         break;
-      case 17: /* FLAGS */
+      case 18: /* FLAGS */
         f->set_null();
         break;
       default:

=== modified file 'storage/perfschema/table_events_waits.h'
--- a/storage/perfschema/table_events_waits.h	2011-07-08 21:31:33 +0000
+++ b/storage/perfschema/table_events_waits.h	2011-08-26 08:42:40 +0000
@@ -39,6 +39,8 @@ struct row_events_waits
   ulong m_thread_internal_id;
   /** Column EVENT_ID. */
   ulonglong m_event_id;
+  /** Column END_EVENT_ID. */
+  ulonglong m_end_event_id;
   /** Column NESTING_EVENT_ID. */
   ulonglong m_nesting_event_id;
   /** Column NESTING_EVENT_TYPE. */

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk-wl5908 branch (chris.powers:3429 to 3430) Christopher Powers28 Oct