summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <lars@mysql.com>2005-12-22 06:39:02 +0100
committerunknown <lars@mysql.com>2005-12-22 06:39:02 +0100
commit09346e6e2de57fadc94f70beb29eabe5186dbe62 (patch)
tree192a6c65973c50f6a436a8c6e6bb19efa2ed2419 /mysql-test
parent65c560e9b836953bba66307268430f0faf50ca3c (diff)
downloadmariadb-git-09346e6e2de57fadc94f70beb29eabe5186dbe62.tar.gz
WL#1012: All changes as one single changeset.
This includes both code and test cases. BitKeeper/deleted/.del-ctype_ucs_binlog.result~280d136b1a0bcf17: Delete: mysql-test/r/ctype_ucs_binlog.result BitKeeper/deleted/.del-rpl_delete_all.result~7c050d592614b3f: Delete: mysql-test/r/rpl_delete_all.result BitKeeper/deleted/.del-rpl000013-slave.opt~18266ad8a2403e8d: Delete: mysql-test/t/rpl000013-slave.opt BitKeeper/deleted/.del-rpl_delete_all.test~700a1490277780e0: Delete: mysql-test/t/rpl_delete_all.test mysql-test/extra/binlog_tests/binlog.test: Import patch wl1012.patch mysql-test/extra/binlog_tests/blackhole.test: Import patch wl1012.patch mysql-test/extra/binlog_tests/ctype_cp932.test: Import patch wl1012.patch mysql-test/extra/binlog_tests/ctype_cp932_binlog.test: Import patch wl1012.patch mysql-test/extra/binlog_tests/ctype_ucs_binlog.test: Import patch wl1012.patch mysql-test/extra/binlog_tests/drop_temp_table.test: Import patch wl1012.patch mysql-test/extra/binlog_tests/insert_select-binlog.test: Import patch wl1012.patch mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test: Import patch wl1012.patch mysql-test/extra/rpl_tests/rpl_ddl.test: Import patch wl1012.patch mysql-test/extra/rpl_tests/rpl_deadlock.test: Import patch wl1012.patch mysql-test/extra/rpl_tests/rpl_err_ignoredtable.test: Import patch wl1012.patch mysql-test/extra/rpl_tests/rpl_flsh_tbls.test: Import patch wl1012.patch mysql-test/extra/rpl_tests/rpl_loaddata_m.test: Import patch wl1012.patch mysql-test/extra/rpl_tests/rpl_log.test: Import patch wl1012.patch mysql-test/extra/rpl_tests/rpl_max_relay_size.test: Import patch wl1012.patch mysql-test/extra/rpl_tests/rpl_multi_query.test: Import patch wl1012.patch mysql-test/extra/rpl_tests/rpl_reset_slave.test: Import patch wl1012.patch mysql-test/extra/rpl_tests/rpl_stm_000001.test: Import patch wl1012.patch mysql-test/extra/rpl_tests/rpl_stm_EE_err.test: Import patch wl1012.patch mysql-test/extra/rpl_tests/rpl_stm_charset.test: Import patch wl1012.patch mysql-test/extra/rpl_tests/rpl_user_variables.test: Import patch wl1012.patch mysql-test/r/binlog_stm_binlog.result: Import patch wl1012.patch mysql-test/r/binlog_stm_blackhole.result: Import patch wl1012.patch mysql-test/r/binlog_stm_ctype_cp932.result: Import patch wl1012.patch mysql-test/r/binlog_stm_ctype_ucs.result: Import patch wl1012.patch mysql-test/r/binlog_stm_drop_tmp_tbl.result: Import patch wl1012.patch mysql-test/r/binlog_stm_insert_select.result: Import patch wl1012.patch mysql-test/r/binlog_stm_mix_innodb_myisam.result: Import patch wl1012.patch mysql-test/r/rpl_000012.result: Import patch wl1012.patch mysql-test/r/rpl_000015.result: Import patch wl1012.patch mysql-test/r/rpl_deadlock_innodb.result: Import patch wl1012.patch mysql-test/r/rpl_flushlog_loop.result: Import patch wl1012.patch mysql-test/r/rpl_loaddata_s.result: Import patch wl1012.patch mysql-test/r/rpl_stm_000001.result: Import patch wl1012.patch mysql-test/r/rpl_stm_EE_err.result: Import patch wl1012.patch mysql-test/r/rpl_stm_charset.result: Import patch wl1012.patch mysql-test/r/rpl_stm_ddl.result: Import patch wl1012.patch mysql-test/r/rpl_stm_err_ignoredtable.result: Import patch wl1012.patch mysql-test/r/rpl_stm_flsh_tbls.result: Import patch wl1012.patch mysql-test/r/rpl_stm_loaddata_m.result: Import patch wl1012.patch mysql-test/r/rpl_stm_log.result: Import patch wl1012.patch mysql-test/r/rpl_stm_max_relay_size.result: Import patch wl1012.patch mysql-test/r/rpl_stm_multi_query.result: Import patch wl1012.patch mysql-test/r/rpl_stm_mystery22.result: Import patch wl1012.patch mysql-test/r/rpl_stm_reset_slave.result: Import patch wl1012.patch mysql-test/r/rpl_stm_rewrt_db.result: Import patch wl1012.patch mysql-test/r/rpl_stm_sp.result: Import patch wl1012.patch mysql-test/r/rpl_stm_timezone.result: Import patch wl1012.patch mysql-test/r/rpl_stm_until.result: Import patch wl1012.patch mysql-test/r/rpl_stm_user_variables.result: Import patch wl1012.patch mysql-test/r/rpl_stm_view.result: Import patch wl1012.patch mysql-test/t/binlog_row_binlog-master.opt: Import patch wl1012.patch mysql-test/t/rpl_000012.test: Import patch wl1012.patch mysql-test/t/rpl_000015-slave.sh: Import patch wl1012.patch mysql-test/t/rpl_000015.slave-mi: Import patch wl1012.patch mysql-test/t/rpl_000015.test: Import patch wl1012.patch mysql-test/t/rpl_deadlock_innodb-slave.opt: Import patch wl1012.patch mysql-test/t/rpl_flushlog_loop-master.opt: Import patch wl1012.patch mysql-test/t/rpl_flushlog_loop-master.sh: Import patch wl1012.patch mysql-test/t/rpl_flushlog_loop-slave.opt: Import patch wl1012.patch mysql-test/t/rpl_flushlog_loop-slave.sh: Import patch wl1012.patch mysql-test/t/rpl_flushlog_loop.test: Import patch wl1012.patch mysql-test/t/rpl_loaddata_s-slave.opt: Import patch wl1012.patch mysql-test/t/rpl_loaddata_s.test: Import patch wl1012.patch mysql-test/t/rpl_stm_000001-slave.opt: Import patch wl1012.patch mysql-test/t/rpl_stm_err_ignoredtable-slave.opt: Import patch wl1012.patch mysql-test/t/rpl_stm_loaddata_m-master.opt: Import patch wl1012.patch mysql-test/t/rpl_stm_log-master.opt: Import patch wl1012.patch mysql-test/t/rpl_stm_log-slave.opt: Import patch wl1012.patch mysql-test/t/rpl_stm_mystery22.test: Import patch wl1012.patch mysql-test/t/rpl_stm_rewrt_db-slave.opt: Import patch wl1012.patch mysql-test/t/rpl_stm_rewrt_db.test: Import patch wl1012.patch mysql-test/t/rpl_stm_sp-master.opt: Import patch wl1012.patch mysql-test/t/rpl_stm_sp-slave.opt: Import patch wl1012.patch mysql-test/t/rpl_stm_sp.test: Import patch wl1012.patch mysql-test/t/rpl_stm_timezone-master.opt: Import patch wl1012.patch mysql-test/t/rpl_stm_timezone-slave.opt: Import patch wl1012.patch BUILD/SETUP.sh: Import patch wl1012.patch Makefile.am: Import patch wl1012.patch mysql-test/t/rpl_stm_timezone.test: Import patch wl1012.patch mysql-test/t/rpl_stm_until.test: Import patch wl1012.patch mysql-test/t/rpl_stm_view.test: Import patch wl1012.patch client/Makefile.am: Import patch wl1012.patch client/client_priv.h: Import patch wl1012.patch client/mysqlbinlog.cc: Import patch wl1012.patch configure.in: Import patch wl1012.patch include/Makefile.am: Import patch wl1012.patch include/base64.h: Import patch wl1012.patch include/config-win.h: Import patch wl1012.patch include/my_base.h: Import patch wl1012.patch include/my_global.h: Import patch wl1012.patch mysql-test/Makefile.am: Import patch wl1012.patch mysql-test/mysql-test-run.pl: Import patch wl1012.patch mysql-test/mysql-test-run.sh: Import patch wl1012.patch mysql-test/r/date_formats.result: Import patch wl1012.patch mysql-test/r/flush_block_commit.result: Import patch wl1012.patch mysql-test/r/innodb.result: Import patch wl1012.patch mysql-test/r/rpl000017.result: Import patch wl1012.patch mysql-test/r/rpl_change_master.result: Import patch wl1012.patch mysql-test/r/rpl_commit_after_flush.result: Import patch wl1012.patch mysql-test/r/rpl_create_database.result: Import patch wl1012.patch mysql-test/r/rpl_do_grant.result: Import patch wl1012.patch mysql-test/r/rpl_loaddata.result: Import patch wl1012.patch mysql-test/r/rpl_log_pos.result: Import patch wl1012.patch mysql-test/r/rpl_multi_delete.result: Import patch wl1012.patch mysql-test/r/rpl_multi_update.result: Import patch wl1012.patch mysql-test/r/rpl_openssl.result: Import patch wl1012.patch mysql-test/r/rpl_replicate_do.result: Import patch wl1012.patch mysql-test/r/rpl_rotate_logs.result: Import patch wl1012.patch mysql-test/r/rpl_server_id1.result: Import patch wl1012.patch mysql-test/r/rpl_server_id2.result: Import patch wl1012.patch mysql-test/r/rpl_temporary.result: Import patch wl1012.patch mysql-test/r/user_var-binlog.result: Import patch wl1012.patch mysql-test/t/create_select_tmp.test: Import patch wl1012.patch mysql-test/t/date_formats.test: Import patch wl1012.patch mysql-test/t/disabled.def: Import patch wl1012.patch mysql-test/t/innodb.test: Import patch wl1012.patch mysql-test/t/mysqlbinlog.test: Import patch wl1012.patch mysql-test/t/mysqlbinlog2.test: Import patch wl1012.patch mysql-test/t/rpl000002.test: Import patch wl1012.patch mysql-test/t/rpl000006.test: Import patch wl1012.patch mysql-test/t/rpl000013.test: Import patch wl1012.patch mysql-test/t/rpl000017.test: Import patch wl1012.patch mysql-test/t/rpl_auto_increment.test: Import patch wl1012.patch mysql-test/t/rpl_change_master.test: Import patch wl1012.patch mysql-test/t/rpl_commit_after_flush.test: Import patch wl1012.patch mysql-test/t/rpl_create_database.test: Import patch wl1012.patch mysql-test/t/rpl_do_grant.test: Import patch wl1012.patch mysql-test/t/rpl_drop.test: Import patch wl1012.patch mysql-test/t/rpl_empty_master_crash.test: Import patch wl1012.patch mysql-test/t/rpl_failed_optimize.test: Import patch wl1012.patch mysql-test/t/rpl_heap.test: Import patch wl1012.patch mysql-test/t/rpl_insert_id.test: Import patch wl1012.patch mysql-test/t/rpl_insert_ignore.test: Import patch wl1012.patch mysql-test/t/rpl_loaddata.test: Import patch wl1012.patch mysql-test/t/rpl_log_pos.test: Import patch wl1012.patch mysql-test/t/rpl_multi_delete.test: Import patch wl1012.patch mysql-test/t/rpl_multi_update.test: Import patch wl1012.patch mysql-test/t/rpl_multi_update2.test: Import patch wl1012.patch mysql-test/t/rpl_multi_update3.test: Import patch wl1012.patch mysql-test/t/rpl_openssl.test: Import patch wl1012.patch mysql-test/t/rpl_redirect.test: Import patch wl1012.patch mysql-test/t/rpl_relayrotate.test: Import patch wl1012.patch mysql-test/t/rpl_replicate_do.test: Import patch wl1012.patch mysql-test/t/rpl_rotate_logs.test: Import patch wl1012.patch mysql-test/t/rpl_server_id1.test: Import patch wl1012.patch mysql-test/t/rpl_sp_effects.test: Import patch wl1012.patch mysql-test/t/rpl_temporary.test: Import patch wl1012.patch mysql-test/t/rpl_trigger.test: Import patch wl1012.patch mysql-test/t/sp.test: Import patch wl1012.patch mysql-test/t/user_var-binlog.test: Import patch wl1012.patch mysys/Makefile.am: Import patch wl1012.patch mysys/base64.c: Import patch wl1012.patch sql/Makefile.am: Import patch wl1012.patch sql/ha_innodb.cc: Import patch wl1012.patch sql/ha_innodb.h: Import patch wl1012.patch sql/ha_partition.cc: Import patch wl1012.patch sql/handler.cc: Import patch wl1012.patch sql/handler.h: Import patch wl1012.patch sql/item_sum.cc: Import patch wl1012.patch sql/log.cc: Import patch wl1012.patch sql/log_event.cc: Import patch wl1012.patch sql/log_event.h: Import patch wl1012.patch sql/mysql_priv.h: Import patch wl1012.patch sql/mysqld.cc: Import patch wl1012.patch sql/rpl_filter.h: Import patch wl1012.patch sql/set_var.cc: Import patch wl1012.patch sql/share/errmsg.txt: Import patch wl1012.patch sql/slave.cc: Import patch wl1012.patch sql/slave.h: Import patch wl1012.patch sql/sp.cc: Import patch wl1012.patch sql/sp_head.cc: Import patch wl1012.patch sql/sql_acl.cc: Import patch wl1012.patch sql/sql_base.cc: Import patch wl1012.patch sql/sql_class.cc: Import patch wl1012.patch sql/sql_class.h: Import patch wl1012.patch sql/sql_delete.cc: Import patch wl1012.patch sql/sql_insert.cc: Import patch wl1012.patch sql/sql_lex.h: Import patch wl1012.patch sql/sql_list.h: Import patch wl1012.patch sql/sql_load.cc: Import patch wl1012.patch sql/sql_parse.cc: Import patch wl1012.patch sql/sql_plugin.cc: Import patch wl1012.patch sql/sql_rename.cc: Import patch wl1012.patch sql/sql_repl.h: Import patch wl1012.patch sql/sql_select.cc: Import patch wl1012.patch sql/sql_show.cc: Import patch wl1012.patch sql/sql_table.cc: Import patch wl1012.patch sql/sql_udf.cc: Import patch wl1012.patch sql/sql_union.cc: Import patch wl1012.patch sql/sql_update.cc: Import patch wl1012.patch sql/sql_yacc.yy: Import patch wl1012.patch sql/table.cc: Import patch wl1012.patch sql/table.h: Import patch wl1012.patch storage/innobase/include/lock0lock.h: Import patch wl1012.patch storage/innobase/include/row0mysql.h: Import patch wl1012.patch storage/innobase/include/row0vers.h: Import patch wl1012.patch storage/innobase/lock/lock0lock.c: Import patch wl1012.patch storage/innobase/row/row0mysql.c: Import patch wl1012.patch storage/innobase/row/row0sel.c: Import patch wl1012.patch storage/innobase/row/row0vers.c: Import patch wl1012.patch
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/Makefile.am23
-rw-r--r--mysql-test/extra/binlog_tests/binlog.test (renamed from mysql-test/t/binlog.test)11
-rw-r--r--mysql-test/extra/binlog_tests/blackhole.test (renamed from mysql-test/t/blackhole.test)0
-rw-r--r--mysql-test/extra/binlog_tests/ctype_cp932.test (renamed from mysql-test/t/ctype_cp932.test)2
-rw-r--r--mysql-test/extra/binlog_tests/ctype_cp932_binlog.test (renamed from mysql-test/t/ctype_cp932_binlog.test)3
-rw-r--r--mysql-test/extra/binlog_tests/ctype_ucs_binlog.test (renamed from mysql-test/t/ctype_ucs_binlog.test)2
-rw-r--r--mysql-test/extra/binlog_tests/drop_temp_table.test (renamed from mysql-test/t/drop_temp_table.test)0
-rw-r--r--mysql-test/extra/binlog_tests/innodb_stat.test47
-rw-r--r--mysql-test/extra/binlog_tests/insert_select-binlog.test (renamed from mysql-test/t/insert_select-binlog.test)0
-rw-r--r--mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test (renamed from mysql-test/t/mix_innodb_myisam_binlog.test)37
-rw-r--r--mysql-test/extra/rpl_tests/rpl000006.test47
-rw-r--r--mysql-test/extra/rpl_tests/rpl_auto_increment.test103
-rw-r--r--mysql-test/extra/rpl_tests/rpl_commit_after_flush.test22
-rw-r--r--mysql-test/extra/rpl_tests/rpl_ddl.test (renamed from mysql-test/t/rpl_ddl.test)48
-rw-r--r--mysql-test/extra/rpl_tests/rpl_deadlock.test (renamed from mysql-test/t/rpl_deadlock.test)21
-rw-r--r--mysql-test/extra/rpl_tests/rpl_delete_no_where.test19
-rw-r--r--mysql-test/extra/rpl_tests/rpl_err_ignoredtable.test (renamed from mysql-test/t/rpl_error_ignored_table.test)6
-rw-r--r--mysql-test/extra/rpl_tests/rpl_failed_optimize.test19
-rw-r--r--mysql-test/extra/rpl_tests/rpl_flsh_tbls.test (renamed from mysql-test/t/rpl_flush_tables.test)13
-rw-r--r--mysql-test/extra/rpl_tests/rpl_foreign_key.test32
-rw-r--r--mysql-test/extra/rpl_tests/rpl_insert_id.test78
-rw-r--r--mysql-test/extra/rpl_tests/rpl_insert_ignore.test71
-rw-r--r--mysql-test/extra/rpl_tests/rpl_loaddata.test156
-rw-r--r--mysql-test/extra/rpl_tests/rpl_loaddata_m.test (renamed from mysql-test/t/rpl_loaddata_rule_m.test)12
-rw-r--r--mysql-test/extra/rpl_tests/rpl_log.test (renamed from mysql-test/t/rpl_log.test)22
-rw-r--r--mysql-test/extra/rpl_tests/rpl_max_relay_size.test (renamed from mysql-test/t/rpl_max_relay_size.test)21
-rw-r--r--mysql-test/extra/rpl_tests/rpl_multi_query.test (renamed from mysql-test/t/rpl_multi_query.test)9
-rw-r--r--mysql-test/extra/rpl_tests/rpl_multi_update.test30
-rw-r--r--mysql-test/extra/rpl_tests/rpl_multi_update2.test62
-rw-r--r--mysql-test/extra/rpl_tests/rpl_multi_update3.test220
-rw-r--r--mysql-test/extra/rpl_tests/rpl_relayrotate.test75
-rw-r--r--mysql-test/extra/rpl_tests/rpl_reset_slave.test (renamed from mysql-test/t/rpl_reset_slave.test)16
-rw-r--r--mysql-test/extra/rpl_tests/rpl_row_001.test84
-rw-r--r--mysql-test/extra/rpl_tests/rpl_row_EE_err.test40
-rw-r--r--mysql-test/extra/rpl_tests/rpl_row_UUID.test80
-rw-r--r--mysql-test/extra/rpl_tests/rpl_row_charset.test182
-rw-r--r--mysql-test/extra/rpl_tests/rpl_row_delayed_ins.test22
-rw-r--r--mysql-test/extra/rpl_tests/rpl_row_func003.test96
-rw-r--r--mysql-test/extra/rpl_tests/rpl_row_multi_update3.test159
-rw-r--r--mysql-test/extra/rpl_tests/rpl_row_sp002.test239
-rw-r--r--mysql-test/extra/rpl_tests/rpl_row_sp003.test72
-rw-r--r--mysql-test/extra/rpl_tests/rpl_row_sp006.test90
-rw-r--r--mysql-test/extra/rpl_tests/rpl_row_sp007.test70
-rw-r--r--mysql-test/extra/rpl_tests/rpl_row_tabledefs.test129
-rw-r--r--mysql-test/extra/rpl_tests/rpl_stm_000001.test (renamed from mysql-test/t/rpl000001.test)5
-rw-r--r--mysql-test/extra/rpl_tests/rpl_stm_EE_err.test (renamed from mysql-test/t/rpl_EE_error.test)12
-rw-r--r--mysql-test/extra/rpl_tests/rpl_stm_charset.test (renamed from mysql-test/t/rpl_charset.test)9
-rw-r--r--mysql-test/extra/rpl_tests/rpl_trig004.test46
-rw-r--r--mysql-test/extra/rpl_tests/rpl_user_variables.test (renamed from mysql-test/t/rpl_user_variables.test)18
-rw-r--r--mysql-test/include/have_binlog_format_row.inc4
-rw-r--r--mysql-test/include/have_binlog_format_statement.inc4
-rw-r--r--mysql-test/include/have_row_based.inc4
-rw-r--r--mysql-test/include/not_row_based.inc4
-rw-r--r--mysql-test/include/rpl_multi_engine.inc16
-rw-r--r--mysql-test/include/rpl_row_basic.inc249
-rw-r--r--mysql-test/include/rpl_stmt_seq2.inc201
-rwxr-xr-xmysql-test/mysql-test-run.pl7
-rw-r--r--mysql-test/mysql-test-run.sh12
-rw-r--r--mysql-test/r/binlog_row_binlog.result237
-rw-r--r--mysql-test/r/binlog_row_blackhole.result146
-rw-r--r--mysql-test/r/binlog_row_ctype_cp932.result11368
-rw-r--r--mysql-test/r/binlog_row_ctype_ucs.result16
-rw-r--r--mysql-test/r/binlog_row_drop_tmp_tbl.result18
-rw-r--r--mysql-test/r/binlog_row_innodb_stat.result39
-rw-r--r--mysql-test/r/binlog_row_insert_select.result26
-rw-r--r--mysql-test/r/binlog_row_mix_innodb_myisam.result282
-rw-r--r--mysql-test/r/binlog_stm_binlog.result (renamed from mysql-test/r/binlog.result)10
-rw-r--r--mysql-test/r/binlog_stm_blackhole.result (renamed from mysql-test/r/blackhole.result)0
-rwxr-xr-xmysql-test/r/binlog_stm_ctype_cp932.result (renamed from mysql-test/r/ctype_cp932.result)8
-rw-r--r--mysql-test/r/binlog_stm_ctype_ucs.result (renamed from mysql-test/r/ctype_ucs_binlog.result)6
-rw-r--r--mysql-test/r/binlog_stm_drop_tmp_tbl.result (renamed from mysql-test/r/drop_temp_table.result)0
-rw-r--r--mysql-test/r/binlog_stm_innodb_stat.result39
-rw-r--r--mysql-test/r/binlog_stm_insert_select.result (renamed from mysql-test/r/insert_select-binlog.result)6
-rw-r--r--mysql-test/r/binlog_stm_mix_innodb_myisam.result258
-rw-r--r--mysql-test/r/ctype_cp932_binlog_row.result (renamed from mysql-test/r/ctype_cp932_binlog.result)8
-rw-r--r--mysql-test/r/ctype_cp932_binlog_stm.result17
-rw-r--r--mysql-test/r/date_formats.result3
-rw-r--r--mysql-test/r/flush_block_commit.result4
-rw-r--r--mysql-test/r/have_binlog_format_row.require2
-rw-r--r--mysql-test/r/have_binlog_format_statement.require2
-rw-r--r--mysql-test/r/have_row_based.require2
-rw-r--r--mysql-test/r/innodb.result38
-rw-r--r--mysql-test/r/innodb_concurrent.result621
-rw-r--r--mysql-test/r/mix_innodb_myisam_binlog.result258
-rw-r--r--mysql-test/r/mysqlbinlog_base64.result89
-rw-r--r--mysql-test/r/not_row_based.require2
-rw-r--r--mysql-test/r/rpl000017.result6
-rw-r--r--mysql-test/r/rpl_000012.result (renamed from mysql-test/r/rpl000012.result)29
-rw-r--r--mysql-test/r/rpl_000015.result (renamed from mysql-test/r/rpl000015.result)11
-rw-r--r--mysql-test/r/rpl_LD_INFILE.result121
-rw-r--r--mysql-test/r/rpl_bit.result138
-rw-r--r--mysql-test/r/rpl_bit_npk.result137
-rw-r--r--mysql-test/r/rpl_change_master.result4
-rw-r--r--mysql-test/r/rpl_commit_after_flush.result2
-rw-r--r--mysql-test/r/rpl_create_database.result15
-rw-r--r--mysql-test/r/rpl_deadlock_innodb.result (renamed from mysql-test/r/rpl_deadlock.result)18
-rw-r--r--mysql-test/r/rpl_delete_no_where.result15
-rw-r--r--mysql-test/r/rpl_do_grant.result52
-rw-r--r--mysql-test/r/rpl_flush_tables.result46
-rw-r--r--mysql-test/r/rpl_flushlog_loop.result (renamed from mysql-test/r/rpl_flush_log_loop.result)3
-rw-r--r--mysql-test/r/rpl_foreign_key_innodb.result42
-rw-r--r--mysql-test/r/rpl_loaddata.result8
-rw-r--r--mysql-test/r/rpl_loaddata2.result152
-rw-r--r--mysql-test/r/rpl_loaddata_s.result (renamed from mysql-test/r/rpl_loaddata_rule_s.result)6
-rw-r--r--mysql-test/r/rpl_loadfile.result234
-rw-r--r--mysql-test/r/rpl_log.result103
-rw-r--r--mysql-test/r/rpl_log_pos.result20
-rw-r--r--mysql-test/r/rpl_multi_delete.result9
-rw-r--r--mysql-test/r/rpl_multi_engine.result365
-rw-r--r--mysql-test/r/rpl_multi_update.result12
-rw-r--r--mysql-test/r/rpl_mystery22.result23
-rw-r--r--mysql-test/r/rpl_openssl.result4
-rw-r--r--mysql-test/r/rpl_replicate_do.result2
-rw-r--r--mysql-test/r/rpl_replicate_ignore_db.result23
-rw-r--r--mysql-test/r/rpl_rotate_logs.result30
-rw-r--r--mysql-test/r/rpl_row_001.result55
-rw-r--r--mysql-test/r/rpl_row_4_bytes.result27
-rw-r--r--mysql-test/r/rpl_row_EE_err.result19
-rw-r--r--mysql-test/r/rpl_row_NOW.result28
-rw-r--r--mysql-test/r/rpl_row_USER.result36
-rw-r--r--mysql-test/r/rpl_row_UUID.result38
-rw-r--r--mysql-test/r/rpl_row_basic_2myisam.result426
-rw-r--r--mysql-test/r/rpl_row_basic_3innodb.result426
-rw-r--r--mysql-test/r/rpl_row_charset.result201
-rw-r--r--mysql-test/r/rpl_row_create_table.result213
-rw-r--r--mysql-test/r/rpl_row_ddl.result1693
-rw-r--r--mysql-test/r/rpl_row_delayed_ins.result27
-rw-r--r--mysql-test/r/rpl_row_drop.result56
-rw-r--r--mysql-test/r/rpl_row_err_ignoredtable.result44
-rw-r--r--mysql-test/r/rpl_row_flsh_tbls.result32
-rw-r--r--mysql-test/r/rpl_row_func001.result30
-rw-r--r--mysql-test/r/rpl_row_func002.result25
-rw-r--r--mysql-test/r/rpl_row_func003.result29
-rw-r--r--mysql-test/r/rpl_row_inexist_tbl.result45
-rw-r--r--mysql-test/r/rpl_row_loaddata_m.result20
-rw-r--r--mysql-test/r/rpl_row_log.result105
-rw-r--r--mysql-test/r/rpl_row_max_relay_size.result (renamed from mysql-test/r/rpl_max_relay_size.result)14
-rw-r--r--mysql-test/r/rpl_row_multi_query.result37
-rw-r--r--mysql-test/r/rpl_row_multi_update3.result124
-rw-r--r--mysql-test/r/rpl_row_mystery22.result30
-rw-r--r--mysql-test/r/rpl_row_reset_slave.result32
-rw-r--r--mysql-test/r/rpl_row_rewrt_db.result (renamed from mysql-test/r/rpl_rewrite_db.result)0
-rw-r--r--mysql-test/r/rpl_row_sp000.result362
-rw-r--r--mysql-test/r/rpl_row_sp001.result85
-rw-r--r--mysql-test/r/rpl_row_sp002_innodb.result239
-rw-r--r--mysql-test/r/rpl_row_sp003.result49
-rw-r--r--mysql-test/r/rpl_row_sp005.result100
-rw-r--r--mysql-test/r/rpl_row_sp006_InnoDB.result45
-rw-r--r--mysql-test/r/rpl_row_sp007_innodb.result50
-rw-r--r--mysql-test/r/rpl_row_sp008.result45
-rw-r--r--mysql-test/r/rpl_row_sp009.result77
-rw-r--r--mysql-test/r/rpl_row_sp010.result56
-rw-r--r--mysql-test/r/rpl_row_sp011.result69
-rw-r--r--mysql-test/r/rpl_row_sp012.result58
-rw-r--r--mysql-test/r/rpl_row_stop_middle.result26
-rw-r--r--mysql-test/r/rpl_row_stop_middle_update.result16
-rw-r--r--mysql-test/r/rpl_row_tabledefs.result248
-rw-r--r--mysql-test/r/rpl_row_timezone.result121
-rw-r--r--mysql-test/r/rpl_row_trig001.result29
-rw-r--r--mysql-test/r/rpl_row_trig002.result63
-rw-r--r--mysql-test/r/rpl_row_trig003.result83
-rw-r--r--mysql-test/r/rpl_row_trig004.result29
-rw-r--r--mysql-test/r/rpl_row_until.result62
-rw-r--r--mysql-test/r/rpl_row_user_variables.result82
-rw-r--r--mysql-test/r/rpl_row_view.result44
-rw-r--r--mysql-test/r/rpl_row_view01.result100
-rw-r--r--mysql-test/r/rpl_server_id1.result2
-rw-r--r--mysql-test/r/rpl_server_id2.result2
-rw-r--r--mysql-test/r/rpl_sp004.result93
-rw-r--r--mysql-test/r/rpl_stm_000001.result (renamed from mysql-test/r/rpl000001.result)0
-rw-r--r--mysql-test/r/rpl_stm_EE_err.result (renamed from mysql-test/r/rpl_EE_error.result)0
-rw-r--r--mysql-test/r/rpl_stm_charset.result (renamed from mysql-test/r/rpl_charset.result)2
-rw-r--r--mysql-test/r/rpl_stm_ddl.result (renamed from mysql-test/r/rpl_ddl.result)38
-rw-r--r--mysql-test/r/rpl_stm_err_ignoredtable.result (renamed from mysql-test/r/rpl_error_ignored_table.result)4
-rw-r--r--mysql-test/r/rpl_stm_flsh_tbls.result32
-rw-r--r--mysql-test/r/rpl_stm_loaddata_m.result (renamed from mysql-test/r/rpl_loaddata_rule_m.result)9
-rw-r--r--mysql-test/r/rpl_stm_log.result103
-rw-r--r--mysql-test/r/rpl_stm_max_relay_size.result61
-rw-r--r--mysql-test/r/rpl_stm_multi_query.result (renamed from mysql-test/r/rpl_multi_query.result)2
-rw-r--r--mysql-test/r/rpl_stm_mystery22.result31
-rw-r--r--mysql-test/r/rpl_stm_no_op.result (renamed from mysql-test/r/rpl_delete_all.result)37
-rw-r--r--mysql-test/r/rpl_stm_reset_slave.result (renamed from mysql-test/r/rpl_reset_slave.result)8
-rw-r--r--mysql-test/r/rpl_stm_rewrt_db.result93
-rw-r--r--mysql-test/r/rpl_stm_sp.result (renamed from mysql-test/r/rpl_sp.result)2
-rw-r--r--mysql-test/r/rpl_stm_timezone.result (renamed from mysql-test/r/rpl_timezone.result)0
-rw-r--r--mysql-test/r/rpl_stm_until.result (renamed from mysql-test/r/rpl_until.result)20
-rw-r--r--mysql-test/r/rpl_stm_user_variables.result82
-rw-r--r--mysql-test/r/rpl_stm_view.result (renamed from mysql-test/r/rpl_view.result)0
-rw-r--r--mysql-test/r/rpl_temporary.result15
-rw-r--r--mysql-test/r/rpl_user_variables.result110
-rw-r--r--mysql-test/r/user_var-binlog.result12
-rw-r--r--mysql-test/std_data/rpl_timezone2.dat2
-rw-r--r--mysql-test/std_data/words2.dat50
-rw-r--r--mysql-test/t/binlog_row_binlog-master.opt (renamed from mysql-test/t/binlog-master.opt)0
-rw-r--r--mysql-test/t/binlog_row_binlog.test5
-rw-r--r--mysql-test/t/binlog_row_blackhole.test5
-rw-r--r--mysql-test/t/binlog_row_ctype_cp932.test5
-rw-r--r--mysql-test/t/binlog_row_ctype_ucs.test6
-rw-r--r--mysql-test/t/binlog_row_drop_tmp_tbl.test5
-rw-r--r--mysql-test/t/binlog_row_innodb_stat.test5
-rw-r--r--mysql-test/t/binlog_row_insert_select.test5
-rw-r--r--mysql-test/t/binlog_row_mix_innodb_myisam.test5
-rw-r--r--mysql-test/t/binlog_stm_binlog-master.opt1
-rw-r--r--mysql-test/t/binlog_stm_binlog.test5
-rw-r--r--mysql-test/t/binlog_stm_blackhole.test5
-rw-r--r--mysql-test/t/binlog_stm_ctype_cp932.test5
-rw-r--r--mysql-test/t/binlog_stm_ctype_ucs.test6
-rw-r--r--mysql-test/t/binlog_stm_drop_tmp_tbl.test5
-rw-r--r--mysql-test/t/binlog_stm_innodb_stat-master.opt1
-rw-r--r--mysql-test/t/binlog_stm_innodb_stat.test5
-rw-r--r--mysql-test/t/binlog_stm_insert_select.test5
-rw-r--r--mysql-test/t/binlog_stm_mix_innodb_myisam.test5
-rw-r--r--mysql-test/t/create_select_tmp.test3
-rw-r--r--mysql-test/t/ctype_cp932_binlog_row.test5
-rw-r--r--mysql-test/t/ctype_cp932_binlog_stm.test5
-rw-r--r--mysql-test/t/date_formats.test3
-rw-r--r--mysql-test/t/disabled.def18
-rw-r--r--mysql-test/t/innodb.test43
-rw-r--r--mysql-test/t/innodb_concurrent-master.opt1
-rw-r--r--mysql-test/t/innodb_concurrent.test346
-rw-r--r--mysql-test/t/mysqlbinlog.test6
-rw-r--r--mysql-test/t/mysqlbinlog2.test19
-rw-r--r--mysql-test/t/mysqlbinlog_base64.test38
-rw-r--r--mysql-test/t/rpl000002.test5
-rw-r--r--mysql-test/t/rpl000006.test49
-rw-r--r--mysql-test/t/rpl000013-slave.opt1
-rw-r--r--mysql-test/t/rpl000013.test10
-rw-r--r--mysql-test/t/rpl000017.test6
-rw-r--r--mysql-test/t/rpl_000012.test (renamed from mysql-test/t/rpl000012.test)36
-rwxr-xr-xmysql-test/t/rpl_000015-slave.sh (renamed from mysql-test/t/rpl000015-slave.sh)0
-rw-r--r--mysql-test/t/rpl_000015.slave-mi (renamed from mysql-test/t/rpl000015.slave-mi)0
-rw-r--r--mysql-test/t/rpl_000015.test (renamed from mysql-test/t/rpl000015.test)6
-rw-r--r--mysql-test/t/rpl_LD_INFILE.test41
-rw-r--r--mysql-test/t/rpl_auto_increment.test111
-rw-r--r--mysql-test/t/rpl_bit.test90
-rw-r--r--mysql-test/t/rpl_bit_npk.test112
-rw-r--r--mysql-test/t/rpl_change_master.test4
-rw-r--r--mysql-test/t/rpl_commit_after_flush.test25
-rw-r--r--mysql-test/t/rpl_create_database.test3
-rw-r--r--mysql-test/t/rpl_deadlock_innodb-slave.opt (renamed from mysql-test/t/rpl_deadlock-slave.opt)0
-rw-r--r--mysql-test/t/rpl_deadlock_innodb.test6
-rw-r--r--mysql-test/t/rpl_delete_all.test43
-rw-r--r--mysql-test/t/rpl_delete_no_where.test2
-rw-r--r--mysql-test/t/rpl_do_grant.test54
-rw-r--r--mysql-test/t/rpl_drop.test2
-rw-r--r--mysql-test/t/rpl_empty_master_crash.test2
-rw-r--r--mysql-test/t/rpl_failed_optimize.test26
-rw-r--r--mysql-test/t/rpl_flushlog_loop-master.opt (renamed from mysql-test/t/rpl_flush_log_loop-master.opt)0
-rwxr-xr-xmysql-test/t/rpl_flushlog_loop-master.sh (renamed from mysql-test/t/rpl_flush_log_loop-master.sh)0
-rw-r--r--mysql-test/t/rpl_flushlog_loop-slave.opt (renamed from mysql-test/t/rpl_flush_log_loop-slave.opt)0
-rwxr-xr-xmysql-test/t/rpl_flushlog_loop-slave.sh (renamed from mysql-test/t/rpl_flush_log_loop-slave.sh)0
-rw-r--r--mysql-test/t/rpl_flushlog_loop.test (renamed from mysql-test/t/rpl_flush_log_loop.test)14
-rw-r--r--mysql-test/t/rpl_foreign_key_innodb.test6
-rw-r--r--mysql-test/t/rpl_heap.test5
-rw-r--r--mysql-test/t/rpl_insert_id.test83
-rw-r--r--mysql-test/t/rpl_insert_ignore.test78
-rw-r--r--mysql-test/t/rpl_loaddata.test155
-rw-r--r--mysql-test/t/rpl_loaddata2.test8
-rw-r--r--mysql-test/t/rpl_loaddata_s-slave.opt (renamed from mysql-test/t/rpl_loaddata_rule_m-master.opt)0
-rw-r--r--mysql-test/t/rpl_loaddata_s.test (renamed from mysql-test/t/rpl_loaddata_rule_s.test)14
-rw-r--r--mysql-test/t/rpl_loadfile.test47
-rw-r--r--mysql-test/t/rpl_log_pos.test13
-rw-r--r--mysql-test/t/rpl_multi_delete.test26
-rw-r--r--mysql-test/t/rpl_multi_engine-slave.opt (renamed from mysql-test/t/rpl000001-slave.opt)0
-rw-r--r--mysql-test/t/rpl_multi_engine.test99
-rw-r--r--mysql-test/t/rpl_multi_update.test51
-rw-r--r--mysql-test/t/rpl_multi_update2.test64
-rw-r--r--mysql-test/t/rpl_multi_update3.test222
-rw-r--r--mysql-test/t/rpl_openssl.test4
-rw-r--r--mysql-test/t/rpl_redirect.test2
-rw-r--r--mysql-test/t/rpl_relayrotate.test78
-rw-r--r--mysql-test/t/rpl_replicate_do.test3
-rw-r--r--mysql-test/t/rpl_replicate_ignore_db-slave.opt1
-rw-r--r--mysql-test/t/rpl_replicate_ignore_db.test30
-rw-r--r--mysql-test/t/rpl_rotate_logs.test9
-rw-r--r--mysql-test/t/rpl_row_001.test2
-rw-r--r--mysql-test/t/rpl_row_4_bytes-master.opt1
-rw-r--r--mysql-test/t/rpl_row_4_bytes.test33
-rw-r--r--mysql-test/t/rpl_row_EE_err.test2
-rw-r--r--mysql-test/t/rpl_row_NOW.test73
-rw-r--r--mysql-test/t/rpl_row_USER.test54
-rw-r--r--mysql-test/t/rpl_row_UUID.test2
-rw-r--r--mysql-test/t/rpl_row_basic_2myisam.test3
-rw-r--r--mysql-test/t/rpl_row_basic_3innodb-slave.opt1
-rw-r--r--mysql-test/t/rpl_row_basic_3innodb.test6
-rw-r--r--mysql-test/t/rpl_row_charset.test2
-rw-r--r--mysql-test/t/rpl_row_create_table.test108
-rw-r--r--mysql-test/t/rpl_row_ddl.test35
-rw-r--r--mysql-test/t/rpl_row_delayed_ins.test2
-rw-r--r--mysql-test/t/rpl_row_drop.test47
-rw-r--r--mysql-test/t/rpl_row_err_daisychain-master.opt1
-rw-r--r--mysql-test/t/rpl_row_err_daisychain-slave.opt1
-rw-r--r--mysql-test/t/rpl_row_flsh_tbls.test6
-rw-r--r--mysql-test/t/rpl_row_func001.test56
-rw-r--r--mysql-test/t/rpl_row_func002.test104
-rw-r--r--mysql-test/t/rpl_row_func003.test6
-rw-r--r--mysql-test/t/rpl_row_inexist_tbl.test27
-rw-r--r--mysql-test/t/rpl_row_log-master.opt (renamed from mysql-test/t/rpl_log-master.opt)0
-rw-r--r--mysql-test/t/rpl_row_log-slave.opt (renamed from mysql-test/t/rpl_log-slave.opt)0
-rw-r--r--mysql-test/t/rpl_row_log.test4
-rw-r--r--mysql-test/t/rpl_row_max_relay_size.test9
-rw-r--r--mysql-test/t/rpl_row_multi_update3.test2
-rw-r--r--mysql-test/t/rpl_row_mystery22.test45
-rw-r--r--mysql-test/t/rpl_row_reset_slave.test5
-rw-r--r--mysql-test/t/rpl_row_rewrt_db-slave.opt (renamed from mysql-test/t/rpl_rewrite_db-slave.opt)0
-rw-r--r--mysql-test/t/rpl_row_rewrt_db.test (renamed from mysql-test/t/rpl_rewrite_db.test)6
-rw-r--r--mysql-test/t/rpl_row_sp000-master.opt (renamed from mysql-test/t/rpl_sp-master.opt)0
-rw-r--r--mysql-test/t/rpl_row_sp000-slave.opt1
-rw-r--r--mysql-test/t/rpl_row_sp000.test323
-rw-r--r--mysql-test/t/rpl_row_sp001.test144
-rw-r--r--mysql-test/t/rpl_row_sp002_innodb-master.opt1
-rw-r--r--mysql-test/t/rpl_row_sp002_innodb-slave.opt1
-rw-r--r--mysql-test/t/rpl_row_sp002_innodb.test6
-rw-r--r--mysql-test/t/rpl_row_sp003-master.opt1
-rw-r--r--mysql-test/t/rpl_row_sp003-slave.opt1
-rw-r--r--mysql-test/t/rpl_row_sp003.test6
-rw-r--r--mysql-test/t/rpl_row_sp005.test105
-rw-r--r--mysql-test/t/rpl_row_sp006_InnoDB-slave.opt1
-rw-r--r--mysql-test/t/rpl_row_sp006_InnoDB.test6
-rw-r--r--mysql-test/t/rpl_row_sp007_innodb.test6
-rw-r--r--mysql-test/t/rpl_row_sp008.test58
-rw-r--r--mysql-test/t/rpl_row_sp009.test105
-rw-r--r--mysql-test/t/rpl_row_sp010.test81
-rw-r--r--mysql-test/t/rpl_row_sp011.test115
-rw-r--r--mysql-test/t/rpl_row_sp012.test74
-rw-r--r--mysql-test/t/rpl_row_stop_middle.test44
-rw-r--r--mysql-test/t/rpl_row_stop_middle_update-master.opt1
-rw-r--r--mysql-test/t/rpl_row_stop_middle_update-slave.opt1
-rw-r--r--mysql-test/t/rpl_row_stop_middle_update.test31
-rw-r--r--mysql-test/t/rpl_row_timezone-master.opt (renamed from mysql-test/t/rpl_timezone-master.opt)0
-rw-r--r--mysql-test/t/rpl_row_timezone-slave.opt2
-rw-r--r--mysql-test/t/rpl_row_timezone.test129
-rw-r--r--mysql-test/t/rpl_row_trig001.test98
-rw-r--r--mysql-test/t/rpl_row_trig002.test79
-rw-r--r--mysql-test/t/rpl_row_trig003.test152
-rw-r--r--mysql-test/t/rpl_row_trig004.test14
-rw-r--r--mysql-test/t/rpl_row_until.test86
-rw-r--r--mysql-test/t/rpl_row_user_variables.test4
-rw-r--r--mysql-test/t/rpl_row_view.test (renamed from mysql-test/t/rpl_view.test)6
-rw-r--r--mysql-test/t/rpl_row_view01.test82
-rw-r--r--mysql-test/t/rpl_server_id1.test2
-rw-r--r--mysql-test/t/rpl_sp004.test97
-rw-r--r--mysql-test/t/rpl_sp_effects.test7
-rw-r--r--mysql-test/t/rpl_stm_000001-slave.opt1
-rw-r--r--mysql-test/t/rpl_stm_000001.test2
-rw-r--r--mysql-test/t/rpl_stm_EE_err.test2
-rw-r--r--mysql-test/t/rpl_stm_charset.test2
-rw-r--r--mysql-test/t/rpl_stm_ddl.test35
-rw-r--r--mysql-test/t/rpl_stm_err_ignoredtable-slave.opt (renamed from mysql-test/t/rpl_error_ignored_table-slave.opt)0
-rw-r--r--mysql-test/t/rpl_stm_err_ignoredtable.test8
-rw-r--r--mysql-test/t/rpl_stm_flsh_tbls.test8
-rw-r--r--mysql-test/t/rpl_stm_loaddata_m-master.opt (renamed from mysql-test/t/rpl_loaddata_rule_s-slave.opt)0
-rw-r--r--mysql-test/t/rpl_stm_loaddata_m.test10
-rw-r--r--mysql-test/t/rpl_stm_log-master.opt1
-rw-r--r--mysql-test/t/rpl_stm_log-slave.opt1
-rw-r--r--mysql-test/t/rpl_stm_log.test7
-rw-r--r--mysql-test/t/rpl_stm_max_relay_size.test11
-rw-r--r--mysql-test/t/rpl_stm_multi_query.test12
-rw-r--r--mysql-test/t/rpl_stm_mystery22.test (renamed from mysql-test/t/rpl_mystery22.test)30
-rw-r--r--mysql-test/t/rpl_stm_no_op.test93
-rw-r--r--mysql-test/t/rpl_stm_reset_slave.test6
-rw-r--r--mysql-test/t/rpl_stm_rewrt_db-slave.opt1
-rw-r--r--mysql-test/t/rpl_stm_rewrt_db.test84
-rw-r--r--mysql-test/t/rpl_stm_sp-master.opt1
-rw-r--r--mysql-test/t/rpl_stm_sp-slave.opt (renamed from mysql-test/t/rpl_sp-slave.opt)0
-rw-r--r--mysql-test/t/rpl_stm_sp.test (renamed from mysql-test/t/rpl_sp.test)5
-rw-r--r--mysql-test/t/rpl_stm_timezone-master.opt1
-rw-r--r--mysql-test/t/rpl_stm_timezone-slave.opt (renamed from mysql-test/t/rpl_timezone-slave.opt)0
-rw-r--r--mysql-test/t/rpl_stm_timezone.test (renamed from mysql-test/t/rpl_timezone.test)3
-rw-r--r--mysql-test/t/rpl_stm_until.test (renamed from mysql-test/t/rpl_until.test)11
-rw-r--r--mysql-test/t/rpl_stm_user_variables.test5
-rw-r--r--mysql-test/t/rpl_stm_view.test50
-rw-r--r--mysql-test/t/rpl_temporary.test11
-rw-r--r--mysql-test/t/rpl_trigger.test5
-rw-r--r--mysql-test/t/sp.test4
-rw-r--r--mysql-test/t/user_var-binlog.test6
376 files changed, 28097 insertions, 2025 deletions
diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am
index a63b4cbf178..c1db94e9d71 100644
--- a/mysql-test/Makefile.am
+++ b/mysql-test/Makefile.am
@@ -36,15 +36,24 @@ mysql_test_run_new_SOURCES= mysql_test_run_new.c my_manage.c my_create_tables.c
dist-hook:
- mkdir -p $(distdir)/t $(distdir)/r $(distdir)/include \
- $(distdir)/std_data $(distdir)/lib
+ mkdir -p \
+ $(distdir)/t \
+ $(distdir)/extra/binlog_tests \
+ $(distdir)/extra/rpl_tests \
+ $(distdir)/r \
+ $(distdir)/include \
+ $(distdir)/std_data \
+ $(distdir)/lib
-$(INSTALL_DATA) $(srcdir)/t/*.def $(distdir)/t
$(INSTALL_DATA) $(srcdir)/t/*.test $(distdir)/t
-$(INSTALL_DATA) $(srcdir)/t/*.imtest $(distdir)/t
$(INSTALL_DATA) $(srcdir)/t/*.sql $(distdir)/t
-$(INSTALL_DATA) $(srcdir)/t/*.disabled $(distdir)/t
- $(INSTALL_DATA) $(srcdir)/t/*.opt $(srcdir)/t/*.slave-mi $(distdir)/t
- $(INSTALL_SCRIPT) $(srcdir)/t/*.sh $(distdir)/t
+ $(INSTALL_DATA) $(srcdir)/t/*.opt $(srcdir)/t/*.sh $(srcdir)/t/*.slave-mi $(distdir)/t
+ $(INSTALL_DATA) $(srcdir)/extra/binlog_tests/*.test $(distdir)/extra/binlog_tests
+ $(INSTALL_DATA) $(srcdir)/extra/rpl_tests/*.test $(distdir)/extra/rpl_tests
+ -$(INSTALL_DATA) $(srcdir)/extra/binlog_tests/*.opt $(distdir)/extra/binlog_tests
+ -$(INSTALL_DATA) $(srcdir)/extra/rpl_tests/*.opt $(distdir)/extra/rpl_tests
$(INSTALL_DATA) $(srcdir)/include/*.inc $(distdir)/include
$(INSTALL_DATA) $(srcdir)/r/*.result $(srcdir)/r/*.require $(distdir)/r
$(INSTALL_DATA) $(srcdir)/std_data/Moscow_leap $(distdir)/std_data
@@ -59,6 +68,8 @@ dist-hook:
install-data-local:
$(mkinstalldirs) \
$(DESTDIR)$(testdir)/t \
+ $(DESTDIR)$(testdir)/extra/binlog_tests \
+ $(DESTDIR)$(testdir)/extra/rpl_tests \
$(DESTDIR)$(testdir)/r \
$(DESTDIR)$(testdir)/include \
$(DESTDIR)$(testdir)/std_data \
@@ -74,6 +85,10 @@ install-data-local:
$(INSTALL_DATA) $(srcdir)/t/*.slave-mi $(DESTDIR)$(testdir)/t
$(INSTALL_DATA) $(srcdir)/r/*.result $(DESTDIR)$(testdir)/r
$(INSTALL_DATA) $(srcdir)/r/*.require $(DESTDIR)$(testdir)/r
+ $(INSTALL_DATA) $(srcdir)/extra/binlog_tests/*.test $(DESTDIR)$(testdir)/extra/binlog_tests
+ $(INSTALL_DATA) $(srcdir)/extra/rpl_tests/*.test $(DESTDIR)$(testdir)/extra/rpl_tests
+ -$(INSTALL_DATA) $(srcdir)/extra/binlog_tests/*.opt $(DESTDIR)$(testdir)/extra/binlog_tests
+ -$(INSTALL_DATA) $(srcdir)/extra/rpl_tests/*.opt $(DESTDIR)$(testdir)/extra/rpl_tests
$(INSTALL_DATA) $(srcdir)/include/*.inc $(DESTDIR)$(testdir)/include
$(INSTALL_DATA) $(srcdir)/std_data/*.dat $(DESTDIR)$(testdir)/std_data
$(INSTALL_DATA) $(srcdir)/std_data/*.*001 $(DESTDIR)$(testdir)/std_data
diff --git a/mysql-test/t/binlog.test b/mysql-test/extra/binlog_tests/binlog.test
index 2310e800df7..8eb1dcb7dc3 100644
--- a/mysql-test/t/binlog.test
+++ b/mysql-test/extra/binlog_tests/binlog.test
@@ -1,8 +1,10 @@
#
# misc binlogging tests that do not require a slave running
#
+
-- source include/have_bdb.inc
-- source include/have_innodb.inc
+-- source include/have_debug.inc
--disable_warnings
drop table if exists t1, t2;
@@ -18,9 +20,8 @@ begin;
insert t2 values (5);
commit;
# first COMMIT must be Query_log_event, second - Xid_log_event
---replace_result "xid=18" "xid=11"
--replace_column 2 # 5 #
-show binlog events from 98;
+show binlog events from 102;
drop table t1,t2;
#
@@ -40,9 +41,7 @@ while ($1)
--enable_query_log
commit;
drop table t1;
---replace_result "xid=29" "xid=18"
--replace_column 2 # 5 #
-show binlog events in 'master-bin.000001' from 98;
+show binlog events in 'master-bin.000001' from 102;
--replace_column 2 # 5 #
-show binlog events in 'master-bin.000002' from 98;
-
+show binlog events in 'master-bin.000002' from 102;
diff --git a/mysql-test/t/blackhole.test b/mysql-test/extra/binlog_tests/blackhole.test
index 1b5a9beb887..1b5a9beb887 100644
--- a/mysql-test/t/blackhole.test
+++ b/mysql-test/extra/binlog_tests/blackhole.test
diff --git a/mysql-test/t/ctype_cp932.test b/mysql-test/extra/binlog_tests/ctype_cp932.test
index 082786e38af..ab1dd6d0108 100644
--- a/mysql-test/t/ctype_cp932.test
+++ b/mysql-test/extra/binlog_tests/ctype_cp932.test
@@ -415,7 +415,7 @@ SET @var1= x'8300';
# code (and I have used it to test the fix) until there is some way to
# exercise this code from mysql-test-run.
EXECUTE stmt1 USING @var1;
-SHOW BINLOG EVENTS FROM 98;
+SHOW BINLOG EVENTS FROM 102;
SELECT HEX(f1) FROM t1;
DROP table t1;
# end test for bug#11338
diff --git a/mysql-test/t/ctype_cp932_binlog.test b/mysql-test/extra/binlog_tests/ctype_cp932_binlog.test
index 270e27cf27f..a17f8f827a6 100644
--- a/mysql-test/t/ctype_cp932_binlog.test
+++ b/mysql-test/extra/binlog_tests/ctype_cp932_binlog.test
@@ -26,7 +26,8 @@ SET @var1= x'8300';
# code (and I have used it to test the fix) until there is some way to
# exercise this code from mysql-test-run.
EXECUTE stmt1 USING @var1;
-SHOW BINLOG EVENTS FROM 98;
+--replace_column 2 # 5 #
+SHOW BINLOG EVENTS FROM 102;
SELECT HEX(f1) FROM t1;
DROP table t1;
# end test for bug#11338
diff --git a/mysql-test/t/ctype_ucs_binlog.test b/mysql-test/extra/binlog_tests/ctype_ucs_binlog.test
index 1ce55edd469..f7f46388033 100644
--- a/mysql-test/t/ctype_ucs_binlog.test
+++ b/mysql-test/extra/binlog_tests/ctype_ucs_binlog.test
@@ -9,7 +9,7 @@ create table t2 (c char(30)) charset=ucs2;
set @v=convert('abc' using ucs2);
reset master;
insert into t2 values (@v);
-show binlog events from 98;
+show binlog events from 102;
# more important than SHOW BINLOG EVENTS, mysqlbinlog (where we
# absolutely need variables names to be quoted and strings to be
# escaped).
diff --git a/mysql-test/t/drop_temp_table.test b/mysql-test/extra/binlog_tests/drop_temp_table.test
index bc06de4096c..bc06de4096c 100644
--- a/mysql-test/t/drop_temp_table.test
+++ b/mysql-test/extra/binlog_tests/drop_temp_table.test
diff --git a/mysql-test/extra/binlog_tests/innodb_stat.test b/mysql-test/extra/binlog_tests/innodb_stat.test
new file mode 100644
index 00000000000..131c244d8fd
--- /dev/null
+++ b/mysql-test/extra/binlog_tests/innodb_stat.test
@@ -0,0 +1,47 @@
+-- source include/have_innodb.inc
+
+#
+# Let us test binlog_cache_use and binlog_cache_disk_use status vars.
+# Actually this test has nothing to do with innodb per se, it just requires
+# transactional table.
+#
+show status like "binlog_cache_use";
+show status like "binlog_cache_disk_use";
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+create table t1 (a int) engine=innodb;
+
+# Now we are going to create transaction which is long enough so its
+# transaction binlog will be flushed to disk...
+let $1=2000;
+disable_query_log;
+begin;
+while ($1)
+{
+ eval insert into t1 values( $1 );
+ dec $1;
+}
+commit;
+enable_query_log;
+show status like "binlog_cache_use";
+show status like "binlog_cache_disk_use";
+
+# Transaction which should not be flushed to disk and so should not
+# increase binlog_cache_disk_use.
+begin;
+delete from t1;
+commit;
+show status like "binlog_cache_use";
+show status like "binlog_cache_disk_use";
+drop table t1;
+
+# Test for testable InnoDB status variables. This test
+# uses previous ones(pages_created, rows_deleted, ...).
+show status like "Innodb_buffer_pool_pages_total";
+show status like "Innodb_page_size";
+show status like "Innodb_rows_deleted";
+show status like "Innodb_rows_inserted";
+show status like "Innodb_rows_updated";
+
diff --git a/mysql-test/t/insert_select-binlog.test b/mysql-test/extra/binlog_tests/insert_select-binlog.test
index d4041f86ab5..d4041f86ab5 100644
--- a/mysql-test/t/insert_select-binlog.test
+++ b/mysql-test/extra/binlog_tests/insert_select-binlog.test
diff --git a/mysql-test/t/mix_innodb_myisam_binlog.test b/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test
index 658584b625e..a9612b831f1 100644
--- a/mysql-test/t/mix_innodb_myisam_binlog.test
+++ b/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test
@@ -9,6 +9,7 @@
-- source include/not_embedded.inc
-- source include/have_innodb.inc
+-- source include/have_debug.inc
--disable_warnings
drop table if exists t1, t2;
@@ -29,8 +30,7 @@ insert into t2 select * from t1;
commit;
--replace_column 5 #
---replace_result "xid=15" "xid=8"
-show binlog events from 98;
+show binlog events from 102;
delete from t1;
delete from t2;
@@ -43,7 +43,7 @@ insert into t2 select * from t1;
rollback;
--replace_column 5 #
-show binlog events from 98;
+show binlog events from 102;
delete from t1;
delete from t2;
@@ -58,8 +58,7 @@ rollback to savepoint my_savepoint;
commit;
--replace_column 5 #
---replace_result "xid=48" "xid=25"
-show binlog events from 98;
+show binlog events from 102;
delete from t1;
delete from t2;
@@ -76,8 +75,7 @@ commit;
select a from t1 order by a; # check that savepoints work :)
--replace_column 5 #
---replace_result "xid=70" "xid=37"
-show binlog events from 98;
+show binlog events from 102;
# and when ROLLBACK is not explicit?
delete from t1;
@@ -98,7 +96,7 @@ connection con2;
# logging has been done, we use a user lock.
select get_lock("a",10);
--replace_column 5 #
-show binlog events from 98;
+show binlog events from 102;
# and when not in a transact1on?
delete from t1;
@@ -109,8 +107,7 @@ insert into t1 values(9);
insert into t2 select * from t1;
--replace_column 5 #
---replace_result "xid=119" "xid=60"
-show binlog events from 98;
+show binlog events from 102;
# Check that when the query updat1ng the MyISAM table is the first in the
# transaction, we log it immediately.
@@ -122,14 +119,12 @@ insert into t1 values(10); # first make t1 non-empty
begin;
insert into t2 select * from t1;
--replace_column 5 #
---replace_result "xid=133" "xid=66"
-show binlog events from 98;
+show binlog events from 102;
insert into t1 values(11);
commit;
--replace_column 5 #
---replace_result "xid=133" "xid=66" "xid=136" "xid=68"
-show binlog events from 98;
+show binlog events from 102;
# Check that things work like before this BEGIN/ROLLBACK code was added,
@@ -147,8 +142,7 @@ insert into t2 select * from t1;
commit;
--replace_column 5 #
---replace_result "xid=155" "xid=78"
-show binlog events from 98;
+show binlog events from 102;
delete from t1;
delete from t2;
@@ -160,7 +154,7 @@ insert into t2 select * from t1;
rollback;
--replace_column 5 #
-show binlog events from 98;
+show binlog events from 102;
delete from t1;
delete from t2;
@@ -175,8 +169,7 @@ rollback to savepoint my_savepoint;
commit;
--replace_column 5 #
---replace_result "xid=187" "xid=94"
-show binlog events from 98;
+show binlog events from 102;
delete from t1;
delete from t2;
@@ -193,8 +186,7 @@ commit;
select a from t1 order by a; # check that savepoints work :)
--replace_column 5 #
---replace_result "xid=208" "xid=105"
-show binlog events from 98;
+show binlog events from 102;
# Test for BUG#5714, where a MyISAM update in the transaction used to
# release row-level locks in InnoDB
@@ -254,8 +246,7 @@ disconnect con2;
connection con3;
select get_lock("lock1",60);
--replace_column 5 #
---replace_result "xid=208" "xid=105" "xid=227" "xid=114" "xid=230" "xid=115" "xid=234" "xid=117" "xid=261" "xid=132"
-show binlog events from 98;
+show binlog events from 102;
do release_lock("lock1");
drop table t0,t2;
diff --git a/mysql-test/extra/rpl_tests/rpl000006.test b/mysql-test/extra/rpl_tests/rpl000006.test
new file mode 100644
index 00000000000..272e5744d9c
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl000006.test
@@ -0,0 +1,47 @@
+#
+# Test forced timestamp
+#
+-- source include/master-slave.inc
+
+# Don't log table creating to the slave as we want to test LOAD TABLE
+set SQL_LOG_BIN=0,timestamp=200006;
+create table t1(t timestamp not null,a char(1));
+insert into t1 ( a) values ('F');
+select unix_timestamp(t) from t1;
+connection slave;
+load table t1 from master;
+select unix_timestamp(t) from t1;
+
+# Delete the created table on master and slave
+connection master;
+set SQL_LOG_BIN=1,timestamp=default;
+drop table t1;
+save_master_pos;
+connection slave;
+sync_with_master;
+connection master;
+
+#
+# Test copying table with checksum
+#
+
+# Don't log table creating to the slave as we want to test LOAD TABLE
+set SQL_LOG_BIN=0;
+
+eval CREATE TABLE t1 (
+ a int not null
+) ENGINE=$engine_type MAX_ROWS=4000 CHECKSUM=1;
+INSERT INTO t1 VALUES (1);
+save_master_pos;
+connection slave;
+sync_with_master;
+load table t1 from master;
+check table t1;
+drop table t1;
+connection master;
+drop table t1;
+save_master_pos;
+connection slave;
+sync_with_master;
+
+# End of 4.1 tests
diff --git a/mysql-test/extra/rpl_tests/rpl_auto_increment.test b/mysql-test/extra/rpl_tests/rpl_auto_increment.test
new file mode 100644
index 00000000000..e7ea85f9f71
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_auto_increment.test
@@ -0,0 +1,103 @@
+#
+# Test of auto_increment with offset
+#
+-- source include/master-slave.inc
+
+eval create table t1 (a int not null auto_increment,b int, primary key (a)) engine=$engine_type2 auto_increment=3;
+insert into t1 values (NULL,1),(NULL,2),(NULL,3);
+select * from t1;
+
+sync_slave_with_master;
+select * from t1;
+connection master;
+drop table t1;
+
+eval create table t1 (a int not null auto_increment,b int, primary key (a)) engine=$engine_type2;
+insert into t1 values (1,1),(NULL,2),(3,3),(NULL,4);
+delete from t1 where b=4;
+insert into t1 values (NULL,5),(NULL,6);
+select * from t1;
+
+sync_slave_with_master;
+select * from t1;
+connection master;
+
+drop table t1;
+
+set @@session.auto_increment_increment=100, @@session.auto_increment_offset=10;
+show variables like "%auto_inc%";
+
+eval create table t1 (a int not null auto_increment, primary key (a)) engine=$engine_type2;
+# Insert with 2 insert statements to get better testing of logging
+insert into t1 values (NULL),(5),(NULL);
+insert into t1 values (250),(NULL);
+select * from t1;
+insert into t1 values (1000);
+set @@insert_id=400;
+insert into t1 values(NULL),(NULL);
+select * from t1;
+
+sync_slave_with_master;
+select * from t1;
+connection master;
+drop table t1;
+
+#
+# Same test with innodb (as the innodb code is a bit different)
+#
+eval create table t1 (a int not null auto_increment, primary key (a)) engine=$engine_type;
+# Insert with 2 insert statements to get better testing of logging
+insert into t1 values (NULL),(5),(NULL);
+insert into t1 values (250),(NULL);
+select * from t1;
+insert into t1 values (1000);
+set @@insert_id=400;
+insert into t1 values(NULL),(NULL);
+select * from t1;
+
+sync_slave_with_master;
+select * from t1;
+connection master;
+drop table t1;
+
+set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1;
+eval create table t1 (a int not null auto_increment, primary key (a)) engine=$engine_type2;
+# Insert with 2 insert statements to get better testing of logging
+insert into t1 values (NULL),(5),(NULL),(NULL);
+insert into t1 values (500),(NULL),(502),(NULL),(NULL);
+select * from t1;
+set @@insert_id=600;
+--error 1062
+insert into t1 values(600),(NULL),(NULL);
+set @@insert_id=600;
+insert ignore into t1 values(600),(NULL),(NULL),(610),(NULL);
+select * from t1;
+
+sync_slave_with_master;
+select * from t1;
+connection master;
+drop table t1;
+
+#
+# Test that auto-increment works when slave has rows in the table
+#
+set @@session.auto_increment_increment=10, @@session.auto_increment_offset=1;
+
+eval create table t1 (a int not null auto_increment, primary key (a)) engine=$engine_type2;
+
+sync_slave_with_master;
+insert into t1 values(2),(12),(22),(32),(42);
+connection master;
+
+insert into t1 values (NULL),(NULL);
+insert into t1 values (3),(NULL),(NULL);
+select * from t1;
+
+sync_slave_with_master;
+select * from t1;
+connection master;
+
+drop table t1;
+
+# End cleanup
+sync_slave_with_master;
diff --git a/mysql-test/extra/rpl_tests/rpl_commit_after_flush.test b/mysql-test/extra/rpl_tests/rpl_commit_after_flush.test
new file mode 100644
index 00000000000..d63d7e4b07d
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_commit_after_flush.test
@@ -0,0 +1,22 @@
+#################################
+# Test updated to use a wrapper #
+#################################
+
+-- source include/master-slave.inc
+
+eval CREATE TABLE t1 (a INT) ENGINE=$engine_type;
+
+begin;
+insert into t1 values(1);
+flush tables with read lock;
+commit;
+save_master_pos;
+connection slave;
+sync_with_master;
+# cleanup
+connection master;
+unlock tables;
+drop table t1;
+sync_slave_with_master;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_ddl.test b/mysql-test/extra/rpl_tests/rpl_ddl.test
index d2a41a305b6..0d9f390531f 100644
--- a/mysql-test/t/rpl_ddl.test
+++ b/mysql-test/extra/rpl_tests/rpl_ddl.test
@@ -28,9 +28,6 @@
# eval SELECT CONCAT('######## ','$my_stmt',' ########') as "";
#
---source include/have_innodb.inc
---source include/master-slave.inc
-
###############################################################
# Some preparations
###############################################################
@@ -54,28 +51,28 @@ DROP DATABASE IF EXISTS mysqltest3;
#
CREATE DATABASE mysqltest1;
CREATE DATABASE mysqltest2;
-CREATE TABLE mysqltest1.t1 (f1 BIGINT) ENGINE= "InnoDB";
+eval CREATE TABLE mysqltest1.t1 (f1 BIGINT) ENGINE=$engine_type;
INSERT INTO mysqltest1.t1 SET f1= 0;
-CREATE TABLE mysqltest1.t2 (f1 BIGINT) ENGINE= "InnoDB";
-CREATE TABLE mysqltest1.t3 (f1 BIGINT) ENGINE= "InnoDB";
-CREATE TABLE mysqltest1.t4 (f1 BIGINT) ENGINE= "InnoDB";
-CREATE TABLE mysqltest1.t5 (f1 BIGINT) ENGINE= "InnoDB";
-CREATE TABLE mysqltest1.t6 (f1 BIGINT) ENGINE= "InnoDB";
+eval CREATE TABLE mysqltest1.t2 (f1 BIGINT) ENGINE=$engine_type;
+eval CREATE TABLE mysqltest1.t3 (f1 BIGINT) ENGINE=$engine_type;
+eval CREATE TABLE mysqltest1.t4 (f1 BIGINT) ENGINE=$engine_type;
+eval CREATE TABLE mysqltest1.t5 (f1 BIGINT) ENGINE=$engine_type;
+eval CREATE TABLE mysqltest1.t6 (f1 BIGINT) ENGINE=$engine_type;
CREATE INDEX my_idx6 ON mysqltest1.t6(f1);
-CREATE TABLE mysqltest1.t7 (f1 BIGINT) ENGINE= "InnoDB";
+eval CREATE TABLE mysqltest1.t7 (f1 BIGINT) ENGINE=$engine_type;
INSERT INTO mysqltest1.t7 SET f1= 0;
-CREATE TABLE mysqltest1.t8 (f1 BIGINT) ENGINE= "InnoDB";
-CREATE TABLE mysqltest1.t9 (f1 BIGINT) ENGINE= "InnoDB";
-CREATE TABLE mysqltest1.t10 (f1 BIGINT) ENGINE= "InnoDB";
-CREATE TABLE mysqltest1.t11 (f1 BIGINT) ENGINE= "InnoDB";
-CREATE TABLE mysqltest1.t12 (f1 BIGINT) ENGINE= "InnoDB";
-CREATE TABLE mysqltest1.t13 (f1 BIGINT) ENGINE= "InnoDB";
-CREATE TABLE mysqltest1.t14 (f1 BIGINT) ENGINE= "InnoDB";
-CREATE TABLE mysqltest1.t15 (f1 BIGINT) ENGINE= "InnoDB";
-CREATE TABLE mysqltest1.t16 (f1 BIGINT) ENGINE= "InnoDB";
-CREATE TABLE mysqltest1.t17 (f1 BIGINT) ENGINE= "InnoDB";
-CREATE TABLE mysqltest1.t18 (f1 BIGINT) ENGINE= "InnoDB";
-CREATE TABLE mysqltest1.t19 (f1 BIGINT) ENGINE= "InnoDB";
+eval CREATE TABLE mysqltest1.t8 (f1 BIGINT) ENGINE=$engine_type;
+eval CREATE TABLE mysqltest1.t9 (f1 BIGINT) ENGINE=$engine_type;
+eval CREATE TABLE mysqltest1.t10 (f1 BIGINT) ENGINE=$engine_type;
+eval CREATE TABLE mysqltest1.t11 (f1 BIGINT) ENGINE=$engine_type;
+eval CREATE TABLE mysqltest1.t12 (f1 BIGINT) ENGINE=$engine_type;
+eval CREATE TABLE mysqltest1.t13 (f1 BIGINT) ENGINE=$engine_type;
+eval CREATE TABLE mysqltest1.t14 (f1 BIGINT) ENGINE=$engine_type;
+eval CREATE TABLE mysqltest1.t15 (f1 BIGINT) ENGINE=$engine_type;
+eval CREATE TABLE mysqltest1.t16 (f1 BIGINT) ENGINE=$engine_type;
+eval CREATE TABLE mysqltest1.t17 (f1 BIGINT) ENGINE=$engine_type;
+eval CREATE TABLE mysqltest1.t18 (f1 BIGINT) ENGINE=$engine_type;
+eval CREATE TABLE mysqltest1.t19 (f1 BIGINT) ENGINE=$engine_type;
CREATE TEMPORARY TABLE mysqltest1.t23 (f1 BIGINT);
#
@@ -207,10 +204,10 @@ connection master;
SELECT '-------- switch to master -------' as "";
--enable_query_log
-let $my_stmt= CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE= "InnoDB";
+let $my_stmt= CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE=;
let $my_master_commit= true;
let $my_slave_commit= true;
---source include/rpl_stmt_seq.inc
+--source include/rpl_stmt_seq2.inc
# Note: Since this test is executed with a skip-innodb slave, the
# slave incorrectly commits the insert. One can *not* have InnoDB on
@@ -218,6 +215,9 @@ let $my_slave_commit= true;
# after a CREATE TEMPORARY TABLE should work correctly on the slave.
# For this to work properly the handler on the slave must be able to
# handle transactions (e.g. InnoDB or NDB).
+let $engine='';
+let $eng_type='';
+
let $my_stmt= CREATE TEMPORARY TABLE mysqltest1.t22 (f1 BIGINT);
let $my_master_commit= false;
let $my_slave_commit= true;
diff --git a/mysql-test/t/rpl_deadlock.test b/mysql-test/extra/rpl_tests/rpl_deadlock.test
index c74ed989ece..2582a901b3b 100644
--- a/mysql-test/t/rpl_deadlock.test
+++ b/mysql-test/extra/rpl_tests/rpl_deadlock.test
@@ -10,14 +10,13 @@
# We don't 'show status like 'slave_retried_transactions'' because this
# is not repeatable (depends on sleeps).
-source include/have_innodb.inc;
-source include/master-slave.inc;
+-- source include/master-slave.inc
connection master;
-create table t1 (a int not null, key(a)) engine=innodb;
-create table t2 (a int not null, key(a)) engine=innodb;
-create table t3 (a int) engine=innodb;
-create table t4 (a int) engine=innodb;
+eval CREATE TABLE t1 (a INT NOT NULL, KEY(a)) ENGINE=$engine_type;
+eval CREATE TABLE t2 (a INT NOT NULL, KEY(a)) ENGINE=$engine_type;
+eval CREATE TABLE t3 (a INT) ENGINE=$engine_type;
+eval CREATE TABLE t4 (a INT) ENGINE=$engine_type;
show variables like 'slave_transaction_retries';
sync_slave_with_master;
@@ -65,14 +64,14 @@ sync_with_master;
select * from t1; # check that slave succeeded finally
select * from t2;
# check that no error is reported
---replace_column 1 # 8 # 9 # 23 # 33 #
+--replace_column 1 # 7 # 8 # 9 # 16 # 22 # 23 # 33 #
--replace_result $MASTER_MYPORT MASTER_MYPORT
show slave status;
# 2) Test lock wait timeout
stop slave;
-change master to master_log_pos=532; # the BEGIN log event
+change master to master_log_pos=536; # the BEGIN log event
begin;
select * from t2 for update; # hold lock
start slave;
@@ -82,7 +81,7 @@ sync_with_master;
select * from t1; # check that slave succeeded finally
select * from t2;
# check that no error is reported
---replace_column 1 # 8 # 9 # 23 # 33 #
+--replace_column 1 # 7 # 8 # 9 # 16 # 22 # 23 # 33 #
--replace_result $MASTER_MYPORT MASTER_MYPORT
show slave status;
@@ -93,7 +92,7 @@ set global max_relay_log_size=0;
# This is really copy-paste of 2) of above
stop slave;
-change master to master_log_pos=532;
+change master to master_log_pos=536;
begin;
select * from t2 for update;
start slave;
@@ -102,7 +101,7 @@ commit;
sync_with_master;
select * from t1;
select * from t2;
---replace_column 1 # 8 # 9 # 11 # 23 # 33 #
+--replace_column 1 # 7 # 8 # 9 # 11 # 16 # 22 # 23 # 33 #
--replace_result $MASTER_MYPORT MASTER_MYPORT
show slave status;
diff --git a/mysql-test/extra/rpl_tests/rpl_delete_no_where.test b/mysql-test/extra/rpl_tests/rpl_delete_no_where.test
new file mode 100644
index 00000000000..4db9e0fb63f
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_delete_no_where.test
@@ -0,0 +1,19 @@
+# Test to see if a DELETE which triggers a fast deletion of all rows
+# (not internally row-per-row but more like a TRUNCATE, MyISAM
+# supports that), is replicated (BUG#13576).
+
+-- source include/master-slave.inc
+
+eval create table t1 (a int, b int) engine=$engine_type;
+insert into t1 values(1,1);
+sync_slave_with_master;
+select * from t1;
+connection master;
+delete from t1;
+sync_slave_with_master;
+select * from t1;
+
+# cleanup
+connection master;
+drop table t1;
+sync_slave_with_master;
diff --git a/mysql-test/t/rpl_error_ignored_table.test b/mysql-test/extra/rpl_tests/rpl_err_ignoredtable.test
index 339d966dbb3..e439dbdc388 100644
--- a/mysql-test/t/rpl_error_ignored_table.test
+++ b/mysql-test/extra/rpl_tests/rpl_err_ignoredtable.test
@@ -2,7 +2,9 @@
# Bug #797: If a query is ignored on slave (replicate-ignore-table) the slave
# still checks that it has the same error as on the master.
-source include/master-slave.inc;
+# Requires statement logging
+-- source include/master-slave.inc
+
connection master;
create table t1 (a int primary key);
# generate an error that goes to the binlog
@@ -49,7 +51,7 @@ connection master;
reap;
connection master1;
--replace_column 2 # 5 #
-show binlog events from 98;
+show binlog events from 102;
save_master_pos;
connection slave;
# SQL slave thread should not have stopped (because table of the killed
diff --git a/mysql-test/extra/rpl_tests/rpl_failed_optimize.test b/mysql-test/extra/rpl_tests/rpl_failed_optimize.test
new file mode 100644
index 00000000000..598f9746fab
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_failed_optimize.test
@@ -0,0 +1,19 @@
+-- source include/master-slave.inc
+
+#
+# BUG#5551 "Failed OPTIMIZE TABLE is logged to binary log"
+# Replication should work when OPTIMIZE TABLE timeouts, and
+# when OPTIMIZE TABLE is executed on a non-existing table
+#
+
+eval CREATE TABLE t1 ( a int ) ENGINE=$engine_type;
+BEGIN;
+INSERT INTO t1 VALUES (1);
+
+connection master1;
+OPTIMIZE TABLE t1;
+
+OPTIMIZE TABLE non_existing;
+sync_slave_with_master;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_flush_tables.test b/mysql-test/extra/rpl_tests/rpl_flsh_tbls.test
index 92aef9c85d0..c046487729e 100644
--- a/mysql-test/t/rpl_flush_tables.test
+++ b/mysql-test/extra/rpl_tests/rpl_flsh_tbls.test
@@ -1,12 +1,9 @@
-#
+# depends on the binlog output
# Test of replicating FLUSH TABLES to make
# RENAME TABLE work with MERGE tables on the slave.
# Test of FLUSH NO_WRITE_TO_BINLOG by the way.
#
---source include/master-slave.inc
-# Skipped on Windows because it can't handle a table underlying an open
-# merge table getting renamed.
---source include/not_windows.inc
+-- source include/master-slave.inc
create table t1 (a int);
insert into t1 values (10);
@@ -22,7 +19,7 @@ flush no_write_to_binlog tables;
# Check that it's not in the binlog.
--replace_result $SERVER_VERSION SERVER_VERSION
--replace_column 2 # 5 #
-show binlog events;
+eval SHOW BINLOG EVENTS FROM $rename_event_pos ;
# Check that the master is not confused.
select * from t3;
# This FLUSH should go into the binlog to not confuse the slave.
@@ -30,7 +27,7 @@ flush tables;
# Check that it's in the binlog.
--replace_result $SERVER_VERSION SERVER_VERSION
--replace_column 2 # 5 #
-show binlog events;
+eval SHOW BINLOG EVENTS FROM $rename_event_pos ;
save_master_pos;
connection slave;
sync_with_master;
@@ -50,4 +47,4 @@ sleep 1;
stop slave;
# End of 4.1 tests
-# Adding comment for force manual merge 5.0 -> wl1012. Delete me if needed.
+
diff --git a/mysql-test/extra/rpl_tests/rpl_foreign_key.test b/mysql-test/extra/rpl_tests/rpl_foreign_key.test
new file mode 100644
index 00000000000..20ec0e4179e
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_foreign_key.test
@@ -0,0 +1,32 @@
+# Check the replication of the FOREIGN_KEY_CHECKS variable.
+
+-- source include/master-slave.inc
+
+eval CREATE TABLE t1 (a INT AUTO_INCREMENT KEY) ENGINE=$engine_type;
+eval CREATE TABLE t2 (b INT AUTO_INCREMENT KEY, c INT, FOREIGN KEY(b) REFERENCES t1(a)) ENGINE=$engine_type;
+
+SET FOREIGN_KEY_CHECKS=0;
+INSERT INTO t1 VALUES (10);
+INSERT INTO t1 VALUES (NULL),(NULL),(NULL);
+INSERT INTO t2 VALUES (5,0);
+INSERT INTO t2 VALUES (NULL,LAST_INSERT_ID());
+SET FOREIGN_KEY_CHECKS=1;
+SELECT * FROM t1;
+SELECT * FROM t2;
+sync_slave_with_master;
+SELECT * FROM t1;
+SELECT * FROM t2;
+
+connection master;
+SET TIMESTAMP=1000000000;
+CREATE TABLE t3 ( a INT UNIQUE );
+SET FOREIGN_KEY_CHECKS=0;
+--error 1062
+INSERT INTO t3 VALUES (1),(1);
+sync_slave_with_master;
+
+connection master;
+SET FOREIGN_KEY_CHECKS=0;
+DROP TABLE IF EXISTS t1,t2,t3;
+SET FOREIGN_KEY_CHECKS=1;
+
diff --git a/mysql-test/extra/rpl_tests/rpl_insert_id.test b/mysql-test/extra/rpl_tests/rpl_insert_id.test
new file mode 100644
index 00000000000..adf8631bea2
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_insert_id.test
@@ -0,0 +1,78 @@
+# See if queries that use both auto_increment and LAST_INSERT_ID()
+# are replicated well
+
+# We also check how the foreign_key_check variable is replicated
+
+-- source include/master-slave.inc
+#should work for both SBR and RBR
+
+connection master;
+create table t1(a int auto_increment, key(a));
+create table t2(b int auto_increment, c int, key(b));
+insert into t1 values (1),(2),(3);
+insert into t1 values (null);
+insert into t2 values (null,last_insert_id());
+save_master_pos;
+connection slave;
+sync_with_master;
+select * from t1;
+select * from t2;
+connection master;
+#check if multi-line inserts,
+#which set last_insert_id to the first id inserted,
+#are replicated the same way
+drop table t1;
+drop table t2;
+--disable_warnings
+eval create table t1(a int auto_increment, key(a)) engine=$engine_type;
+eval create table t2(b int auto_increment, c int, key(b), foreign key(b) references t1(a)) engine=$engine_type;
+--enable_warnings
+SET FOREIGN_KEY_CHECKS=0;
+insert into t1 values (10);
+insert into t1 values (null),(null),(null);
+insert into t2 values (5,0);
+insert into t2 values (null,last_insert_id());
+SET FOREIGN_KEY_CHECKS=1;
+save_master_pos;
+connection slave;
+sync_with_master;
+select * from t1;
+select * from t2;
+connection master;
+
+# check if INSERT SELECT in auto_increment is well replicated (bug #490)
+
+drop table t2;
+drop table t1;
+create table t1(a int auto_increment, key(a));
+create table t2(b int auto_increment, c int, key(b));
+insert into t1 values (10);
+insert into t1 values (null),(null),(null);
+insert into t2 values (5,0);
+insert into t2 (c) select * from t1;
+select * from t2;
+save_master_pos;
+connection slave;
+sync_with_master;
+select * from t1;
+select * from t2;
+connection master;
+drop table t1;
+drop table t2;
+save_master_pos;
+connection slave;
+sync_with_master;
+
+#
+# Bug#8412: Error codes reported in binary log for CHARACTER SET,
+# FOREIGN_KEY_CHECKS
+#
+connection master;
+SET TIMESTAMP=1000000000;
+CREATE TABLE t1 ( a INT UNIQUE );
+SET FOREIGN_KEY_CHECKS=0;
+--error 1062
+INSERT INTO t1 VALUES (1),(1);
+sync_slave_with_master;
+
+# End of 4.1 tests
diff --git a/mysql-test/extra/rpl_tests/rpl_insert_ignore.test b/mysql-test/extra/rpl_tests/rpl_insert_ignore.test
new file mode 100644
index 00000000000..207b53b6fb4
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_insert_ignore.test
@@ -0,0 +1,71 @@
+# Testcase for BUG#6287 "Slave skips auto_increment values in Replication with InnoDB"
+# The bug was that if on master, INSERT IGNORE ignored some
+# rows, and the table was InnoDB with auto_inc column, then on slave
+# some rows received an auto_inc bigger than on master.
+# Slave needs to be started with --innodb to store table in InnoDB.
+# Same test for MyISAM (which had no bug).
+
+-- source include/master-slave.inc
+
+eval CREATE TABLE t1 (
+ a int unsigned not null auto_increment primary key,
+ b int unsigned,
+ unique (b)
+) ENGINE=$engine_type;
+
+eval CREATE TABLE t2 (
+ a int unsigned, # to force INSERT SELECT to have a certain order
+ b int unsigned
+) ENGINE=$engine_type;
+
+
+INSERT INTO t1 VALUES (NULL, 1);
+INSERT INTO t1 VALUES (NULL, 2);
+INSERT INTO t1 VALUES (NULL, 3);
+INSERT INTO t1 VALUES (NULL, 4);
+
+# An alternation of values which will conflict in t1 and will not.
+
+INSERT INTO t2 VALUES (1, 1);
+INSERT INTO t2 VALUES (2, 2);
+INSERT INTO t2 VALUES (3, 5);
+INSERT INTO t2 VALUES (4, 3);
+INSERT INTO t2 VALUES (5, 4);
+INSERT INTO t2 VALUES (6, 6);
+
+INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a;
+
+# Compare results
+
+SELECT * FROM t1 ORDER BY a;
+
+sync_slave_with_master;
+SELECT * FROM t1 ORDER BY a;
+
+# Now do the same for MyISAM
+
+connection master;
+drop table t1;
+eval CREATE TABLE t1 (
+ a int unsigned not null auto_increment primary key,
+ b int unsigned,
+ unique (b)
+) ENGINE=$engine_type2;
+
+INSERT INTO t1 VALUES (1, 1);
+INSERT INTO t1 VALUES (2, 2);
+INSERT INTO t1 VALUES (3, 3);
+INSERT INTO t1 VALUES (4, 4);
+
+INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a;
+
+SELECT * FROM t1 ORDER BY a;
+
+sync_slave_with_master;
+SELECT * FROM t1 ORDER BY a;
+
+connection master;
+drop table t1, t2;
+sync_slave_with_master;
+
+# End of 4.1 tests
diff --git a/mysql-test/extra/rpl_tests/rpl_loaddata.test b/mysql-test/extra/rpl_tests/rpl_loaddata.test
new file mode 100644
index 00000000000..0da3a8b8011
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_loaddata.test
@@ -0,0 +1,156 @@
+# Requires statement logging
+-- source include/have_binlog_format_statement.inc
+
+# See if replication of a "LOAD DATA in an autoincrement column"
+# Honours autoincrement values
+# i.e. if the master and slave have the same sequence
+#
+# check replication of load data for temporary tables with additional
+# parameters
+#
+# check if duplicate entries trigger an error (they should unless IGNORE or
+# REPLACE was used on the master) (bug 571).
+#
+# check if START SLAVE, RESET SLAVE, CHANGE MASTER reset Last_slave_error and
+# Last_slave_errno in SHOW SLAVE STATUS (1st and 3rd commands did not: bug 986)
+
+-- source include/master-slave.inc
+
+connection slave;
+reset master;
+connection master;
+
+create table t1(a int not null auto_increment, b int, primary key(a) );
+load data infile '../../std_data/rpl_loaddata.dat' into table t1;
+
+create temporary table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60));
+load data infile '../../std_data/rpl_loaddata2.dat' into table t2 fields terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by '\n##\n' starting by '>' ignore 1 lines;
+
+create table t3 (day date,id int(9),category enum('a','b','c'),name varchar(60));
+insert into t3 select * from t2;
+
+save_master_pos;
+connection slave;
+sync_with_master;
+
+select * from t1;
+select * from t3;
+# We want to be sure that LOAD DATA is in the slave's binlog.
+# But we can't simply read this binlog, because as the slave has not been
+# restarted for this test, the file_id is uncertain (would cause test
+# failures). So instead, we test if the binlog looks long enough to
+# contain LOAD DATA. Since 5.0.3 we assume that binlog of 1292 is ok.
+# If LOAD DATA was not logged, the binlog would be shorter.
+show master status;
+
+connection master;
+
+drop table t1;
+drop table t2;
+drop table t3;
+create table t1(a int, b int, unique(b));
+
+save_master_pos;
+connection slave;
+sync_with_master;
+
+# See if slave stops when there's a duplicate entry for key error in LOAD DATA
+
+insert into t1 values(1,10);
+
+connection master;
+load data infile '../../std_data/rpl_loaddata.dat' into table t1;
+
+save_master_pos;
+connection slave;
+# The SQL slave thread should be stopped now.
+wait_for_slave_to_stop;
+
+# Skip the bad event and see if error is cleared in SHOW SLAVE STATUS by START
+# SLAVE, even though we are not executing any event (as sql_slave_skip_counter
+# takes us directly to the end of the relay log).
+
+set global sql_slave_skip_counter=1;
+start slave;
+sync_with_master;
+--replace_result $MASTER_MYPORT MASTER_PORT
+--replace_column 1 # 8 # 9 # 16 # 23 # 33 #
+show slave status;
+
+# Trigger error again to test CHANGE MASTER
+
+connection master;
+set sql_log_bin=0;
+delete from t1;
+set sql_log_bin=1;
+load data infile '../../std_data/rpl_loaddata.dat' into table t1;
+save_master_pos;
+connection slave;
+# The SQL slave thread should be stopped now.
+# Exec_Master_Log_Pos should point to the start of Execute event
+# for last load data.
+wait_for_slave_to_stop;
+
+# CHANGE MASTER and see if error is cleared in SHOW SLAVE STATUS.
+stop slave;
+change master to master_user='test';
+change master to master_user='root';
+--replace_result $MASTER_MYPORT MASTER_PORT
+--replace_column 1 # 8 # 9 # 16 # 23 # 33 #
+show slave status;
+
+# Trigger error again to test RESET SLAVE
+
+set global sql_slave_skip_counter=1;
+start slave;
+sync_with_master;
+connection master;
+set sql_log_bin=0;
+delete from t1;
+set sql_log_bin=1;
+load data infile '../../std_data/rpl_loaddata.dat' into table t1;
+save_master_pos;
+connection slave;
+# The SQL slave thread should be stopped now.
+wait_for_slave_to_stop;
+
+# RESET SLAVE and see if error is cleared in SHOW SLAVE STATUS.
+stop slave;
+reset slave;
+--replace_result $MASTER_MYPORT MASTER_PORT
+--replace_column 1 # 8 # 9 # 16 # 23 # 33 #
+show slave status;
+
+# Finally, see if logging is done ok on master for a failing LOAD DATA INFILE
+
+connection master;
+reset master;
+eval create table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60),
+unique(day)) engine=$engine_type; # no transactions
+--error 1062
+load data infile '../../std_data/rpl_loaddata2.dat' into table t2 fields
+terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by
+'\n##\n' starting by '>' ignore 1 lines;
+select * from t2;
+save_master_pos;
+connection slave;
+start slave;
+sync_with_master;
+select * from t2;
+
+# verify that if no error on slave, this is an error
+
+alter table t2 drop key day;
+connection master;
+delete from t2;
+--error 1062
+load data infile '../../std_data/rpl_loaddata2.dat' into table t2 fields
+terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by
+'\n##\n' starting by '>' ignore 1 lines;
+connection slave;
+wait_for_slave_to_stop;
+drop table t2;
+connection master;
+drop table t2;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_loaddata_rule_m.test b/mysql-test/extra/rpl_tests/rpl_loaddata_m.test
index c956f2c7720..ef90283f80e 100644
--- a/mysql-test/t/rpl_loaddata_rule_m.test
+++ b/mysql-test/extra/rpl_tests/rpl_loaddata_m.test
@@ -2,7 +2,8 @@
# exist.
# This is for BUG#1100 (LOAD DATA INFILE was half-logged).
-source include/master-slave.inc;
+
+-- source include/master-slave.inc
--disable_warnings
drop database if exists mysqltest;
@@ -16,15 +17,12 @@ stop slave; # don't need slave for this test
connection master;
# 'test' is the current database
create database mysqltest;
-create table t1(a int, b int, unique(b));
use mysqltest;
-load data infile '../../std_data/rpl_loaddata.dat' into table test.t1;
+create table t1(a int, b int, unique(b));
+load data infile '../../std_data/rpl_loaddata.dat' into table t1;
# Starting from 5.0.3 LOAD DATA is replicated much in the same way as ordinary
# query so "show binlog ..." should show two events (before 5.0.3 no events
# were returned).
--replace_column 2 # 5 #
-show binlog events from 98;
+show binlog events from 102;
drop database mysqltest;
-
-# End of 4.1 tests
-# Adding comment for force manual merge 5.0 -> wl1012: Delete me
diff --git a/mysql-test/t/rpl_log.test b/mysql-test/extra/rpl_tests/rpl_log.test
index 1f71d2981c5..252c1fcca41 100644
--- a/mysql-test/t/rpl_log.test
+++ b/mysql-test/extra/rpl_tests/rpl_log.test
@@ -1,4 +1,5 @@
-source include/master-slave.inc;
+# Requires statement logging
+-- source include/master-slave.inc
# Clean up old slave's binlogs.
# The slave is started with --log-slave-updates
@@ -37,10 +38,14 @@ load data infile '../../std_data/words.dat' into table t1 ignore 1 lines;
select count(*) from t1;
drop table t1;
--replace_result $VERSION VERSION
+--replace_column 2 # 5 #
show binlog events;
-show binlog events from 98 limit 1;
-show binlog events from 98 limit 2;
-show binlog events from 98 limit 2,1;
+--replace_column 2 # 5 #
+show binlog events from 102 limit 1;
+--replace_column 2 # 5 #
+show binlog events from 102 limit 2;
+--replace_column 2 # 5 #
+show binlog events from 102 limit 2,1;
flush logs;
# We need an extra update before doing save_master_pos.
@@ -81,8 +86,10 @@ create table t1 (n int);
insert into t1 values (1);
drop table t1;
--replace_result $VERSION VERSION
+--replace_column 2 # 5 #
show binlog events;
--replace_result $VERSION VERSION
+--replace_column 2 # 5 #
show binlog events in 'master-bin.000002';
show binary logs;
save_master_pos;
@@ -91,11 +98,13 @@ start slave;
sync_with_master;
show binary logs;
--replace_result $MASTER_MYPORT MASTER_PORT $VERSION VERSION
+--replace_column 2 # 5 #
show binlog events in 'slave-bin.000001' from 4;
--replace_result $MASTER_MYPORT MASTER_PORT $VERSION VERSION
+--replace_column 2 # 5 #
show binlog events in 'slave-bin.000002' from 4;
--replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 23 # 33 #
+--replace_column 1 # 8 # 9 # 16 # 23 # 33 #
show slave status;
# Need to recode the following
@@ -108,6 +117,3 @@ show slave status;
--error 1220
show binlog events in 'slave-bin.000005' from 4;
-
-# End of 4.1 tests
-# Adding comment for force manual merge 5.0 -> wl1012: Delete me
diff --git a/mysql-test/t/rpl_max_relay_size.test b/mysql-test/extra/rpl_tests/rpl_max_relay_size.test
index 9b6b06e0b14..14223392224 100644
--- a/mysql-test/t/rpl_max_relay_size.test
+++ b/mysql-test/extra/rpl_tests/rpl_max_relay_size.test
@@ -3,11 +3,14 @@
# for relay logs too).
# Test of manual relay log rotation with FLUSH LOGS.
-source include/master-slave.inc;
+# Requires statement logging
+-- source include/master-slave.inc
+
connection slave;
stop slave;
connection master;
# Generate a big enough master's binlog to cause relay log rotations
+
create table t1 (a int);
let $1=800;
disable_query_log;
@@ -29,7 +32,7 @@ select @@global.max_relay_log_size;
start slave;
sync_with_master;
--replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 23 # 33 #
+--replace_column 1 # 8 # 9 # 16 # 23 # 33 #
show slave status;
stop slave;
reset slave;
@@ -38,7 +41,7 @@ select @@global.max_relay_log_size;
start slave;
sync_with_master;
--replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 23 # 33 #
+--replace_column 1 # 8 # 9 # 16 # 23 # 33 #
show slave status;
stop slave;
reset slave;
@@ -47,7 +50,7 @@ select @@global.max_relay_log_size;
start slave;
sync_with_master;
--replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 23 # 33 #
+--replace_column 1 # 8 # 9 # 16 # 23 # 33 #
show slave status;
# Tests below are mainly to ensure that we have not coded with wrong assumptions
@@ -58,7 +61,7 @@ reset slave;
# (to make sure it does not crash).
flush logs;
--replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 23 # 33 #
+--replace_column 1 # 8 # 9 # 16 # 23 # 33 #
show slave status;
reset slave;
@@ -74,7 +77,7 @@ save_master_pos;
connection slave;
sync_with_master;
--replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 23 # 33 #
+--replace_column 1 # 8 # 9 # 16 # 23 # 33 #
show slave status;
# one more rotation, to be sure Relay_Log_Space is correctly updated
flush logs;
@@ -84,13 +87,11 @@ save_master_pos;
connection slave;
sync_with_master;
--replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 23 # 33 #
+--replace_column 1 # 8 # 9 # 16 # 23 # 33 #
show slave status;
connection master;
# test that the absence of relay logs does not make a master crash
flush logs;
+-- replace_column 3 <Binlog_Ignore_DB>
show master status;
-
-# End of 4.1 tests
-#
diff --git a/mysql-test/t/rpl_multi_query.test b/mysql-test/extra/rpl_tests/rpl_multi_query.test
index b4cd88f756e..a0062bd04bf 100644
--- a/mysql-test/t/rpl_multi_query.test
+++ b/mysql-test/extra/rpl_tests/rpl_multi_query.test
@@ -3,10 +3,10 @@
# CLIENT_MULTI_STATEMENTS) will be binlogged ONE-query-per-event (not
# one binlog event containing all queries)
+
# PS doesn't support multi-statements
--disable_ps_protocol
-
-source include/master-slave.inc;
+-- source include/master-slave.inc
--disable_warnings
drop database if exists mysqltest;
--enable_warnings
@@ -24,9 +24,6 @@ sync_slave_with_master;
select * from mysqltest.t1;
connection master;
--replace_column 2 # 5 #
-show binlog events from 98;
+show binlog events from 102;
drop database mysqltest;
sync_slave_with_master;
-
-# End of 4.1 tests
-#
diff --git a/mysql-test/extra/rpl_tests/rpl_multi_update.test b/mysql-test/extra/rpl_tests/rpl_multi_update.test
new file mode 100644
index 00000000000..121ae18daa8
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_multi_update.test
@@ -0,0 +1,30 @@
+source include/master-slave.inc;
+
+eval CREATE TABLE t1 (
+ a int unsigned not null auto_increment primary key,
+ b int unsigned
+) ENGINE=$engine_type;
+
+eval CREATE TABLE t2 (
+ a int unsigned not null auto_increment primary key,
+ b int unsigned
+) ENGINE=$engine_type;
+
+INSERT INTO t1 VALUES (NULL, 0);
+INSERT INTO t1 SELECT NULL, 0 FROM t1;
+
+INSERT INTO t2 VALUES (NULL, 0), (NULL,1);
+
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+
+UPDATE t1, t2 SET t1.b = t2.b WHERE t1.a = t2.a;
+save_master_pos;
+connection slave;
+sync_with_master;
+
+# End of 4.1 tests
+
+connection master;
+drop table t1, t2;
+sync_slave_with_master;
diff --git a/mysql-test/extra/rpl_tests/rpl_multi_update2.test b/mysql-test/extra/rpl_tests/rpl_multi_update2.test
new file mode 100644
index 00000000000..0adf0053425
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_multi_update2.test
@@ -0,0 +1,62 @@
+# Let's verify that multi-update is not always skipped by slave if
+# some replicate-* rules exist.
+# (BUG#7011)
+
+source include/master-slave.inc;
+
+--disable_warnings
+drop table if exists t1,t2;
+--enable_warnings
+
+eval CREATE TABLE t1 (
+ a int unsigned not null auto_increment primary key,
+ b int unsigned
+) ENGINE=$engine_type;
+
+eval CREATE TABLE t2 (
+ a int unsigned not null auto_increment primary key,
+ b int unsigned
+) ENGINE=$engine_type;
+
+INSERT INTO t1 VALUES (NULL, 0);
+INSERT INTO t1 SELECT NULL, 0 FROM t1;
+
+INSERT INTO t2 VALUES (NULL, 0), (NULL,1);
+
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+
+UPDATE t1, t2 SET t1.b = (t2.b+4) WHERE t1.a = t2.a;
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+
+save_master_pos;
+connection slave;
+sync_with_master;
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+
+connection master;
+drop table t1,t2;
+sync_slave_with_master;
+
+#
+# BUG#13236 multi-update with subquery & --replicate-ignore-table
+#
+reset master;
+
+connection master;
+CREATE TABLE t1 ( a INT );
+INSERT INTO t1 VALUES (0);
+UPDATE t1, (SELECT 3 as b) AS x SET t1.a = x.b;
+select * from t1;
+sync_slave_with_master;
+
+connection slave;
+select * from t1;
+
+connection master;
+drop table t1;
+sync_slave_with_master;
+
+# End of 4.1 tests
diff --git a/mysql-test/extra/rpl_tests/rpl_multi_update3.test b/mysql-test/extra/rpl_tests/rpl_multi_update3.test
new file mode 100644
index 00000000000..90cc81cfd58
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_multi_update3.test
@@ -0,0 +1,220 @@
+-- source include/master-slave.inc
+
+##############################################################################
+#
+# Let's verify that multi-update with a subselect does not cause the slave to crash
+# (BUG#10442)
+#
+--disable_query_log
+SELECT '-------- Test for BUG#9361 --------' as "";
+--enable_query_log
+
+eval CREATE TABLE t1 (
+ a int unsigned not null auto_increment primary key,
+ b int unsigned
+) ENGINE=$engine_type;
+
+eval CREATE TABLE t2 (
+ a int unsigned not null auto_increment primary key,
+ b int unsigned
+) ENGINE=$engine_type;
+
+INSERT INTO t1 VALUES (NULL, 0);
+INSERT INTO t1 SELECT NULL, 0 FROM t1;
+
+INSERT INTO t2 VALUES (NULL, 0), (NULL,1);
+
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+
+UPDATE t2, (SELECT a FROM t1) AS t SET t2.b = t.a+5 ;
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+
+sync_slave_with_master;
+connection slave;
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+
+connection master;
+drop table t1,t2;
+
+##############################################################################
+#
+# Test for BUG#9361:
+# Subselects should work inside multi-updates
+#
+--disable_query_log
+SELECT '-------- Test 1 for BUG#9361 --------' as "";
+--enable_query_log
+
+connection master;
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+--enable_warnings
+
+CREATE TABLE t1 (
+ a1 char(30),
+ a2 int,
+ a3 int,
+ a4 char(30),
+ a5 char(30)
+);
+
+CREATE TABLE t2 (
+ b1 int,
+ b2 char(30)
+);
+
+# Insert one row per table
+INSERT INTO t1 VALUES ('Yes', 1, NULL, 'foo', 'bar');
+INSERT INTO t2 VALUES (1, 'baz');
+
+# This should update the row in t1
+UPDATE t1 a, t2
+ SET a.a1 = 'No'
+ WHERE a.a2 =
+ (SELECT b1
+ FROM t2
+ WHERE b2 = 'baz')
+ AND a.a3 IS NULL
+ AND a.a4 = 'foo'
+ AND a.a5 = 'bar';
+
+sync_slave_with_master;
+connection slave;
+SELECT * FROM t1;
+SELECT * FROM t2;
+
+connection master;
+DROP TABLE t1, t2;
+
+##############################################################################
+#
+# Second test for BUG#9361
+#
+
+--disable_query_log
+SELECT '-------- Test 2 for BUG#9361 --------' as "";
+--enable_query_log
+
+connection master;
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+DROP TABLE IF EXISTS t3;
+--enable_warnings
+
+CREATE TABLE t1 (
+ i INT,
+ j INT,
+ x INT,
+ y INT,
+ z INT
+);
+
+CREATE TABLE t2 (
+ i INT,
+ k INT,
+ x INT,
+ y INT,
+ z INT
+);
+
+CREATE TABLE t3 (
+ j INT,
+ k INT,
+ x INT,
+ y INT,
+ z INT
+);
+
+INSERT INTO t1 VALUES ( 1, 2,13,14,15);
+INSERT INTO t2 VALUES ( 1, 3,23,24,25);
+INSERT INTO t3 VALUES ( 2, 3, 1,34,35), ( 2, 3, 1,34,36);
+
+UPDATE t1 AS a
+INNER JOIN t2 AS b
+ ON a.i = b.i
+INNER JOIN t3 AS c
+ ON a.j = c.j AND b.k = c.k
+SET a.x = b.x,
+ a.y = b.y,
+ a.z = (
+ SELECT sum(z)
+ FROM t3
+ WHERE y = 34
+ )
+WHERE b.x = 23;
+
+sync_slave_with_master;
+connection slave;
+
+SELECT * FROM t1;
+
+connection master;
+DROP TABLE t1, t2, t3;
+
+##############################################################################
+#
+# BUG#12618
+#
+# TEST: Replication of a statement containing a join in a multi-update.
+
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+
+CREATE TABLE t1 (
+ idp int(11) NOT NULL default '0',
+ idpro int(11) default NULL,
+ price decimal(19,4) default NULL,
+ PRIMARY KEY (idp)
+);
+
+CREATE TABLE t2 (
+ idpro int(11) NOT NULL default '0',
+ price decimal(19,4) default NULL,
+ nbprice int(11) default NULL,
+ PRIMARY KEY (idpro)
+);
+
+INSERT INTO t1 VALUES
+ (1,1,'3.0000'),
+ (2,2,'1.0000'),
+ (3,1,'1.0000'),
+ (4,1,'4.0000'),
+ (5,3,'2.0000'),
+ (6,2,'4.0000');
+
+INSERT INTO t2 VALUES
+ (1,'0.0000',0),
+ (2,'0.0000',0),
+ (3,'0.0000',0);
+
+# This update sets t2 to the minimal prices for each product
+update
+ t2
+ join
+ ( select idpro, min(price) as min_price, count(*) as nbr_price
+ from t1
+ where idpro>0 and price>0
+ group by idpro
+ ) as table_price
+on t2.idpro = table_price.idpro
+set t2.price = table_price.min_price,
+ t2.nbprice = table_price.nbr_price;
+
+select "-- MASTER AFTER JOIN --" as "";
+select * from t1;
+select * from t2;
+
+sync_slave_with_master;
+
+select "-- SLAVE AFTER JOIN --" as "";
+select * from t1;
+select * from t2;
+
+# End of 4.1 tests
diff --git a/mysql-test/extra/rpl_tests/rpl_relayrotate.test b/mysql-test/extra/rpl_tests/rpl_relayrotate.test
new file mode 100644
index 00000000000..dc91f9e7fff
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_relayrotate.test
@@ -0,0 +1,75 @@
+# When the relay log gets rotated while the I/O thread
+# is reading a transaction, the transaction spans on two or more
+# relay logs. If STOP SLAVE occurs while the SQL thread is
+# executing a part of the transaction in the non-first relay logs,
+# we test if START SLAVE will resume in the beginning of the
+# transaction (i.e., step back to the first relay log)
+
+# The slave is started with max_binlog_size=16384 bytes,
+# to force many rotations (approximately 30 rotations)
+
+-- source include/master-slave.inc
+
+connection slave;
+stop slave;
+connection master;
+--disable_warnings
+eval create table t1 (a int) engine=$engine_type;
+--enable_warnings
+let $1=8000;
+disable_query_log;
+begin;
+while ($1)
+{
+# eval means expand $ expressions
+ eval insert into t1 values( $1 );
+ dec $1;
+}
+commit;
+# This will generate a 500kB master's binlog,
+# which corresponds to 30 slave's relay logs.
+enable_query_log;
+save_master_pos;
+connection slave;
+reset slave;
+start slave;
+# We wait 1 sec for the SQL thread to be somewhere in
+# the middle of the transaction, hopefully not in
+# the first relay log, and hopefully before the COMMIT.
+# Usually it stops when the SQL thread is around the 15th relay log.
+# We cannot use MASTER_POS_WAIT() as master's position
+# increases only when the slave executes the COMMIT.
+# Note that except when using Valgrind, 1 second is enough for the I/O slave
+# thread to fetch the whole master's binlog.
+sleep 1;
+stop slave;
+# We suppose the SQL thread stopped before COMMIT.
+# If so the transaction was rolled back
+# and the table is now empty.
+# Now restart
+start slave;
+# And see if the table contains '8000'
+# which proves that the transaction restarted at
+# the right place.
+# We must wait for the transaction to commit before
+# reading, with a sync_with_master.
+sync_with_master;
+select max(a) from t1;
+connection master;
+
+# The following DROP is a very important cleaning task:
+# imagine the next test is run with --skip-innodb: it will do
+# DROP TABLE IF EXISTS t1; but this will delete the frm and leave
+# some data in the InnoDB datafile (because at that time mysqld
+# does not know about InnoDB : --skip-innodb). So if later in the
+# test suite a test wants to create an InnoDB table called t1, it
+# will fail with
+# InnoDB: Error: table t1 already exists in InnoDB internal
+# InnoDB: data dictionary. Have you deleted the .frm file etc
+drop table t1;
+# wait until this drop is executed on slave
+save_master_pos;
+connection slave;
+sync_with_master;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_reset_slave.test b/mysql-test/extra/rpl_tests/rpl_reset_slave.test
index 00b1cf68294..374b2620a34 100644
--- a/mysql-test/t/rpl_reset_slave.test
+++ b/mysql-test/extra/rpl_tests/rpl_reset_slave.test
@@ -1,3 +1,6 @@
+# TBF - difference in row level logging
+# Temp tables are not replicated in rbr, but it is still good to hit rbr with everthing
+
# See SHOW SLAVE STATUS displays well after RESET SLAVE (it should display the
# --master-* options from mysqld, as this is what is going to be used next time
# slave threads will be started). In bug 985, it displayed old values (of before
@@ -5,30 +8,30 @@
# See if slave crashes when doing a CREATE TEMPORARY TABLE twice, separated by
# RESET SLAVE.
-source include/master-slave.inc;
+-- source include/master-slave.inc
connection master;
save_master_pos;
connection slave;
sync_with_master;
--replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 23 # 33 #
+--replace_column 1 # 8 # 9 # 16 # 23 # 33 #
show slave status;
stop slave;
change master to master_user='test';
--replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 23 # 33 #
+--replace_column 1 # 8 # 9 # 16 # 23 # 33 #
show slave status;
reset slave;
--replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 23 # 33 #
+--replace_column 1 # 8 # 9 # 16 # 23 # 33 #
show slave status;
start slave;
sync_with_master;
--replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 23 # 33 #
+--replace_column 1 # 8 # 9 # 16 # 23 # 33 #
show slave status;
# test of crash with temp tables & RESET SLAVE
@@ -46,6 +49,3 @@ reset slave;
start slave;
sync_with_master;
show status like 'slave_open_temp_tables';
-
-# End of 4.1 tests
-#
diff --git a/mysql-test/extra/rpl_tests/rpl_row_001.test b/mysql-test/extra/rpl_tests/rpl_row_001.test
new file mode 100644
index 00000000000..2efefb3cd63
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_row_001.test
@@ -0,0 +1,84 @@
+-- source include/master-slave.inc
+-- source include/have_binlog_format_row.inc
+
+CREATE TABLE t1 (word CHAR(20) NOT NULL);
+LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE t1;
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+eval LOAD DATA LOCAL INFILE '$MYSQL_TEST_DIR/std_data/words.dat' INTO TABLE t1;
+SELECT * FROM t1 LIMIT 10;
+
+#
+# Test slave with wrong password
+#
+save_master_pos;
+connection slave;
+sync_with_master;
+STOP SLAVE;
+connection master;
+SET PASSWORD FOR root@"localhost" = PASSWORD('foo');
+connection slave;
+START SLAVE;
+connection master;
+#
+# Give slave time to do at last one failed connect retry
+# This one must be short so that the slave will not stop retrying
+real_sleep 2;
+SET PASSWORD FOR root@"localhost" = PASSWORD('');
+# Give slave time to connect (will retry every second)
+sleep 2;
+
+CREATE TABLE t3(n INT);
+INSERT INTO t3 VALUES(1),(2);
+sync_slave_with_master;
+SELECT * FROM t3;
+SELECT SUM(LENGTH(word)) FROM t1;
+connection master;
+DROP TABLE t1,t3;
+save_master_pos;
+connection slave;
+sync_with_master;
+
+# Test if the slave SQL thread can be more than 16K behind the slave
+# I/O thread (> IO_SIZE)
+
+connection master;
+# we'll use table-level locking to delay slave SQL thread
+eval CREATE TABLE t1 (n INT) ENGINE=$engine_type;
+sync_slave_with_master;
+connection master;
+RESET MASTER;
+connection slave;
+STOP SLAVE;
+RESET SLAVE;
+
+connection master;
+let $1=5000;
+# Generate 16K of relay log
+disable_query_log;
+while ($1)
+{
+ eval INSERT INTO t1 VALUES($1);
+ dec $1;
+}
+enable_query_log;
+SELECT COUNT(*) FROM t1;
+save_master_pos;
+
+# Try to cause a large relay log lag on the slave by locking t1
+connection slave;
+LOCK TABLES t1 READ;
+START SLAVE;
+UNLOCK TABLES;
+sync_with_master;
+SELECT COUNT(*) FROM t1;
+
+connection master;
+DROP TABLE t1;
+CREATE TABLE t1 (n INT);
+INSERT INTO t1 VALUES(3456);
+sync_slave_with_master;
+SELECT n FROM t1;
+
+connection master;
+DROP TABLE t1;
+sync_slave_with_master;
diff --git a/mysql-test/extra/rpl_tests/rpl_row_EE_err.test b/mysql-test/extra/rpl_tests/rpl_row_EE_err.test
new file mode 100644
index 00000000000..7312e4e0fb5
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_row_EE_err.test
@@ -0,0 +1,40 @@
+# The test is not relevant when testing replication of error codes for
+# statements that are not replicated. The test below could be changed
+# to rely on the replication of error codes for statements that are not
+# replicated row-based.
+
+# This test does not work the same for row based as the insert in the second part is not replicated as a call but rather as a table map and row right. Have added a slave stop so the test will complete, other wise it just continues to loop waiting for a slave stop that never comes. 8/22/2005 JBM
+
+-- source include/have_binlog_format_row.inc
+
+# See if an EE_ error in one event of the master's binlog stops replication
+# (it should not: in this configuration the EE_ error is probably not
+# critical). Example: you do a DROP TABLE on a table which has no MYI file
+# check if START SLAVE, RESET SLAVE, CHANGE MASTER reset Last_slave_error and
+# Last_slave_errno in SHOW SLAVE STATUS (1st and 3rd commands did not: bug 986).
+
+-- source include/master-slave.inc
+
+eval create table t1 (a int) engine=$engine_type;
+flush tables;
+system rm ./var/master-data/test/t1.MYI ;
+drop table if exists t1;
+save_master_pos;
+connection slave;
+sync_with_master;
+
+# Now a real error.
+
+connection master;
+eval create table t1 (a int, unique(a)) engine=$engine_type;
+set sql_log_bin=0;
+insert into t1 values(2);
+set sql_log_bin=1;
+save_master_pos;
+--error 1062
+insert into t1 values(1),(2);
+drop table t1;
+save_master_pos;
+connection slave;
+stop slave;
+wait_for_slave_to_stop;
diff --git a/mysql-test/extra/rpl_tests/rpl_row_UUID.test b/mysql-test/extra/rpl_tests/rpl_row_UUID.test
new file mode 100644
index 00000000000..6bad362057a
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_row_UUID.test
@@ -0,0 +1,80 @@
+#############################################################################
+# Original Author: JBM #
+# Original Date: Aug/18/2005 #
+#############################################################################
+# TEST: To test the UUID() in rbr #
+#############################################################################
+
+# Includes
+-- source include/have_binlog_format_row.inc
+-- source include/master-slave.inc
+
+# Begin clean up test section
+connection master;
+
+--disable_warnings
+DROP PROCEDURE IF EXISTS test.p1;
+DROP TABLE IF EXISTS test.t1;
+--enable_warnings
+
+# Section 1 test
+
+eval CREATE TABLE test.t1 (a INT, blob_column LONGBLOB, vchar_column VARCHAR(100), PRIMARY KEY(a)) engine=$engine_type;
+INSERT INTO test.t1 VALUES(1,UUID(),UUID());
+delimiter |;
+create procedure test.p1()
+begin
+ INSERT INTO test.t1 VALUES(2,UUID(),UUID());
+ INSERT INTO test.t1 VALUES(3,UUID(),UUID());
+end|
+delimiter ;|
+
+CALL test.p1();
+
+# Now the same thing with a function
+
+delimiter |;
+create function test.fn1(x int)
+ returns int
+begin
+ insert into t1 values (4+x,UUID(),UUID());
+ insert into t1 values (5+x,UUID(),UUID());
+ return 0;
+end|
+
+delimiter ;|
+# test both in SELECT and in INSERT
+select fn1(0);
+create table t2 (a int);
+insert into t2 values(fn1(2));
+
+sync_slave_with_master;
+SHOW CREATE TABLE test.t1;
+
+# Dump the databases and so we can see if they match
+# Another method would be to use SELECT INTO OUTFILE on master,
+# then LOAD DATA INFILE in slave, and use a query to compare.
+# This would have the advantage that it would not assume
+# the system has a 'diff'
+--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > ./var/tmp/rpl_row_UUID_master.sql
+--exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > ./var/tmp/rpl_row_UUID_slave.sql
+
+connection master;
+# Let's cleanup
+
+DROP PROCEDURE test.p1;
+DROP TABLE test.t1;
+
+# Let's compare. Note: If they match test will pass, if they do not match
+# the test will show that the diff statement failed and not reject file
+# will be created. You will need to go to the mysql-test dir and diff
+# the files your self to see what is not matching :-)
+
+--exec diff ./var/tmp/rpl_row_UUID_master.sql ./var/tmp/rpl_row_UUID_slave.sql;
+
+# Cleanup dump files.
+# Long-term "system rm" is not portable; we could live without
+# this cleanup as no other test will use these files and they'll
+# be removed at next testsuite run.
+
+# End of 5.0 test case
diff --git a/mysql-test/extra/rpl_tests/rpl_row_charset.test b/mysql-test/extra/rpl_tests/rpl_row_charset.test
new file mode 100644
index 00000000000..c2a7cda4333
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_row_charset.test
@@ -0,0 +1,182 @@
+# Replication of character sets.
+# This test will fail if the server/client does not support enough charsets.
+
+# Requires statement logging
+-- source include/have_binlog_format_row.inc
+
+-- source include/master-slave.inc
+--disable_warnings
+set timestamp=1000000000;
+drop database if exists mysqltest2;
+drop database if exists mysqltest3;
+--enable_warnings
+
+create database mysqltest2 character set latin2;
+set @@character_set_server=latin5;
+create database mysqltest3;
+--disable_query_log
+select "--- --master--" as "";
+--enable_query_log
+show create database mysqltest2;
+show create database mysqltest3;
+sync_slave_with_master;
+--disable_query_log
+select "--- --slave--" as "";
+--enable_query_log
+show create database mysqltest2;
+show create database mysqltest3;
+
+connection master;
+set @@collation_server=armscii8_bin;
+drop database mysqltest3;
+create database mysqltest3;
+--disable_query_log
+select "--- --master--" as "";
+--enable_query_log
+show create database mysqltest3;
+sync_slave_with_master;
+--disable_query_log
+select "--- --slave--" as "";
+--enable_query_log
+show create database mysqltest3;
+
+connection master;
+use mysqltest2;
+create table t1 (a int auto_increment primary key, b varchar(100));
+set character_set_client=cp850, collation_connection=latin2_croatian_ci;
+insert into t1 (b) values(@@character_set_server);
+insert into t1 (b) values(@@collation_server);
+# character_set_database and collation_database are not tested as they
+# needn't be replicated (Bar said in Jan 2005).
+insert into t1 (b) values(@@character_set_client);
+# collation_client does not exist
+insert into t1 (b) values(@@character_set_connection);
+insert into t1 (b) values(@@collation_connection);
+--disable_query_log
+select "--- --master--" as "";
+--enable_query_log
+select * from t1 order by a;
+sync_slave_with_master;
+--disable_query_log
+select "--- --slave--" as "";
+--enable_query_log
+select * from mysqltest2.t1 order by a;
+
+select "--- --muller--" as "";
+connection master;
+set character_set_client=latin1, collation_connection=latin1_german1_ci;
+truncate table t1;
+insert into t1 (b) values(@@collation_connection);
+insert into t1 (b) values(LEAST("Müller","Muffler"));
+set collation_connection=latin1_german2_ci;
+insert into t1 (b) values(@@collation_connection);
+insert into t1 (b) values(LEAST("Müller","Muffler"));
+--disable_query_log
+select "--- --master--" as "";
+--enable_query_log
+select * from t1 order by a;
+sync_slave_with_master;
+--disable_query_log
+select "--- --slave--" as "";
+--enable_query_log
+select * from mysqltest2.t1 order by a;
+
+# Presently charset info is not logged with LOAD DATA but it will
+# change in Jan 2005 when Dmitri pushes his new LOAD DATA,
+# before 5.0.3 goes out. When done, LOAD DATA INFILE should be tested
+# here.
+
+# See if user var is prefixed with collation in binlog and replicated well.
+# Note: replication of user variables is broken as far as derivation is
+# concerned. That's because when we store a user variable in the binlog,
+# we lose its derivation. So later on the slave, it's impossible to
+# know if the collation was explicit or not, so we use DERIVATION_NONE,
+# which provokes error messages (like 'Illegal mix of collation') when
+# we replay the master's INSERT/etc statements.
+
+
+select "--- --INSERT--" as "";
+connection master;
+set @a= _cp850 'Müller' collate cp850_general_ci;
+truncate table t1;
+insert into t1 (b) values(collation(@a));
+--disable_query_log
+select "--- --master--" as "";
+--enable_query_log
+select * from t1 order by a;
+sync_slave_with_master;
+--disable_query_log
+select "--- --slave--" as "";
+--enable_query_log
+select * from mysqltest2.t1 order by a;
+
+connection master;
+drop database mysqltest2;
+drop database mysqltest3;
+--replace_column 2 # 5 #
+show binlog events from 102;
+sync_slave_with_master;
+
+# Check that we can change global.collation_server (since 5.0.3)
+
+select "--- --global--" as "";
+set global character_set_server=latin2;
+set global character_set_server=latin1; # back
+connection master;
+set global character_set_server=latin2;
+set global character_set_server=latin1; # back
+
+# Check that SET ONE_SHOT is really one shot
+
+select "--- --oneshot--" as "";
+set one_shot @@character_set_server=latin5;
+set @@max_join_size=1000;
+select @@character_set_server;
+select @@character_set_server;
+set @@character_set_server=latin5;
+select @@character_set_server;
+select @@character_set_server;
+
+# ONE_SHOT on not charset/collation stuff is not allowed
+-- error 1382
+set one_shot max_join_size=10;
+
+# Test of wrong character set numbers;
+error 1115;
+set character_set_client=9999999;
+error 1273;
+set collation_server=9999998;
+
+# This one was contributed by Sergey Petrunia (BUG#3943)
+
+select "--- --3943--" as "";
+use test;
+CREATE TABLE t1 (c1 VARBINARY(255), c2 VARBINARY(255));
+SET CHARACTER_SET_CLIENT=koi8r,
+ CHARACTER_SET_CONNECTION=cp1251,
+ CHARACTER_SET_RESULTS=koi8r;
+INSERT INTO t1 (c1, c2) VALUES ('îÕ, ÚÁ ÒÙÂÁÌËÕ','îÕ, ÚÁ ÒÙÂÁÌËÕ');
+select hex(c1), hex(c2) from t1;
+sync_slave_with_master;
+select hex(c1), hex(c2) from t1;
+
+connection master;
+# Let's have a look at generated SETs.
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+#--exec $MYSQL_BINLOG --short-form $MYSQL_TEST_DIR/var/log/master-bin.000001
+drop table t1;
+sync_slave_with_master;
+
+#
+# BUG#6676: Derivation of variables must be correct on slave
+#
+select "--- --6676--" as "";
+connection master;
+eval create table `t1` (
+ `pk` varchar(10) not null default '',
+ primary key (`pk`)
+) engine=$engine_type default charset=latin1;
+set @p=_latin1 'test';
+update t1 set pk='test' where pk=@p;
+drop table t1;
+sync_slave_with_master;
diff --git a/mysql-test/extra/rpl_tests/rpl_row_delayed_ins.test b/mysql-test/extra/rpl_tests/rpl_row_delayed_ins.test
new file mode 100644
index 00000000000..fc899f1fa5f
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_row_delayed_ins.test
@@ -0,0 +1,22 @@
+# See if INSERT DELAYED gets replicated
+# Only in row-based, as we do SHOW BINLOG EVENTS
+
+-- source include/have_binlog_format_row.inc
+-- source include/master-slave.inc
+
+connection master;
+let $VERSION=`select version()`;
+eval create table t1(a int not null primary key) engine=$engine_type;
+insert delayed into t1 values (1),(2),(3);
+flush tables;
+select * from t1;
+sync_slave_with_master;
+
+connection master;
+--replace_result $VERSION VERSION
+show binlog events;
+sync_slave_with_master;
+select * from t1;
+connection master;
+drop table t1;
+sync_slave_with_master;
diff --git a/mysql-test/extra/rpl_tests/rpl_row_func003.test b/mysql-test/extra/rpl_tests/rpl_row_func003.test
new file mode 100644
index 00000000000..f07c8a65265
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_row_func003.test
@@ -0,0 +1,96 @@
+#############################################################################
+# Original Author: JBM #
+# Original Date: Aug/15/2005 #
+# Update: 08/29/2005 Comment out sleep. Only needed for debugging #
+#############################################################################
+# Note: Many lines are commented out in this test case. These were used for #
+# creating the test case and debugging and are being left for #
+# debugging, but they can not be used for the regular testing as the #
+# Time changes and is not deteministic, so instead we dump both the #
+# master and slave and diff the dumps. If the dumps differ then the #
+# test case will fail. To run during diff failuers, comment out the #
+# diff. #
+# Test: Tests MySQL stored function using RAND() and a flow control. The #
+# test inserts rows into a givin table with the function used in #
+# the insert statement. Depending on the RAND() value returned #
+# inside the function one set of text is returned. In addition, #
+# it uses a transaction to see the effect a rollback has on master #
+# Vs slave. #
+#############################################################################
+
+# Includes
+-- source include/have_binlog_format_row.inc
+-- source include/master-slave.inc
+
+
+# Begin clean up test section
+connection master;
+--disable_warnings
+DROP FUNCTION IF EXISTS test.f1;
+DROP TABLE IF EXISTS test.t1;
+
+--enable_warnings
+
+
+eval CREATE TABLE test.t1 (a INT NOT NULL AUTO_INCREMENT, c CHAR(16),PRIMARY KEY(a))ENGINE=$engine_type;
+
+delimiter |;
+create function test.f1() RETURNS CHAR(16)
+BEGIN
+ DECLARE tmp CHAR(16);
+ DECLARE var_name FLOAT;
+ SET var_name = RAND();
+ IF var_name > .6
+ THEN SET tmp = 'Texas';
+ ELSE SET tmp = 'MySQL';
+ END IF;
+RETURN tmp;
+END|
+delimiter ;|
+
+INSERT INTO test.t1 VALUES (null,test.f1()),(null,test.f1()),(null,test.f1());
+sleep 6;
+INSERT INTO test.t1 VALUES (null,test.f1()),(null,test.f1()),(null,test.f1());
+sleep 6;
+
+#Select in this test are used for debugging
+#select * from test.t1;
+#connection slave;
+#select * from test.t1;
+
+connection master;
+SET AUTOCOMMIT=0;
+START TRANSACTION;
+INSERT INTO test.t1 VALUES (null,test.f1());
+ROLLBACK;
+SET AUTOCOMMIT=1;
+#select * from test.t1;
+#sleep 6;
+
+#connection slave;
+#select * from test.t1;
+
+#connection master;
+
+#used for debugging
+#show binlog events;
+
+# time to dump the databases and so we can see if they match
+
+--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > ./var/tmp/func003_master.sql
+--exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > ./var/tmp/func003_slave.sql
+
+# First lets cleanupi
+DROP FUNCTION test.f1;
+DROP TABLE test.t1;
+
+
+# the test will show that the diff statement failed and no reject file
+# will be created. You will need to go to the mysql-test dir and diff
+# the files yourself to see what is not matching :-) File are located
+# in mysql-test/var/tmp
+
+exec diff ./var/tmp/func003_master.sql ./var/tmp/func003_slave.sql;
+
+
+# End of 5.0 test case
diff --git a/mysql-test/extra/rpl_tests/rpl_row_multi_update3.test b/mysql-test/extra/rpl_tests/rpl_row_multi_update3.test
new file mode 100644
index 00000000000..cd771d04229
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_row_multi_update3.test
@@ -0,0 +1,159 @@
+-- source include/master-slave.inc
+
+##############################################################################
+#
+# Let's verify that multi-update with a subselect does not cause the slave to crash
+# (BUG#10442)
+#
+--disable_query_log
+SELECT '-------- Test for BUG#9361 --------' as "";
+--enable_query_log
+
+eval CREATE TABLE t1 (
+ a int unsigned not null auto_increment primary key,
+ b int unsigned
+) ENGINE=$engine_type;
+
+eval CREATE TABLE t2 (
+ a int unsigned not null auto_increment primary key,
+ b int unsigned
+) ENGINE=$engine_type;
+
+INSERT INTO t1 VALUES (NULL, 0);
+INSERT INTO t1 SELECT NULL, 0 FROM t1;
+
+INSERT INTO t2 VALUES (NULL, 0), (NULL,1);
+
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+
+UPDATE t2, (SELECT a FROM t1) AS t SET t2.b = t.a+5 ;
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+
+sync_slave_with_master;
+connection slave;
+SELECT * FROM t1 ORDER BY a;
+SELECT * FROM t2 ORDER BY a;
+
+connection master;
+drop table t1,t2;
+
+##############################################################################
+#
+# Test for BUG#9361:
+# Subselects should work inside multi-updates
+#
+--disable_query_log
+SELECT '-------- Test 1 for BUG#9361 --------' as "";
+--enable_query_log
+
+connection master;
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+--enable_warnings
+
+CREATE TABLE t1 (
+ a1 char(30),
+ a2 int,
+ a3 int,
+ a4 char(30),
+ a5 char(30)
+);
+
+CREATE TABLE t2 (
+ b1 int,
+ b2 char(30)
+);
+
+# Insert one row per table
+INSERT INTO t1 VALUES ('Yes', 1, NULL, 'foo', 'bar');
+INSERT INTO t2 VALUES (1, 'baz');
+
+# This should update the row in t1
+UPDATE t1 a, t2
+ SET a.a1 = 'No'
+ WHERE a.a2 =
+ (SELECT b1
+ FROM t2
+ WHERE b2 = 'baz')
+ AND a.a3 IS NULL
+ AND a.a4 = 'foo'
+ AND a.a5 = 'bar';
+
+sync_slave_with_master;
+connection slave;
+SELECT * FROM t1;
+SELECT * FROM t2;
+
+connection master;
+DROP TABLE t1, t2;
+
+##############################################################################
+#
+# Second test for BUG#9361
+#
+
+--disable_query_log
+SELECT '-------- Test 2 for BUG#9361 --------' as "";
+--enable_query_log
+
+connection master;
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+DROP TABLE IF EXISTS t3;
+--enable_warnings
+
+CREATE TABLE t1 (
+ i INT,
+ j INT,
+ x INT,
+ y INT,
+ z INT
+);
+
+CREATE TABLE t2 (
+ i INT,
+ k INT,
+ x INT,
+ y INT,
+ z INT
+);
+
+CREATE TABLE t3 (
+ j INT,
+ k INT,
+ x INT,
+ y INT,
+ z INT
+);
+
+INSERT INTO t1 VALUES ( 1, 2,13,14,15);
+INSERT INTO t2 VALUES ( 1, 3,23,24,25);
+INSERT INTO t3 VALUES ( 2, 3, 1,34,35), ( 2, 3, 1,34,36);
+
+UPDATE t1 AS a
+INNER JOIN t2 AS b
+ ON a.i = b.i
+INNER JOIN t3 AS c
+ ON a.j = c.j AND b.k = c.k
+SET a.x = b.x,
+ a.y = b.y,
+ a.z = (
+ SELECT sum(z)
+ FROM t3
+ WHERE y = 34
+ )
+WHERE b.x = 23;
+
+sync_slave_with_master;
+connection slave;
+
+SELECT * FROM t1;
+
+connection master;
+DROP TABLE t1, t2, t3;
diff --git a/mysql-test/extra/rpl_tests/rpl_row_sp002.test b/mysql-test/extra/rpl_tests/rpl_row_sp002.test
new file mode 100644
index 00000000000..9d056626cf2
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_row_sp002.test
@@ -0,0 +1,239 @@
+#############################################################################
+# This test is being created to test out the non deterministic items with #
+# row based replication. #
+# Original Author: JBM #
+# Original Date: Aug/09/2005 #
+# Updated: Aug/29/2005 #
+#############################################################################
+# Test: Contains two stored procedures test one that insert data into tables#
+# and use the LAST_INSERTED_ID() on tables with FOREIGN KEY(a) #
+# REFERENCES ON DELETE CASCADE. This test also has a delete sp that #
+# should cause a delete cascade. #
+# The second test has a sp that will either insert rows or delete from#
+# the table depending on the CASE outcome. The test uses this SP in a#
+# transaction first rolling back and then commiting, #
+#############################################################################
+# Mod Date: 08/22/2005 #
+# TEST: Added test to include UPDATE CASCADE on table with FK per Trudy #
+#############################################################################
+
+
+
+# Includes
+-- source include/have_binlog_format_row.inc
+-- source include/master-slave.inc
+
+
+# Begin clean up test section
+connection master;
+--disable_warnings
+DROP PROCEDURE IF EXISTS test.p1;
+DROP PROCEDURE IF EXISTS test.p2;
+DROP PROCEDURE IF EXISTS test.p3;
+DROP TABLE IF EXISTS test.t3;
+DROP TABLE IF EXISTS test.t1;
+DROP TABLE IF EXISTS test.t2;
+--enable_warnings
+# End of cleanup
+
+# Begin test section 1
+
+eval CREATE TABLE test.t1 (a INT AUTO_INCREMENT KEY, t CHAR(6)) ENGINE=$engine_type;
+eval CREATE TABLE test.t2 (a INT AUTO_INCREMENT KEY, f INT, FOREIGN KEY(a) REFERENCES test.t1(a) ON DELETE CASCADE) ENGINE=$engine_type;
+
+delimiter |;
+create procedure test.p1(IN i CHAR(6))
+begin
+ INSERT INTO test.t1 (t) VALUES (i);
+ INSERT INTO test.t2 VALUES (NULL,LAST_INSERT_ID());
+end|
+create procedure test.p2(IN i INT)
+begin
+ DELETE FROM test.t1 where a < i;
+end|
+delimiter ;|
+
+let $message=< -- test 1 call p1 -- >;
+--source include/show_msg.inc
+SET FOREIGN_KEY_CHECKS=1;
+call test.p1('texas');
+call test.p1('Live');
+call test.p1('next');
+call test.p1('to');
+call test.p1('OK');
+call test.p1('MySQL');
+
+let $message=< -- test 1 select master after p1 -- >;
+--source include/show_msg.inc
+
+SELECT * FROM test.t1;
+SELECT * FROM test.t2;
+
+let $message=< -- test 1 select slave after p1 -- >;
+--source include/show_msg.inc
+save_master_pos;
+connection slave;
+sync_with_master;
+SELECT * FROM test.t1;
+SELECT * FROM test.t2;
+
+let $message=< -- test 1 call p2 & select master -- >;
+--source include/show_msg.inc
+connection master;
+call test.p2(4);
+SELECT * FROM test.t1;
+SELECT * FROM test.t2;
+
+let $message=< -- test 1 select slave after p2 -- >;
+--source include/show_msg.inc
+save_master_pos;
+connection slave;
+sync_with_master;
+SELECT * FROM test.t1;
+SELECT * FROM test.t2;
+
+connection master;
+#show binlog events;
+let $message=< -- End test 1 Begin test 2 -- >;
+--source include/show_msg.inc
+# End test 1 Begin test 2
+
+--disable_warnings
+SET FOREIGN_KEY_CHECKS=0;
+DROP PROCEDURE IF EXISTS test.p1;
+DROP PROCEDURE IF EXISTS test.p2;
+DROP TABLE IF EXISTS test.t1;
+DROP TABLE IF EXISTS test.t2;
+--enable_warnings
+# End of cleanup
+
+eval CREATE TABLE test.t1 (a INT, t CHAR(6), PRIMARY KEY(a)) ENGINE=$engine_type;
+eval CREATE TABLE test.t2 (a INT, f INT, FOREIGN KEY(a) REFERENCES test.t1(a) ON UPDATE CASCADE, PRIMARY KEY(a)) ENGINE=$engine_type;
+
+delimiter |;
+CREATE PROCEDURE test.p1(IN nm INT, IN ch CHAR(6))
+BEGIN
+ INSERT INTO test.t1 (a,t) VALUES (nm, ch);
+ INSERT INTO test.t2 VALUES (nm, LAST_INSERT_ID());
+END|
+CREATE PROCEDURE test.p2(IN i INT)
+BEGIN
+ UPDATE test.t1 SET a = i*10 WHERE a = i;
+END|
+delimiter ;|
+SET FOREIGN_KEY_CHECKS=1;
+CALL test.p1(1,'texas');
+CALL test.p1(2,'Live');
+CALL test.p1(3,'next');
+CALL test.p1(4,'to');
+CALL test.p1(5,'OK');
+CALL test.p1(6,'MySQL');
+
+let $message=< -- test 2 select Master after p1 -- >;
+--source include/show_msg.inc
+SELECT * FROM test.t1;
+SELECT * FROM test.t2;
+
+let $message=< -- test 2 select Slave after p1 -- >;
+--source include/show_msg.inc
+save_master_pos;
+connection slave;
+sync_with_master;
+SELECT * FROM test.t1;
+SELECT * FROM test.t2;
+
+let $message=< -- test 2 call p2 & select Master -- >;
+--source include/show_msg.inc
+connection master;
+CALL test.p2(2);
+CALL test.p2(4);
+CALL test.p2(6);
+SELECT * FROM test.t1;
+SELECT * FROM test.t2;
+
+let $message=< -- test 1 select Slave after p2 -- >;
+--source include/show_msg.inc
+save_master_pos;
+connection slave;
+sync_with_master;
+SELECT * FROM test.t1;
+SELECT * FROM test.t2;
+
+connection master;
+#show binlog events;
+let $message=< -- End test 2 Begin test 3 -- >;
+--source include/show_msg.inc
+# End test 2 begin test 3
+
+eval CREATE TABLE test.t3 (a INT AUTO_INCREMENT KEY, t CHAR(6))ENGINE=$engine_type;
+
+delimiter |;
+CREATE PROCEDURE test.p3(IN n INT)
+begin
+CASE n
+WHEN 2 THEN
+ DELETE from test.t3;
+ELSE
+ INSERT INTO test.t3 VALUES (NULL,'NONE');
+END CASE;
+end|
+delimiter ;|
+
+SET AUTOCOMMIT=0;
+START TRANSACTION;
+
+-- disable_query_log
+-- disable_result_log
+let $n=50;
+while ($n)
+{
+ eval call test.p3($n);
+ dec $n;
+}
+-- enable_result_log
+-- enable_query_log
+
+ROLLBACK;
+select * from test.t3;
+save_master_pos;
+connection slave;
+sync_with_master;
+select * from test.t3;
+
+connection master;
+START TRANSACTION;
+
+-- disable_query_log
+-- disable_result_log
+let $n=50;
+while ($n>3)
+{
+ eval call test.p3($n);
+ dec $n;
+}
+-- enable_result_log
+-- enable_query_log
+
+COMMIT;
+select * from test.t3;
+save_master_pos;
+connection slave;
+sync_with_master;
+select * from test.t3;
+
+connection master;
+#show binlog events from 1626;
+
+
+# First lets cleanup
+SET AUTOCOMMIT=1;
+SET FOREIGN_KEY_CHECKS=0;
+DROP PROCEDURE IF EXISTS test.p3;
+DROP PROCEDURE IF EXISTS test.p1;
+DROP PROCEDURE IF EXISTS test.p2;
+DROP TABLE IF EXISTS test.t1;
+DROP TABLE IF EXISTS test.t2;
+DROP TABLE IF EXISTS test.t3;
+sync_slave_with_master;
+
+# End of 5.0 test case
diff --git a/mysql-test/extra/rpl_tests/rpl_row_sp003.test b/mysql-test/extra/rpl_tests/rpl_row_sp003.test
new file mode 100644
index 00000000000..2073fb41264
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_row_sp003.test
@@ -0,0 +1,72 @@
+#############################################################################
+# Original Author: JBM #
+# Original Date: Aug/13/2005 Created from Bug 12335 #
+#############################################################################
+
+# Includes
+-- source include/have_binlog_format_row.inc
+-- source include/master-slave.inc
+
+
+# Begin clean up test section
+connection master;
+--disable_warnings
+DROP PROCEDURE IF EXISTS test.p1;
+DROP PROCEDURE IF EXISTS test.p2;
+DROP TABLE IF EXISTS test.t1;
+--enable_warnings
+# End of cleanup
+
+# Begin test section 1
+
+eval CREATE TABLE test.t1(a INT,PRIMARY KEY(a))ENGINE=$engine_type;
+
+delimiter |;
+CREATE PROCEDURE test.p1()
+BEGIN
+ INSERT INTO test.t1 VALUES (4);
+ SELECT get_lock("test", 100);
+ UPDATE test.t1 set a=a+4 WHERE a=4;
+END|
+CREATE PROCEDURE test.p2()
+BEGIN
+ UPDATE test.t1 SET a=a+1;
+END|
+delimiter ;|
+
+SELECT get_lock("test", 200);
+
+connection master1;
+send CALL test.p1();
+
+connection master;
+# To make sure tha the call on master1 arrived at the get_lock
+sleep 1;
+CALL test.p2();
+SELECT release_lock("test");
+SELECT * FROM test.t1;
+#show binlog events;
+
+sync_slave_with_master;
+connection slave;
+SELECT * FROM test.t1;
+
+connection master;
+DROP TABLE IF EXISTS test.t1;
+eval CREATE TABLE test.t1(a INT,PRIMARY KEY(a))ENGINE=$engine_type;
+CALL test.p2();
+CALL test.p1();
+SELECT * FROM test.t1;
+
+sync_slave_with_master;
+connection slave;
+SELECT * FROM test.t1;
+connection master;
+#show binlog events from 719;
+
+DROP PROCEDURE IF EXISTS test.p1;
+DROP PROCEDURE IF EXISTS test.p2;
+DROP TABLE IF EXISTS test.t1;
+sync_slave_with_master;
+
+# End of 5.0 test case
diff --git a/mysql-test/extra/rpl_tests/rpl_row_sp006.test b/mysql-test/extra/rpl_tests/rpl_row_sp006.test
new file mode 100644
index 00000000000..272a7caf9ac
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_row_sp006.test
@@ -0,0 +1,90 @@
+#############################################################################
+# Original Author: JBM #
+# Original Date: Aug/15/2005 #
+# Updated: 08/29/2005 to remove sleeps #
+#############################################################################
+# Test: This test uses two SPs, one to populate a table, and another to use #
+# Cursors, CURRENT_DATE(), loop control, date math and logic control #
+# to populate a table with data from the first table. #
+#############################################################################
+
+# Includes
+-- source include/have_binlog_format_row.inc
+-- source include/master-slave.inc
+
+# Begin clean up test section
+connection master;
+--disable_warnings
+create database if not exists mysqltest1;
+DROP PROCEDURE IF EXISTS mysqltest1.p1;
+DROP PROCEDURE IF EXISTS mysqltest1.p2;
+DROP TABLE IF EXISTS mysqltest1.t2;
+DROP TABLE IF EXISTS mysqltest1.t1;
+--enable_warnings
+# End of cleanup
+
+# Begin test section 1
+eval CREATE TABLE IF NOT EXISTS mysqltest1.t1(name CHAR(16), birth DATE,PRIMARY KEY(name))ENGINE=$engine_type;
+eval CREATE TABLE IF NOT EXISTS mysqltest1.t2(name CHAR(16), age INT ,PRIMARY KEY(name))ENGINE=$engine_type;
+
+delimiter |;
+CREATE PROCEDURE mysqltest1.p1()
+BEGIN
+ DECLARE done INT DEFAULT 0;
+ DECLARE spa CHAR(16);
+ DECLARE spb INT;
+ DECLARE cur1 CURSOR FOR SELECT name,
+ (YEAR(CURDATE())-YEAR(birth))-(RIGHT(CURDATE(),5)<RIGHT(birth,5))
+ FROM mysqltest1.t1;
+ DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done = 1;
+
+ OPEN cur1;
+
+ SET AUTOCOMMIT=0;
+ REPEAT
+ FETCH cur1 INTO spa, spb;
+ IF NOT done THEN
+ START TRANSACTION;
+ INSERT INTO mysqltest1.t2 VALUES (spa,spb);
+ COMMIT;
+ END IF;
+ UNTIL done END REPEAT;
+
+ SET AUTOCOMMIT=1;
+ CLOSE cur1;
+END|
+CREATE PROCEDURE mysqltest1.p2()
+BEGIN
+ INSERT INTO mysqltest1.t1 VALUES ('MySQL','1993-02-04'),('ROCKS', '1990-08-27'),('Texas', '1999-03-30'),('kyle','2005-1-1');
+END|
+delimiter ;|
+
+CALL mysqltest1.p2();
+sync_slave_with_master;
+
+connection master;
+CALL mysqltest1.p1();
+sync_slave_with_master;
+
+connection master;
+
+--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info mysqltest1 > ./var/tmp/sp006_master.sql
+--exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info mysqltest1 > ./var/tmp/sp006_slave.sql
+
+
+DROP PROCEDURE IF EXISTS mysqltest1.p1;
+DROP PROCEDURE IF EXISTS mysqltest1.p2;
+DROP TABLE IF EXISTS mysqltest1.t1;
+DROP TABLE IF EXISTS mysqltest1.t2;
+
+# Lets compare. Note: If they match test will pass, if they do not match
+# the test will show that the diff statement failed and not reject file
+# will be created. You will need to go to the mysql-test dir and diff
+# the files your self to see what is not matching :-) Failed test
+# Dump files will be located in mysql-test/var/tmp.
+
+exec diff ./var/tmp/sp006_master.sql ./var/tmp/sp006_slave.sql;
+
+sync_slave_with_master;
+
+# End of 5.1 test case
diff --git a/mysql-test/extra/rpl_tests/rpl_row_sp007.test b/mysql-test/extra/rpl_tests/rpl_row_sp007.test
new file mode 100644
index 00000000000..8f2b72e4d32
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_row_sp007.test
@@ -0,0 +1,70 @@
+#############################################################################
+# Original Author: JBM #
+# Original Date: Aug/15/2005 #
+# Updated: 08/29/2005 Remove sleeps #
+#############################################################################
+# TEST: SP that creates table, starts tranaction inserts. Save point, insert#
+# rollback to save point and then commits. #
+#############################################################################
+# Includes
+-- source include/have_binlog_format_row.inc
+-- source include/master-slave.inc
+
+# Begin clean up test section
+connection master;
+--disable_warnings
+DROP PROCEDURE IF EXISTS test.p1;
+DROP TABLE IF EXISTS test.t1;
+--enable_warnings
+# End of cleanup
+
+# Begin test section 1
+delimiter |;
+eval CREATE PROCEDURE test.p1(IN i INT)
+BEGIN
+ DECLARE CONTINUE HANDLER FOR sqlexception BEGIN END;
+ DROP TABLE IF EXISTS test.t1;
+ CREATE TABLE test.t1 (num INT,PRIMARY KEY(num))ENGINE=$engine_type;
+ START TRANSACTION;
+ INSERT INTO test.t1 VALUES(i);
+ savepoint t1_save;
+ INSERT INTO test.t1 VALUES (14);
+ ROLLBACK to savepoint t1_save;
+ COMMIT;
+END|
+delimiter ;|
+
+let $message=< ---- Master selects-- >;
+--source include/show_msg.inc
+CALL test.p1(12);
+SELECT * FROM test.t1;
+
+
+let $message=< ---- Slave selects-- >;
+--source include/show_msg.inc
+save_master_pos;
+connection slave;
+sync_with_master;
+SELECT * FROM test.t1;
+
+let $message=< ---- Master selects-- >;
+--source include/show_msg.inc
+connection master;
+CALL test.p1(13);
+SELECT * FROM test.t1;
+
+let $message=< ---- Slave selects-- >;
+--source include/show_msg.inc
+save_master_pos;
+connection slave;
+sync_with_master;
+SELECT * FROM test.t1;
+
+connection master;
+#show binlog events;
+
+
+DROP PROCEDURE IF EXISTS test.p1;
+DROP TABLE IF EXISTS test.t1;
+
+# End of 5.0 test case
diff --git a/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test b/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test
new file mode 100644
index 00000000000..94a3af87ecd
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test
@@ -0,0 +1,129 @@
+# Test how replication of tables work when the definition on the
+# master and slave differs.
+
+# Consider making these part of the basic RBR tests.
+
+-- source include/have_binlog_format_row.inc
+-- source include/master-slave.inc
+
+connection master;
+eval CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=$engine_type;
+eval CREATE TABLE t2 (a INT PRIMARY KEY, b INT) ENGINE=$engine_type;
+eval CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE=$engine_type;
+eval CREATE TABLE t4 (a INT) ENGINE=$engine_type;
+eval CREATE TABLE t5 (a INT, b INT, c INT) ENGINE=$engine_type;
+eval CREATE TABLE t6 (a INT, b INT, c INT) ENGINE=$engine_type;
+
+# Table used to detect that slave is running
+eval CREATE TABLE t9 (a INT PRIMARY KEY) ENGINE=$engine_type;
+
+sync_slave_with_master;
+# On the slave, we add one column last in table 't1',
+ALTER TABLE t1 ADD x INT DEFAULT 42;
+# ... add one column in the middle of table 't2', and
+ALTER TABLE t2 ADD x INT DEFAULT 42 AFTER a;
+# ... add one column first in table 't3'.
+ALTER TABLE t3 ADD x INT DEFAULT 42 FIRST;
+# ... change the type of the single column in table 't4'
+ALTER TABLE t4 MODIFY a FLOAT;
+# ... change the type of the middle column of table 't5'
+ALTER TABLE t5 MODIFY b FLOAT;
+# ... change the type of the last column of table 't6'
+ALTER TABLE t6 MODIFY c FLOAT;
+
+# Each of these should generate an error and stop the slave
+connection master;
+INSERT INTO t9 VALUES (1);
+sync_slave_with_master;
+# Now slave is guaranteed to be running
+connection master;
+INSERT INTO t1 VALUES (1,2);
+connection slave;
+wait_for_slave_to_stop;
+--replace_result $MASTER_MYPORT MASTER_PORT
+--replace_column 1 # 8 # 9 # 23 # 33 #
+--vertical_results
+SHOW SLAVE STATUS;
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+
+connection master;
+INSERT INTO t9 VALUES (2);
+sync_slave_with_master;
+# Now slave is guaranteed to be running
+connection master;
+INSERT INTO t2 VALUES (2,4);
+connection slave;
+wait_for_slave_to_stop;
+--replace_result $MASTER_MYPORT MASTER_PORT
+--replace_column 1 # 8 # 9 # 23 # 33 #
+--vertical_results
+SHOW SLAVE STATUS;
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+
+connection master;
+INSERT INTO t9 VALUES (3);
+sync_slave_with_master;
+# Now slave is guaranteed to be running
+connection master;
+INSERT INTO t3 VALUES (3,6);
+connection slave;
+wait_for_slave_to_stop;
+--replace_result $MASTER_MYPORT MASTER_PORT
+--replace_column 1 # 8 # 9 # 23 # 33 #
+--vertical_results
+SHOW SLAVE STATUS;
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+
+connection master;
+INSERT INTO t9 VALUES (4);
+sync_slave_with_master;
+# Now slave is guaranteed to be running
+connection master;
+INSERT INTO t4 VALUES (4);
+connection slave;
+wait_for_slave_to_stop;
+--replace_result $MASTER_MYPORT MASTER_PORT
+--replace_column 1 # 8 # 9 # 23 # 33 #
+--vertical_results
+SHOW SLAVE STATUS;
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+
+connection master;
+INSERT INTO t9 VALUES (5);
+sync_slave_with_master;
+# Now slave is guaranteed to be running
+connection master;
+INSERT INTO t5 VALUES (5,10,25);
+connection slave;
+wait_for_slave_to_stop;
+--replace_result $MASTER_MYPORT MASTER_PORT
+--replace_column 1 # 8 # 9 # 23 # 33 #
+--vertical_results
+SHOW SLAVE STATUS;
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+
+connection master;
+INSERT INTO t9 VALUES (6);
+sync_slave_with_master;
+# Now slave is guaranteed to be running
+connection master;
+INSERT INTO t6 VALUES (6,12,36);
+connection slave;
+wait_for_slave_to_stop;
+--replace_result $MASTER_MYPORT MASTER_PORT
+--replace_column 1 # 8 # 9 # 23 # 33 #
+--vertical_results
+SHOW SLAVE STATUS;
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+
+connection master;
+--disable_warnings
+DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t9;
+--enable_warnings
+sync_slave_with_master;
diff --git a/mysql-test/t/rpl000001.test b/mysql-test/extra/rpl_tests/rpl_stm_000001.test
index 45d621b730f..fb2749a0764 100644
--- a/mysql-test/t/rpl000001.test
+++ b/mysql-test/extra/rpl_tests/rpl_stm_000001.test
@@ -1,4 +1,5 @@
-source include/master-slave.inc;
+-- source include/have_binlog_format_statement.inc
+-- source include/master-slave.inc
create table t1 (word char(20) not null);
load data infile '../../std_data/words.dat' into table t1;
@@ -44,7 +45,7 @@ sync_with_master;
connection master;
# we'll use table-level locking to delay slave SQL thread
-create table t1 (n int) engine=myisam;
+eval create table t1 (n int) engine=$engine_type;
sync_slave_with_master;
connection master;
reset master;
diff --git a/mysql-test/t/rpl_EE_error.test b/mysql-test/extra/rpl_tests/rpl_stm_EE_err.test
index 72df0c20ef8..9c7361093c3 100644
--- a/mysql-test/t/rpl_EE_error.test
+++ b/mysql-test/extra/rpl_tests/rpl_stm_EE_err.test
@@ -1,12 +1,18 @@
+# The test is not relevant when testing replication of error codes for
+# statements that are not replicated. The test below could be changed
+# to rely on the replication of error codes for statements that are not
+# replicated row-based.
+-- source include/have_binlog_format_statement.inc
+
# See if an EE_ error in one event of the master's binlog stops replication
# (it should not: in this configuration the EE_ error is probably not
# critical). Example: you do a DROP TABLE on a table which has no MYI file
# check if START SLAVE, RESET SLAVE, CHANGE MASTER reset Last_slave_error and
# Last_slave_errno in SHOW SLAVE STATUS (1st and 3rd commands did not: bug 986).
-source include/master-slave.inc;
+-- source include/master-slave.inc
-create table t1 (a int) engine=myisam;
+eval create table t1 (a int) engine=$engine_type;
flush tables;
system rm ./var/master-data/test/t1.MYI ;
drop table if exists t1;
@@ -17,7 +23,7 @@ sync_with_master;
# Now a real error.
connection master;
-create table t1 (a int, unique(a)) engine=myisam;
+eval create table t1 (a int, unique(a)) engine=$engine_type;
set sql_log_bin=0;
insert into t1 values(2);
set sql_log_bin=1;
diff --git a/mysql-test/t/rpl_charset.test b/mysql-test/extra/rpl_tests/rpl_stm_charset.test
index e5ddf084461..e05bbb49c4a 100644
--- a/mysql-test/t/rpl_charset.test
+++ b/mysql-test/extra/rpl_tests/rpl_stm_charset.test
@@ -1,6 +1,9 @@
# Replication of character sets.
# This test will fail if the server/client does not support enough charsets.
+# Requires statement logging
+-- source include/have_binlog_format_statement.inc
+
source include/master-slave.inc;
--disable_warnings
set timestamp=1000000000;
@@ -107,7 +110,7 @@ connection master;
drop database mysqltest2;
drop database mysqltest3;
--replace_column 2 # 5 #
-show binlog events from 98;
+show binlog events from 102;
sync_slave_with_master;
# Check that we can change global.collation_server (since 5.0.3)
@@ -161,10 +164,10 @@ sync_slave_with_master;
# BUG#6676: Derivation of variables must be correct on slave
#
connection master;
-create table `t1` (
+eval create table `t1` (
`pk` varchar(10) not null default '',
primary key (`pk`)
-) engine=myisam default charset=latin1;
+) engine=$engine_type default charset=latin1;
set @p=_latin1 'test';
update t1 set pk='test' where pk=@p;
drop table t1;
diff --git a/mysql-test/extra/rpl_tests/rpl_trig004.test b/mysql-test/extra/rpl_tests/rpl_trig004.test
new file mode 100644
index 00000000000..17031421bbe
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_trig004.test
@@ -0,0 +1,46 @@
+#############################################################################
+# Original Author: JBM #
+# Original Date: Aug/09/2005 #
+#############################################################################
+# TEST: Use after insert and before inset triggers and stored procdures to #
+# Update and insert data #
+#############################################################################
+
+
+# Begin clean up test section
+connection master;
+--disable_warnings
+--error 0,1360
+DROP TRIGGER test.t1_bi_t2;
+DROP TABLE IF EXISTS test.t1;
+DROP TABLE IF EXISTS test.t2;
+
+
+eval CREATE TABLE test.t1 (n MEDIUMINT NOT NULL AUTO_INCREMENT, d FLOAT, PRIMARY KEY(n))ENGINE=$engine_type;
+eval CREATE TABLE test.t2 (n MEDIUMINT NOT NULL, f FLOAT, PRIMARY KEY(n))ENGINE=$engine_type;
+
+
+delimiter //;
+CREATE TRIGGER test.t1_bi_t2 BEFORE INSERT ON test.t2 FOR EACH ROW INSERT INTO test.t1 VALUES (NULL, 1.234)//
+delimiter ;//
+
+INSERT INTO test.t2 VALUES (1, 0.0);
+--error 0,1062
+INSERT INTO test.t2 VALUES (1, 0.0);
+
+#show binlog events;
+select * from test.t1;
+select * from test.t2;
+sync_slave_with_master;
+connection slave;
+select * from test.t1;
+select * from test.t2;
+
+connection master;
+
+DROP TRIGGER test.t1_bi_t2;
+DROP TABLE test.t1;
+DROP TABLE test.t2;
+
+sync_slave_with_master;
+# End of 5.0 test case
diff --git a/mysql-test/t/rpl_user_variables.test b/mysql-test/extra/rpl_tests/rpl_user_variables.test
index e8985397703..256c244d4eb 100644
--- a/mysql-test/t/rpl_user_variables.test
+++ b/mysql-test/extra/rpl_tests/rpl_user_variables.test
@@ -1,7 +1,8 @@
+# row-based and statement binlog difference in result files
#
# Test of replicating user variables
#
-source include/master-slave.inc;
+-- source include/master-slave.inc
# Disable PS as the log positions differs
--disable_ps_protocol
@@ -39,20 +40,15 @@ set @q:='abc';
insert t1 values (@q), (@q:=concat(@q, 'n1')), (@q:=concat(@q, 'n2'));
set @a:=5;
insert into t1 values (@a),(@a);
+# To flush the pending event, we add the following statement. RBR can
+# concatenate the result of several statements, which SBR cannot.
+select * from t1 where n = '<nonexistant>';
connection master1; # see if variable is reset in binlog when thread changes
insert into t1 values (@a),(@a),(@a*5);
select * from t1;
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
select * from t1;
---replace_column 2 # 5 #
-show binlog events from 98;
connection master;
drop table t1;
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
stop slave;
-
-# End of 4.1 tests
diff --git a/mysql-test/include/have_binlog_format_row.inc b/mysql-test/include/have_binlog_format_row.inc
new file mode 100644
index 00000000000..2992b8e0f32
--- /dev/null
+++ b/mysql-test/include/have_binlog_format_row.inc
@@ -0,0 +1,4 @@
+-- require r/have_binlog_format_row.require
+disable_query_log;
+show variables like "binlog_format";
+enable_query_log;
diff --git a/mysql-test/include/have_binlog_format_statement.inc b/mysql-test/include/have_binlog_format_statement.inc
new file mode 100644
index 00000000000..c99297c10e5
--- /dev/null
+++ b/mysql-test/include/have_binlog_format_statement.inc
@@ -0,0 +1,4 @@
+-- require r/have_binlog_format_statement.require
+disable_query_log;
+show variables like "binlog_format";
+enable_query_log;
diff --git a/mysql-test/include/have_row_based.inc b/mysql-test/include/have_row_based.inc
new file mode 100644
index 00000000000..23771fde5cc
--- /dev/null
+++ b/mysql-test/include/have_row_based.inc
@@ -0,0 +1,4 @@
+-- require r/have_row_based.require
+disable_query_log;
+show variables like "have_row_based_replication";
+enable_query_log;
diff --git a/mysql-test/include/not_row_based.inc b/mysql-test/include/not_row_based.inc
new file mode 100644
index 00000000000..22f40bdceb0
--- /dev/null
+++ b/mysql-test/include/not_row_based.inc
@@ -0,0 +1,4 @@
+-- require r/not_row_based.require
+disable_query_log;
+show variables like "have_row_based_replication";
+enable_query_log;
diff --git a/mysql-test/include/rpl_multi_engine.inc b/mysql-test/include/rpl_multi_engine.inc
new file mode 100644
index 00000000000..f2c837ef90b
--- /dev/null
+++ b/mysql-test/include/rpl_multi_engine.inc
@@ -0,0 +1,16 @@
+connection master;
+INSERT INTO t1 VALUES(42,1,'Testing MySQL databases is a cool ', 'Must make it bug free for the customer',654321.4321,15.21,0,1965,"2005-11-14");
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+sync_slave_with_master;
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+connection master;
+UPDATE t1 SET b1 = 0, t="2005-09-09" WHERE b1 = 1;
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+sync_slave_with_master;
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+connection master;
+DELETE FROM mysqltest1.t1 WHERE id = 42;
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+sync_slave_with_master;
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+connection master;
diff --git a/mysql-test/include/rpl_row_basic.inc b/mysql-test/include/rpl_row_basic.inc
new file mode 100644
index 00000000000..9f1cc186388
--- /dev/null
+++ b/mysql-test/include/rpl_row_basic.inc
@@ -0,0 +1,249 @@
+--source include/have_row_based.inc
+--source include/have_binlog_format_row.inc
+--source include/master-slave.inc
+
+#
+# Basic tests of row-level logging
+#
+
+#
+# First we test tables with only an index.
+#
+
+eval CREATE TABLE t1 (C1 CHAR(1), C2 CHAR(1), INDEX (C1)$extra_index_t1) ENGINE = $type ;
+SELECT * FROM t1;
+sync_slave_with_master;
+SELECT * FROM t1;
+
+# Testing insert
+connection master;
+INSERT INTO t1 VALUES ('A','B'), ('X','Y'), ('X','X');
+INSERT INTO t1 VALUES ('A','C'), ('X','Z'), ('A','A');
+SELECT * FROM t1 ORDER BY C1,C2;
+sync_slave_with_master;
+SELECT * FROM t1 ORDER BY C1,C2;
+
+# Testing delete
+# Observe that are several rows having the value for the index but only one
+# should be deleted.
+connection master;
+DELETE FROM t1 WHERE C1 = C2;
+SELECT * FROM t1 ORDER BY C1,C2;
+sync_slave_with_master;
+SELECT * FROM t1 ORDER BY C1,C2;
+
+#
+# Testing update.
+# Note that we have a condition on a column that is not part of the index for
+# the table. The right row should be updated nevertheless.
+#
+connection master;
+UPDATE t1 SET C2 = 'I' WHERE C1 = 'A' AND C2 = 'C';
+SELECT * FROM t1 ORDER BY C1,C2;
+sync_slave_with_master;
+SELECT * FROM t1 ORDER BY C1,C2;
+
+# Testing update with a condition that does not match any rows, but
+# which has a match for the index.
+connection master;
+UPDATE t1 SET c2 = 'Q' WHERE c1 = 'A' AND c2 = 'N';
+SELECT * FROM t1 ORDER BY c1,c2;
+sync_slave_with_master;
+SELECT * FROM t1 ORDER BY c1,c2;
+
+#
+# Testing table with primary key
+#
+connection master;
+eval CREATE TABLE t2 (c1 INT, c12 char(1), c2 INT, PRIMARY KEY (c1)) ENGINE = $type ;
+INSERT INTO t2
+ VALUES (1,'A',2), (2,'A',4), (3,'A',9), (4,'A',15), (5,'A',25),
+ (6,'A',35), (7,'A',50), (8,'A',64), (9,'A',81);
+SELECT * FROM t2 ORDER BY c1,c2;
+SELECT * FROM t2 WHERE c2 = c1 * c1 ORDER BY c1,c2;
+sync_slave_with_master;
+SELECT * FROM t2 ORDER BY c1,c2;
+SELECT * FROM t2 WHERE c2 = c1 * c1 ORDER BY c1,c2;
+
+connection master;
+UPDATE t2 SET c2 = c1*c1 WHERE c2 != c1*c1;
+SELECT * FROM t2 WHERE c2 = c1 * c1 ORDER BY c1,c2;
+sync_slave_with_master;
+SELECT * FROM t2 WHERE c2 = c1 * c1 ORDER BY c1,c2;
+
+# Testing update with a condition that does not match any rows, but
+# which has a match for the primary key.
+connection master;
+UPDATE t2 SET c12 = 'Q' WHERE c1 = 1 AND c2 = 999;
+SELECT * FROM t2 ORDER BY c1,c2;
+sync_slave_with_master;
+SELECT * FROM t2 ORDER BY c1,c2;
+
+connection master;
+DELETE FROM t2 WHERE c1 % 4 = 0;
+SELECT * FROM t2 ORDER BY c1,c2;
+sync_slave_with_master;
+SELECT * FROM t2 ORDER BY c1,c2;
+
+connection master;
+UPDATE t2 SET c12='X';
+
+#
+# Testing table with a multi-column primary key.
+#
+connection master;
+eval CREATE TABLE t3 (C1 CHAR(1), C2 CHAR(1), pk1 INT, C3 CHAR(1), pk2 INT, PRIMARY KEY (pk1,pk2)) ENGINE = $type ;
+
+INSERT INTO t3 VALUES ('A','B',1,'B',1), ('X','Y',2,'B',1), ('X','X',3,'B',1);
+INSERT INTO t3 VALUES ('A','C',1,'B',2), ('X','Z',2,'B',2), ('A','A',3,'B',2);
+SELECT * FROM t3 ORDER BY C1,C2;
+sync_slave_with_master;
+SELECT * FROM t3 ORDER BY C1,C2;
+
+connection master;
+DELETE FROM t3 WHERE C1 = C2;
+SELECT * FROM t3 ORDER BY C1,C2;
+sync_slave_with_master;
+SELECT * FROM t3 ORDER BY C1,C2;
+
+connection master;
+UPDATE t3 SET C2 = 'I' WHERE C1 = 'A' AND C2 = 'C';
+SELECT * FROM t3 ORDER BY C1,C2;
+sync_slave_with_master;
+SELECT * FROM t3 ORDER BY C1,C2;
+
+#
+# Testing table without index or primary key
+#
+connection master;
+eval CREATE TABLE t6 (C1 CHAR(1), C2 CHAR(1), C3 INT$extra_index_t6) ENGINE = $type;
+
+# Testing insert
+INSERT INTO t6 VALUES ('A','B',1), ('X','Y',2), ('X','X',3);
+INSERT INTO t6 VALUES ('A','C',4), ('X','Z',5), ('A','A',6);
+SELECT * FROM t6 ORDER BY C3;
+sync_slave_with_master;
+SELECT * FROM t6 ORDER BY C3;
+
+# Testing delete
+# Observe that are several rows having the value for the index but only one
+# should be deleted.
+connection master;
+DELETE FROM t6 WHERE C1 = C2;
+SELECT * FROM t6 ORDER BY C3;
+sync_slave_with_master;
+SELECT * FROM t6 ORDER BY C3;
+
+#
+# Testing update.
+# Note that we have a condition on a column that is not part of the index for
+# the table. The right row should be updated nevertheless.
+#
+connection master;
+UPDATE t6 SET C2 = 'I' WHERE C1 = 'A' AND C2 = 'C';
+SELECT * FROM t6 ORDER BY C3;
+sync_slave_with_master;
+SELECT * FROM t6 ORDER BY C3;
+
+# now mixing the 3 tables without begin/commit
+connection master;
+eval CREATE TABLE t5 (C1 CHAR(1), C2 CHAR(1), C3 INT PRIMARY KEY) ENGINE = $type ;
+INSERT INTO t5 VALUES ('A','B',1), ('X','Y',2), ('X','X',3);
+INSERT INTO t5 VALUES ('A','C',4), ('X','Z',5), ('A','A',6);
+
+UPDATE t5,t2,t3 SET t5.C2='Q', t2.c12='R', t3.C3 ='S' WHERE t5.C1 = t2.c12 AND t5.C1 = t3.C1;
+SELECT * FROM t5,t2,t3 WHERE t5.C2='Q' AND t2.c12='R' AND t3.C3 ='S' ORDER BY t5.C3,t2.c1,t3.pk1,t3.pk2;
+sync_slave_with_master;
+SELECT * FROM t5,t2,t3 WHERE t5.C2='Q' AND t2.c12='R' AND t3.C3 ='S' ORDER BY t5.C3,t2.c1,t3.pk1,t3.pk2;
+
+#
+# Testing special column types
+#
+
+connection master;
+eval CREATE TABLE t4 (C1 CHAR(1) PRIMARY KEY, B1 BIT(1), B2 BIT(1) NOT NULL DEFAULT 0, C2 CHAR(1) NOT NULL DEFAULT 'A') ENGINE = $type ;
+
+INSERT INTO t4 SET C1 = 1;
+SELECT C1,HEX(B1),HEX(B2) FROM t4 ORDER BY C1;
+sync_slave_with_master;
+SELECT C1,HEX(B1),HEX(B2) FROM t4 ORDER BY C1;
+
+#
+# Testing conflicting operations
+#
+connection master;
+eval CREATE TABLE t7 (C1 INT PRIMARY KEY, C2 INT) ENGINE = $type ;
+sync_slave_with_master;
+--disable_query_log
+SELECT "--- on slave: original values ---" AS "";
+--enable_query_log
+INSERT INTO t7 VALUES (1,3), (2,6), (3,9);
+SELECT * FROM t7 ORDER BY C1;
+
+connection master;
+--disable_query_log
+SELECT "--- on master: new values inserted ---" AS "";
+--enable_query_log
+INSERT INTO t7 VALUES (1,2), (2,4), (3,6);
+SELECT * FROM t7 ORDER BY C1;
+sync_slave_with_master;
+--disable_query_log
+SELECT "--- on slave: old values should be overwritten by replicated values ---" AS "";
+--enable_query_log
+SELECT * FROM t7 ORDER BY C1;
+
+#
+# A more complicated test where the table has several keys and we are
+# causing a conflict for a key that is not "last".
+#
+connection master;
+--disable_query_log
+SELECT "--- on master ---" AS "";
+--enable_query_log
+DROP TABLE t7;
+eval CREATE TABLE t7 (a INT PRIMARY KEY, b INT UNIQUE, c INT UNIQUE) ENGINE = $type ;
+
+# First we make sure that the constraints are correctly set.
+INSERT INTO t7 VALUES (99,99,99);
+--error 1062
+INSERT INTO t7 VALUES (99,22,33);
+--error 1062
+INSERT INTO t7 VALUES (11,99,33);
+--error 1062
+INSERT INTO t7 VALUES (11,22,99);
+SELECT * FROM t7 ORDER BY a;
+
+sync_slave_with_master;
+--disable_query_log
+SELECT "--- on slave ---" AS "";
+--enable_query_log
+SELECT * FROM t7 ORDER BY a;
+INSERT INTO t7 VALUES (1,2,3), (2,4,6), (3,6,9);
+SELECT * FROM t7 ORDER BY a;
+
+connection master;
+--disable_query_log
+SELECT "--- on master ---" AS "";
+--enable_query_log
+# We insert a row that will cause conflict on the primary key but not
+# on the other keys.
+INSERT INTO t7 VALUES (2,4,8);
+sync_slave_with_master;
+--disable_query_log
+SELECT "--- on slave ---" AS "";
+--enable_query_log
+SELECT * FROM t7 ORDER BY a;
+
+#
+# Test conflicting operations when changing in a table referenced by a
+# foreign key. We'll reuse the above table and just add a table that
+# references it.
+#
+
+#
+# cleanup
+#
+
+connection master;
+DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7;
+sync_slave_with_master;
diff --git a/mysql-test/include/rpl_stmt_seq2.inc b/mysql-test/include/rpl_stmt_seq2.inc
new file mode 100644
index 00000000000..7671a6a857c
--- /dev/null
+++ b/mysql-test/include/rpl_stmt_seq2.inc
@@ -0,0 +1,201 @@
+# include/rpl_stmt_seq.inc
+#
+# Please be very careful when editing this routine, because the handling of
+# the $variables is extreme sensitive.
+#
+
+###############################################################
+# Debug options : To debug this test script
+###############################################################
+let $show_binlog= 0;
+let $manipulate= 1;
+
+######## The typical test sequence
+# 1. INSERT without commit
+# check table content of master and slave
+# 2. EXECUTE the statement
+# check table content of master and slave
+# 3. ROLLBACK
+# check table content of master and slave
+# 4. flush the logs
+
+let $VERSION=`select version()`;
+
+--disable_query_log
+# SELECT '######## new test sequence ########' as "";
+eval SELECT CONCAT('######## ','$my_stmt',' $engine_type',' ########') as "";
+--enable_query_log
+
+
+###############################################################
+# Predict the number of the current log
+###############################################################
+# Disable the logging of the log number computation.
+--disable_query_log
+# $_log_num_n should contain the number of the current binlog in numeric style.
+# If this routine is called for the first time, $_log_num will not initialized
+# and contain the value '' instead of '1'. So we will correct it here.
+#
+eval set @aux= IF('$_log_num_n' = '', '1', '$_log_num_n');
+let $_log_num_n= `SELECT @aux`;
+eval set @aux= LPAD('$_log_num_n',6,'0');
+# SELECT @aux AS "@aux is";
+#
+# $_log_num_s should contain the number of the current binlog in string style.
+let $_log_num_s= `select @aux`;
+# eval SELECT '$log_num' ;
+--enable_query_log
+
+###############################################################
+# INSERT
+###############################################################
+connection master;
+--disable_query_log
+SELECT '-------- switch to master -------' as "";
+--enable_query_log
+# Maybe it would be smarter to use a table with autoincrement column.
+let $MAX= `SELECT MAX(f1) FROM t1` ;
+eval INSERT INTO t1 SET f1= $MAX + 1;
+# results before DDL(to be tested)
+SELECT MAX(f1) FROM t1;
+if ($show_binlog)
+{
+--replace_result $VERSION VERSION
+--replace_column 2 # 5 #
+eval SHOW BINLOG EVENTS IN 'master-bin.$_log_num_s';
+}
+sync_slave_with_master;
+
+connection slave;
+--disable_query_log
+SELECT '-------- switch to slave --------' as "";
+--enable_query_log
+# results before DDL(to be tested)
+SELECT MAX(f1) FROM t1;
+if ($show_binlog)
+{
+--replace_result $VERSION VERSION
+--replace_column 2 # 5 #
+eval SHOW BINLOG EVENTS IN 'slave-bin.$_log_num_s';
+}
+
+###############################################################
+# command to be tested
+###############################################################
+connection master;
+--disable_query_log
+SELECT '-------- switch to master -------' as "";
+--enable_query_log
+eval $my_stmt $engine_type;
+# Devaluate $my_stmt, to detect script bugs
+let $my_stmt= ERROR: YOU FORGOT TO FILL IN THE STATEMENT;
+# results after DDL(to be tested)
+SELECT MAX(f1) FROM t1;
+if ($show_binlog)
+{
+--replace_result $VERSION VERSION
+--replace_column 2 # 5 #
+eval SHOW BINLOG EVENTS IN 'master-bin.$_log_num_s';
+}
+sync_slave_with_master;
+
+connection slave;
+--disable_query_log
+SELECT '-------- switch to slave --------' as "";
+--enable_query_log
+# results after DDL(to be tested)
+SELECT MAX(f1) FROM t1;
+if ($show_binlog)
+{
+--replace_result $VERSION VERSION
+--replace_column 2 # 5 #
+eval SHOW BINLOG EVENTS IN 'slave-bin.$_log_num_s';
+}
+
+###############################################################
+# ROLLBACK
+###############################################################
+connection master;
+--disable_query_log
+SELECT '-------- switch to master -------' as "";
+--enable_query_log
+ROLLBACK;
+# results after final ROLLBACK
+SELECT MAX(f1) FROM t1;
+# Try to detect if the DDL command caused that the INSERT is committed
+# $MAX holds the highest/last value just before the insert of MAX + 1
+--disable_query_log
+eval SELECT CONCAT(CONCAT('TEST-INFO: MASTER: The INSERT is ',
+ IF(MAX(f1) = $MAX + 1, 'committed', 'not committed')),
+ IF((MAX(f1) = $MAX + 1) XOR NOT $my_master_commit,
+ ' (Succeeded)',
+ ' (Failed)')) AS ""
+ FROM mysqltest1.t1;
+--enable_query_log
+if ($show_binlog)
+{
+--replace_result $VERSION VERSION
+--replace_column 2 # 5 #
+eval SHOW BINLOG EVENTS IN 'master-bin.$_log_num_s';
+}
+sync_slave_with_master;
+
+connection slave;
+--disable_query_log
+SELECT '-------- switch to slave --------' as "";
+--enable_query_log
+# results after final ROLLBACK
+SELECT MAX(f1) FROM t1;
+--disable_query_log
+eval SELECT CONCAT(CONCAT('TEST-INFO: SLAVE: The INSERT is ',
+ IF(MAX(f1) = $MAX + 1, 'committed', 'not committed')),
+ IF((MAX(f1) = $MAX + 1) XOR NOT $my_slave_commit,
+ ' (Succeeded)',
+ ' (Failed)')) AS ""
+ FROM mysqltest1.t1;
+--enable_query_log
+if ($show_binlog)
+{
+--replace_result $VERSION VERSION
+--replace_column 2 # 5 #
+eval SHOW BINLOG EVENTS IN 'slave-bin.$_log_num_s';
+}
+
+###############################################################
+# Manipulate binlog
+###############################################################
+if ($manipulate)
+{
+#### Manipulate the binary logs,
+# so that the output of SHOW BINLOG EVENTS IN <current log>
+# contains only commands of the current test sequence.
+# - flush the master and the slave log
+# ---> both start to write into new logs with incremented number
+# - increment $_log_num_n
+connection master;
+--disable_query_log
+SELECT '-------- switch to master -------' as "";
+--enable_query_log
+flush logs;
+# sleep 1;
+# eval SHOW BINLOG EVENTS IN 'master-bin.$_log_num_s';
+sync_slave_with_master;
+
+connection slave;
+--disable_query_log
+SELECT '-------- switch to slave --------' as "";
+--enable_query_log
+# the final content of the binary log
+flush logs;
+# The next sleep is urgent needed.
+# Without this sleep the slaves crashes often, when the SHOW BINLOG
+# is executed. :-(
+# sleep 1;
+# eval SHOW BINLOG EVENTS IN 'slave-bin.$_log_num_s';
+inc $_log_num_n;
+}
+
+connection master;
+--disable_query_log
+SELECT '-------- switch to master -------' as "";
+--enable_query_log
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index 650c2b343f6..95968e1511e 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -2042,6 +2042,7 @@ sub mysqld_arguments ($$$$$) {
mtr_add_arg($args, "%s--character-sets-dir=%s", $prefix, $path_charsetsdir);
mtr_add_arg($args, "%s--core", $prefix);
mtr_add_arg($args, "%s--log-bin-trust-function-creators", $prefix);
+ mtr_add_arg($args, "%s--loose-binlog-show-xid=0", $prefix);
mtr_add_arg($args, "%s--default-character-set=latin1", $prefix);
mtr_add_arg($args, "%s--language=%s", $prefix, $path_language);
mtr_add_arg($args, "%s--tmpdir=$opt_tmpdir", $prefix);
@@ -2165,6 +2166,7 @@ sub mysqld_arguments ($$$$$) {
mtr_add_arg($args, "%s--sort_buffer=256K", $prefix);
mtr_add_arg($args, "%s--max_heap_table_size=1M", $prefix);
mtr_add_arg($args, "%s--log-bin-trust-function-creators", $prefix);
+ mtr_add_arg($args, "%s--loose-binlog-show-xid=0", $prefix);
if ( $opt_ssl_supported )
{
@@ -2485,6 +2487,10 @@ sub run_mysqltest ($) {
my $cmdline_mysqldump= "$exe_mysqldump --no-defaults -uroot " .
"--port=$master->[0]->{'path_myport'} " .
"--socket=$master->[0]->{'path_mysock'} --password=";
+
+ my $cmdline_mysqldumpslave= "$exe_mysqldump --no-defaults -uroot " .
+ "--socket=$slave->[0]->{'path_mysock'} --password=";
+
if ( $opt_debug )
{
$cmdline_mysqldump .=
@@ -2568,6 +2574,7 @@ sub run_mysqltest ($) {
$ENV{'MYSQL_DUMP'}= $cmdline_mysqldump;
$ENV{'MYSQL_SLAP'}= $cmdline_mysqlslap unless $glob_win32;
$ENV{'MYSQL_IMPORT'}= $cmdline_mysqlimport;
+ $ENV{'MYSQL_DUMP_SLAVE'}= $cmdline_mysqldumpslave;
$ENV{'MYSQL_SHOW'}= $cmdline_mysqlshow;
$ENV{'MYSQL_BINLOG'}= $cmdline_mysqlbinlog;
$ENV{'MYSQL_FIX_SYSTEM_TABLES'}= $cmdline_mysql_fix_system_tables;
diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh
index 5fc8f50dd47..3300e1a21a5 100644
--- a/mysql-test/mysql-test-run.sh
+++ b/mysql-test/mysql-test-run.sh
@@ -806,12 +806,13 @@ export MYSQL_DUMP_DIR
MYSQL_CHECK="$MYSQL_CHECK --no-defaults -uroot --socket=$MASTER_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLCHECK_OPT"
MYSQL_DUMP="$MYSQL_DUMP --no-defaults -uroot --socket=$MASTER_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLDUMP_OPT"
MYSQL_SLAP="$MYSQL_SLAP -uroot --socket=$MASTER_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLSLAP_OPT"
+MYSQL_DUMP_SLAVE="$MYSQL_DUMP_DIR --no-defaults -uroot --socket=$SLAVE_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLDUMP_OPT"
MYSQL_SHOW="$MYSQL_SHOW -uroot --socket=$MASTER_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLSHOW_OPT"
MYSQL_BINLOG="$MYSQL_BINLOG --no-defaults --local-load=$MYSQL_TMP_DIR --character-sets-dir=$CHARSETSDIR $EXTRA_MYSQLBINLOG_OPT"
MYSQL_IMPORT="$MYSQL_IMPORT -uroot --socket=$MASTER_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLDUMP_OPT"
MYSQL_FIX_SYSTEM_TABLES="$MYSQL_FIX_SYSTEM_TABLES --no-defaults --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --user=root --password=$DBPASSWD --basedir=$BASEDIR --bindir=$CLIENT_BINDIR --verbose"
MYSQL="$MYSQL --no-defaults --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --user=root --password=$DBPASSWD"
-export MYSQL MYSQL_CHECK MYSQL_DUMP MYSQL_SHOW MYSQL_BINLOG MYSQL_FIX_SYSTEM_TABLES MYSQL_IMPORT
+export MYSQL MYSQL_CHECK MYSQL_DUMP MYSQL_DUMP_SLAVE MYSQL_SHOW MYSQL_BINLOG MYSQL_FIX_SYSTEM_TABLES MYSQL_IMPORT
export CLIENT_BINDIR MYSQL_CLIENT_TEST CHARSETSDIR MYSQL_MY_PRINT_DEFAULTS
export MYSQL_SLAP
export NDB_TOOLS_DIR
@@ -1287,9 +1288,10 @@ start_master()
--innodb_data_file_path=ibdata1:128M:autoextend \
--open-files-limit=1024 \
--log-bin-trust-function-creators \
+ --loose-binlog-show-xid=0 \
$MASTER_40_ARGS \
$SMALL_SERVER \
- $EXTRA_MASTER_OPT $EXTRA_MASTER_MYSQLD_OPT \
+ $EXTRA_MASTER_MYSQLD_OPT $EXTRA_MASTER_OPT \
$NOT_FIRST_MASTER_EXTRA_OPTS $CURR_MASTER_MYSQLD_TRACE"
else
master_args="--no-defaults --log-bin=$MYSQL_TEST_DIR/var/log/master-bin$1 \
@@ -1308,9 +1310,10 @@ start_master()
--language=$LANGUAGE \
--innodb_data_file_path=ibdata1:128M:autoextend \
--log-bin-trust-function-creators \
+ --loose-binlog-show-xid=0 \
$MASTER_40_ARGS \
$SMALL_SERVER \
- $EXTRA_MASTER_OPT $EXTRA_MASTER_MYSQLD_OPT \
+ $EXTRA_MASTER_MYSQLD_OPT $EXTRA_MASTER_OPT \
$NOT_FIRST_MASTER_EXTRA_OPTS"
fi
@@ -1441,8 +1444,9 @@ start_slave()
--master-retry-count=10 \
-O slave_net_timeout=10 \
--log-bin-trust-function-creators \
+ --loose-binlog-show-xid=0 \
$SMALL_SERVER \
- $EXTRA_SLAVE_OPT $EXTRA_SLAVE_MYSQLD_OPT"
+ $EXTRA_SLAVE_MYSQLD_OPT $EXTRA_SLAVE_OPT"
CUR_MYERR=$slave_err
CUR_MYSOCK=$slave_sock
diff --git a/mysql-test/r/binlog_row_binlog.result b/mysql-test/r/binlog_row_binlog.result
new file mode 100644
index 00000000000..df69ca29b2f
--- /dev/null
+++ b/mysql-test/r/binlog_row_binlog.result
@@ -0,0 +1,237 @@
+drop table if exists t1, t2;
+reset master;
+create table t1 (a int) engine=bdb;
+create table t2 (a int) engine=innodb;
+begin;
+insert t1 values (5);
+commit;
+begin;
+insert t2 values (5);
+commit;
+show binlog events from 102;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query 1 # use `test`; create table t1 (a int) engine=bdb
+master-bin.000001 # Query 1 # use `test`; create table t2 (a int) engine=innodb
+master-bin.000001 # Query 1 # use `test`; BEGIN
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Query 1 # use `test`; COMMIT
+master-bin.000001 # Query 1 # use `test`; BEGIN
+master-bin.000001 # Table_map 1 # test.t2
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Xid 1 # COMMIT /* xid= */
+drop table t1,t2;
+reset master;
+create table t1 (n int) engine=innodb;
+begin;
+commit;
+drop table t1;
+show binlog events in 'master-bin.000001' from 102;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query 1 # use `test`; create table t1 (n int) engine=innodb
+master-bin.000001 # Query 1 # use `test`; BEGIN
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Xid 1 # COMMIT /* xid= */
+master-bin.000001 # Rotate 1 # master-bin.000002;pos=4
+show binlog events in 'master-bin.000002' from 102;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000002 # Query 1 # use `test`; drop table t1
diff --git a/mysql-test/r/binlog_row_blackhole.result b/mysql-test/r/binlog_row_blackhole.result
new file mode 100644
index 00000000000..5c79f27bdf5
--- /dev/null
+++ b/mysql-test/r/binlog_row_blackhole.result
@@ -0,0 +1,146 @@
+drop table if exists t1,t2;
+CREATE TABLE t1 (
+Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL,
+Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL
+) ENGINE=blackhole;
+INSERT INTO t1 VALUES (9410,9412);
+select period from t1;
+period
+select * from t1;
+Period Varor_period
+select t1.* from t1;
+Period Varor_period
+CREATE TABLE t2 (
+auto int NOT NULL auto_increment,
+fld1 int(6) unsigned zerofill DEFAULT '000000' NOT NULL,
+companynr tinyint(2) unsigned zerofill DEFAULT '00' NOT NULL,
+fld3 char(30) DEFAULT '' NOT NULL,
+fld4 char(35) DEFAULT '' NOT NULL,
+fld5 char(35) DEFAULT '' NOT NULL,
+fld6 char(4) DEFAULT '' NOT NULL,
+primary key (auto)
+) ENGINE=blackhole;
+INSERT INTO t2 VALUES (1192,068305,00,'Colombo','hardware','colicky','');
+INSERT INTO t2 VALUES (1193,000000,00,'nondecreasing','implant','thrillingly','');
+select t2.fld3 from t2 where companynr = 58 and fld3 like "%imaginable%";
+fld3
+select fld3 from t2 where fld3 like "%cultivation" ;
+fld3
+select t2.fld3,companynr from t2 where companynr = 57+1 order by fld3;
+fld3 companynr
+select fld3,companynr from t2 where companynr = 58 order by fld3;
+fld3 companynr
+select fld3 from t2 order by fld3 desc limit 10;
+fld3
+select fld3 from t2 order by fld3 desc limit 5;
+fld3
+select fld3 from t2 order by fld3 desc limit 5,5;
+fld3
+select t2.fld3 from t2 where fld3 = 'honeysuckle';
+fld3
+select t2.fld3 from t2 where fld3 LIKE 'honeysuckl_';
+fld3
+select t2.fld3 from t2 where fld3 LIKE 'hon_ysuckl_';
+fld3
+select t2.fld3 from t2 where fld3 LIKE 'honeysuckle%';
+fld3
+select t2.fld3 from t2 where fld3 LIKE 'h%le';
+fld3
+select t2.fld3 from t2 where fld3 LIKE 'honeysuckle_';
+fld3
+select t2.fld3 from t2 where fld3 LIKE 'don_t_find_me_please%';
+fld3
+select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3;
+fld3
+select fld1,fld3 from t2 where fld3="Colombo" or fld3 = "nondecreasing" order by fld3;
+fld1 fld3
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(200), b TEXT, FULLTEXT (a,b));
+INSERT INTO t1 VALUES('MySQL has now support', 'for full-text search'),
+('Full-text indexes', 'are called collections'),
+('Only MyISAM tables','support collections'),
+('Function MATCH ... AGAINST()','is used to do a search'),
+('Full-text search in MySQL', 'implements vector space model');
+SHOW INDEX FROM t1;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
+t1 1 a 1 a NULL NULL NULL NULL YES FULLTEXT
+t1 1 a 2 b NULL NULL NULL NULL YES FULLTEXT
+select * from t1 where MATCH(a,b) AGAINST ("collections");
+a b
+Only MyISAM tables support collections
+Full-text indexes are called collections
+explain extended select * from t1 where MATCH(a,b) AGAINST ("collections");
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 fulltext a a 0 1 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where (match `test`.`t1`.`a`,`test`.`t1`.`b` against (_latin1'collections'))
+select * from t1 where MATCH(a,b) AGAINST ("indexes");
+a b
+Full-text indexes are called collections
+select * from t1 where MATCH(a,b) AGAINST ("indexes collections");
+a b
+Full-text indexes are called collections
+Only MyISAM tables support collections
+select * from t1 where MATCH(a,b) AGAINST ("only");
+a b
+reset master;
+drop table t1,t2;
+create table t1 (a int) engine=blackhole;
+delete from t1 where a=10;
+update t1 set a=11 where a=15;
+insert into t1 values(1);
+insert ignore into t1 values(1);
+replace into t1 values(100);
+create table t2 (a varchar(200)) engine=blackhole;
+load data infile '../../std_data/words.dat' into table t2;
+alter table t1 add b int;
+alter table t1 drop b;
+create table t3 like t1;
+insert into t1 select * from t3;
+replace into t1 select * from t3;
+select * from t1;
+a
+select * from t2;
+a
+select * from t3;
+a
+show binlog events;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4
+master-bin.000001 # Query 1 # use `test`; drop table t1,t2
+master-bin.000001 # Query 1 # use `test`; create table t1 (a int) engine=blackhole
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Query 1 # use `test`; COMMIT
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Query 1 # use `test`; COMMIT
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Query 1 # use `test`; COMMIT
+master-bin.000001 # Query 1 # use `test`; create table t2 (a varchar(200)) engine=blackhole
+master-bin.000001 # Table_map 1 # test.t2
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Query 1 # use `test`; COMMIT
+master-bin.000001 # Query 1 # use `test`; alter table t1 add b int
+master-bin.000001 # Query 1 # use `test`; alter table t1 drop b
+master-bin.000001 # Query 1 # use `test`; create table t3 like t1
+drop table t1,t2,t3;
+reset master;
+create table t1 (a int) engine=blackhole;
+set autocommit=0;
+start transaction;
+insert into t1 values(1);
+commit;
+start transaction;
+insert into t1 values(2);
+rollback;
+set autocommit=1;
+show binlog events;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4
+master-bin.000001 # Query 1 # use `test`; create table t1 (a int) engine=blackhole
+master-bin.000001 # Query 1 # use `test`; BEGIN
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Query 1 # use `test`; COMMIT
diff --git a/mysql-test/r/binlog_row_ctype_cp932.result b/mysql-test/r/binlog_row_ctype_cp932.result
new file mode 100644
index 00000000000..179b6e52d86
--- /dev/null
+++ b/mysql-test/r/binlog_row_ctype_cp932.result
@@ -0,0 +1,11368 @@
+drop table if exists t1;
+drop table if exists t2;
+drop table if exists t3;
+drop table if exists t4;
+set names cp932;
+set character_set_database = cp932;
+CREATE TABLE t1(c1 CHAR(1)) DEFAULT CHARACTER SET = cp932;
+INSERT INTO t1 VALUES
+(0x05),(0x7E),(0x815C),(0x815F),(0x8160),(0x8161),(0x817C),(0x8191),(0x8192),(0x81CA);
+INSERT INTO t1 VALUES
+(0x8740),(0x8741),(0x8742),(0x8743),(0x8744),(0x8745),(0x8746),(0x8747),
+(0x8748),(0x8749),(0x874A),(0x874B),(0x874C),(0x874D),(0x874E),(0x874F),
+(0x8750),(0x8751),(0x8752),(0x8753),(0x8754),(0x8755),(0x8756),(0x8757),
+(0x8758),(0x8759),(0x875A),(0x875B),(0x875C),(0x875D),(0x875F),
+(0x8760),(0x8761),(0x8762),(0x8763),(0x8764),(0x8765),(0x8766),(0x8767),
+(0x8768),(0x8769),(0x876A),(0x876B),(0x876C),(0x876D),(0x876E),(0x876F),
+(0x8770),(0x8771),(0x8772),(0x8773),(0x8774),(0x8775),(0x877E),
+(0x8780),(0x8781),(0x8782),(0x8783),(0x8784),(0x8785),(0x8786),(0x8787),
+(0x8788),(0x8789),(0x878A),(0x878B),(0x878C),(0x878D),(0x878E),(0x878F),
+(0x8790),(0x8791),(0x8792),(0x8793),(0x8794),(0x8795),(0x8796),(0x8797),
+(0x8798),(0x8799),(0x879A),(0x879B),(0x879C);
+INSERT INTO t1 VALUES
+(0xED40),(0xED41),(0xED42),(0xED43),(0xED44),(0xED45),(0xED46),(0xED47),
+(0xED48),(0xED49),(0xED4A),(0xED4B),(0xED4C),(0xED4D),(0xED4E),(0xED4F),
+(0xED50),(0xED51),(0xED52),(0xED53),(0xED54),(0xED55),(0xED56),(0xED57),
+(0xED58),(0xED59),(0xED5A),(0xED5B),(0xED5C),(0xED5D),(0xED5E),(0xED5F),
+(0xED60),(0xED61),(0xED62),(0xED63),(0xED64),(0xED65),(0xED66),(0xED67),
+(0xED68),(0xED69),(0xED6A),(0xED6B),(0xED6C),(0xED6D),(0xED6E),(0xED6F),
+(0xED70),(0xED71),(0xED72),(0xED73),(0xED74),(0xED75),(0xED76),(0xED77),
+(0xED78),(0xED79),(0xED7A),(0xED7B),(0xED7C),(0xED7D),(0xED7E),
+(0xED80),(0xED81),(0xED82),(0xED83),(0xED84),(0xED85),(0xED86),(0xED87),
+(0xED88),(0xED89),(0xED8A),(0xED8B),(0xED8C),(0xED8D),(0xED8E),(0xED8F),
+(0xED90),(0xED91),(0xED92),(0xED93),(0xED94),(0xED95),(0xED96),(0xED97),
+(0xED98),(0xED99),(0xED9A),(0xED9B),(0xED9C),(0xED9D),(0xED9E),(0xED9F),
+(0xEDA0),(0xEDA1),(0xEDA2),(0xEDA3),(0xEDA4),(0xEDA5),(0xEDA6),(0xEDA7),
+(0xEDA8),(0xEDA9),(0xEDAA),(0xEDAB),(0xEDAC),(0xEDAD),(0xEDAE),(0xEDAF),
+(0xEDB0),(0xEDB1),(0xEDB2),(0xEDB3),(0xEDB4),(0xEDB5),(0xEDB6),(0xEDB7),
+(0xEDB8),(0xEDB9),(0xEDBA),(0xEDBB),(0xEDBC),(0xEDBD),(0xEDBE),(0xEDBF),
+(0xEDC0),(0xEDC1),(0xEDC2),(0xEDC3),(0xEDC4),(0xEDC5),(0xEDC6),(0xEDC7),
+(0xEDC8),(0xEDC9),(0xEDCA),(0xEDCB),(0xEDCC),(0xEDCD),(0xEDCE),(0xEDCF),
+(0xEDD0),(0xEDD1),(0xEDD2),(0xEDD3),(0xEDD4),(0xEDD5),(0xEDD6),(0xEDD7),
+(0xEDD8),(0xEDD9),(0xEDDA),(0xEDDB),(0xEDDC),(0xEDDD),(0xEDDE),(0xEDDF),
+(0xEDE0),(0xEDE1),(0xEDE2),(0xEDE3),(0xEDE4),(0xEDE5),(0xEDE6),(0xEDE7),
+(0xEDE8),(0xEDE9),(0xEDEA),(0xEDEB),(0xEDEC),(0xEDED),(0xEDEE),(0xEDEF),
+(0xEDF0),(0xEDF1),(0xEDF2),(0xEDF3),(0xEDF4),(0xEDF5),(0xEDF6),(0xEDF7),
+(0xEDF8),(0xEDF9),(0xEDFA),(0xEDFB),(0xEDFC),
+(0xEE40),(0xEE41),(0xEE42),(0xEE43),(0xEE44),(0xEE45),(0xEE46),(0xEE47),
+(0xEE48),(0xEE49),(0xEE4A),(0xEE4B),(0xEE4C),(0xEE4D),(0xEE4E),(0xEE4F),
+(0xEE50),(0xEE51),(0xEE52),(0xEE53),(0xEE54),(0xEE55),(0xEE56),(0xEE57),
+(0xEE58),(0xEE59),(0xEE5A),(0xEE5B),(0xEE5C),(0xEE5D),(0xEE5E),(0xEE5F),
+(0xEE60),(0xEE61),(0xEE62),(0xEE63),(0xEE64),(0xEE65),(0xEE66),(0xEE67),
+(0xEE68),(0xEE69),(0xEE6A),(0xEE6B),(0xEE6C),(0xEE6D),(0xEE6E),(0xEE6F),
+(0xEE70),(0xEE71),(0xEE72),(0xEE73),(0xEE74),(0xEE75),(0xEE76),(0xEE77),
+(0xEE78),(0xEE79),(0xEE7A),(0xEE7B),(0xEE7C),(0xEE7D),(0xEE7E),
+(0xEE80),(0xEE81),(0xEE82),(0xEE83),(0xEE84),(0xEE85),(0xEE86),(0xEE87),
+(0xEE88),(0xEE89),(0xEE8A),(0xEE8B),(0xEE8C),(0xEE8D),(0xEE8E),(0xEE8F),
+(0xEE90),(0xEE91),(0xEE92),(0xEE93),(0xEE94),(0xEE95),(0xEE96),(0xEE97),
+(0xEE98),(0xEE99),(0xEE9A),(0xEE9B),(0xEE9C),(0xEE9D),(0xEE9E),(0xEE9F),
+(0xEEA0),(0xEEA1),(0xEEA2),(0xEEA3),(0xEEA4),(0xEEA5),(0xEEA6),(0xEEA7),
+(0xEEA8),(0xEEA9),(0xEEAA),(0xEEAB),(0xEEAC),(0xEEAD),(0xEEAE),(0xEEAF),
+(0xEEB0),(0xEEB1),(0xEEB2),(0xEEB3),(0xEEB4),(0xEEB5),(0xEEB6),(0xEEB7),
+(0xEEB8),(0xEEB9),(0xEEBA),(0xEEBB),(0xEEBC),(0xEEBD),(0xEEBE),(0xEEBF),
+(0xEEC0),(0xEEC1),(0xEEC2),(0xEEC3),(0xEEC4),(0xEEC5),(0xEEC6),(0xEEC7),
+(0xEEC8),(0xEEC9),(0xEECA),(0xEECB),(0xEECC),(0xEECD),(0xEECE),(0xEECF),
+(0xEED0),(0xEED1),(0xEED2),(0xEED3),(0xEED4),(0xEED5),(0xEED6),(0xEED7),
+(0xEED8),(0xEED9),(0xEEDA),(0xEEDB),(0xEEDC),(0xEEDD),(0xEEDE),(0xEEDF),
+(0xEEE0),(0xEEE1),(0xEEE2),(0xEEE3),(0xEEE4),(0xEEE5),(0xEEE6),(0xEEE7),
+(0xEEE8),(0xEEE9),(0xEEEA),(0xEEEB),(0xEEEC),(0xEEEF),
+(0xEEF0),(0xEEF1),(0xEEF2),(0xEEF3),(0xEEF4),(0xEEF5),(0xEEF6),(0xEEF7),
+(0xEEF8),(0xEEF9),(0xEEFA),(0xEEFB),(0xEEFC);
+INSERT INTO t1 VALUES
+(0xFA40),(0xFA41),(0xFA42),(0xFA43),(0xFA44),(0xFA45),(0xFA46),(0xFA47),
+(0xFA48),(0xFA49),(0xFA4A),(0xFA4B),(0xFA4C),(0xFA4D),(0xFA4E),(0xFA4F),
+(0xFA50),(0xFA51),(0xFA52),(0xFA53),(0xFA54),(0xFA55),(0xFA56),(0xFA57),
+(0xFA58),(0xFA59),(0xFA5A),(0xFA5B),(0xFA5C),(0xFA5D),(0xFA5E),(0xFA5F),
+(0xFA60),(0xFA61),(0xFA62),(0xFA63),(0xFA64),(0xFA65),(0xFA66),(0xFA67),
+(0xFA68),(0xFA69),(0xFA6A),(0xFA6B),(0xFA6C),(0xFA6D),(0xFA6E),(0xFA6F),
+(0xFA70),(0xFA71),(0xFA72),(0xFA73),(0xFA74),(0xFA75),(0xFA76),(0xFA77),
+(0xFA78),(0xFA79),(0xFA7A),(0xFA7B),(0xFA7C),(0xFA7D),(0xFA7E),
+(0xFA80),(0xFA81),(0xFA82),(0xFA83),(0xFA84),(0xFA85),(0xFA86),(0xFA87),
+(0xFA88),(0xFA89),(0xFA8A),(0xFA8B),(0xFA8C),(0xFA8D),(0xFA8E),(0xFA8F),
+(0xFA90),(0xFA91),(0xFA92),(0xFA93),(0xFA94),(0xFA95),(0xFA96),(0xFA97),
+(0xFA98),(0xFA99),(0xFA9A),(0xFA9B),(0xFA9C),(0xFA9D),(0xFA9E),(0xFA9F),
+(0xFAA0),(0xFAA1),(0xFAA2),(0xFAA3),(0xFAA4),(0xFAA5),(0xFAA6),(0xFAA7),
+(0xFAA8),(0xFAA9),(0xFAAA),(0xFAAB),(0xFAAC),(0xFAAD),(0xFAAE),(0xFAAF),
+(0xFAB0),(0xFAB1),(0xFAB2),(0xFAB3),(0xFAB4),(0xFAB5),(0xFAB6),(0xFAB7),
+(0xFAB8),(0xFAB9),(0xFABA),(0xFABB),(0xFABC),(0xFABD),(0xFABE),(0xFABF),
+(0xFAC0),(0xFAC1),(0xFAC2),(0xFAC3),(0xFAC4),(0xFAC5),(0xFAC6),(0xFAC7),
+(0xFAC8),(0xFAC9),(0xFACA),(0xFACB),(0xFACC),(0xFACD),(0xFACE),(0xFACF),
+(0xFAD0),(0xFAD1),(0xFAD2),(0xFAD3),(0xFAD4),(0xFAD5),(0xFAD6),(0xFAD7),
+(0xFAD8),(0xFAD9),(0xFADA),(0xFADB),(0xFADC),(0xFADD),(0xFADE),(0xFADF),
+(0xFAE0),(0xFAE1),(0xFAE2),(0xFAE3),(0xFAE4),(0xFAE5),(0xFAE6),(0xFAE7),
+(0xFAE8),(0xFAE9),(0xFAEA),(0xFAEB),(0xFAEC),(0xFAED),(0xFAEE),(0xFAEF),
+(0xFAF0),(0xFAF1),(0xFAF2),(0xFAF3),(0xFAF4),(0xFAF5),(0xFAF6),(0xFAF7),
+(0xFAF8),(0xFAF9),(0xFAFA),(0xFAFB),(0xFAFC),
+(0xFB40),(0xFB41),(0xFB42),(0xFB43),(0xFB44),(0xFB45),(0xFB46),(0xFB47),
+(0xFB48),(0xFB49),(0xFB4A),(0xFB4B),(0xFB4C),(0xFB4D),(0xFB4E),(0xFB4F),
+(0xFB50),(0xFB51),(0xFB52),(0xFB53),(0xFB54),(0xFB55),(0xFB56),(0xFB57),
+(0xFB58),(0xFB59),(0xFB5A),(0xFB5B),(0xFB5C),(0xFB5D),(0xFB5E),(0xFB5F),
+(0xFB60),(0xFB61),(0xFB62),(0xFB63),(0xFB64),(0xFB65),(0xFB66),(0xFB67),
+(0xFB68),(0xFB69),(0xFB6A),(0xFB6B),(0xFB6C),(0xFB6D),(0xFB6E),(0xFB6F),
+(0xFB70),(0xFB71),(0xFB72),(0xFB73),(0xFB74),(0xFB75),(0xFB76),(0xFB77),
+(0xFB78),(0xFB79),(0xFB7A),(0xFB7B),(0xFB7C),(0xFB7D),(0xFB7E),
+(0xFB80),(0xFB81),(0xFB82),(0xFB83),(0xFB84),(0xFB85),(0xFB86),(0xFB87),
+(0xFB88),(0xFB89),(0xFB8A),(0xFB8B),(0xFB8C),(0xFB8D),(0xFB8E),(0xFB8F),
+(0xFB90),(0xFB91),(0xFB92),(0xFB93),(0xFB94),(0xFB95),(0xFB96),(0xFB97),
+(0xFB98),(0xFB99),(0xFB9A),(0xFB9B),(0xFB9C),(0xFB9D),(0xFB9E),(0xFB9F),
+(0xFBA0),(0xFBA1),(0xFBA2),(0xFBA3),(0xFBA4),(0xFBA5),(0xFBA6),(0xFBA7),
+(0xFBA8),(0xFBA9),(0xFBAA),(0xFBAB),(0xFBAC),(0xFBAD),(0xFBAE),(0xFBAF),
+(0xFBB0),(0xFBB1),(0xFBB2),(0xFBB3),(0xFBB4),(0xFBB5),(0xFBB6),(0xFBB7),
+(0xFBB8),(0xFBB9),(0xFBBA),(0xFBBB),(0xFBBC),(0xFBBD),(0xFBBE),(0xFBBF),
+(0xFBC0),(0xFBC1),(0xFBC2),(0xFBC3),(0xFBC4),(0xFBC5),(0xFBC6),(0xFBC7),
+(0xFBC8),(0xFBC9),(0xFBCA),(0xFBCB),(0xFBCC),(0xFBCD),(0xFBCE),(0xFBCF),
+(0xFBD0),(0xFBD1),(0xFBD2),(0xFBD3),(0xFBD4),(0xFBD5),(0xFBD6),(0xFBD7),
+(0xFBD8),(0xFBD9),(0xFBDA),(0xFBDB),(0xFBDC),(0xFBDD),(0xFBDE),(0xFBDF),
+(0xFBE0),(0xFBE1),(0xFBE2),(0xFBE3),(0xFBE4),(0xFBE5),(0xFBE6),(0xFBE7),
+(0xFBE8),(0xFBE9),(0xFBEA),(0xFBEB),(0xFBEC),(0xFBED),(0xFBEE),(0xFBEF),
+(0xFBF0),(0xFBF1),(0xFBF2),(0xFBF3),(0xFBF4),(0xFBF5),(0xFBF6),(0xFBF7),
+(0xFBF8),(0xFBF9),(0xFBFA),(0xFBFB),(0xFBFC),
+(0xFC40),(0xFC41),(0xFC42),(0xFC43),(0xFC44),(0xFC45),(0xFC46),(0xFC47),
+(0xFC48),(0xFC49),(0xFC4A),(0xFC4B);
+INSERT INTO t1 VALUES
+(0xF040),(0xF041),(0xF042),(0xF043),(0xF044),(0xF045),(0xF046),(0xF047),
+(0xF048),(0xF049),(0xF04A),(0xF04B),(0xF04C),(0xF04D),(0xF04E),(0xF04F),
+(0xF050),(0xF051),(0xF052),(0xF053),(0xF054),(0xF055),(0xF056),(0xF057),
+(0xF058),(0xF059),(0xF05A),(0xF05B),(0xF05C),(0xF05D),(0xF05E),(0xF05F),
+(0xF060),(0xF061),(0xF062),(0xF063),(0xF064),(0xF065),(0xF066),(0xF067),
+(0xF068),(0xF069),(0xF06A),(0xF06B),(0xF06C),(0xF06D),(0xF06E),(0xF06F),
+(0xF070),(0xF071),(0xF072),(0xF073),(0xF074),(0xF075),(0xF076),(0xF077),
+(0xF078),(0xF079),(0xF07A),(0xF07B),(0xF07C),(0xF07D),(0xF07E),
+(0xF080),(0xF081),(0xF082),(0xF083),(0xF084),(0xF085),(0xF086),(0xF087),
+(0xF088),(0xF089),(0xF08A),(0xF08B),(0xF08C),(0xF08D),(0xF08E),(0xF08F),
+(0xF090),(0xF091),(0xF092),(0xF093),(0xF094),(0xF095),(0xF096),(0xF097),
+(0xF098),(0xF099),(0xF09A),(0xF09B),(0xF09C),(0xF09D),(0xF09E),(0xF09F),
+(0xF0A0),(0xF0A1),(0xF0A2),(0xF0A3),(0xF0A4),(0xF0A5),(0xF0A6),(0xF0A7),
+(0xF0A8),(0xF0A9),(0xF0AA),(0xF0AB),(0xF0AC),(0xF0AD),(0xF0AE),(0xF0AF),
+(0xF0B0),(0xF0B1),(0xF0B2),(0xF0B3),(0xF0B4),(0xF0B5),(0xF0B6),(0xF0B7),
+(0xF0B8),(0xF0B9),(0xF0BA),(0xF0BB),(0xF0BC),(0xF0BD),(0xF0BE),(0xF0BF),
+(0xF0C0),(0xF0C1),(0xF0C2),(0xF0C3),(0xF0C4),(0xF0C5),(0xF0C6),(0xF0C7),
+(0xF0C8),(0xF0C9),(0xF0CA),(0xF0CB),(0xF0CC),(0xF0CD),(0xF0CE),(0xF0CF),
+(0xF0D0),(0xF0D1),(0xF0D2),(0xF0D3),(0xF0D4),(0xF0D5),(0xF0D6),(0xF0D7),
+(0xF0D8),(0xF0D9),(0xF0DA),(0xF0DB),(0xF0DC),(0xF0DD),(0xF0DE),(0xF0DF),
+(0xF0E0),(0xF0E1),(0xF0E2),(0xF0E3),(0xF0E4),(0xF0E5),(0xF0E6),(0xF0E7),
+(0xF0E8),(0xF0E9),(0xF0EA),(0xF0EB),(0xF0EC),(0xF0ED),(0xF0EE),(0xF0EF),
+(0xF0F0),(0xF0F1),(0xF0F2),(0xF0F3),(0xF0F4),(0xF0F5),(0xF0F6),(0xF0F7),
+(0xF0F8),(0xF0F9),(0xF0FA),(0xF0FB),(0xF0FC),
+(0xF140),(0xF141),(0xF142),(0xF143),(0xF144),(0xF145),(0xF146),(0xF147),
+(0xF148),(0xF149),(0xF14A),(0xF14B),(0xF14C),(0xF14D),(0xF14E),(0xF14F),
+(0xF150),(0xF151),(0xF152),(0xF153),(0xF154),(0xF155),(0xF156),(0xF157),
+(0xF158),(0xF159),(0xF15A),(0xF15B),(0xF15C),(0xF15D),(0xF15E),(0xF15F),
+(0xF160),(0xF161),(0xF162),(0xF163),(0xF164),(0xF165),(0xF166),(0xF167),
+(0xF168),(0xF169),(0xF16A),(0xF16B),(0xF16C),(0xF16D),(0xF16E),(0xF16F),
+(0xF170),(0xF171),(0xF172),(0xF173),(0xF174),(0xF175),(0xF176),(0xF177),
+(0xF178),(0xF179),(0xF17A),(0xF17B),(0xF17C),(0xF17D),(0xF17E),
+(0xF180),(0xF181),(0xF182),(0xF183),(0xF184),(0xF185),(0xF186),(0xF187),
+(0xF188),(0xF189),(0xF18A),(0xF18B),(0xF18C),(0xF18D),(0xF18E),(0xF18F),
+(0xF190),(0xF191),(0xF192),(0xF193),(0xF194),(0xF195),(0xF196),(0xF197),
+(0xF198),(0xF199),(0xF19A),(0xF19B),(0xF19C),(0xF19D),(0xF19E),(0xF19F),
+(0xF1A0),(0xF1A1),(0xF1A2),(0xF1A3),(0xF1A4),(0xF1A5),(0xF1A6),(0xF1A7),
+(0xF1A8),(0xF1A9),(0xF1AA),(0xF1AB),(0xF1AC),(0xF1AD),(0xF1AE),(0xF1AF),
+(0xF1B0),(0xF1B1),(0xF1B2),(0xF1B3),(0xF1B4),(0xF1B5),(0xF1B6),(0xF1B7),
+(0xF1B8),(0xF1B9),(0xF1BA),(0xF1BB),(0xF1BC),(0xF1BD),(0xF1BE),(0xF1BF),
+(0xF1C0),(0xF1C1),(0xF1C2),(0xF1C3),(0xF1C4),(0xF1C5),(0xF1C6),(0xF1C7),
+(0xF1C8),(0xF1C9),(0xF1CA),(0xF1CB),(0xF1CC),(0xF1CD),(0xF1CE),(0xF1CF),
+(0xF1D0),(0xF1D1),(0xF1D2),(0xF1D3),(0xF1D4),(0xF1D5),(0xF1D6),(0xF1D7),
+(0xF1D8),(0xF1D9),(0xF1DA),(0xF1DB),(0xF1DC),(0xF1DD),(0xF1DE),(0xF1DF),
+(0xF1E0),(0xF1E1),(0xF1E2),(0xF1E3),(0xF1E4),(0xF1E5),(0xF1E6),(0xF1E7),
+(0xF1E8),(0xF1E9),(0xF1EA),(0xF1EB),(0xF1EC),(0xF1ED),(0xF1EE),(0xF1EF),
+(0xF1F0),(0xF1F1),(0xF1F2),(0xF1F3),(0xF1F4),(0xF1F5),(0xF1F6),(0xF1F7),
+(0xF1F8),(0xF1F9),(0xF1FA),(0xF1FB),(0xF1FC),
+(0xF240),(0xF241),(0xF242),(0xF243),(0xF244),(0xF245),(0xF246),(0xF247),
+(0xF248),(0xF249),(0xF24A),(0xF24B),(0xF24C),(0xF24D),(0xF24E),(0xF24F),
+(0xF250),(0xF251),(0xF252),(0xF253),(0xF254),(0xF255),(0xF256),(0xF257),
+(0xF258),(0xF259),(0xF25A),(0xF25B),(0xF25C),(0xF25D),(0xF25E),(0xF25F),
+(0xF260),(0xF261),(0xF262),(0xF263),(0xF264),(0xF265),(0xF266),(0xF267),
+(0xF268),(0xF269),(0xF26A),(0xF26B),(0xF26C),(0xF26D),(0xF26E),(0xF26F),
+(0xF270),(0xF271),(0xF272),(0xF273),(0xF274),(0xF275),(0xF276),(0xF277),
+(0xF278),(0xF279),(0xF27A),(0xF27B),(0xF27C),(0xF27D),(0xF27E),
+(0xF280),(0xF281),(0xF282),(0xF283),(0xF284),(0xF285),(0xF286),(0xF287),
+(0xF288),(0xF289),(0xF28A),(0xF28B),(0xF28C),(0xF28D),(0xF28E),(0xF28F),
+(0xF290),(0xF291),(0xF292),(0xF293),(0xF294),(0xF295),(0xF296),(0xF297),
+(0xF298),(0xF299),(0xF29A),(0xF29B),(0xF29C),(0xF29D),(0xF29E),(0xF29F),
+(0xF2A0),(0xF2A1),(0xF2A2),(0xF2A3),(0xF2A4),(0xF2A5),(0xF2A6),(0xF2A7),
+(0xF2A8),(0xF2A9),(0xF2AA),(0xF2AB),(0xF2AC),(0xF2AD),(0xF2AE),(0xF2AF),
+(0xF2B0),(0xF2B1),(0xF2B2),(0xF2B3),(0xF2B4),(0xF2B5),(0xF2B6),(0xF2B7),
+(0xF2B8),(0xF2B9),(0xF2BA),(0xF2BB),(0xF2BC),(0xF2BD),(0xF2BE),(0xF2BF),
+(0xF2C0),(0xF2C1),(0xF2C2),(0xF2C3),(0xF2C4),(0xF2C5),(0xF2C6),(0xF2C7),
+(0xF2C8),(0xF2C9),(0xF2CA),(0xF2CB),(0xF2CC),(0xF2CD),(0xF2CE),(0xF2CF),
+(0xF2D0),(0xF2D1),(0xF2D2),(0xF2D3),(0xF2D4),(0xF2D5),(0xF2D6),(0xF2D7),
+(0xF2D8),(0xF2D9),(0xF2DA),(0xF2DB),(0xF2DC),(0xF2DD),(0xF2DE),(0xF2DF),
+(0xF2E0),(0xF2E1),(0xF2E2),(0xF2E3),(0xF2E4),(0xF2E5),(0xF2E6),(0xF2E7),
+(0xF2E8),(0xF2E9),(0xF2EA),(0xF2EB),(0xF2EC),(0xF2ED),(0xF2EE),(0xF2EF),
+(0xF2F0),(0xF2F1),(0xF2F2),(0xF2F3),(0xF2F4),(0xF2F5),(0xF2F6),(0xF2F7),
+(0xF2F8),(0xF2F9),(0xF2FA),(0xF2FB),(0xF2FC),
+(0xF340),(0xF341),(0xF342),(0xF343),(0xF344),(0xF345),(0xF346),(0xF347),
+(0xF348),(0xF349),(0xF34A),(0xF34B),(0xF34C),(0xF34D),(0xF34E),(0xF34F),
+(0xF350),(0xF351),(0xF352),(0xF353),(0xF354),(0xF355),(0xF356),(0xF357),
+(0xF358),(0xF359),(0xF35A),(0xF35B),(0xF35C),(0xF35D),(0xF35E),(0xF35F),
+(0xF360),(0xF361),(0xF362),(0xF363),(0xF364),(0xF365),(0xF366),(0xF367),
+(0xF368),(0xF369),(0xF36A),(0xF36B),(0xF36C),(0xF36D),(0xF36E),(0xF36F),
+(0xF370),(0xF371),(0xF372),(0xF373),(0xF374),(0xF375),(0xF376),(0xF377),
+(0xF378),(0xF379),(0xF37A),(0xF37B),(0xF37C),(0xF37D),(0xF37E),
+(0xF380),(0xF381),(0xF382),(0xF383),(0xF384),(0xF385),(0xF386),(0xF387),
+(0xF388),(0xF389),(0xF38A),(0xF38B),(0xF38C),(0xF38D),(0xF38E),(0xF38F),
+(0xF390),(0xF391),(0xF392),(0xF393),(0xF394),(0xF395),(0xF396),(0xF397),
+(0xF398),(0xF399),(0xF39A),(0xF39B),(0xF39C),(0xF39D),(0xF39E),(0xF39F),
+(0xF3A0),(0xF3A1),(0xF3A2),(0xF3A3),(0xF3A4),(0xF3A5),(0xF3A6),(0xF3A7),
+(0xF3A8),(0xF3A9),(0xF3AA),(0xF3AB),(0xF3AC),(0xF3AD),(0xF3AE),(0xF3AF),
+(0xF3B0),(0xF3B1),(0xF3B2),(0xF3B3),(0xF3B4),(0xF3B5),(0xF3B6),(0xF3B7),
+(0xF3B8),(0xF3B9),(0xF3BA),(0xF3BB),(0xF3BC),(0xF3BD),(0xF3BE),(0xF3BF),
+(0xF3C0),(0xF3C1),(0xF3C2),(0xF3C3),(0xF3C4),(0xF3C5),(0xF3C6),(0xF3C7),
+(0xF3C8),(0xF3C9),(0xF3CA),(0xF3CB),(0xF3CC),(0xF3CD),(0xF3CE),(0xF3CF),
+(0xF3D0),(0xF3D1),(0xF3D2),(0xF3D3),(0xF3D4),(0xF3D5),(0xF3D6),(0xF3D7),
+(0xF3D8),(0xF3D9),(0xF3DA),(0xF3DB),(0xF3DC),(0xF3DD),(0xF3DE),(0xF3DF),
+(0xF3E0),(0xF3E1),(0xF3E2),(0xF3E3),(0xF3E4),(0xF3E5),(0xF3E6),(0xF3E7),
+(0xF3E8),(0xF3E9),(0xF3EA),(0xF3EB),(0xF3EC),(0xF3ED),(0xF3EE),(0xF3EF),
+(0xF3F0),(0xF3F1),(0xF3F2),(0xF3F3),(0xF3F4),(0xF3F5),(0xF3F6),(0xF3F7),
+(0xF3F8),(0xF3F9),(0xF3FA),(0xF3FB),(0xF3FC),
+(0xF440),(0xF441),(0xF442),(0xF443),(0xF444),(0xF445),(0xF446),(0xF447),
+(0xF448),(0xF449),(0xF44A),(0xF44B),(0xF44C),(0xF44D),(0xF44E),(0xF44F),
+(0xF450),(0xF451),(0xF452),(0xF453),(0xF454),(0xF455),(0xF456),(0xF457),
+(0xF458),(0xF459),(0xF45A),(0xF45B),(0xF45C),(0xF45D),(0xF45E),(0xF45F),
+(0xF460),(0xF461),(0xF462),(0xF463),(0xF464),(0xF465),(0xF466),(0xF467),
+(0xF468),(0xF469),(0xF46A),(0xF46B),(0xF46C),(0xF46D),(0xF46E),(0xF46F),
+(0xF470),(0xF471),(0xF472),(0xF473),(0xF474),(0xF475),(0xF476),(0xF477),
+(0xF478),(0xF479),(0xF47A),(0xF47B),(0xF47C),(0xF47D),(0xF47E),
+(0xF480),(0xF481),(0xF482),(0xF483),(0xF484),(0xF485),(0xF486),(0xF487),
+(0xF488),(0xF489),(0xF48A),(0xF48B),(0xF48C),(0xF48D),(0xF48E),(0xF48F),
+(0xF490),(0xF491),(0xF492),(0xF493),(0xF494),(0xF495),(0xF496),(0xF497),
+(0xF498),(0xF499),(0xF49A),(0xF49B),(0xF49C),(0xF49D),(0xF49E),(0xF49F),
+(0xF4A0),(0xF4A1),(0xF4A2),(0xF4A3),(0xF4A4),(0xF4A5),(0xF4A6),(0xF4A7),
+(0xF4A8),(0xF4A9),(0xF4AA),(0xF4AB),(0xF4AC),(0xF4AD),(0xF4AE),(0xF4AF),
+(0xF4B0),(0xF4B1),(0xF4B2),(0xF4B3),(0xF4B4),(0xF4B5),(0xF4B6),(0xF4B7),
+(0xF4B8),(0xF4B9),(0xF4BA),(0xF4BB),(0xF4BC),(0xF4BD),(0xF4BE),(0xF4BF),
+(0xF4C0),(0xF4C1),(0xF4C2),(0xF4C3),(0xF4C4),(0xF4C5),(0xF4C6),(0xF4C7),
+(0xF4C8),(0xF4C9),(0xF4CA),(0xF4CB),(0xF4CC),(0xF4CD),(0xF4CE),(0xF4CF),
+(0xF4D0),(0xF4D1),(0xF4D2),(0xF4D3),(0xF4D4),(0xF4D5),(0xF4D6),(0xF4D7),
+(0xF4D8),(0xF4D9),(0xF4DA),(0xF4DB),(0xF4DC),(0xF4DD),(0xF4DE),(0xF4DF),
+(0xF4E0),(0xF4E1),(0xF4E2),(0xF4E3),(0xF4E4),(0xF4E5),(0xF4E6),(0xF4E7),
+(0xF4E8),(0xF4E9),(0xF4EA),(0xF4EB),(0xF4EC),(0xF4ED),(0xF4EE),(0xF4EF),
+(0xF4F0),(0xF4F1),(0xF4F2),(0xF4F3),(0xF4F4),(0xF4F5),(0xF4F6),(0xF4F7),
+(0xF4F8),(0xF4F9),(0xF4FA),(0xF4FB),(0xF4FC),
+(0xF540),(0xF541),(0xF542),(0xF543),(0xF544),(0xF545),(0xF546),(0xF547),
+(0xF548),(0xF549),(0xF54A),(0xF54B),(0xF54C),(0xF54D),(0xF54E),(0xF54F),
+(0xF550),(0xF551),(0xF552),(0xF553),(0xF554),(0xF555),(0xF556),(0xF557),
+(0xF558),(0xF559),(0xF55A),(0xF55B),(0xF55C),(0xF55D),(0xF55E),(0xF55F),
+(0xF560),(0xF561),(0xF562),(0xF563),(0xF564),(0xF565),(0xF566),(0xF567),
+(0xF568),(0xF569),(0xF56A),(0xF56B),(0xF56C),(0xF56D),(0xF56E),(0xF56F),
+(0xF570),(0xF571),(0xF572),(0xF573),(0xF574),(0xF575),(0xF576),(0xF577),
+(0xF578),(0xF579),(0xF57A),(0xF57B),(0xF57C),(0xF57D),(0xF57E),
+(0xF580),(0xF581),(0xF582),(0xF583),(0xF584),(0xF585),(0xF586),(0xF587),
+(0xF588),(0xF589),(0xF58A),(0xF58B),(0xF58C),(0xF58D),(0xF58E),(0xF58F),
+(0xF590),(0xF591),(0xF592),(0xF593),(0xF594),(0xF595),(0xF596),(0xF597),
+(0xF598),(0xF599),(0xF59A),(0xF59B),(0xF59C),(0xF59D),(0xF59E),(0xF59F),
+(0xF5A0),(0xF5A1),(0xF5A2),(0xF5A3),(0xF5A4),(0xF5A5),(0xF5A6),(0xF5A7),
+(0xF5A8),(0xF5A9),(0xF5AA),(0xF5AB),(0xF5AC),(0xF5AD),(0xF5AE),(0xF5AF),
+(0xF5B0),(0xF5B1),(0xF5B2),(0xF5B3),(0xF5B4),(0xF5B5),(0xF5B6),(0xF5B7),
+(0xF5B8),(0xF5B9),(0xF5BA),(0xF5BB),(0xF5BC),(0xF5BD),(0xF5BE),(0xF5BF),
+(0xF5C0),(0xF5C1),(0xF5C2),(0xF5C3),(0xF5C4),(0xF5C5),(0xF5C6),(0xF5C7),
+(0xF5C8),(0xF5C9),(0xF5CA),(0xF5CB),(0xF5CC),(0xF5CD),(0xF5CE),(0xF5CF),
+(0xF5D0),(0xF5D1),(0xF5D2),(0xF5D3),(0xF5D4),(0xF5D5),(0xF5D6),(0xF5D7),
+(0xF5D8),(0xF5D9),(0xF5DA),(0xF5DB),(0xF5DC),(0xF5DD),(0xF5DE),(0xF5DF),
+(0xF5E0),(0xF5E1),(0xF5E2),(0xF5E3),(0xF5E4),(0xF5E5),(0xF5E6),(0xF5E7),
+(0xF5E8),(0xF5E9),(0xF5EA),(0xF5EB),(0xF5EC),(0xF5ED),(0xF5EE),(0xF5EF),
+(0xF5F0),(0xF5F1),(0xF5F2),(0xF5F3),(0xF5F4),(0xF5F5),(0xF5F6),(0xF5F7),
+(0xF5F8),(0xF5F9),(0xF5FA),(0xF5FB),(0xF5FC),
+(0xF640),(0xF641),(0xF642),(0xF643),(0xF644),(0xF645),(0xF646),(0xF647),
+(0xF648),(0xF649),(0xF64A),(0xF64B),(0xF64C),(0xF64D),(0xF64E),(0xF64F),
+(0xF650),(0xF651),(0xF652),(0xF653),(0xF654),(0xF655),(0xF656),(0xF657),
+(0xF658),(0xF659),(0xF65A),(0xF65B),(0xF65C),(0xF65D),(0xF65E),(0xF65F),
+(0xF660),(0xF661),(0xF662),(0xF663),(0xF664),(0xF665),(0xF666),(0xF667),
+(0xF668),(0xF669),(0xF66A),(0xF66B),(0xF66C),(0xF66D),(0xF66E),(0xF66F),
+(0xF670),(0xF671),(0xF672),(0xF673),(0xF674),(0xF675),(0xF676),(0xF677),
+(0xF678),(0xF679),(0xF67A),(0xF67B),(0xF67C),(0xF67D),(0xF67E),
+(0xF680),(0xF681),(0xF682),(0xF683),(0xF684),(0xF685),(0xF686),(0xF687),
+(0xF688),(0xF689),(0xF68A),(0xF68B),(0xF68C),(0xF68D),(0xF68E),(0xF68F),
+(0xF690),(0xF691),(0xF692),(0xF693),(0xF694),(0xF695),(0xF696),(0xF697),
+(0xF698),(0xF699),(0xF69A),(0xF69B),(0xF69C),(0xF69D),(0xF69E),(0xF69F),
+(0xF6A0),(0xF6A1),(0xF6A2),(0xF6A3),(0xF6A4),(0xF6A5),(0xF6A6),(0xF6A7),
+(0xF6A8),(0xF6A9),(0xF6AA),(0xF6AB),(0xF6AC),(0xF6AD),(0xF6AE),(0xF6AF),
+(0xF6B0),(0xF6B1),(0xF6B2),(0xF6B3),(0xF6B4),(0xF6B5),(0xF6B6),(0xF6B7),
+(0xF6B8),(0xF6B9),(0xF6BA),(0xF6BB),(0xF6BC),(0xF6BD),(0xF6BE),(0xF6BF),
+(0xF6C0),(0xF6C1),(0xF6C2),(0xF6C3),(0xF6C4),(0xF6C5),(0xF6C6),(0xF6C7),
+(0xF6C8),(0xF6C9),(0xF6CA),(0xF6CB),(0xF6CC),(0xF6CD),(0xF6CE),(0xF6CF),
+(0xF6D0),(0xF6D1),(0xF6D2),(0xF6D3),(0xF6D4),(0xF6D5),(0xF6D6),(0xF6D7),
+(0xF6D8),(0xF6D9),(0xF6DA),(0xF6DB),(0xF6DC),(0xF6DD),(0xF6DE),(0xF6DF),
+(0xF6E0),(0xF6E1),(0xF6E2),(0xF6E3),(0xF6E4),(0xF6E5),(0xF6E6),(0xF6E7),
+(0xF6E8),(0xF6E9),(0xF6EA),(0xF6EB),(0xF6EC),(0xF6ED),(0xF6EE),(0xF6EF),
+(0xF6F0),(0xF6F1),(0xF6F2),(0xF6F3),(0xF6F4),(0xF6F5),(0xF6F6),(0xF6F7),
+(0xF6F8),(0xF6F9),(0xF6FA),(0xF6FB),(0xF6FC),
+(0xF740),(0xF741),(0xF742),(0xF743),(0xF744),(0xF745),(0xF746),(0xF747),
+(0xF748),(0xF749),(0xF74A),(0xF74B),(0xF74C),(0xF74D),(0xF74E),(0xF74F),
+(0xF750),(0xF751),(0xF752),(0xF753),(0xF754),(0xF755),(0xF756),(0xF757),
+(0xF758),(0xF759),(0xF75A),(0xF75B),(0xF75C),(0xF75D),(0xF75E),(0xF75F),
+(0xF760),(0xF761),(0xF762),(0xF763),(0xF764),(0xF765),(0xF766),(0xF767),
+(0xF768),(0xF769),(0xF76A),(0xF76B),(0xF76C),(0xF76D),(0xF76E),(0xF76F),
+(0xF770),(0xF771),(0xF772),(0xF773),(0xF774),(0xF775),(0xF776),(0xF777),
+(0xF778),(0xF779),(0xF77A),(0xF77B),(0xF77C),(0xF77D),(0xF77E),
+(0xF780),(0xF781),(0xF782),(0xF783),(0xF784),(0xF785),(0xF786),(0xF787),
+(0xF788),(0xF789),(0xF78A),(0xF78B),(0xF78C),(0xF78D),(0xF78E),(0xF78F),
+(0xF790),(0xF791),(0xF792),(0xF793),(0xF794),(0xF795),(0xF796),(0xF797),
+(0xF798),(0xF799),(0xF79A),(0xF79B),(0xF79C),(0xF79D),(0xF79E),(0xF79F),
+(0xF7A0),(0xF7A1),(0xF7A2),(0xF7A3),(0xF7A4),(0xF7A5),(0xF7A6),(0xF7A7),
+(0xF7A8),(0xF7A9),(0xF7AA),(0xF7AB),(0xF7AC),(0xF7AD),(0xF7AE),(0xF7AF),
+(0xF7B0),(0xF7B1),(0xF7B2),(0xF7B3),(0xF7B4),(0xF7B5),(0xF7B6),(0xF7B7),
+(0xF7B8),(0xF7B9),(0xF7BA),(0xF7BB),(0xF7BC),(0xF7BD),(0xF7BE),(0xF7BF),
+(0xF7C0),(0xF7C1),(0xF7C2),(0xF7C3),(0xF7C4),(0xF7C5),(0xF7C6),(0xF7C7),
+(0xF7C8),(0xF7C9),(0xF7CA),(0xF7CB),(0xF7CC),(0xF7CD),(0xF7CE),(0xF7CF),
+(0xF7D0),(0xF7D1),(0xF7D2),(0xF7D3),(0xF7D4),(0xF7D5),(0xF7D6),(0xF7D7),
+(0xF7D8),(0xF7D9),(0xF7DA),(0xF7DB),(0xF7DC),(0xF7DD),(0xF7DE),(0xF7DF),
+(0xF7E0),(0xF7E1),(0xF7E2),(0xF7E3),(0xF7E4),(0xF7E5),(0xF7E6),(0xF7E7),
+(0xF7E8),(0xF7E9),(0xF7EA),(0xF7EB),(0xF7EC),(0xF7ED),(0xF7EE),(0xF7EF),
+(0xF7F0),(0xF7F1),(0xF7F2),(0xF7F3),(0xF7F4),(0xF7F5),(0xF7F6),(0xF7F7),
+(0xF7F8),(0xF7F9),(0xF7FA),(0xF7FB),(0xF7FC),
+(0xF840),(0xF841),(0xF842),(0xF843),(0xF844),(0xF845),(0xF846),(0xF847),
+(0xF848),(0xF849),(0xF84A),(0xF84B),(0xF84C),(0xF84D),(0xF84E),(0xF84F),
+(0xF850),(0xF851),(0xF852),(0xF853),(0xF854),(0xF855),(0xF856),(0xF857),
+(0xF858),(0xF859),(0xF85A),(0xF85B),(0xF85C),(0xF85D),(0xF85E),(0xF85F),
+(0xF860),(0xF861),(0xF862),(0xF863),(0xF864),(0xF865),(0xF866),(0xF867),
+(0xF868),(0xF869),(0xF86A),(0xF86B),(0xF86C),(0xF86D),(0xF86E),(0xF86F),
+(0xF870),(0xF871),(0xF872),(0xF873),(0xF874),(0xF875),(0xF876),(0xF877),
+(0xF878),(0xF879),(0xF87A),(0xF87B),(0xF87C),(0xF87D),(0xF87E),
+(0xF880),(0xF881),(0xF882),(0xF883),(0xF884),(0xF885),(0xF886),(0xF887),
+(0xF888),(0xF889),(0xF88A),(0xF88B),(0xF88C),(0xF88D),(0xF88E),(0xF88F),
+(0xF890),(0xF891),(0xF892),(0xF893),(0xF894),(0xF895),(0xF896),(0xF897),
+(0xF898),(0xF899),(0xF89A),(0xF89B),(0xF89C),(0xF89D),(0xF89E),(0xF89F),
+(0xF8A0),(0xF8A1),(0xF8A2),(0xF8A3),(0xF8A4),(0xF8A5),(0xF8A6),(0xF8A7),
+(0xF8A8),(0xF8A9),(0xF8AA),(0xF8AB),(0xF8AC),(0xF8AD),(0xF8AE),(0xF8AF),
+(0xF8B0),(0xF8B1),(0xF8B2),(0xF8B3),(0xF8B4),(0xF8B5),(0xF8B6),(0xF8B7),
+(0xF8B8),(0xF8B9),(0xF8BA),(0xF8BB),(0xF8BC),(0xF8BD),(0xF8BE),(0xF8BF),
+(0xF8C0),(0xF8C1),(0xF8C2),(0xF8C3),(0xF8C4),(0xF8C5),(0xF8C6),(0xF8C7),
+(0xF8C8),(0xF8C9),(0xF8CA),(0xF8CB),(0xF8CC),(0xF8CD),(0xF8CE),(0xF8CF),
+(0xF8D0),(0xF8D1),(0xF8D2),(0xF8D3),(0xF8D4),(0xF8D5),(0xF8D6),(0xF8D7),
+(0xF8D8),(0xF8D9),(0xF8DA),(0xF8DB),(0xF8DC),(0xF8DD),(0xF8DE),(0xF8DF),
+(0xF8E0),(0xF8E1),(0xF8E2),(0xF8E3),(0xF8E4),(0xF8E5),(0xF8E6),(0xF8E7),
+(0xF8E8),(0xF8E9),(0xF8EA),(0xF8EB),(0xF8EC),(0xF8ED),(0xF8EE),(0xF8EF),
+(0xF8F0),(0xF8F1),(0xF8F2),(0xF8F3),(0xF8F4),(0xF8F5),(0xF8F6),(0xF8F7),
+(0xF8F8),(0xF8F9),(0xF8FA),(0xF8FB),(0xF8FC),
+(0xF940),(0xF941),(0xF942),(0xF943),(0xF944),(0xF945),(0xF946),(0xF947),
+(0xF948),(0xF949),(0xF94A),(0xF94B),(0xF94C),(0xF94D),(0xF94E),(0xF94F),
+(0xF950),(0xF951),(0xF952),(0xF953),(0xF954),(0xF955),(0xF956),(0xF957),
+(0xF958),(0xF959),(0xF95A),(0xF95B),(0xF95C),(0xF95D),(0xF95E),(0xF95F),
+(0xF960),(0xF961),(0xF962),(0xF963),(0xF964),(0xF965),(0xF966),(0xF967),
+(0xF968),(0xF969),(0xF96A),(0xF96B),(0xF96C),(0xF96D),(0xF96E),(0xF96F),
+(0xF970),(0xF971),(0xF972),(0xF973),(0xF974),(0xF975),(0xF976),(0xF977),
+(0xF978),(0xF979),(0xF97A),(0xF97B),(0xF97C),(0xF97D),(0xF97E),
+(0xF980),(0xF981),(0xF982),(0xF983),(0xF984),(0xF985),(0xF986),(0xF987),
+(0xF988),(0xF989),(0xF98A),(0xF98B),(0xF98C),(0xF98D),(0xF98E),(0xF98F),
+(0xF990),(0xF991),(0xF992),(0xF993),(0xF994),(0xF995),(0xF996),(0xF997),
+(0xF998),(0xF999),(0xF99A),(0xF99B),(0xF99C),(0xF99D),(0xF99E),(0xF99F),
+(0xF9A0),(0xF9A1),(0xF9A2),(0xF9A3),(0xF9A4),(0xF9A5),(0xF9A6),(0xF9A7),
+(0xF9A8),(0xF9A9),(0xF9AA),(0xF9AB),(0xF9AC),(0xF9AD),(0xF9AE),(0xF9AF),
+(0xF9B0),(0xF9B1),(0xF9B2),(0xF9B3),(0xF9B4),(0xF9B5),(0xF9B6),(0xF9B7),
+(0xF9B8),(0xF9B9),(0xF9BA),(0xF9BB),(0xF9BC),(0xF9BD),(0xF9BE),(0xF9BF),
+(0xF9C0),(0xF9C1),(0xF9C2),(0xF9C3),(0xF9C4),(0xF9C5),(0xF9C6),(0xF9C7),
+(0xF9C8),(0xF9C9),(0xF9CA),(0xF9CB),(0xF9CC),(0xF9CD),(0xF9CE),(0xF9CF),
+(0xF9D0),(0xF9D1),(0xF9D2),(0xF9D3),(0xF9D4),(0xF9D5),(0xF9D6),(0xF9D7),
+(0xF9D8),(0xF9D9),(0xF9DA),(0xF9DB),(0xF9DC),(0xF9DD),(0xF9DE),(0xF9DF),
+(0xF9E0),(0xF9E1),(0xF9E2),(0xF9E3),(0xF9E4),(0xF9E5),(0xF9E6),(0xF9E7),
+(0xF9E8),(0xF9E9),(0xF9EA),(0xF9EB),(0xF9EC),(0xF9ED),(0xF9EE),(0xF9EF),
+(0xF9F0),(0xF9F1),(0xF9F2),(0xF9F3),(0xF9F4),(0xF9F5),(0xF9F6),(0xF9F7),
+(0xF9F8),(0xF9F9),(0xF9FA),(0xF9FB),(0xF9FC);
+SELECT HEX(c1) FROM t1;
+HEX(c1)
+05
+7E
+815C
+815F
+8160
+8161
+817C
+8191
+8192
+81CA
+8740
+8741
+8742
+8743
+8744
+8745
+8746
+8747
+8748
+8749
+874A
+874B
+874C
+874D
+874E
+874F
+8750
+8751
+8752
+8753
+8754
+8755
+8756
+8757
+8758
+8759
+875A
+875B
+875C
+875D
+875F
+8760
+8761
+8762
+8763
+8764
+8765
+8766
+8767
+8768
+8769
+876A
+876B
+876C
+876D
+876E
+876F
+8770
+8771
+8772
+8773
+8774
+8775
+877E
+8780
+8781
+8782
+8783
+8784
+8785
+8786
+8787
+8788
+8789
+878A
+878B
+878C
+878D
+878E
+878F
+8790
+8791
+8792
+8793
+8794
+8795
+8796
+8797
+8798
+8799
+879A
+879B
+879C
+ED40
+ED41
+ED42
+ED43
+ED44
+ED45
+ED46
+ED47
+ED48
+ED49
+ED4A
+ED4B
+ED4C
+ED4D
+ED4E
+ED4F
+ED50
+ED51
+ED52
+ED53
+ED54
+ED55
+ED56
+ED57
+ED58
+ED59
+ED5A
+ED5B
+ED5C
+ED5D
+ED5E
+ED5F
+ED60
+ED61
+ED62
+ED63
+ED64
+ED65
+ED66
+ED67
+ED68
+ED69
+ED6A
+ED6B
+ED6C
+ED6D
+ED6E
+ED6F
+ED70
+ED71
+ED72
+ED73
+ED74
+ED75
+ED76
+ED77
+ED78
+ED79
+ED7A
+ED7B
+ED7C
+ED7D
+ED7E
+ED80
+ED81
+ED82
+ED83
+ED84
+ED85
+ED86
+ED87
+ED88
+ED89
+ED8A
+ED8B
+ED8C
+ED8D
+ED8E
+ED8F
+ED90
+ED91
+ED92
+ED93
+ED94
+ED95
+ED96
+ED97
+ED98
+ED99
+ED9A
+ED9B
+ED9C
+ED9D
+ED9E
+ED9F
+EDA0
+EDA1
+EDA2
+EDA3
+EDA4
+EDA5
+EDA6
+EDA7
+EDA8
+EDA9
+EDAA
+EDAB
+EDAC
+EDAD
+EDAE
+EDAF
+EDB0
+EDB1
+EDB2
+EDB3
+EDB4
+EDB5
+EDB6
+EDB7
+EDB8
+EDB9
+EDBA
+EDBB
+EDBC
+EDBD
+EDBE
+EDBF
+EDC0
+EDC1
+EDC2
+EDC3
+EDC4
+EDC5
+EDC6
+EDC7
+EDC8
+EDC9
+EDCA
+EDCB
+EDCC
+EDCD
+EDCE
+EDCF
+EDD0
+EDD1
+EDD2
+EDD3
+EDD4
+EDD5
+EDD6
+EDD7
+EDD8
+EDD9
+EDDA
+EDDB
+EDDC
+EDDD
+EDDE
+EDDF
+EDE0
+EDE1
+EDE2
+EDE3
+EDE4
+EDE5
+EDE6
+EDE7
+EDE8
+EDE9
+EDEA
+EDEB
+EDEC
+EDED
+EDEE
+EDEF
+EDF0
+EDF1
+EDF2
+EDF3
+EDF4
+EDF5
+EDF6
+EDF7
+EDF8
+EDF9
+EDFA
+EDFB
+EDFC
+EE40
+EE41
+EE42
+EE43
+EE44
+EE45
+EE46
+EE47
+EE48
+EE49
+EE4A
+EE4B
+EE4C
+EE4D
+EE4E
+EE4F
+EE50
+EE51
+EE52
+EE53
+EE54
+EE55
+EE56
+EE57
+EE58
+EE59
+EE5A
+EE5B
+EE5C
+EE5D
+EE5E
+EE5F
+EE60
+EE61
+EE62
+EE63
+EE64
+EE65
+EE66
+EE67
+EE68
+EE69
+EE6A
+EE6B
+EE6C
+EE6D
+EE6E
+EE6F
+EE70
+EE71
+EE72
+EE73
+EE74
+EE75
+EE76
+EE77
+EE78
+EE79
+EE7A
+EE7B
+EE7C
+EE7D
+EE7E
+EE80
+EE81
+EE82
+EE83
+EE84
+EE85
+EE86
+EE87
+EE88
+EE89
+EE8A
+EE8B
+EE8C
+EE8D
+EE8E
+EE8F
+EE90
+EE91
+EE92
+EE93
+EE94
+EE95
+EE96
+EE97
+EE98
+EE99
+EE9A
+EE9B
+EE9C
+EE9D
+EE9E
+EE9F
+EEA0
+EEA1
+EEA2
+EEA3
+EEA4
+EEA5
+EEA6
+EEA7
+EEA8
+EEA9
+EEAA
+EEAB
+EEAC
+EEAD
+EEAE
+EEAF
+EEB0
+EEB1
+EEB2
+EEB3
+EEB4
+EEB5
+EEB6
+EEB7
+EEB8
+EEB9
+EEBA
+EEBB
+EEBC
+EEBD
+EEBE
+EEBF
+EEC0
+EEC1
+EEC2
+EEC3
+EEC4
+EEC5
+EEC6
+EEC7
+EEC8
+EEC9
+EECA
+EECB
+EECC
+EECD
+EECE
+EECF
+EED0
+EED1
+EED2
+EED3
+EED4
+EED5
+EED6
+EED7
+EED8
+EED9
+EEDA
+EEDB
+EEDC
+EEDD
+EEDE
+EEDF
+EEE0
+EEE1
+EEE2
+EEE3
+EEE4
+EEE5
+EEE6
+EEE7
+EEE8
+EEE9
+EEEA
+EEEB
+EEEC
+EEEF
+EEF0
+EEF1
+EEF2
+EEF3
+EEF4
+EEF5
+EEF6
+EEF7
+EEF8
+EEF9
+EEFA
+EEFB
+EEFC
+FA40
+FA41
+FA42
+FA43
+FA44
+FA45
+FA46
+FA47
+FA48
+FA49
+FA4A
+FA4B
+FA4C
+FA4D
+FA4E
+FA4F
+FA50
+FA51
+FA52
+FA53
+FA54
+FA55
+FA56
+FA57
+FA58
+FA59
+FA5A
+FA5B
+FA5C
+FA5D
+FA5E
+FA5F
+FA60
+FA61
+FA62
+FA63
+FA64
+FA65
+FA66
+FA67
+FA68
+FA69
+FA6A
+FA6B
+FA6C
+FA6D
+FA6E
+FA6F
+FA70
+FA71
+FA72
+FA73
+FA74
+FA75
+FA76
+FA77
+FA78
+FA79
+FA7A
+FA7B
+FA7C
+FA7D
+FA7E
+FA80
+FA81
+FA82
+FA83
+FA84
+FA85
+FA86
+FA87
+FA88
+FA89
+FA8A
+FA8B
+FA8C
+FA8D
+FA8E
+FA8F
+FA90
+FA91
+FA92
+FA93
+FA94
+FA95
+FA96
+FA97
+FA98
+FA99
+FA9A
+FA9B
+FA9C
+FA9D
+FA9E
+FA9F
+FAA0
+FAA1
+FAA2
+FAA3
+FAA4
+FAA5
+FAA6
+FAA7
+FAA8
+FAA9
+FAAA
+FAAB
+FAAC
+FAAD
+FAAE
+FAAF
+FAB0
+FAB1
+FAB2
+FAB3
+FAB4
+FAB5
+FAB6
+FAB7
+FAB8
+FAB9
+FABA
+FABB
+FABC
+FABD
+FABE
+FABF
+FAC0
+FAC1
+FAC2
+FAC3
+FAC4
+FAC5
+FAC6
+FAC7
+FAC8
+FAC9
+FACA
+FACB
+FACC
+FACD
+FACE
+FACF
+FAD0
+FAD1
+FAD2
+FAD3
+FAD4
+FAD5
+FAD6
+FAD7
+FAD8
+FAD9
+FADA
+FADB
+FADC
+FADD
+FADE
+FADF
+FAE0
+FAE1
+FAE2
+FAE3
+FAE4
+FAE5
+FAE6
+FAE7
+FAE8
+FAE9
+FAEA
+FAEB
+FAEC
+FAED
+FAEE
+FAEF
+FAF0
+FAF1
+FAF2
+FAF3
+FAF4
+FAF5
+FAF6
+FAF7
+FAF8
+FAF9
+FAFA
+FAFB
+FAFC
+FB40
+FB41
+FB42
+FB43
+FB44
+FB45
+FB46
+FB47
+FB48
+FB49
+FB4A
+FB4B
+FB4C
+FB4D
+FB4E
+FB4F
+FB50
+FB51
+FB52
+FB53
+FB54
+FB55
+FB56
+FB57
+FB58
+FB59
+FB5A
+FB5B
+FB5C
+FB5D
+FB5E
+FB5F
+FB60
+FB61
+FB62
+FB63
+FB64
+FB65
+FB66
+FB67
+FB68
+FB69
+FB6A
+FB6B
+FB6C
+FB6D
+FB6E
+FB6F
+FB70
+FB71
+FB72
+FB73
+FB74
+FB75
+FB76
+FB77
+FB78
+FB79
+FB7A
+FB7B
+FB7C
+FB7D
+FB7E
+FB80
+FB81
+FB82
+FB83
+FB84
+FB85
+FB86
+FB87
+FB88
+FB89
+FB8A
+FB8B
+FB8C
+FB8D
+FB8E
+FB8F
+FB90
+FB91
+FB92
+FB93
+FB94
+FB95
+FB96
+FB97
+FB98
+FB99
+FB9A
+FB9B
+FB9C
+FB9D
+FB9E
+FB9F
+FBA0
+FBA1
+FBA2
+FBA3
+FBA4
+FBA5
+FBA6
+FBA7
+FBA8
+FBA9
+FBAA
+FBAB
+FBAC
+FBAD
+FBAE
+FBAF
+FBB0
+FBB1
+FBB2
+FBB3
+FBB4
+FBB5
+FBB6
+FBB7
+FBB8
+FBB9
+FBBA
+FBBB
+FBBC
+FBBD
+FBBE
+FBBF
+FBC0
+FBC1
+FBC2
+FBC3
+FBC4
+FBC5
+FBC6
+FBC7
+FBC8
+FBC9
+FBCA
+FBCB
+FBCC
+FBCD
+FBCE
+FBCF
+FBD0
+FBD1
+FBD2
+FBD3
+FBD4
+FBD5
+FBD6
+FBD7
+FBD8
+FBD9
+FBDA
+FBDB
+FBDC
+FBDD
+FBDE
+FBDF
+FBE0
+FBE1
+FBE2
+FBE3
+FBE4
+FBE5
+FBE6
+FBE7
+FBE8
+FBE9
+FBEA
+FBEB
+FBEC
+FBED
+FBEE
+FBEF
+FBF0
+FBF1
+FBF2
+FBF3
+FBF4
+FBF5
+FBF6
+FBF7
+FBF8
+FBF9
+FBFA
+FBFB
+FBFC
+FC40
+FC41
+FC42
+FC43
+FC44
+FC45
+FC46
+FC47
+FC48
+FC49
+FC4A
+FC4B
+F040
+F041
+F042
+F043
+F044
+F045
+F046
+F047
+F048
+F049
+F04A
+F04B
+F04C
+F04D
+F04E
+F04F
+F050
+F051
+F052
+F053
+F054
+F055
+F056
+F057
+F058
+F059
+F05A
+F05B
+F05C
+F05D
+F05E
+F05F
+F060
+F061
+F062
+F063
+F064
+F065
+F066
+F067
+F068
+F069
+F06A
+F06B
+F06C
+F06D
+F06E
+F06F
+F070
+F071
+F072
+F073
+F074
+F075
+F076
+F077
+F078
+F079
+F07A
+F07B
+F07C
+F07D
+F07E
+F080
+F081
+F082
+F083
+F084
+F085
+F086
+F087
+F088
+F089
+F08A
+F08B
+F08C
+F08D
+F08E
+F08F
+F090
+F091
+F092
+F093
+F094
+F095
+F096
+F097
+F098
+F099
+F09A
+F09B
+F09C
+F09D
+F09E
+F09F
+F0A0
+F0A1
+F0A2
+F0A3
+F0A4
+F0A5
+F0A6
+F0A7
+F0A8
+F0A9
+F0AA
+F0AB
+F0AC
+F0AD
+F0AE
+F0AF
+F0B0
+F0B1
+F0B2
+F0B3
+F0B4
+F0B5
+F0B6
+F0B7
+F0B8
+F0B9
+F0BA
+F0BB
+F0BC
+F0BD
+F0BE
+F0BF
+F0C0
+F0C1
+F0C2
+F0C3
+F0C4
+F0C5
+F0C6
+F0C7
+F0C8
+F0C9
+F0CA
+F0CB
+F0CC
+F0CD
+F0CE
+F0CF
+F0D0
+F0D1
+F0D2
+F0D3
+F0D4
+F0D5
+F0D6
+F0D7
+F0D8
+F0D9
+F0DA
+F0DB
+F0DC
+F0DD
+F0DE
+F0DF
+F0E0
+F0E1
+F0E2
+F0E3
+F0E4
+F0E5
+F0E6
+F0E7
+F0E8
+F0E9
+F0EA
+F0EB
+F0EC
+F0ED
+F0EE
+F0EF
+F0F0
+F0F1
+F0F2
+F0F3
+F0F4
+F0F5
+F0F6
+F0F7
+F0F8
+F0F9
+F0FA
+F0FB
+F0FC
+F140
+F141
+F142
+F143
+F144
+F145
+F146
+F147
+F148
+F149
+F14A
+F14B
+F14C
+F14D
+F14E
+F14F
+F150
+F151
+F152
+F153
+F154
+F155
+F156
+F157
+F158
+F159
+F15A
+F15B
+F15C
+F15D
+F15E
+F15F
+F160
+F161
+F162
+F163
+F164
+F165
+F166
+F167
+F168
+F169
+F16A
+F16B
+F16C
+F16D
+F16E
+F16F
+F170
+F171
+F172
+F173
+F174
+F175
+F176
+F177
+F178
+F179
+F17A
+F17B
+F17C
+F17D
+F17E
+F180
+F181
+F182
+F183
+F184
+F185
+F186
+F187
+F188
+F189
+F18A
+F18B
+F18C
+F18D
+F18E
+F18F
+F190
+F191
+F192
+F193
+F194
+F195
+F196
+F197
+F198
+F199
+F19A
+F19B
+F19C
+F19D
+F19E
+F19F
+F1A0
+F1A1
+F1A2
+F1A3
+F1A4
+F1A5
+F1A6
+F1A7
+F1A8
+F1A9
+F1AA
+F1AB
+F1AC
+F1AD
+F1AE
+F1AF
+F1B0
+F1B1
+F1B2
+F1B3
+F1B4
+F1B5
+F1B6
+F1B7
+F1B8
+F1B9
+F1BA
+F1BB
+F1BC
+F1BD
+F1BE
+F1BF
+F1C0
+F1C1
+F1C2
+F1C3
+F1C4
+F1C5
+F1C6
+F1C7
+F1C8
+F1C9
+F1CA
+F1CB
+F1CC
+F1CD
+F1CE
+F1CF
+F1D0
+F1D1
+F1D2
+F1D3
+F1D4
+F1D5
+F1D6
+F1D7
+F1D8
+F1D9
+F1DA
+F1DB
+F1DC
+F1DD
+F1DE
+F1DF
+F1E0
+F1E1
+F1E2
+F1E3
+F1E4
+F1E5
+F1E6
+F1E7
+F1E8
+F1E9
+F1EA
+F1EB
+F1EC
+F1ED
+F1EE
+F1EF
+F1F0
+F1F1
+F1F2
+F1F3
+F1F4
+F1F5
+F1F6
+F1F7
+F1F8
+F1F9
+F1FA
+F1FB
+F1FC
+F240
+F241
+F242
+F243
+F244
+F245
+F246
+F247
+F248
+F249
+F24A
+F24B
+F24C
+F24D
+F24E
+F24F
+F250
+F251
+F252
+F253
+F254
+F255
+F256
+F257
+F258
+F259
+F25A
+F25B
+F25C
+F25D
+F25E
+F25F
+F260
+F261
+F262
+F263
+F264
+F265
+F266
+F267
+F268
+F269
+F26A
+F26B
+F26C
+F26D
+F26E
+F26F
+F270
+F271
+F272
+F273
+F274
+F275
+F276
+F277
+F278
+F279
+F27A
+F27B
+F27C
+F27D
+F27E
+F280
+F281
+F282
+F283
+F284
+F285
+F286
+F287
+F288
+F289
+F28A
+F28B
+F28C
+F28D
+F28E
+F28F
+F290
+F291
+F292
+F293
+F294
+F295
+F296
+F297
+F298
+F299
+F29A
+F29B
+F29C
+F29D
+F29E
+F29F
+F2A0
+F2A1
+F2A2
+F2A3
+F2A4
+F2A5
+F2A6
+F2A7
+F2A8
+F2A9
+F2AA
+F2AB
+F2AC
+F2AD
+F2AE
+F2AF
+F2B0
+F2B1
+F2B2
+F2B3
+F2B4
+F2B5
+F2B6
+F2B7
+F2B8
+F2B9
+F2BA
+F2BB
+F2BC
+F2BD
+F2BE
+F2BF
+F2C0
+F2C1
+F2C2
+F2C3
+F2C4
+F2C5
+F2C6
+F2C7
+F2C8
+F2C9
+F2CA
+F2CB
+F2CC
+F2CD
+F2CE
+F2CF
+F2D0
+F2D1
+F2D2
+F2D3
+F2D4
+F2D5
+F2D6
+F2D7
+F2D8
+F2D9
+F2DA
+F2DB
+F2DC
+F2DD
+F2DE
+F2DF
+F2E0
+F2E1
+F2E2
+F2E3
+F2E4
+F2E5
+F2E6
+F2E7
+F2E8
+F2E9
+F2EA
+F2EB
+F2EC
+F2ED
+F2EE
+F2EF
+F2F0
+F2F1
+F2F2
+F2F3
+F2F4
+F2F5
+F2F6
+F2F7
+F2F8
+F2F9
+F2FA
+F2FB
+F2FC
+F340
+F341
+F342
+F343
+F344
+F345
+F346
+F347
+F348
+F349
+F34A
+F34B
+F34C
+F34D
+F34E
+F34F
+F350
+F351
+F352
+F353
+F354
+F355
+F356
+F357
+F358
+F359
+F35A
+F35B
+F35C
+F35D
+F35E
+F35F
+F360
+F361
+F362
+F363
+F364
+F365
+F366
+F367
+F368
+F369
+F36A
+F36B
+F36C
+F36D
+F36E
+F36F
+F370
+F371
+F372
+F373
+F374
+F375
+F376
+F377
+F378
+F379
+F37A
+F37B
+F37C
+F37D
+F37E
+F380
+F381
+F382
+F383
+F384
+F385
+F386
+F387
+F388
+F389
+F38A
+F38B
+F38C
+F38D
+F38E
+F38F
+F390
+F391
+F392
+F393
+F394
+F395
+F396
+F397
+F398
+F399
+F39A
+F39B
+F39C
+F39D
+F39E
+F39F
+F3A0
+F3A1
+F3A2
+F3A3
+F3A4
+F3A5
+F3A6
+F3A7
+F3A8
+F3A9
+F3AA
+F3AB
+F3AC
+F3AD
+F3AE
+F3AF
+F3B0
+F3B1
+F3B2
+F3B3
+F3B4
+F3B5
+F3B6
+F3B7
+F3B8
+F3B9
+F3BA
+F3BB
+F3BC
+F3BD
+F3BE
+F3BF
+F3C0
+F3C1
+F3C2
+F3C3
+F3C4
+F3C5
+F3C6
+F3C7
+F3C8
+F3C9
+F3CA
+F3CB
+F3CC
+F3CD
+F3CE
+F3CF
+F3D0
+F3D1
+F3D2
+F3D3
+F3D4
+F3D5
+F3D6
+F3D7
+F3D8
+F3D9
+F3DA
+F3DB
+F3DC
+F3DD
+F3DE
+F3DF
+F3E0
+F3E1
+F3E2
+F3E3
+F3E4
+F3E5
+F3E6
+F3E7
+F3E8
+F3E9
+F3EA
+F3EB
+F3EC
+F3ED
+F3EE
+F3EF
+F3F0
+F3F1
+F3F2
+F3F3
+F3F4
+F3F5
+F3F6
+F3F7
+F3F8
+F3F9
+F3FA
+F3FB
+F3FC
+F440
+F441
+F442
+F443
+F444
+F445
+F446
+F447
+F448
+F449
+F44A
+F44B
+F44C
+F44D
+F44E
+F44F
+F450
+F451
+F452
+F453
+F454
+F455
+F456
+F457
+F458
+F459
+F45A
+F45B
+F45C
+F45D
+F45E
+F45F
+F460
+F461
+F462
+F463
+F464
+F465
+F466
+F467
+F468
+F469
+F46A
+F46B
+F46C
+F46D
+F46E
+F46F
+F470
+F471
+F472
+F473
+F474
+F475
+F476
+F477
+F478
+F479
+F47A
+F47B
+F47C
+F47D
+F47E
+F480
+F481
+F482
+F483
+F484
+F485
+F486
+F487
+F488
+F489
+F48A
+F48B
+F48C
+F48D
+F48E
+F48F
+F490
+F491
+F492
+F493
+F494
+F495
+F496
+F497
+F498
+F499
+F49A
+F49B
+F49C
+F49D
+F49E
+F49F
+F4A0
+F4A1
+F4A2
+F4A3
+F4A4
+F4A5
+F4A6
+F4A7
+F4A8
+F4A9
+F4AA
+F4AB
+F4AC
+F4AD
+F4AE
+F4AF
+F4B0
+F4B1
+F4B2
+F4B3
+F4B4
+F4B5
+F4B6
+F4B7
+F4B8
+F4B9
+F4BA
+F4BB
+F4BC
+F4BD
+F4BE
+F4BF
+F4C0
+F4C1
+F4C2
+F4C3
+F4C4
+F4C5
+F4C6
+F4C7
+F4C8
+F4C9
+F4CA
+F4CB
+F4CC
+F4CD
+F4CE
+F4CF
+F4D0
+F4D1
+F4D2
+F4D3
+F4D4
+F4D5
+F4D6
+F4D7
+F4D8
+F4D9
+F4DA
+F4DB
+F4DC
+F4DD
+F4DE
+F4DF
+F4E0
+F4E1
+F4E2
+F4E3
+F4E4
+F4E5
+F4E6
+F4E7
+F4E8
+F4E9
+F4EA
+F4EB
+F4EC
+F4ED
+F4EE
+F4EF
+F4F0
+F4F1
+F4F2
+F4F3
+F4F4
+F4F5
+F4F6
+F4F7
+F4F8
+F4F9
+F4FA
+F4FB
+F4FC
+F540
+F541
+F542
+F543
+F544
+F545
+F546
+F547
+F548
+F549
+F54A
+F54B
+F54C
+F54D
+F54E
+F54F
+F550
+F551
+F552
+F553
+F554
+F555
+F556
+F557
+F558
+F559
+F55A
+F55B
+F55C
+F55D
+F55E
+F55F
+F560
+F561
+F562
+F563
+F564
+F565
+F566
+F567
+F568
+F569
+F56A
+F56B
+F56C
+F56D
+F56E
+F56F
+F570
+F571
+F572
+F573
+F574
+F575
+F576
+F577
+F578
+F579
+F57A
+F57B
+F57C
+F57D
+F57E
+F580
+F581
+F582
+F583
+F584
+F585
+F586
+F587
+F588
+F589
+F58A
+F58B
+F58C
+F58D
+F58E
+F58F
+F590
+F591
+F592
+F593
+F594
+F595
+F596
+F597
+F598
+F599
+F59A
+F59B
+F59C
+F59D
+F59E
+F59F
+F5A0
+F5A1
+F5A2
+F5A3
+F5A4
+F5A5
+F5A6
+F5A7
+F5A8
+F5A9
+F5AA
+F5AB
+F5AC
+F5AD
+F5AE
+F5AF
+F5B0
+F5B1
+F5B2
+F5B3
+F5B4
+F5B5
+F5B6
+F5B7
+F5B8
+F5B9
+F5BA
+F5BB
+F5BC
+F5BD
+F5BE
+F5BF
+F5C0
+F5C1
+F5C2
+F5C3
+F5C4
+F5C5
+F5C6
+F5C7
+F5C8
+F5C9
+F5CA
+F5CB
+F5CC
+F5CD
+F5CE
+F5CF
+F5D0
+F5D1
+F5D2
+F5D3
+F5D4
+F5D5
+F5D6
+F5D7
+F5D8
+F5D9
+F5DA
+F5DB
+F5DC
+F5DD
+F5DE
+F5DF
+F5E0
+F5E1
+F5E2
+F5E3
+F5E4
+F5E5
+F5E6
+F5E7
+F5E8
+F5E9
+F5EA
+F5EB
+F5EC
+F5ED
+F5EE
+F5EF
+F5F0
+F5F1
+F5F2
+F5F3
+F5F4
+F5F5
+F5F6
+F5F7
+F5F8
+F5F9
+F5FA
+F5FB
+F5FC
+F640
+F641
+F642
+F643
+F644
+F645
+F646
+F647
+F648
+F649
+F64A
+F64B
+F64C
+F64D
+F64E
+F64F
+F650
+F651
+F652
+F653
+F654
+F655
+F656
+F657
+F658
+F659
+F65A
+F65B
+F65C
+F65D
+F65E
+F65F
+F660
+F661
+F662
+F663
+F664
+F665
+F666
+F667
+F668
+F669
+F66A
+F66B
+F66C
+F66D
+F66E
+F66F
+F670
+F671
+F672
+F673
+F674
+F675
+F676
+F677
+F678
+F679
+F67A
+F67B
+F67C
+F67D
+F67E
+F680
+F681
+F682
+F683
+F684
+F685
+F686
+F687
+F688
+F689
+F68A
+F68B
+F68C
+F68D
+F68E
+F68F
+F690
+F691
+F692
+F693
+F694
+F695
+F696
+F697
+F698
+F699
+F69A
+F69B
+F69C
+F69D
+F69E
+F69F
+F6A0
+F6A1
+F6A2
+F6A3
+F6A4
+F6A5
+F6A6
+F6A7
+F6A8
+F6A9
+F6AA
+F6AB
+F6AC
+F6AD
+F6AE
+F6AF
+F6B0
+F6B1
+F6B2
+F6B3
+F6B4
+F6B5
+F6B6
+F6B7
+F6B8
+F6B9
+F6BA
+F6BB
+F6BC
+F6BD
+F6BE
+F6BF
+F6C0
+F6C1
+F6C2
+F6C3
+F6C4
+F6C5
+F6C6
+F6C7
+F6C8
+F6C9
+F6CA
+F6CB
+F6CC
+F6CD
+F6CE
+F6CF
+F6D0
+F6D1
+F6D2
+F6D3
+F6D4
+F6D5
+F6D6
+F6D7
+F6D8
+F6D9
+F6DA
+F6DB
+F6DC
+F6DD
+F6DE
+F6DF
+F6E0
+F6E1
+F6E2
+F6E3
+F6E4
+F6E5
+F6E6
+F6E7
+F6E8
+F6E9
+F6EA
+F6EB
+F6EC
+F6ED
+F6EE
+F6EF
+F6F0
+F6F1
+F6F2
+F6F3
+F6F4
+F6F5
+F6F6
+F6F7
+F6F8
+F6F9
+F6FA
+F6FB
+F6FC
+F740
+F741
+F742
+F743
+F744
+F745
+F746
+F747
+F748
+F749
+F74A
+F74B
+F74C
+F74D
+F74E
+F74F
+F750
+F751
+F752
+F753
+F754
+F755
+F756
+F757
+F758
+F759
+F75A
+F75B
+F75C
+F75D
+F75E
+F75F
+F760
+F761
+F762
+F763
+F764
+F765
+F766
+F767
+F768
+F769
+F76A
+F76B
+F76C
+F76D
+F76E
+F76F
+F770
+F771
+F772
+F773
+F774
+F775
+F776
+F777
+F778
+F779
+F77A
+F77B
+F77C
+F77D
+F77E
+F780
+F781
+F782
+F783
+F784
+F785
+F786
+F787
+F788
+F789
+F78A
+F78B
+F78C
+F78D
+F78E
+F78F
+F790
+F791
+F792
+F793
+F794
+F795
+F796
+F797
+F798
+F799
+F79A
+F79B
+F79C
+F79D
+F79E
+F79F
+F7A0
+F7A1
+F7A2
+F7A3
+F7A4
+F7A5
+F7A6
+F7A7
+F7A8
+F7A9
+F7AA
+F7AB
+F7AC
+F7AD
+F7AE
+F7AF
+F7B0
+F7B1
+F7B2
+F7B3
+F7B4
+F7B5
+F7B6
+F7B7
+F7B8
+F7B9
+F7BA
+F7BB
+F7BC
+F7BD
+F7BE
+F7BF
+F7C0
+F7C1
+F7C2
+F7C3
+F7C4
+F7C5
+F7C6
+F7C7
+F7C8
+F7C9
+F7CA
+F7CB
+F7CC
+F7CD
+F7CE
+F7CF
+F7D0
+F7D1
+F7D2
+F7D3
+F7D4
+F7D5
+F7D6
+F7D7
+F7D8
+F7D9
+F7DA
+F7DB
+F7DC
+F7DD
+F7DE
+F7DF
+F7E0
+F7E1
+F7E2
+F7E3
+F7E4
+F7E5
+F7E6
+F7E7
+F7E8
+F7E9
+F7EA
+F7EB
+F7EC
+F7ED
+F7EE
+F7EF
+F7F0
+F7F1
+F7F2
+F7F3
+F7F4
+F7F5
+F7F6
+F7F7
+F7F8
+F7F9
+F7FA
+F7FB
+F7FC
+F840
+F841
+F842
+F843
+F844
+F845
+F846
+F847
+F848
+F849
+F84A
+F84B
+F84C
+F84D
+F84E
+F84F
+F850
+F851
+F852
+F853
+F854
+F855
+F856
+F857
+F858
+F859
+F85A
+F85B
+F85C
+F85D
+F85E
+F85F
+F860
+F861
+F862
+F863
+F864
+F865
+F866
+F867
+F868
+F869
+F86A
+F86B
+F86C
+F86D
+F86E
+F86F
+F870
+F871
+F872
+F873
+F874
+F875
+F876
+F877
+F878
+F879
+F87A
+F87B
+F87C
+F87D
+F87E
+F880
+F881
+F882
+F883
+F884
+F885
+F886
+F887
+F888
+F889
+F88A
+F88B
+F88C
+F88D
+F88E
+F88F
+F890
+F891
+F892
+F893
+F894
+F895
+F896
+F897
+F898
+F899
+F89A
+F89B
+F89C
+F89D
+F89E
+F89F
+F8A0
+F8A1
+F8A2
+F8A3
+F8A4
+F8A5
+F8A6
+F8A7
+F8A8
+F8A9
+F8AA
+F8AB
+F8AC
+F8AD
+F8AE
+F8AF
+F8B0
+F8B1
+F8B2
+F8B3
+F8B4
+F8B5
+F8B6
+F8B7
+F8B8
+F8B9
+F8BA
+F8BB
+F8BC
+F8BD
+F8BE
+F8BF
+F8C0
+F8C1
+F8C2
+F8C3
+F8C4
+F8C5
+F8C6
+F8C7
+F8C8
+F8C9
+F8CA
+F8CB
+F8CC
+F8CD
+F8CE
+F8CF
+F8D0
+F8D1
+F8D2
+F8D3
+F8D4
+F8D5
+F8D6
+F8D7
+F8D8
+F8D9
+F8DA
+F8DB
+F8DC
+F8DD
+F8DE
+F8DF
+F8E0
+F8E1
+F8E2
+F8E3
+F8E4
+F8E5
+F8E6
+F8E7
+F8E8
+F8E9
+F8EA
+F8EB
+F8EC
+F8ED
+F8EE
+F8EF
+F8F0
+F8F1
+F8F2
+F8F3
+F8F4
+F8F5
+F8F6
+F8F7
+F8F8
+F8F9
+F8FA
+F8FB
+F8FC
+F940
+F941
+F942
+F943
+F944
+F945
+F946
+F947
+F948
+F949
+F94A
+F94B
+F94C
+F94D
+F94E
+F94F
+F950
+F951
+F952
+F953
+F954
+F955
+F956
+F957
+F958
+F959
+F95A
+F95B
+F95C
+F95D
+F95E
+F95F
+F960
+F961
+F962
+F963
+F964
+F965
+F966
+F967
+F968
+F969
+F96A
+F96B
+F96C
+F96D
+F96E
+F96F
+F970
+F971
+F972
+F973
+F974
+F975
+F976
+F977
+F978
+F979
+F97A
+F97B
+F97C
+F97D
+F97E
+F980
+F981
+F982
+F983
+F984
+F985
+F986
+F987
+F988
+F989
+F98A
+F98B
+F98C
+F98D
+F98E
+F98F
+F990
+F991
+F992
+F993
+F994
+F995
+F996
+F997
+F998
+F999
+F99A
+F99B
+F99C
+F99D
+F99E
+F99F
+F9A0
+F9A1
+F9A2
+F9A3
+F9A4
+F9A5
+F9A6
+F9A7
+F9A8
+F9A9
+F9AA
+F9AB
+F9AC
+F9AD
+F9AE
+F9AF
+F9B0
+F9B1
+F9B2
+F9B3
+F9B4
+F9B5
+F9B6
+F9B7
+F9B8
+F9B9
+F9BA
+F9BB
+F9BC
+F9BD
+F9BE
+F9BF
+F9C0
+F9C1
+F9C2
+F9C3
+F9C4
+F9C5
+F9C6
+F9C7
+F9C8
+F9C9
+F9CA
+F9CB
+F9CC
+F9CD
+F9CE
+F9CF
+F9D0
+F9D1
+F9D2
+F9D3
+F9D4
+F9D5
+F9D6
+F9D7
+F9D8
+F9D9
+F9DA
+F9DB
+F9DC
+F9DD
+F9DE
+F9DF
+F9E0
+F9E1
+F9E2
+F9E3
+F9E4
+F9E5
+F9E6
+F9E7
+F9E8
+F9E9
+F9EA
+F9EB
+F9EC
+F9ED
+F9EE
+F9EF
+F9F0
+F9F1
+F9F2
+F9F3
+F9F4
+F9F5
+F9F6
+F9F7
+F9F8
+F9F9
+F9FA
+F9FB
+F9FC
+CREATE TABLE t2 SELECT CONVERT(c1 USING ucs2) AS c1 FROM t1;
+SELECT HEX(c1) FROM t2;
+HEX(c1)
+0005
+007E
+2015
+FF3C
+FF5E
+2225
+FF0D
+FFE0
+FFE1
+FFE2
+2460
+2461
+2462
+2463
+2464
+2465
+2466
+2467
+2468
+2469
+246A
+246B
+246C
+246D
+246E
+246F
+2470
+2471
+2472
+2473
+2160
+2161
+2162
+2163
+2164
+2165
+2166
+2167
+2168
+2169
+3349
+3314
+3322
+334D
+3318
+3327
+3303
+3336
+3351
+3357
+330D
+3326
+3323
+332B
+334A
+333B
+339C
+339D
+339E
+338E
+338F
+33C4
+33A1
+337B
+301D
+301F
+2116
+33CD
+2121
+32A4
+32A5
+32A6
+32A7
+32A8
+3231
+3232
+3239
+337E
+337D
+337C
+2252
+2261
+222B
+222E
+2211
+221A
+22A5
+2220
+221F
+22BF
+2235
+2229
+222A
+7E8A
+891C
+9348
+9288
+84DC
+4FC9
+70BB
+6631
+68C8
+92F9
+66FB
+5F45
+4E28
+4EE1
+4EFC
+4F00
+4F03
+4F39
+4F56
+4F92
+4F8A
+4F9A
+4F94
+4FCD
+5040
+5022
+4FFF
+501E
+5046
+5070
+5042
+5094
+50F4
+50D8
+514A
+5164
+519D
+51BE
+51EC
+5215
+529C
+52A6
+52C0
+52DB
+5300
+5307
+5324
+5372
+5393
+53B2
+53DD
+FA0E
+549C
+548A
+54A9
+54FF
+5586
+5759
+5765
+57AC
+57C8
+57C7
+FA0F
+FA10
+589E
+58B2
+590B
+5953
+595B
+595D
+5963
+59A4
+59BA
+5B56
+5BC0
+752F
+5BD8
+5BEC
+5C1E
+5CA6
+5CBA
+5CF5
+5D27
+5D53
+FA11
+5D42
+5D6D
+5DB8
+5DB9
+5DD0
+5F21
+5F34
+5F67
+5FB7
+5FDE
+605D
+6085
+608A
+60DE
+60D5
+6120
+60F2
+6111
+6137
+6130
+6198
+6213
+62A6
+63F5
+6460
+649D
+64CE
+654E
+6600
+6615
+663B
+6609
+662E
+661E
+6624
+6665
+6657
+6659
+FA12
+6673
+6699
+66A0
+66B2
+66BF
+66FA
+670E
+F929
+6766
+67BB
+6852
+67C0
+6801
+6844
+68CF
+FA13
+6968
+FA14
+6998
+69E2
+6A30
+6A6B
+6A46
+6A73
+6A7E
+6AE2
+6AE4
+6BD6
+6C3F
+6C5C
+6C86
+6C6F
+6CDA
+6D04
+6D87
+6D6F
+6D96
+6DAC
+6DCF
+6DF8
+6DF2
+6DFC
+6E39
+6E5C
+6E27
+6E3C
+6EBF
+6F88
+6FB5
+6FF5
+7005
+7007
+7028
+7085
+70AB
+710F
+7104
+715C
+7146
+7147
+FA15
+71C1
+71FE
+72B1
+72BE
+7324
+FA16
+7377
+73BD
+73C9
+73D6
+73E3
+73D2
+7407
+73F5
+7426
+742A
+7429
+742E
+7462
+7489
+749F
+7501
+756F
+7682
+769C
+769E
+769B
+76A6
+FA17
+7746
+52AF
+7821
+784E
+7864
+787A
+7930
+FA18
+FA19
+FA1A
+7994
+FA1B
+799B
+7AD1
+7AE7
+FA1C
+7AEB
+7B9E
+FA1D
+7D48
+7D5C
+7DB7
+7DA0
+7DD6
+7E52
+7F47
+7FA1
+FA1E
+8301
+8362
+837F
+83C7
+83F6
+8448
+84B4
+8553
+8559
+856B
+FA1F
+85B0
+FA20
+FA21
+8807
+88F5
+8A12
+8A37
+8A79
+8AA7
+8ABE
+8ADF
+FA22
+8AF6
+8B53
+8B7F
+8CF0
+8CF4
+8D12
+8D76
+FA23
+8ECF
+FA24
+FA25
+9067
+90DE
+FA26
+9115
+9127
+91DA
+91D7
+91DE
+91ED
+91EE
+91E4
+91E5
+9206
+9210
+920A
+923A
+9240
+923C
+924E
+9259
+9251
+9239
+9267
+92A7
+9277
+9278
+92E7
+92D7
+92D9
+92D0
+FA27
+92D5
+92E0
+92D3
+9325
+9321
+92FB
+FA28
+931E
+92FF
+931D
+9302
+9370
+9357
+93A4
+93C6
+93DE
+93F8
+9431
+9445
+9448
+9592
+F9DC
+FA29
+969D
+96AF
+9733
+973B
+9743
+974D
+974F
+9751
+9755
+9857
+9865
+FA2A
+FA2B
+9927
+FA2C
+999E
+9A4E
+9AD9
+9ADC
+9B75
+9B72
+9B8F
+9BB1
+9BBB
+9C00
+9D70
+9D6B
+FA2D
+9E19
+9ED1
+2170
+2171
+2172
+2173
+2174
+2175
+2176
+2177
+2178
+2179
+FFE2
+FFE4
+FF07
+FF02
+2170
+2171
+2172
+2173
+2174
+2175
+2176
+2177
+2178
+2179
+2160
+2161
+2162
+2163
+2164
+2165
+2166
+2167
+2168
+2169
+FFE2
+FFE4
+FF07
+FF02
+3231
+2116
+2121
+2235
+7E8A
+891C
+9348
+9288
+84DC
+4FC9
+70BB
+6631
+68C8
+92F9
+66FB
+5F45
+4E28
+4EE1
+4EFC
+4F00
+4F03
+4F39
+4F56
+4F92
+4F8A
+4F9A
+4F94
+4FCD
+5040
+5022
+4FFF
+501E
+5046
+5070
+5042
+5094
+50F4
+50D8
+514A
+5164
+519D
+51BE
+51EC
+5215
+529C
+52A6
+52C0
+52DB
+5300
+5307
+5324
+5372
+5393
+53B2
+53DD
+FA0E
+549C
+548A
+54A9
+54FF
+5586
+5759
+5765
+57AC
+57C8
+57C7
+FA0F
+FA10
+589E
+58B2
+590B
+5953
+595B
+595D
+5963
+59A4
+59BA
+5B56
+5BC0
+752F
+5BD8
+5BEC
+5C1E
+5CA6
+5CBA
+5CF5
+5D27
+5D53
+FA11
+5D42
+5D6D
+5DB8
+5DB9
+5DD0
+5F21
+5F34
+5F67
+5FB7
+5FDE
+605D
+6085
+608A
+60DE
+60D5
+6120
+60F2
+6111
+6137
+6130
+6198
+6213
+62A6
+63F5
+6460
+649D
+64CE
+654E
+6600
+6615
+663B
+6609
+662E
+661E
+6624
+6665
+6657
+6659
+FA12
+6673
+6699
+66A0
+66B2
+66BF
+66FA
+670E
+F929
+6766
+67BB
+6852
+67C0
+6801
+6844
+68CF
+FA13
+6968
+FA14
+6998
+69E2
+6A30
+6A6B
+6A46
+6A73
+6A7E
+6AE2
+6AE4
+6BD6
+6C3F
+6C5C
+6C86
+6C6F
+6CDA
+6D04
+6D87
+6D6F
+6D96
+6DAC
+6DCF
+6DF8
+6DF2
+6DFC
+6E39
+6E5C
+6E27
+6E3C
+6EBF
+6F88
+6FB5
+6FF5
+7005
+7007
+7028
+7085
+70AB
+710F
+7104
+715C
+7146
+7147
+FA15
+71C1
+71FE
+72B1
+72BE
+7324
+FA16
+7377
+73BD
+73C9
+73D6
+73E3
+73D2
+7407
+73F5
+7426
+742A
+7429
+742E
+7462
+7489
+749F
+7501
+756F
+7682
+769C
+769E
+769B
+76A6
+FA17
+7746
+52AF
+7821
+784E
+7864
+787A
+7930
+FA18
+FA19
+FA1A
+7994
+FA1B
+799B
+7AD1
+7AE7
+FA1C
+7AEB
+7B9E
+FA1D
+7D48
+7D5C
+7DB7
+7DA0
+7DD6
+7E52
+7F47
+7FA1
+FA1E
+8301
+8362
+837F
+83C7
+83F6
+8448
+84B4
+8553
+8559
+856B
+FA1F
+85B0
+FA20
+FA21
+8807
+88F5
+8A12
+8A37
+8A79
+8AA7
+8ABE
+8ADF
+FA22
+8AF6
+8B53
+8B7F
+8CF0
+8CF4
+8D12
+8D76
+FA23
+8ECF
+FA24
+FA25
+9067
+90DE
+FA26
+9115
+9127
+91DA
+91D7
+91DE
+91ED
+91EE
+91E4
+91E5
+9206
+9210
+920A
+923A
+9240
+923C
+924E
+9259
+9251
+9239
+9267
+92A7
+9277
+9278
+92E7
+92D7
+92D9
+92D0
+FA27
+92D5
+92E0
+92D3
+9325
+9321
+92FB
+FA28
+931E
+92FF
+931D
+9302
+9370
+9357
+93A4
+93C6
+93DE
+93F8
+9431
+9445
+9448
+9592
+F9DC
+FA29
+969D
+96AF
+9733
+973B
+9743
+974D
+974F
+9751
+9755
+9857
+9865
+FA2A
+FA2B
+9927
+FA2C
+999E
+9A4E
+9AD9
+9ADC
+9B75
+9B72
+9B8F
+9BB1
+9BBB
+9C00
+9D70
+9D6B
+FA2D
+9E19
+9ED1
+E000
+E001
+E002
+E003
+E004
+E005
+E006
+E007
+E008
+E009
+E00A
+E00B
+E00C
+E00D
+E00E
+E00F
+E010
+E011
+E012
+E013
+E014
+E015
+E016
+E017
+E018
+E019
+E01A
+E01B
+E01C
+E01D
+E01E
+E01F
+E020
+E021
+E022
+E023
+E024
+E025
+E026
+E027
+E028
+E029
+E02A
+E02B
+E02C
+E02D
+E02E
+E02F
+E030
+E031
+E032
+E033
+E034
+E035
+E036
+E037
+E038
+E039
+E03A
+E03B
+E03C
+E03D
+E03E
+E03F
+E040
+E041
+E042
+E043
+E044
+E045
+E046
+E047
+E048
+E049
+E04A
+E04B
+E04C
+E04D
+E04E
+E04F
+E050
+E051
+E052
+E053
+E054
+E055
+E056
+E057
+E058
+E059
+E05A
+E05B
+E05C
+E05D
+E05E
+E05F
+E060
+E061
+E062
+E063
+E064
+E065
+E066
+E067
+E068
+E069
+E06A
+E06B
+E06C
+E06D
+E06E
+E06F
+E070
+E071
+E072
+E073
+E074
+E075
+E076
+E077
+E078
+E079
+E07A
+E07B
+E07C
+E07D
+E07E
+E07F
+E080
+E081
+E082
+E083
+E084
+E085
+E086
+E087
+E088
+E089
+E08A
+E08B
+E08C
+E08D
+E08E
+E08F
+E090
+E091
+E092
+E093
+E094
+E095
+E096
+E097
+E098
+E099
+E09A
+E09B
+E09C
+E09D
+E09E
+E09F
+E0A0
+E0A1
+E0A2
+E0A3
+E0A4
+E0A5
+E0A6
+E0A7
+E0A8
+E0A9
+E0AA
+E0AB
+E0AC
+E0AD
+E0AE
+E0AF
+E0B0
+E0B1
+E0B2
+E0B3
+E0B4
+E0B5
+E0B6
+E0B7
+E0B8
+E0B9
+E0BA
+E0BB
+E0BC
+E0BD
+E0BE
+E0BF
+E0C0
+E0C1
+E0C2
+E0C3
+E0C4
+E0C5
+E0C6
+E0C7
+E0C8
+E0C9
+E0CA
+E0CB
+E0CC
+E0CD
+E0CE
+E0CF
+E0D0
+E0D1
+E0D2
+E0D3
+E0D4
+E0D5
+E0D6
+E0D7
+E0D8
+E0D9
+E0DA
+E0DB
+E0DC
+E0DD
+E0DE
+E0DF
+E0E0
+E0E1
+E0E2
+E0E3
+E0E4
+E0E5
+E0E6
+E0E7
+E0E8
+E0E9
+E0EA
+E0EB
+E0EC
+E0ED
+E0EE
+E0EF
+E0F0
+E0F1
+E0F2
+E0F3
+E0F4
+E0F5
+E0F6
+E0F7
+E0F8
+E0F9
+E0FA
+E0FB
+E0FC
+E0FD
+E0FE
+E0FF
+E100
+E101
+E102
+E103
+E104
+E105
+E106
+E107
+E108
+E109
+E10A
+E10B
+E10C
+E10D
+E10E
+E10F
+E110
+E111
+E112
+E113
+E114
+E115
+E116
+E117
+E118
+E119
+E11A
+E11B
+E11C
+E11D
+E11E
+E11F
+E120
+E121
+E122
+E123
+E124
+E125
+E126
+E127
+E128
+E129
+E12A
+E12B
+E12C
+E12D
+E12E
+E12F
+E130
+E131
+E132
+E133
+E134
+E135
+E136
+E137
+E138
+E139
+E13A
+E13B
+E13C
+E13D
+E13E
+E13F
+E140
+E141
+E142
+E143
+E144
+E145
+E146
+E147
+E148
+E149
+E14A
+E14B
+E14C
+E14D
+E14E
+E14F
+E150
+E151
+E152
+E153
+E154
+E155
+E156
+E157
+E158
+E159
+E15A
+E15B
+E15C
+E15D
+E15E
+E15F
+E160
+E161
+E162
+E163
+E164
+E165
+E166
+E167
+E168
+E169
+E16A
+E16B
+E16C
+E16D
+E16E
+E16F
+E170
+E171
+E172
+E173
+E174
+E175
+E176
+E177
+E178
+E179
+E17A
+E17B
+E17C
+E17D
+E17E
+E17F
+E180
+E181
+E182
+E183
+E184
+E185
+E186
+E187
+E188
+E189
+E18A
+E18B
+E18C
+E18D
+E18E
+E18F
+E190
+E191
+E192
+E193
+E194
+E195
+E196
+E197
+E198
+E199
+E19A
+E19B
+E19C
+E19D
+E19E
+E19F
+E1A0
+E1A1
+E1A2
+E1A3
+E1A4
+E1A5
+E1A6
+E1A7
+E1A8
+E1A9
+E1AA
+E1AB
+E1AC
+E1AD
+E1AE
+E1AF
+E1B0
+E1B1
+E1B2
+E1B3
+E1B4
+E1B5
+E1B6
+E1B7
+E1B8
+E1B9
+E1BA
+E1BB
+E1BC
+E1BD
+E1BE
+E1BF
+E1C0
+E1C1
+E1C2
+E1C3
+E1C4
+E1C5
+E1C6
+E1C7
+E1C8
+E1C9
+E1CA
+E1CB
+E1CC
+E1CD
+E1CE
+E1CF
+E1D0
+E1D1
+E1D2
+E1D3
+E1D4
+E1D5
+E1D6
+E1D7
+E1D8
+E1D9
+E1DA
+E1DB
+E1DC
+E1DD
+E1DE
+E1DF
+E1E0
+E1E1
+E1E2
+E1E3
+E1E4
+E1E5
+E1E6
+E1E7
+E1E8
+E1E9
+E1EA
+E1EB
+E1EC
+E1ED
+E1EE
+E1EF
+E1F0
+E1F1
+E1F2
+E1F3
+E1F4
+E1F5
+E1F6
+E1F7
+E1F8
+E1F9
+E1FA
+E1FB
+E1FC
+E1FD
+E1FE
+E1FF
+E200
+E201
+E202
+E203
+E204
+E205
+E206
+E207
+E208
+E209
+E20A
+E20B
+E20C
+E20D
+E20E
+E20F
+E210
+E211
+E212
+E213
+E214
+E215
+E216
+E217
+E218
+E219
+E21A
+E21B
+E21C
+E21D
+E21E
+E21F
+E220
+E221
+E222
+E223
+E224
+E225
+E226
+E227
+E228
+E229
+E22A
+E22B
+E22C
+E22D
+E22E
+E22F
+E230
+E231
+E232
+E233
+E234
+E235
+E236
+E237
+E238
+E239
+E23A
+E23B
+E23C
+E23D
+E23E
+E23F
+E240
+E241
+E242
+E243
+E244
+E245
+E246
+E247
+E248
+E249
+E24A
+E24B
+E24C
+E24D
+E24E
+E24F
+E250
+E251
+E252
+E253
+E254
+E255
+E256
+E257
+E258
+E259
+E25A
+E25B
+E25C
+E25D
+E25E
+E25F
+E260
+E261
+E262
+E263
+E264
+E265
+E266
+E267
+E268
+E269
+E26A
+E26B
+E26C
+E26D
+E26E
+E26F
+E270
+E271
+E272
+E273
+E274
+E275
+E276
+E277
+E278
+E279
+E27A
+E27B
+E27C
+E27D
+E27E
+E27F
+E280
+E281
+E282
+E283
+E284
+E285
+E286
+E287
+E288
+E289
+E28A
+E28B
+E28C
+E28D
+E28E
+E28F
+E290
+E291
+E292
+E293
+E294
+E295
+E296
+E297
+E298
+E299
+E29A
+E29B
+E29C
+E29D
+E29E
+E29F
+E2A0
+E2A1
+E2A2
+E2A3
+E2A4
+E2A5
+E2A6
+E2A7
+E2A8
+E2A9
+E2AA
+E2AB
+E2AC
+E2AD
+E2AE
+E2AF
+E2B0
+E2B1
+E2B2
+E2B3
+E2B4
+E2B5
+E2B6
+E2B7
+E2B8
+E2B9
+E2BA
+E2BB
+E2BC
+E2BD
+E2BE
+E2BF
+E2C0
+E2C1
+E2C2
+E2C3
+E2C4
+E2C5
+E2C6
+E2C7
+E2C8
+E2C9
+E2CA
+E2CB
+E2CC
+E2CD
+E2CE
+E2CF
+E2D0
+E2D1
+E2D2
+E2D3
+E2D4
+E2D5
+E2D6
+E2D7
+E2D8
+E2D9
+E2DA
+E2DB
+E2DC
+E2DD
+E2DE
+E2DF
+E2E0
+E2E1
+E2E2
+E2E3
+E2E4
+E2E5
+E2E6
+E2E7
+E2E8
+E2E9
+E2EA
+E2EB
+E2EC
+E2ED
+E2EE
+E2EF
+E2F0
+E2F1
+E2F2
+E2F3
+E2F4
+E2F5
+E2F6
+E2F7
+E2F8
+E2F9
+E2FA
+E2FB
+E2FC
+E2FD
+E2FE
+E2FF
+E300
+E301
+E302
+E303
+E304
+E305
+E306
+E307
+E308
+E309
+E30A
+E30B
+E30C
+E30D
+E30E
+E30F
+E310
+E311
+E312
+E313
+E314
+E315
+E316
+E317
+E318
+E319
+E31A
+E31B
+E31C
+E31D
+E31E
+E31F
+E320
+E321
+E322
+E323
+E324
+E325
+E326
+E327
+E328
+E329
+E32A
+E32B
+E32C
+E32D
+E32E
+E32F
+E330
+E331
+E332
+E333
+E334
+E335
+E336
+E337
+E338
+E339
+E33A
+E33B
+E33C
+E33D
+E33E
+E33F
+E340
+E341
+E342
+E343
+E344
+E345
+E346
+E347
+E348
+E349
+E34A
+E34B
+E34C
+E34D
+E34E
+E34F
+E350
+E351
+E352
+E353
+E354
+E355
+E356
+E357
+E358
+E359
+E35A
+E35B
+E35C
+E35D
+E35E
+E35F
+E360
+E361
+E362
+E363
+E364
+E365
+E366
+E367
+E368
+E369
+E36A
+E36B
+E36C
+E36D
+E36E
+E36F
+E370
+E371
+E372
+E373
+E374
+E375
+E376
+E377
+E378
+E379
+E37A
+E37B
+E37C
+E37D
+E37E
+E37F
+E380
+E381
+E382
+E383
+E384
+E385
+E386
+E387
+E388
+E389
+E38A
+E38B
+E38C
+E38D
+E38E
+E38F
+E390
+E391
+E392
+E393
+E394
+E395
+E396
+E397
+E398
+E399
+E39A
+E39B
+E39C
+E39D
+E39E
+E39F
+E3A0
+E3A1
+E3A2
+E3A3
+E3A4
+E3A5
+E3A6
+E3A7
+E3A8
+E3A9
+E3AA
+E3AB
+E3AC
+E3AD
+E3AE
+E3AF
+E3B0
+E3B1
+E3B2
+E3B3
+E3B4
+E3B5
+E3B6
+E3B7
+E3B8
+E3B9
+E3BA
+E3BB
+E3BC
+E3BD
+E3BE
+E3BF
+E3C0
+E3C1
+E3C2
+E3C3
+E3C4
+E3C5
+E3C6
+E3C7
+E3C8
+E3C9
+E3CA
+E3CB
+E3CC
+E3CD
+E3CE
+E3CF
+E3D0
+E3D1
+E3D2
+E3D3
+E3D4
+E3D5
+E3D6
+E3D7
+E3D8
+E3D9
+E3DA
+E3DB
+E3DC
+E3DD
+E3DE
+E3DF
+E3E0
+E3E1
+E3E2
+E3E3
+E3E4
+E3E5
+E3E6
+E3E7
+E3E8
+E3E9
+E3EA
+E3EB
+E3EC
+E3ED
+E3EE
+E3EF
+E3F0
+E3F1
+E3F2
+E3F3
+E3F4
+E3F5
+E3F6
+E3F7
+E3F8
+E3F9
+E3FA
+E3FB
+E3FC
+E3FD
+E3FE
+E3FF
+E400
+E401
+E402
+E403
+E404
+E405
+E406
+E407
+E408
+E409
+E40A
+E40B
+E40C
+E40D
+E40E
+E40F
+E410
+E411
+E412
+E413
+E414
+E415
+E416
+E417
+E418
+E419
+E41A
+E41B
+E41C
+E41D
+E41E
+E41F
+E420
+E421
+E422
+E423
+E424
+E425
+E426
+E427
+E428
+E429
+E42A
+E42B
+E42C
+E42D
+E42E
+E42F
+E430
+E431
+E432
+E433
+E434
+E435
+E436
+E437
+E438
+E439
+E43A
+E43B
+E43C
+E43D
+E43E
+E43F
+E440
+E441
+E442
+E443
+E444
+E445
+E446
+E447
+E448
+E449
+E44A
+E44B
+E44C
+E44D
+E44E
+E44F
+E450
+E451
+E452
+E453
+E454
+E455
+E456
+E457
+E458
+E459
+E45A
+E45B
+E45C
+E45D
+E45E
+E45F
+E460
+E461
+E462
+E463
+E464
+E465
+E466
+E467
+E468
+E469
+E46A
+E46B
+E46C
+E46D
+E46E
+E46F
+E470
+E471
+E472
+E473
+E474
+E475
+E476
+E477
+E478
+E479
+E47A
+E47B
+E47C
+E47D
+E47E
+E47F
+E480
+E481
+E482
+E483
+E484
+E485
+E486
+E487
+E488
+E489
+E48A
+E48B
+E48C
+E48D
+E48E
+E48F
+E490
+E491
+E492
+E493
+E494
+E495
+E496
+E497
+E498
+E499
+E49A
+E49B
+E49C
+E49D
+E49E
+E49F
+E4A0
+E4A1
+E4A2
+E4A3
+E4A4
+E4A5
+E4A6
+E4A7
+E4A8
+E4A9
+E4AA
+E4AB
+E4AC
+E4AD
+E4AE
+E4AF
+E4B0
+E4B1
+E4B2
+E4B3
+E4B4
+E4B5
+E4B6
+E4B7
+E4B8
+E4B9
+E4BA
+E4BB
+E4BC
+E4BD
+E4BE
+E4BF
+E4C0
+E4C1
+E4C2
+E4C3
+E4C4
+E4C5
+E4C6
+E4C7
+E4C8
+E4C9
+E4CA
+E4CB
+E4CC
+E4CD
+E4CE
+E4CF
+E4D0
+E4D1
+E4D2
+E4D3
+E4D4
+E4D5
+E4D6
+E4D7
+E4D8
+E4D9
+E4DA
+E4DB
+E4DC
+E4DD
+E4DE
+E4DF
+E4E0
+E4E1
+E4E2
+E4E3
+E4E4
+E4E5
+E4E6
+E4E7
+E4E8
+E4E9
+E4EA
+E4EB
+E4EC
+E4ED
+E4EE
+E4EF
+E4F0
+E4F1
+E4F2
+E4F3
+E4F4
+E4F5
+E4F6
+E4F7
+E4F8
+E4F9
+E4FA
+E4FB
+E4FC
+E4FD
+E4FE
+E4FF
+E500
+E501
+E502
+E503
+E504
+E505
+E506
+E507
+E508
+E509
+E50A
+E50B
+E50C
+E50D
+E50E
+E50F
+E510
+E511
+E512
+E513
+E514
+E515
+E516
+E517
+E518
+E519
+E51A
+E51B
+E51C
+E51D
+E51E
+E51F
+E520
+E521
+E522
+E523
+E524
+E525
+E526
+E527
+E528
+E529
+E52A
+E52B
+E52C
+E52D
+E52E
+E52F
+E530
+E531
+E532
+E533
+E534
+E535
+E536
+E537
+E538
+E539
+E53A
+E53B
+E53C
+E53D
+E53E
+E53F
+E540
+E541
+E542
+E543
+E544
+E545
+E546
+E547
+E548
+E549
+E54A
+E54B
+E54C
+E54D
+E54E
+E54F
+E550
+E551
+E552
+E553
+E554
+E555
+E556
+E557
+E558
+E559
+E55A
+E55B
+E55C
+E55D
+E55E
+E55F
+E560
+E561
+E562
+E563
+E564
+E565
+E566
+E567
+E568
+E569
+E56A
+E56B
+E56C
+E56D
+E56E
+E56F
+E570
+E571
+E572
+E573
+E574
+E575
+E576
+E577
+E578
+E579
+E57A
+E57B
+E57C
+E57D
+E57E
+E57F
+E580
+E581
+E582
+E583
+E584
+E585
+E586
+E587
+E588
+E589
+E58A
+E58B
+E58C
+E58D
+E58E
+E58F
+E590
+E591
+E592
+E593
+E594
+E595
+E596
+E597
+E598
+E599
+E59A
+E59B
+E59C
+E59D
+E59E
+E59F
+E5A0
+E5A1
+E5A2
+E5A3
+E5A4
+E5A5
+E5A6
+E5A7
+E5A8
+E5A9
+E5AA
+E5AB
+E5AC
+E5AD
+E5AE
+E5AF
+E5B0
+E5B1
+E5B2
+E5B3
+E5B4
+E5B5
+E5B6
+E5B7
+E5B8
+E5B9
+E5BA
+E5BB
+E5BC
+E5BD
+E5BE
+E5BF
+E5C0
+E5C1
+E5C2
+E5C3
+E5C4
+E5C5
+E5C6
+E5C7
+E5C8
+E5C9
+E5CA
+E5CB
+E5CC
+E5CD
+E5CE
+E5CF
+E5D0
+E5D1
+E5D2
+E5D3
+E5D4
+E5D5
+E5D6
+E5D7
+E5D8
+E5D9
+E5DA
+E5DB
+E5DC
+E5DD
+E5DE
+E5DF
+E5E0
+E5E1
+E5E2
+E5E3
+E5E4
+E5E5
+E5E6
+E5E7
+E5E8
+E5E9
+E5EA
+E5EB
+E5EC
+E5ED
+E5EE
+E5EF
+E5F0
+E5F1
+E5F2
+E5F3
+E5F4
+E5F5
+E5F6
+E5F7
+E5F8
+E5F9
+E5FA
+E5FB
+E5FC
+E5FD
+E5FE
+E5FF
+E600
+E601
+E602
+E603
+E604
+E605
+E606
+E607
+E608
+E609
+E60A
+E60B
+E60C
+E60D
+E60E
+E60F
+E610
+E611
+E612
+E613
+E614
+E615
+E616
+E617
+E618
+E619
+E61A
+E61B
+E61C
+E61D
+E61E
+E61F
+E620
+E621
+E622
+E623
+E624
+E625
+E626
+E627
+E628
+E629
+E62A
+E62B
+E62C
+E62D
+E62E
+E62F
+E630
+E631
+E632
+E633
+E634
+E635
+E636
+E637
+E638
+E639
+E63A
+E63B
+E63C
+E63D
+E63E
+E63F
+E640
+E641
+E642
+E643
+E644
+E645
+E646
+E647
+E648
+E649
+E64A
+E64B
+E64C
+E64D
+E64E
+E64F
+E650
+E651
+E652
+E653
+E654
+E655
+E656
+E657
+E658
+E659
+E65A
+E65B
+E65C
+E65D
+E65E
+E65F
+E660
+E661
+E662
+E663
+E664
+E665
+E666
+E667
+E668
+E669
+E66A
+E66B
+E66C
+E66D
+E66E
+E66F
+E670
+E671
+E672
+E673
+E674
+E675
+E676
+E677
+E678
+E679
+E67A
+E67B
+E67C
+E67D
+E67E
+E67F
+E680
+E681
+E682
+E683
+E684
+E685
+E686
+E687
+E688
+E689
+E68A
+E68B
+E68C
+E68D
+E68E
+E68F
+E690
+E691
+E692
+E693
+E694
+E695
+E696
+E697
+E698
+E699
+E69A
+E69B
+E69C
+E69D
+E69E
+E69F
+E6A0
+E6A1
+E6A2
+E6A3
+E6A4
+E6A5
+E6A6
+E6A7
+E6A8
+E6A9
+E6AA
+E6AB
+E6AC
+E6AD
+E6AE
+E6AF
+E6B0
+E6B1
+E6B2
+E6B3
+E6B4
+E6B5
+E6B6
+E6B7
+E6B8
+E6B9
+E6BA
+E6BB
+E6BC
+E6BD
+E6BE
+E6BF
+E6C0
+E6C1
+E6C2
+E6C3
+E6C4
+E6C5
+E6C6
+E6C7
+E6C8
+E6C9
+E6CA
+E6CB
+E6CC
+E6CD
+E6CE
+E6CF
+E6D0
+E6D1
+E6D2
+E6D3
+E6D4
+E6D5
+E6D6
+E6D7
+E6D8
+E6D9
+E6DA
+E6DB
+E6DC
+E6DD
+E6DE
+E6DF
+E6E0
+E6E1
+E6E2
+E6E3
+E6E4
+E6E5
+E6E6
+E6E7
+E6E8
+E6E9
+E6EA
+E6EB
+E6EC
+E6ED
+E6EE
+E6EF
+E6F0
+E6F1
+E6F2
+E6F3
+E6F4
+E6F5
+E6F6
+E6F7
+E6F8
+E6F9
+E6FA
+E6FB
+E6FC
+E6FD
+E6FE
+E6FF
+E700
+E701
+E702
+E703
+E704
+E705
+E706
+E707
+E708
+E709
+E70A
+E70B
+E70C
+E70D
+E70E
+E70F
+E710
+E711
+E712
+E713
+E714
+E715
+E716
+E717
+E718
+E719
+E71A
+E71B
+E71C
+E71D
+E71E
+E71F
+E720
+E721
+E722
+E723
+E724
+E725
+E726
+E727
+E728
+E729
+E72A
+E72B
+E72C
+E72D
+E72E
+E72F
+E730
+E731
+E732
+E733
+E734
+E735
+E736
+E737
+E738
+E739
+E73A
+E73B
+E73C
+E73D
+E73E
+E73F
+E740
+E741
+E742
+E743
+E744
+E745
+E746
+E747
+E748
+E749
+E74A
+E74B
+E74C
+E74D
+E74E
+E74F
+E750
+E751
+E752
+E753
+E754
+E755
+E756
+E757
+CREATE TABLE t3 SELECT CONVERT(c1 USING cp932) AS c1 FROM t2;
+SELECT HEX(c1) FROM t3;
+HEX(c1)
+05
+7E
+815C
+815F
+8160
+8161
+817C
+8191
+8192
+81CA
+8740
+8741
+8742
+8743
+8744
+8745
+8746
+8747
+8748
+8749
+874A
+874B
+874C
+874D
+874E
+874F
+8750
+8751
+8752
+8753
+8754
+8755
+8756
+8757
+8758
+8759
+875A
+875B
+875C
+875D
+875F
+8760
+8761
+8762
+8763
+8764
+8765
+8766
+8767
+8768
+8769
+876A
+876B
+876C
+876D
+876E
+876F
+8770
+8771
+8772
+8773
+8774
+8775
+877E
+8780
+8781
+8782
+8783
+8784
+8785
+8786
+8787
+8788
+8789
+878A
+878B
+878C
+878D
+878E
+878F
+81E0
+81DF
+81E7
+8793
+8794
+81E3
+81DB
+81DA
+8798
+8799
+81E6
+81BF
+81BE
+FA5C
+FA5D
+FA5E
+FA5F
+FA60
+FA61
+FA62
+FA63
+FA64
+FA65
+FA66
+FA67
+FA68
+FA69
+FA6A
+FA6B
+FA6C
+FA6D
+FA6E
+FA6F
+FA70
+FA71
+FA72
+FA73
+FA74
+FA75
+FA76
+FA77
+FA78
+FA79
+FA7A
+FA7B
+FA7C
+FA7D
+FA7E
+FA80
+FA81
+FA82
+FA83
+FA84
+FA85
+FA86
+FA87
+FA88
+FA89
+FA8A
+FA8B
+FA8C
+FA8D
+FA8E
+FA8F
+FA90
+FA91
+FA92
+FA93
+FA94
+FA95
+FA96
+FA97
+FA98
+FA99
+FA9A
+FA9B
+FA9C
+FA9D
+FA9E
+FA9F
+FAA0
+FAA1
+FAA2
+FAA3
+FAA4
+FAA5
+FAA6
+FAA7
+FAA8
+FAA9
+FAAA
+FAAB
+FAAC
+FAAD
+FAAE
+FAAF
+FAB0
+FAB1
+FAB2
+FAB3
+FAB4
+FAB5
+FAB6
+FAB7
+FAB8
+FAB9
+FABA
+FABB
+FABC
+FABD
+FABE
+FABF
+FAC0
+FAC1
+FAC2
+FAC3
+FAC4
+FAC5
+FAC6
+FAC7
+FAC8
+FAC9
+FACA
+FACB
+FACC
+FACD
+FACE
+FACF
+FAD0
+FAD1
+FAD2
+FAD3
+FAD4
+FAD5
+FAD6
+FAD7
+FAD8
+FAD9
+FADA
+FADB
+FADC
+FADD
+FADE
+FADF
+FAE0
+FAE1
+FAE2
+FAE3
+FAE4
+FAE5
+FAE6
+FAE7
+FAE8
+FAE9
+FAEA
+FAEB
+FAEC
+FAED
+FAEE
+FAEF
+FAF0
+FAF1
+FAF2
+FAF3
+FAF4
+FAF5
+FAF6
+FAF7
+FAF8
+FAF9
+FAFA
+FAFB
+FAFC
+FB40
+FB41
+FB42
+FB43
+FB44
+FB45
+FB46
+FB47
+FB48
+FB49
+FB4A
+FB4B
+FB4C
+FB4D
+FB4E
+FB4F
+FB50
+FB51
+FB52
+FB53
+FB54
+FB55
+FB56
+FB57
+FB58
+FB59
+FB5A
+FB5B
+FB5C
+FB5D
+FB5E
+FB5F
+FB60
+FB61
+FB62
+FB63
+FB64
+FB65
+FB66
+FB67
+FB68
+FB69
+FB6A
+FB6B
+FB6C
+FB6D
+FB6E
+FB6F
+FB70
+FB71
+FB72
+FB73
+FB74
+FB75
+FB76
+FB77
+FB78
+FB79
+FB7A
+FB7B
+FB7C
+FB7D
+FB7E
+FB80
+FB81
+FB82
+FB83
+FB84
+FB85
+FB86
+FB87
+FB88
+FB89
+FB8A
+FB8B
+FB8C
+FB8D
+FB8E
+FB8F
+FB90
+FB91
+FB92
+FB93
+FB94
+FB95
+FB96
+FB97
+FB98
+FB99
+FB9A
+FB9B
+FB9C
+FB9D
+FB9E
+FB9F
+FBA0
+FBA1
+FBA2
+FBA3
+FBA4
+FBA5
+FBA6
+FBA7
+FBA8
+FBA9
+FBAA
+FBAB
+FBAC
+FBAD
+FBAE
+FBAF
+FBB0
+FBB1
+FBB2
+FBB3
+FBB4
+FBB5
+FBB6
+FBB7
+FBB8
+FBB9
+FBBA
+FBBB
+FBBC
+FBBD
+FBBE
+FBBF
+FBC0
+FBC1
+FBC2
+FBC3
+FBC4
+FBC5
+FBC6
+FBC7
+FBC8
+FBC9
+FBCA
+FBCB
+FBCC
+FBCD
+FBCE
+FBCF
+FBD0
+FBD1
+FBD2
+FBD3
+FBD4
+FBD5
+FBD6
+FBD7
+FBD8
+FBD9
+FBDA
+FBDB
+FBDC
+FBDD
+FBDE
+FBDF
+FBE0
+FBE1
+FBE2
+FBE3
+FBE4
+FBE5
+FBE6
+FBE7
+FBE8
+FBE9
+FBEA
+FBEB
+FBEC
+FBED
+FBEE
+FBEF
+FBF0
+FBF1
+FBF2
+FBF3
+FBF4
+FBF5
+FBF6
+FBF7
+FBF8
+FBF9
+FBFA
+FBFB
+FBFC
+FC40
+FC41
+FC42
+FC43
+FC44
+FC45
+FC46
+FC47
+FC48
+FC49
+FC4A
+FC4B
+FA40
+FA41
+FA42
+FA43
+FA44
+FA45
+FA46
+FA47
+FA48
+FA49
+81CA
+FA55
+FA56
+FA57
+FA40
+FA41
+FA42
+FA43
+FA44
+FA45
+FA46
+FA47
+FA48
+FA49
+8754
+8755
+8756
+8757
+8758
+8759
+875A
+875B
+875C
+875D
+81CA
+FA55
+FA56
+FA57
+878A
+8782
+8784
+81E6
+FA5C
+FA5D
+FA5E
+FA5F
+FA60
+FA61
+FA62
+FA63
+FA64
+FA65
+FA66
+FA67
+FA68
+FA69
+FA6A
+FA6B
+FA6C
+FA6D
+FA6E
+FA6F
+FA70
+FA71
+FA72
+FA73
+FA74
+FA75
+FA76
+FA77
+FA78
+FA79
+FA7A
+FA7B
+FA7C
+FA7D
+FA7E
+FA80
+FA81
+FA82
+FA83
+FA84
+FA85
+FA86
+FA87
+FA88
+FA89
+FA8A
+FA8B
+FA8C
+FA8D
+FA8E
+FA8F
+FA90
+FA91
+FA92
+FA93
+FA94
+FA95
+FA96
+FA97
+FA98
+FA99
+FA9A
+FA9B
+FA9C
+FA9D
+FA9E
+FA9F
+FAA0
+FAA1
+FAA2
+FAA3
+FAA4
+FAA5
+FAA6
+FAA7
+FAA8
+FAA9
+FAAA
+FAAB
+FAAC
+FAAD
+FAAE
+FAAF
+FAB0
+FAB1
+FAB2
+FAB3
+FAB4
+FAB5
+FAB6
+FAB7
+FAB8
+FAB9
+FABA
+FABB
+FABC
+FABD
+FABE
+FABF
+FAC0
+FAC1
+FAC2
+FAC3
+FAC4
+FAC5
+FAC6
+FAC7
+FAC8
+FAC9
+FACA
+FACB
+FACC
+FACD
+FACE
+FACF
+FAD0
+FAD1
+FAD2
+FAD3
+FAD4
+FAD5
+FAD6
+FAD7
+FAD8
+FAD9
+FADA
+FADB
+FADC
+FADD
+FADE
+FADF
+FAE0
+FAE1
+FAE2
+FAE3
+FAE4
+FAE5
+FAE6
+FAE7
+FAE8
+FAE9
+FAEA
+FAEB
+FAEC
+FAED
+FAEE
+FAEF
+FAF0
+FAF1
+FAF2
+FAF3
+FAF4
+FAF5
+FAF6
+FAF7
+FAF8
+FAF9
+FAFA
+FAFB
+FAFC
+FB40
+FB41
+FB42
+FB43
+FB44
+FB45
+FB46
+FB47
+FB48
+FB49
+FB4A
+FB4B
+FB4C
+FB4D
+FB4E
+FB4F
+FB50
+FB51
+FB52
+FB53
+FB54
+FB55
+FB56
+FB57
+FB58
+FB59
+FB5A
+FB5B
+FB5C
+FB5D
+FB5E
+FB5F
+FB60
+FB61
+FB62
+FB63
+FB64
+FB65
+FB66
+FB67
+FB68
+FB69
+FB6A
+FB6B
+FB6C
+FB6D
+FB6E
+FB6F
+FB70
+FB71
+FB72
+FB73
+FB74
+FB75
+FB76
+FB77
+FB78
+FB79
+FB7A
+FB7B
+FB7C
+FB7D
+FB7E
+FB80
+FB81
+FB82
+FB83
+FB84
+FB85
+FB86
+FB87
+FB88
+FB89
+FB8A
+FB8B
+FB8C
+FB8D
+FB8E
+FB8F
+FB90
+FB91
+FB92
+FB93
+FB94
+FB95
+FB96
+FB97
+FB98
+FB99
+FB9A
+FB9B
+FB9C
+FB9D
+FB9E
+FB9F
+FBA0
+FBA1
+FBA2
+FBA3
+FBA4
+FBA5
+FBA6
+FBA7
+FBA8
+FBA9
+FBAA
+FBAB
+FBAC
+FBAD
+FBAE
+FBAF
+FBB0
+FBB1
+FBB2
+FBB3
+FBB4
+FBB5
+FBB6
+FBB7
+FBB8
+FBB9
+FBBA
+FBBB
+FBBC
+FBBD
+FBBE
+FBBF
+FBC0
+FBC1
+FBC2
+FBC3
+FBC4
+FBC5
+FBC6
+FBC7
+FBC8
+FBC9
+FBCA
+FBCB
+FBCC
+FBCD
+FBCE
+FBCF
+FBD0
+FBD1
+FBD2
+FBD3
+FBD4
+FBD5
+FBD6
+FBD7
+FBD8
+FBD9
+FBDA
+FBDB
+FBDC
+FBDD
+FBDE
+FBDF
+FBE0
+FBE1
+FBE2
+FBE3
+FBE4
+FBE5
+FBE6
+FBE7
+FBE8
+FBE9
+FBEA
+FBEB
+FBEC
+FBED
+FBEE
+FBEF
+FBF0
+FBF1
+FBF2
+FBF3
+FBF4
+FBF5
+FBF6
+FBF7
+FBF8
+FBF9
+FBFA
+FBFB
+FBFC
+FC40
+FC41
+FC42
+FC43
+FC44
+FC45
+FC46
+FC47
+FC48
+FC49
+FC4A
+FC4B
+F040
+F041
+F042
+F043
+F044
+F045
+F046
+F047
+F048
+F049
+F04A
+F04B
+F04C
+F04D
+F04E
+F04F
+F050
+F051
+F052
+F053
+F054
+F055
+F056
+F057
+F058
+F059
+F05A
+F05B
+F05C
+F05D
+F05E
+F05F
+F060
+F061
+F062
+F063
+F064
+F065
+F066
+F067
+F068
+F069
+F06A
+F06B
+F06C
+F06D
+F06E
+F06F
+F070
+F071
+F072
+F073
+F074
+F075
+F076
+F077
+F078
+F079
+F07A
+F07B
+F07C
+F07D
+F07E
+F080
+F081
+F082
+F083
+F084
+F085
+F086
+F087
+F088
+F089
+F08A
+F08B
+F08C
+F08D
+F08E
+F08F
+F090
+F091
+F092
+F093
+F094
+F095
+F096
+F097
+F098
+F099
+F09A
+F09B
+F09C
+F09D
+F09E
+F09F
+F0A0
+F0A1
+F0A2
+F0A3
+F0A4
+F0A5
+F0A6
+F0A7
+F0A8
+F0A9
+F0AA
+F0AB
+F0AC
+F0AD
+F0AE
+F0AF
+F0B0
+F0B1
+F0B2
+F0B3
+F0B4
+F0B5
+F0B6
+F0B7
+F0B8
+F0B9
+F0BA
+F0BB
+F0BC
+F0BD
+F0BE
+F0BF
+F0C0
+F0C1
+F0C2
+F0C3
+F0C4
+F0C5
+F0C6
+F0C7
+F0C8
+F0C9
+F0CA
+F0CB
+F0CC
+F0CD
+F0CE
+F0CF
+F0D0
+F0D1
+F0D2
+F0D3
+F0D4
+F0D5
+F0D6
+F0D7
+F0D8
+F0D9
+F0DA
+F0DB
+F0DC
+F0DD
+F0DE
+F0DF
+F0E0
+F0E1
+F0E2
+F0E3
+F0E4
+F0E5
+F0E6
+F0E7
+F0E8
+F0E9
+F0EA
+F0EB
+F0EC
+F0ED
+F0EE
+F0EF
+F0F0
+F0F1
+F0F2
+F0F3
+F0F4
+F0F5
+F0F6
+F0F7
+F0F8
+F0F9
+F0FA
+F0FB
+F0FC
+F140
+F141
+F142
+F143
+F144
+F145
+F146
+F147
+F148
+F149
+F14A
+F14B
+F14C
+F14D
+F14E
+F14F
+F150
+F151
+F152
+F153
+F154
+F155
+F156
+F157
+F158
+F159
+F15A
+F15B
+F15C
+F15D
+F15E
+F15F
+F160
+F161
+F162
+F163
+F164
+F165
+F166
+F167
+F168
+F169
+F16A
+F16B
+F16C
+F16D
+F16E
+F16F
+F170
+F171
+F172
+F173
+F174
+F175
+F176
+F177
+F178
+F179
+F17A
+F17B
+F17C
+F17D
+F17E
+F180
+F181
+F182
+F183
+F184
+F185
+F186
+F187
+F188
+F189
+F18A
+F18B
+F18C
+F18D
+F18E
+F18F
+F190
+F191
+F192
+F193
+F194
+F195
+F196
+F197
+F198
+F199
+F19A
+F19B
+F19C
+F19D
+F19E
+F19F
+F1A0
+F1A1
+F1A2
+F1A3
+F1A4
+F1A5
+F1A6
+F1A7
+F1A8
+F1A9
+F1AA
+F1AB
+F1AC
+F1AD
+F1AE
+F1AF
+F1B0
+F1B1
+F1B2
+F1B3
+F1B4
+F1B5
+F1B6
+F1B7
+F1B8
+F1B9
+F1BA
+F1BB
+F1BC
+F1BD
+F1BE
+F1BF
+F1C0
+F1C1
+F1C2
+F1C3
+F1C4
+F1C5
+F1C6
+F1C7
+F1C8
+F1C9
+F1CA
+F1CB
+F1CC
+F1CD
+F1CE
+F1CF
+F1D0
+F1D1
+F1D2
+F1D3
+F1D4
+F1D5
+F1D6
+F1D7
+F1D8
+F1D9
+F1DA
+F1DB
+F1DC
+F1DD
+F1DE
+F1DF
+F1E0
+F1E1
+F1E2
+F1E3
+F1E4
+F1E5
+F1E6
+F1E7
+F1E8
+F1E9
+F1EA
+F1EB
+F1EC
+F1ED
+F1EE
+F1EF
+F1F0
+F1F1
+F1F2
+F1F3
+F1F4
+F1F5
+F1F6
+F1F7
+F1F8
+F1F9
+F1FA
+F1FB
+F1FC
+F240
+F241
+F242
+F243
+F244
+F245
+F246
+F247
+F248
+F249
+F24A
+F24B
+F24C
+F24D
+F24E
+F24F
+F250
+F251
+F252
+F253
+F254
+F255
+F256
+F257
+F258
+F259
+F25A
+F25B
+F25C
+F25D
+F25E
+F25F
+F260
+F261
+F262
+F263
+F264
+F265
+F266
+F267
+F268
+F269
+F26A
+F26B
+F26C
+F26D
+F26E
+F26F
+F270
+F271
+F272
+F273
+F274
+F275
+F276
+F277
+F278
+F279
+F27A
+F27B
+F27C
+F27D
+F27E
+F280
+F281
+F282
+F283
+F284
+F285
+F286
+F287
+F288
+F289
+F28A
+F28B
+F28C
+F28D
+F28E
+F28F
+F290
+F291
+F292
+F293
+F294
+F295
+F296
+F297
+F298
+F299
+F29A
+F29B
+F29C
+F29D
+F29E
+F29F
+F2A0
+F2A1
+F2A2
+F2A3
+F2A4
+F2A5
+F2A6
+F2A7
+F2A8
+F2A9
+F2AA
+F2AB
+F2AC
+F2AD
+F2AE
+F2AF
+F2B0
+F2B1
+F2B2
+F2B3
+F2B4
+F2B5
+F2B6
+F2B7
+F2B8
+F2B9
+F2BA
+F2BB
+F2BC
+F2BD
+F2BE
+F2BF
+F2C0
+F2C1
+F2C2
+F2C3
+F2C4
+F2C5
+F2C6
+F2C7
+F2C8
+F2C9
+F2CA
+F2CB
+F2CC
+F2CD
+F2CE
+F2CF
+F2D0
+F2D1
+F2D2
+F2D3
+F2D4
+F2D5
+F2D6
+F2D7
+F2D8
+F2D9
+F2DA
+F2DB
+F2DC
+F2DD
+F2DE
+F2DF
+F2E0
+F2E1
+F2E2
+F2E3
+F2E4
+F2E5
+F2E6
+F2E7
+F2E8
+F2E9
+F2EA
+F2EB
+F2EC
+F2ED
+F2EE
+F2EF
+F2F0
+F2F1
+F2F2
+F2F3
+F2F4
+F2F5
+F2F6
+F2F7
+F2F8
+F2F9
+F2FA
+F2FB
+F2FC
+F340
+F341
+F342
+F343
+F344
+F345
+F346
+F347
+F348
+F349
+F34A
+F34B
+F34C
+F34D
+F34E
+F34F
+F350
+F351
+F352
+F353
+F354
+F355
+F356
+F357
+F358
+F359
+F35A
+F35B
+F35C
+F35D
+F35E
+F35F
+F360
+F361
+F362
+F363
+F364
+F365
+F366
+F367
+F368
+F369
+F36A
+F36B
+F36C
+F36D
+F36E
+F36F
+F370
+F371
+F372
+F373
+F374
+F375
+F376
+F377
+F378
+F379
+F37A
+F37B
+F37C
+F37D
+F37E
+F380
+F381
+F382
+F383
+F384
+F385
+F386
+F387
+F388
+F389
+F38A
+F38B
+F38C
+F38D
+F38E
+F38F
+F390
+F391
+F392
+F393
+F394
+F395
+F396
+F397
+F398
+F399
+F39A
+F39B
+F39C
+F39D
+F39E
+F39F
+F3A0
+F3A1
+F3A2
+F3A3
+F3A4
+F3A5
+F3A6
+F3A7
+F3A8
+F3A9
+F3AA
+F3AB
+F3AC
+F3AD
+F3AE
+F3AF
+F3B0
+F3B1
+F3B2
+F3B3
+F3B4
+F3B5
+F3B6
+F3B7
+F3B8
+F3B9
+F3BA
+F3BB
+F3BC
+F3BD
+F3BE
+F3BF
+F3C0
+F3C1
+F3C2
+F3C3
+F3C4
+F3C5
+F3C6
+F3C7
+F3C8
+F3C9
+F3CA
+F3CB
+F3CC
+F3CD
+F3CE
+F3CF
+F3D0
+F3D1
+F3D2
+F3D3
+F3D4
+F3D5
+F3D6
+F3D7
+F3D8
+F3D9
+F3DA
+F3DB
+F3DC
+F3DD
+F3DE
+F3DF
+F3E0
+F3E1
+F3E2
+F3E3
+F3E4
+F3E5
+F3E6
+F3E7
+F3E8
+F3E9
+F3EA
+F3EB
+F3EC
+F3ED
+F3EE
+F3EF
+F3F0
+F3F1
+F3F2
+F3F3
+F3F4
+F3F5
+F3F6
+F3F7
+F3F8
+F3F9
+F3FA
+F3FB
+F3FC
+F440
+F441
+F442
+F443
+F444
+F445
+F446
+F447
+F448
+F449
+F44A
+F44B
+F44C
+F44D
+F44E
+F44F
+F450
+F451
+F452
+F453
+F454
+F455
+F456
+F457
+F458
+F459
+F45A
+F45B
+F45C
+F45D
+F45E
+F45F
+F460
+F461
+F462
+F463
+F464
+F465
+F466
+F467
+F468
+F469
+F46A
+F46B
+F46C
+F46D
+F46E
+F46F
+F470
+F471
+F472
+F473
+F474
+F475
+F476
+F477
+F478
+F479
+F47A
+F47B
+F47C
+F47D
+F47E
+F480
+F481
+F482
+F483
+F484
+F485
+F486
+F487
+F488
+F489
+F48A
+F48B
+F48C
+F48D
+F48E
+F48F
+F490
+F491
+F492
+F493
+F494
+F495
+F496
+F497
+F498
+F499
+F49A
+F49B
+F49C
+F49D
+F49E
+F49F
+F4A0
+F4A1
+F4A2
+F4A3
+F4A4
+F4A5
+F4A6
+F4A7
+F4A8
+F4A9
+F4AA
+F4AB
+F4AC
+F4AD
+F4AE
+F4AF
+F4B0
+F4B1
+F4B2
+F4B3
+F4B4
+F4B5
+F4B6
+F4B7
+F4B8
+F4B9
+F4BA
+F4BB
+F4BC
+F4BD
+F4BE
+F4BF
+F4C0
+F4C1
+F4C2
+F4C3
+F4C4
+F4C5
+F4C6
+F4C7
+F4C8
+F4C9
+F4CA
+F4CB
+F4CC
+F4CD
+F4CE
+F4CF
+F4D0
+F4D1
+F4D2
+F4D3
+F4D4
+F4D5
+F4D6
+F4D7
+F4D8
+F4D9
+F4DA
+F4DB
+F4DC
+F4DD
+F4DE
+F4DF
+F4E0
+F4E1
+F4E2
+F4E3
+F4E4
+F4E5
+F4E6
+F4E7
+F4E8
+F4E9
+F4EA
+F4EB
+F4EC
+F4ED
+F4EE
+F4EF
+F4F0
+F4F1
+F4F2
+F4F3
+F4F4
+F4F5
+F4F6
+F4F7
+F4F8
+F4F9
+F4FA
+F4FB
+F4FC
+F540
+F541
+F542
+F543
+F544
+F545
+F546
+F547
+F548
+F549
+F54A
+F54B
+F54C
+F54D
+F54E
+F54F
+F550
+F551
+F552
+F553
+F554
+F555
+F556
+F557
+F558
+F559
+F55A
+F55B
+F55C
+F55D
+F55E
+F55F
+F560
+F561
+F562
+F563
+F564
+F565
+F566
+F567
+F568
+F569
+F56A
+F56B
+F56C
+F56D
+F56E
+F56F
+F570
+F571
+F572
+F573
+F574
+F575
+F576
+F577
+F578
+F579
+F57A
+F57B
+F57C
+F57D
+F57E
+F580
+F581
+F582
+F583
+F584
+F585
+F586
+F587
+F588
+F589
+F58A
+F58B
+F58C
+F58D
+F58E
+F58F
+F590
+F591
+F592
+F593
+F594
+F595
+F596
+F597
+F598
+F599
+F59A
+F59B
+F59C
+F59D
+F59E
+F59F
+F5A0
+F5A1
+F5A2
+F5A3
+F5A4
+F5A5
+F5A6
+F5A7
+F5A8
+F5A9
+F5AA
+F5AB
+F5AC
+F5AD
+F5AE
+F5AF
+F5B0
+F5B1
+F5B2
+F5B3
+F5B4
+F5B5
+F5B6
+F5B7
+F5B8
+F5B9
+F5BA
+F5BB
+F5BC
+F5BD
+F5BE
+F5BF
+F5C0
+F5C1
+F5C2
+F5C3
+F5C4
+F5C5
+F5C6
+F5C7
+F5C8
+F5C9
+F5CA
+F5CB
+F5CC
+F5CD
+F5CE
+F5CF
+F5D0
+F5D1
+F5D2
+F5D3
+F5D4
+F5D5
+F5D6
+F5D7
+F5D8
+F5D9
+F5DA
+F5DB
+F5DC
+F5DD
+F5DE
+F5DF
+F5E0
+F5E1
+F5E2
+F5E3
+F5E4
+F5E5
+F5E6
+F5E7
+F5E8
+F5E9
+F5EA
+F5EB
+F5EC
+F5ED
+F5EE
+F5EF
+F5F0
+F5F1
+F5F2
+F5F3
+F5F4
+F5F5
+F5F6
+F5F7
+F5F8
+F5F9
+F5FA
+F5FB
+F5FC
+F640
+F641
+F642
+F643
+F644
+F645
+F646
+F647
+F648
+F649
+F64A
+F64B
+F64C
+F64D
+F64E
+F64F
+F650
+F651
+F652
+F653
+F654
+F655
+F656
+F657
+F658
+F659
+F65A
+F65B
+F65C
+F65D
+F65E
+F65F
+F660
+F661
+F662
+F663
+F664
+F665
+F666
+F667
+F668
+F669
+F66A
+F66B
+F66C
+F66D
+F66E
+F66F
+F670
+F671
+F672
+F673
+F674
+F675
+F676
+F677
+F678
+F679
+F67A
+F67B
+F67C
+F67D
+F67E
+F680
+F681
+F682
+F683
+F684
+F685
+F686
+F687
+F688
+F689
+F68A
+F68B
+F68C
+F68D
+F68E
+F68F
+F690
+F691
+F692
+F693
+F694
+F695
+F696
+F697
+F698
+F699
+F69A
+F69B
+F69C
+F69D
+F69E
+F69F
+F6A0
+F6A1
+F6A2
+F6A3
+F6A4
+F6A5
+F6A6
+F6A7
+F6A8
+F6A9
+F6AA
+F6AB
+F6AC
+F6AD
+F6AE
+F6AF
+F6B0
+F6B1
+F6B2
+F6B3
+F6B4
+F6B5
+F6B6
+F6B7
+F6B8
+F6B9
+F6BA
+F6BB
+F6BC
+F6BD
+F6BE
+F6BF
+F6C0
+F6C1
+F6C2
+F6C3
+F6C4
+F6C5
+F6C6
+F6C7
+F6C8
+F6C9
+F6CA
+F6CB
+F6CC
+F6CD
+F6CE
+F6CF
+F6D0
+F6D1
+F6D2
+F6D3
+F6D4
+F6D5
+F6D6
+F6D7
+F6D8
+F6D9
+F6DA
+F6DB
+F6DC
+F6DD
+F6DE
+F6DF
+F6E0
+F6E1
+F6E2
+F6E3
+F6E4
+F6E5
+F6E6
+F6E7
+F6E8
+F6E9
+F6EA
+F6EB
+F6EC
+F6ED
+F6EE
+F6EF
+F6F0
+F6F1
+F6F2
+F6F3
+F6F4
+F6F5
+F6F6
+F6F7
+F6F8
+F6F9
+F6FA
+F6FB
+F6FC
+F740
+F741
+F742
+F743
+F744
+F745
+F746
+F747
+F748
+F749
+F74A
+F74B
+F74C
+F74D
+F74E
+F74F
+F750
+F751
+F752
+F753
+F754
+F755
+F756
+F757
+F758
+F759
+F75A
+F75B
+F75C
+F75D
+F75E
+F75F
+F760
+F761
+F762
+F763
+F764
+F765
+F766
+F767
+F768
+F769
+F76A
+F76B
+F76C
+F76D
+F76E
+F76F
+F770
+F771
+F772
+F773
+F774
+F775
+F776
+F777
+F778
+F779
+F77A
+F77B
+F77C
+F77D
+F77E
+F780
+F781
+F782
+F783
+F784
+F785
+F786
+F787
+F788
+F789
+F78A
+F78B
+F78C
+F78D
+F78E
+F78F
+F790
+F791
+F792
+F793
+F794
+F795
+F796
+F797
+F798
+F799
+F79A
+F79B
+F79C
+F79D
+F79E
+F79F
+F7A0
+F7A1
+F7A2
+F7A3
+F7A4
+F7A5
+F7A6
+F7A7
+F7A8
+F7A9
+F7AA
+F7AB
+F7AC
+F7AD
+F7AE
+F7AF
+F7B0
+F7B1
+F7B2
+F7B3
+F7B4
+F7B5
+F7B6
+F7B7
+F7B8
+F7B9
+F7BA
+F7BB
+F7BC
+F7BD
+F7BE
+F7BF
+F7C0
+F7C1
+F7C2
+F7C3
+F7C4
+F7C5
+F7C6
+F7C7
+F7C8
+F7C9
+F7CA
+F7CB
+F7CC
+F7CD
+F7CE
+F7CF
+F7D0
+F7D1
+F7D2
+F7D3
+F7D4
+F7D5
+F7D6
+F7D7
+F7D8
+F7D9
+F7DA
+F7DB
+F7DC
+F7DD
+F7DE
+F7DF
+F7E0
+F7E1
+F7E2
+F7E3
+F7E4
+F7E5
+F7E6
+F7E7
+F7E8
+F7E9
+F7EA
+F7EB
+F7EC
+F7ED
+F7EE
+F7EF
+F7F0
+F7F1
+F7F2
+F7F3
+F7F4
+F7F5
+F7F6
+F7F7
+F7F8
+F7F9
+F7FA
+F7FB
+F7FC
+F840
+F841
+F842
+F843
+F844
+F845
+F846
+F847
+F848
+F849
+F84A
+F84B
+F84C
+F84D
+F84E
+F84F
+F850
+F851
+F852
+F853
+F854
+F855
+F856
+F857
+F858
+F859
+F85A
+F85B
+F85C
+F85D
+F85E
+F85F
+F860
+F861
+F862
+F863
+F864
+F865
+F866
+F867
+F868
+F869
+F86A
+F86B
+F86C
+F86D
+F86E
+F86F
+F870
+F871
+F872
+F873
+F874
+F875
+F876
+F877
+F878
+F879
+F87A
+F87B
+F87C
+F87D
+F87E
+F880
+F881
+F882
+F883
+F884
+F885
+F886
+F887
+F888
+F889
+F88A
+F88B
+F88C
+F88D
+F88E
+F88F
+F890
+F891
+F892
+F893
+F894
+F895
+F896
+F897
+F898
+F899
+F89A
+F89B
+F89C
+F89D
+F89E
+F89F
+F8A0
+F8A1
+F8A2
+F8A3
+F8A4
+F8A5
+F8A6
+F8A7
+F8A8
+F8A9
+F8AA
+F8AB
+F8AC
+F8AD
+F8AE
+F8AF
+F8B0
+F8B1
+F8B2
+F8B3
+F8B4
+F8B5
+F8B6
+F8B7
+F8B8
+F8B9
+F8BA
+F8BB
+F8BC
+F8BD
+F8BE
+F8BF
+F8C0
+F8C1
+F8C2
+F8C3
+F8C4
+F8C5
+F8C6
+F8C7
+F8C8
+F8C9
+F8CA
+F8CB
+F8CC
+F8CD
+F8CE
+F8CF
+F8D0
+F8D1
+F8D2
+F8D3
+F8D4
+F8D5
+F8D6
+F8D7
+F8D8
+F8D9
+F8DA
+F8DB
+F8DC
+F8DD
+F8DE
+F8DF
+F8E0
+F8E1
+F8E2
+F8E3
+F8E4
+F8E5
+F8E6
+F8E7
+F8E8
+F8E9
+F8EA
+F8EB
+F8EC
+F8ED
+F8EE
+F8EF
+F8F0
+F8F1
+F8F2
+F8F3
+F8F4
+F8F5
+F8F6
+F8F7
+F8F8
+F8F9
+F8FA
+F8FB
+F8FC
+F940
+F941
+F942
+F943
+F944
+F945
+F946
+F947
+F948
+F949
+F94A
+F94B
+F94C
+F94D
+F94E
+F94F
+F950
+F951
+F952
+F953
+F954
+F955
+F956
+F957
+F958
+F959
+F95A
+F95B
+F95C
+F95D
+F95E
+F95F
+F960
+F961
+F962
+F963
+F964
+F965
+F966
+F967
+F968
+F969
+F96A
+F96B
+F96C
+F96D
+F96E
+F96F
+F970
+F971
+F972
+F973
+F974
+F975
+F976
+F977
+F978
+F979
+F97A
+F97B
+F97C
+F97D
+F97E
+F980
+F981
+F982
+F983
+F984
+F985
+F986
+F987
+F988
+F989
+F98A
+F98B
+F98C
+F98D
+F98E
+F98F
+F990
+F991
+F992
+F993
+F994
+F995
+F996
+F997
+F998
+F999
+F99A
+F99B
+F99C
+F99D
+F99E
+F99F
+F9A0
+F9A1
+F9A2
+F9A3
+F9A4
+F9A5
+F9A6
+F9A7
+F9A8
+F9A9
+F9AA
+F9AB
+F9AC
+F9AD
+F9AE
+F9AF
+F9B0
+F9B1
+F9B2
+F9B3
+F9B4
+F9B5
+F9B6
+F9B7
+F9B8
+F9B9
+F9BA
+F9BB
+F9BC
+F9BD
+F9BE
+F9BF
+F9C0
+F9C1
+F9C2
+F9C3
+F9C4
+F9C5
+F9C6
+F9C7
+F9C8
+F9C9
+F9CA
+F9CB
+F9CC
+F9CD
+F9CE
+F9CF
+F9D0
+F9D1
+F9D2
+F9D3
+F9D4
+F9D5
+F9D6
+F9D7
+F9D8
+F9D9
+F9DA
+F9DB
+F9DC
+F9DD
+F9DE
+F9DF
+F9E0
+F9E1
+F9E2
+F9E3
+F9E4
+F9E5
+F9E6
+F9E7
+F9E8
+F9E9
+F9EA
+F9EB
+F9EC
+F9ED
+F9EE
+F9EF
+F9F0
+F9F1
+F9F2
+F9F3
+F9F4
+F9F5
+F9F6
+F9F7
+F9F8
+F9F9
+F9FA
+F9FB
+F9FC
+CREATE TABLE t4 SELECT CONVERT(c1 USING eucjpms) AS c1 FROM t1;
+SELECT HEX(c1) FROM t4;
+HEX(c1)
+05
+7E
+A1BD
+A1C0
+A1C1
+A1C2
+A1DD
+A1F1
+A1F2
+A2CC
+ADA1
+ADA2
+ADA3
+ADA4
+ADA5
+ADA6
+ADA7
+ADA8
+ADA9
+ADAA
+ADAB
+ADAC
+ADAD
+ADAE
+ADAF
+ADB0
+ADB1
+ADB2
+ADB3
+ADB4
+ADB5
+ADB6
+ADB7
+ADB8
+ADB9
+ADBA
+ADBB
+ADBC
+ADBD
+ADBE
+ADC0
+ADC1
+ADC2
+ADC3
+ADC4
+ADC5
+ADC6
+ADC7
+ADC8
+ADC9
+ADCA
+ADCB
+ADCC
+ADCD
+ADCE
+ADCF
+ADD0
+ADD1
+ADD2
+ADD3
+ADD4
+ADD5
+ADD6
+ADDF
+ADE0
+ADE1
+ADE2
+ADE3
+ADE4
+ADE5
+ADE6
+ADE7
+ADE8
+ADE9
+ADEA
+ADEB
+ADEC
+ADED
+ADEE
+ADEF
+A2E2
+A2E1
+A2E9
+ADF3
+ADF4
+A2E5
+A2DD
+A2DC
+ADF8
+ADF9
+A2E8
+A2C1
+A2C0
+8FD4E3
+8FDCDF
+8FE4E9
+8FE3F8
+8FD9A1
+8FB1BB
+8FF4AE
+8FC2AD
+8FC3FC
+8FE4D0
+8FC2BF
+8FBCF4
+8FB0A9
+8FB0C8
+8FF4AF
+8FB0D2
+8FB0D4
+8FB0E3
+8FB0EE
+8FB1A7
+8FB1A3
+8FB1AC
+8FB1A9
+8FB1BE
+8FB1DF
+8FB1D8
+8FB1C8
+8FB1D7
+8FB1E3
+8FB1F4
+8FB1E1
+8FB2A3
+8FF4B0
+8FB2BB
+8FB2E6
+8FB2ED
+8FB2F5
+8FB2FC
+8FF4B1
+8FB3B5
+8FB3D8
+8FB3DB
+8FB3E5
+8FB3EE
+8FB3FB
+8FF4B2
+8FF4B3
+8FB4C0
+8FB4C7
+8FB4D0
+8FB4DE
+8FF4B4
+8FB5AA
+8FF4B5
+8FB5AF
+8FB5C4
+8FB5E8
+8FF4B6
+8FB7C2
+8FB7E4
+8FB7E8
+8FB7E7
+8FF4B7
+8FF4B8
+8FF4B9
+8FB8CE
+8FB8E1
+8FB8F5
+8FB8F7
+8FB8F8
+8FB8FC
+8FB9AF
+8FB9B7
+8FBABE
+8FBADB
+8FCDAA
+8FBAE1
+8FF4BA
+8FBAEB
+8FBBB3
+8FBBB8
+8FF4BB
+8FBBCA
+8FF4BC
+8FF4BD
+8FBBD0
+8FBBDE
+8FBBF4
+8FBBF5
+8FBBF9
+8FBCE4
+8FBCED
+8FBCFE
+8FF4BE
+8FBDC2
+8FBDE7
+8FF4BF
+8FBDF0
+8FBEB0
+8FBEAC
+8FF4C0
+8FBEB3
+8FBEBD
+8FBECD
+8FBEC9
+8FBEE4
+8FBFA8
+8FBFC9
+8FC0C4
+8FC0E4
+8FC0F4
+8FC1A6
+8FF4C1
+8FC1F5
+8FC1FC
+8FF4C2
+8FC1F8
+8FC2AB
+8FC2A1
+8FC2A5
+8FF4C3
+8FC2B8
+8FC2BA
+8FF4C4
+8FC2C4
+8FC2D2
+8FC2D7
+8FC2DB
+8FC2DE
+8FC2ED
+8FC2F0
+8FF4C5
+8FC3A1
+8FC3B5
+8FC3C9
+8FC3B9
+8FF4C6
+8FC3D8
+8FC3FE
+8FF4C7
+8FC4CC
+8FF4C8
+8FC4D9
+8FC4EA
+8FC4FD
+8FF4C9
+8FC5A7
+8FC5B5
+8FC5B6
+8FF4CA
+8FC5D5
+8FC6B8
+8FC6D7
+8FC6E0
+8FC6EA
+8FC6E3
+8FC7A1
+8FC7AB
+8FC7C7
+8FC7C3
+8FC7CB
+8FC7CF
+8FC7D9
+8FF4CB
+8FF4CC
+8FC7E6
+8FC7EE
+8FC7FC
+8FC7EB
+8FC7F0
+8FC8B1
+8FC8E5
+8FC8F8
+8FC9A6
+8FC9AB
+8FC9AD
+8FF4CD
+8FC9CA
+8FC9D3
+8FC9E9
+8FC9E3
+8FC9FC
+8FC9F4
+8FC9F5
+8FF4CE
+8FCAB3
+8FCABD
+8FCAEF
+8FCAF1
+8FCBAE
+8FF4CF
+8FCBCA
+8FCBE6
+8FCBEA
+8FCBF0
+8FCBF4
+8FCBEE
+8FCCA5
+8FCBF9
+8FCCAB
+8FCCAE
+8FCCAD
+8FCCB2
+8FCCC2
+8FCCD0
+8FCCD9
+8FF4D0
+8FCDBB
+8FF4D1
+8FCEBB
+8FF4D2
+8FCEBA
+8FCEC3
+8FF4D3
+8FCEF2
+8FB3DD
+8FCFD5
+8FCFE2
+8FCFE9
+8FCFED
+8FF4D4
+8FF4D5
+8FF4D6
+8FF4D7
+8FD0E5
+8FF4D8
+8FD0E9
+8FD1E8
+8FF4D9
+8FF4DA
+8FD1EC
+8FD2BB
+8FF4DB
+8FD3E1
+8FD3E8
+8FD4A7
+8FF4DC
+8FF4DD
+8FD4D4
+8FD4F2
+8FD5AE
+8FF4DE
+8FD7DE
+8FF4DF
+8FD8A2
+8FD8B7
+8FD8C1
+8FD8D1
+8FD8F4
+8FD9C6
+8FD9C8
+8FD9D1
+8FF4E0
+8FF4E1
+8FF4E2
+8FF4E3
+8FF4E4
+8FDCD3
+8FDDC8
+8FDDD4
+8FDDEA
+8FDDFA
+8FDEA4
+8FDEB0
+8FF4E5
+8FDEB5
+8FDECB
+8FF4E6
+8FDFB9
+8FF4E7
+8FDFC3
+8FF4E8
+8FF4E9
+8FE0D9
+8FF4EA
+8FF4EB
+8FE1E2
+8FF4EC
+8FF4ED
+8FF4EE
+8FE2C7
+8FE3A8
+8FE3A6
+8FE3A9
+8FE3AF
+8FE3B0
+8FE3AA
+8FE3AB
+8FE3BC
+8FE3C1
+8FE3BF
+8FE3D5
+8FE3D8
+8FE3D6
+8FE3DF
+8FE3E3
+8FE3E1
+8FE3D4
+8FE3E9
+8FE4A6
+8FE3F1
+8FE3F2
+8FE4CB
+8FE4C1
+8FE4C3
+8FE4BE
+8FF4EF
+8FE4C0
+8FE4C7
+8FE4BF
+8FE4E0
+8FE4DE
+8FE4D1
+8FF4F0
+8FE4DC
+8FE4D2
+8FE4DB
+8FE4D4
+8FE4FA
+8FE4EF
+8FE5B3
+8FE5BF
+8FE5C9
+8FE5D0
+8FE5E2
+8FE5EA
+8FE5EB
+8FF4F1
+8FF4F2
+8FF4F3
+8FE6E8
+8FE6EF
+8FE7AC
+8FF4F4
+8FE7AE
+8FF4F5
+8FE7B1
+8FF4F6
+8FE7B2
+8FE8B1
+8FE8B6
+8FF4F7
+8FF4F8
+8FE8DD
+8FF4F9
+8FF4FA
+8FE9D1
+8FF4FB
+8FE9ED
+8FEACD
+8FF4FC
+8FEADB
+8FEAE6
+8FEAEA
+8FEBA5
+8FEBFB
+8FEBFA
+8FF4FD
+8FECD6
+8FF4FE
+8FF3F3
+8FF3F4
+8FF3F5
+8FF3F6
+8FF3F7
+8FF3F8
+8FF3F9
+8FF3FA
+8FF3FB
+8FF3FC
+A2CC
+8FA2C3
+8FF4A9
+8FF4AA
+8FF3F3
+8FF3F4
+8FF3F5
+8FF3F6
+8FF3F7
+8FF3F8
+8FF3F9
+8FF3FA
+8FF3FB
+8FF3FC
+ADB5
+ADB6
+ADB7
+ADB8
+ADB9
+ADBA
+ADBB
+ADBC
+ADBD
+ADBE
+A2CC
+8FA2C3
+8FF4A9
+8FF4AA
+ADEA
+ADE2
+ADE4
+A2E8
+8FD4E3
+8FDCDF
+8FE4E9
+8FE3F8
+8FD9A1
+8FB1BB
+8FF4AE
+8FC2AD
+8FC3FC
+8FE4D0
+8FC2BF
+8FBCF4
+8FB0A9
+8FB0C8
+8FF4AF
+8FB0D2
+8FB0D4
+8FB0E3
+8FB0EE
+8FB1A7
+8FB1A3
+8FB1AC
+8FB1A9
+8FB1BE
+8FB1DF
+8FB1D8
+8FB1C8
+8FB1D7
+8FB1E3
+8FB1F4
+8FB1E1
+8FB2A3
+8FF4B0
+8FB2BB
+8FB2E6
+8FB2ED
+8FB2F5
+8FB2FC
+8FF4B1
+8FB3B5
+8FB3D8
+8FB3DB
+8FB3E5
+8FB3EE
+8FB3FB
+8FF4B2
+8FF4B3
+8FB4C0
+8FB4C7
+8FB4D0
+8FB4DE
+8FF4B4
+8FB5AA
+8FF4B5
+8FB5AF
+8FB5C4
+8FB5E8
+8FF4B6
+8FB7C2
+8FB7E4
+8FB7E8
+8FB7E7
+8FF4B7
+8FF4B8
+8FF4B9
+8FB8CE
+8FB8E1
+8FB8F5
+8FB8F7
+8FB8F8
+8FB8FC
+8FB9AF
+8FB9B7
+8FBABE
+8FBADB
+8FCDAA
+8FBAE1
+8FF4BA
+8FBAEB
+8FBBB3
+8FBBB8
+8FF4BB
+8FBBCA
+8FF4BC
+8FF4BD
+8FBBD0
+8FBBDE
+8FBBF4
+8FBBF5
+8FBBF9
+8FBCE4
+8FBCED
+8FBCFE
+8FF4BE
+8FBDC2
+8FBDE7
+8FF4BF
+8FBDF0
+8FBEB0
+8FBEAC
+8FF4C0
+8FBEB3
+8FBEBD
+8FBECD
+8FBEC9
+8FBEE4
+8FBFA8
+8FBFC9
+8FC0C4
+8FC0E4
+8FC0F4
+8FC1A6
+8FF4C1
+8FC1F5
+8FC1FC
+8FF4C2
+8FC1F8
+8FC2AB
+8FC2A1
+8FC2A5
+8FF4C3
+8FC2B8
+8FC2BA
+8FF4C4
+8FC2C4
+8FC2D2
+8FC2D7
+8FC2DB
+8FC2DE
+8FC2ED
+8FC2F0
+8FF4C5
+8FC3A1
+8FC3B5
+8FC3C9
+8FC3B9
+8FF4C6
+8FC3D8
+8FC3FE
+8FF4C7
+8FC4CC
+8FF4C8
+8FC4D9
+8FC4EA
+8FC4FD
+8FF4C9
+8FC5A7
+8FC5B5
+8FC5B6
+8FF4CA
+8FC5D5
+8FC6B8
+8FC6D7
+8FC6E0
+8FC6EA
+8FC6E3
+8FC7A1
+8FC7AB
+8FC7C7
+8FC7C3
+8FC7CB
+8FC7CF
+8FC7D9
+8FF4CB
+8FF4CC
+8FC7E6
+8FC7EE
+8FC7FC
+8FC7EB
+8FC7F0
+8FC8B1
+8FC8E5
+8FC8F8
+8FC9A6
+8FC9AB
+8FC9AD
+8FF4CD
+8FC9CA
+8FC9D3
+8FC9E9
+8FC9E3
+8FC9FC
+8FC9F4
+8FC9F5
+8FF4CE
+8FCAB3
+8FCABD
+8FCAEF
+8FCAF1
+8FCBAE
+8FF4CF
+8FCBCA
+8FCBE6
+8FCBEA
+8FCBF0
+8FCBF4
+8FCBEE
+8FCCA5
+8FCBF9
+8FCCAB
+8FCCAE
+8FCCAD
+8FCCB2
+8FCCC2
+8FCCD0
+8FCCD9
+8FF4D0
+8FCDBB
+8FF4D1
+8FCEBB
+8FF4D2
+8FCEBA
+8FCEC3
+8FF4D3
+8FCEF2
+8FB3DD
+8FCFD5
+8FCFE2
+8FCFE9
+8FCFED
+8FF4D4
+8FF4D5
+8FF4D6
+8FF4D7
+8FD0E5
+8FF4D8
+8FD0E9
+8FD1E8
+8FF4D9
+8FF4DA
+8FD1EC
+8FD2BB
+8FF4DB
+8FD3E1
+8FD3E8
+8FD4A7
+8FF4DC
+8FF4DD
+8FD4D4
+8FD4F2
+8FD5AE
+8FF4DE
+8FD7DE
+8FF4DF
+8FD8A2
+8FD8B7
+8FD8C1
+8FD8D1
+8FD8F4
+8FD9C6
+8FD9C8
+8FD9D1
+8FF4E0
+8FF4E1
+8FF4E2
+8FF4E3
+8FF4E4
+8FDCD3
+8FDDC8
+8FDDD4
+8FDDEA
+8FDDFA
+8FDEA4
+8FDEB0
+8FF4E5
+8FDEB5
+8FDECB
+8FF4E6
+8FDFB9
+8FF4E7
+8FDFC3
+8FF4E8
+8FF4E9
+8FE0D9
+8FF4EA
+8FF4EB
+8FE1E2
+8FF4EC
+8FF4ED
+8FF4EE
+8FE2C7
+8FE3A8
+8FE3A6
+8FE3A9
+8FE3AF
+8FE3B0
+8FE3AA
+8FE3AB
+8FE3BC
+8FE3C1
+8FE3BF
+8FE3D5
+8FE3D8
+8FE3D6
+8FE3DF
+8FE3E3
+8FE3E1
+8FE3D4
+8FE3E9
+8FE4A6
+8FE3F1
+8FE3F2
+8FE4CB
+8FE4C1
+8FE4C3
+8FE4BE
+8FF4EF
+8FE4C0
+8FE4C7
+8FE4BF
+8FE4E0
+8FE4DE
+8FE4D1
+8FF4F0
+8FE4DC
+8FE4D2
+8FE4DB
+8FE4D4
+8FE4FA
+8FE4EF
+8FE5B3
+8FE5BF
+8FE5C9
+8FE5D0
+8FE5E2
+8FE5EA
+8FE5EB
+8FF4F1
+8FF4F2
+8FF4F3
+8FE6E8
+8FE6EF
+8FE7AC
+8FF4F4
+8FE7AE
+8FF4F5
+8FE7B1
+8FF4F6
+8FE7B2
+8FE8B1
+8FE8B6
+8FF4F7
+8FF4F8
+8FE8DD
+8FF4F9
+8FF4FA
+8FE9D1
+8FF4FB
+8FE9ED
+8FEACD
+8FF4FC
+8FEADB
+8FEAE6
+8FEAEA
+8FEBA5
+8FEBFB
+8FEBFA
+8FF4FD
+8FECD6
+8FF4FE
+F5A1
+F5A2
+F5A3
+F5A4
+F5A5
+F5A6
+F5A7
+F5A8
+F5A9
+F5AA
+F5AB
+F5AC
+F5AD
+F5AE
+F5AF
+F5B0
+F5B1
+F5B2
+F5B3
+F5B4
+F5B5
+F5B6
+F5B7
+F5B8
+F5B9
+F5BA
+F5BB
+F5BC
+F5BD
+F5BE
+F5BF
+F5C0
+F5C1
+F5C2
+F5C3
+F5C4
+F5C5
+F5C6
+F5C7
+F5C8
+F5C9
+F5CA
+F5CB
+F5CC
+F5CD
+F5CE
+F5CF
+F5D0
+F5D1
+F5D2
+F5D3
+F5D4
+F5D5
+F5D6
+F5D7
+F5D8
+F5D9
+F5DA
+F5DB
+F5DC
+F5DD
+F5DE
+F5DF
+F5E0
+F5E1
+F5E2
+F5E3
+F5E4
+F5E5
+F5E6
+F5E7
+F5E8
+F5E9
+F5EA
+F5EB
+F5EC
+F5ED
+F5EE
+F5EF
+F5F0
+F5F1
+F5F2
+F5F3
+F5F4
+F5F5
+F5F6
+F5F7
+F5F8
+F5F9
+F5FA
+F5FB
+F5FC
+F5FD
+F5FE
+F6A1
+F6A2
+F6A3
+F6A4
+F6A5
+F6A6
+F6A7
+F6A8
+F6A9
+F6AA
+F6AB
+F6AC
+F6AD
+F6AE
+F6AF
+F6B0
+F6B1
+F6B2
+F6B3
+F6B4
+F6B5
+F6B6
+F6B7
+F6B8
+F6B9
+F6BA
+F6BB
+F6BC
+F6BD
+F6BE
+F6BF
+F6C0
+F6C1
+F6C2
+F6C3
+F6C4
+F6C5
+F6C6
+F6C7
+F6C8
+F6C9
+F6CA
+F6CB
+F6CC
+F6CD
+F6CE
+F6CF
+F6D0
+F6D1
+F6D2
+F6D3
+F6D4
+F6D5
+F6D6
+F6D7
+F6D8
+F6D9
+F6DA
+F6DB
+F6DC
+F6DD
+F6DE
+F6DF
+F6E0
+F6E1
+F6E2
+F6E3
+F6E4
+F6E5
+F6E6
+F6E7
+F6E8
+F6E9
+F6EA
+F6EB
+F6EC
+F6ED
+F6EE
+F6EF
+F6F0
+F6F1
+F6F2
+F6F3
+F6F4
+F6F5
+F6F6
+F6F7
+F6F8
+F6F9
+F6FA
+F6FB
+F6FC
+F6FD
+F6FE
+F7A1
+F7A2
+F7A3
+F7A4
+F7A5
+F7A6
+F7A7
+F7A8
+F7A9
+F7AA
+F7AB
+F7AC
+F7AD
+F7AE
+F7AF
+F7B0
+F7B1
+F7B2
+F7B3
+F7B4
+F7B5
+F7B6
+F7B7
+F7B8
+F7B9
+F7BA
+F7BB
+F7BC
+F7BD
+F7BE
+F7BF
+F7C0
+F7C1
+F7C2
+F7C3
+F7C4
+F7C5
+F7C6
+F7C7
+F7C8
+F7C9
+F7CA
+F7CB
+F7CC
+F7CD
+F7CE
+F7CF
+F7D0
+F7D1
+F7D2
+F7D3
+F7D4
+F7D5
+F7D6
+F7D7
+F7D8
+F7D9
+F7DA
+F7DB
+F7DC
+F7DD
+F7DE
+F7DF
+F7E0
+F7E1
+F7E2
+F7E3
+F7E4
+F7E5
+F7E6
+F7E7
+F7E8
+F7E9
+F7EA
+F7EB
+F7EC
+F7ED
+F7EE
+F7EF
+F7F0
+F7F1
+F7F2
+F7F3
+F7F4
+F7F5
+F7F6
+F7F7
+F7F8
+F7F9
+F7FA
+F7FB
+F7FC
+F7FD
+F7FE
+F8A1
+F8A2
+F8A3
+F8A4
+F8A5
+F8A6
+F8A7
+F8A8
+F8A9
+F8AA
+F8AB
+F8AC
+F8AD
+F8AE
+F8AF
+F8B0
+F8B1
+F8B2
+F8B3
+F8B4
+F8B5
+F8B6
+F8B7
+F8B8
+F8B9
+F8BA
+F8BB
+F8BC
+F8BD
+F8BE
+F8BF
+F8C0
+F8C1
+F8C2
+F8C3
+F8C4
+F8C5
+F8C6
+F8C7
+F8C8
+F8C9
+F8CA
+F8CB
+F8CC
+F8CD
+F8CE
+F8CF
+F8D0
+F8D1
+F8D2
+F8D3
+F8D4
+F8D5
+F8D6
+F8D7
+F8D8
+F8D9
+F8DA
+F8DB
+F8DC
+F8DD
+F8DE
+F8DF
+F8E0
+F8E1
+F8E2
+F8E3
+F8E4
+F8E5
+F8E6
+F8E7
+F8E8
+F8E9
+F8EA
+F8EB
+F8EC
+F8ED
+F8EE
+F8EF
+F8F0
+F8F1
+F8F2
+F8F3
+F8F4
+F8F5
+F8F6
+F8F7
+F8F8
+F8F9
+F8FA
+F8FB
+F8FC
+F8FD
+F8FE
+F9A1
+F9A2
+F9A3
+F9A4
+F9A5
+F9A6
+F9A7
+F9A8
+F9A9
+F9AA
+F9AB
+F9AC
+F9AD
+F9AE
+F9AF
+F9B0
+F9B1
+F9B2
+F9B3
+F9B4
+F9B5
+F9B6
+F9B7
+F9B8
+F9B9
+F9BA
+F9BB
+F9BC
+F9BD
+F9BE
+F9BF
+F9C0
+F9C1
+F9C2
+F9C3
+F9C4
+F9C5
+F9C6
+F9C7
+F9C8
+F9C9
+F9CA
+F9CB
+F9CC
+F9CD
+F9CE
+F9CF
+F9D0
+F9D1
+F9D2
+F9D3
+F9D4
+F9D5
+F9D6
+F9D7
+F9D8
+F9D9
+F9DA
+F9DB
+F9DC
+F9DD
+F9DE
+F9DF
+F9E0
+F9E1
+F9E2
+F9E3
+F9E4
+F9E5
+F9E6
+F9E7
+F9E8
+F9E9
+F9EA
+F9EB
+F9EC
+F9ED
+F9EE
+F9EF
+F9F0
+F9F1
+F9F2
+F9F3
+F9F4
+F9F5
+F9F6
+F9F7
+F9F8
+F9F9
+F9FA
+F9FB
+F9FC
+F9FD
+F9FE
+FAA1
+FAA2
+FAA3
+FAA4
+FAA5
+FAA6
+FAA7
+FAA8
+FAA9
+FAAA
+FAAB
+FAAC
+FAAD
+FAAE
+FAAF
+FAB0
+FAB1
+FAB2
+FAB3
+FAB4
+FAB5
+FAB6
+FAB7
+FAB8
+FAB9
+FABA
+FABB
+FABC
+FABD
+FABE
+FABF
+FAC0
+FAC1
+FAC2
+FAC3
+FAC4
+FAC5
+FAC6
+FAC7
+FAC8
+FAC9
+FACA
+FACB
+FACC
+FACD
+FACE
+FACF
+FAD0
+FAD1
+FAD2
+FAD3
+FAD4
+FAD5
+FAD6
+FAD7
+FAD8
+FAD9
+FADA
+FADB
+FADC
+FADD
+FADE
+FADF
+FAE0
+FAE1
+FAE2
+FAE3
+FAE4
+FAE5
+FAE6
+FAE7
+FAE8
+FAE9
+FAEA
+FAEB
+FAEC
+FAED
+FAEE
+FAEF
+FAF0
+FAF1
+FAF2
+FAF3
+FAF4
+FAF5
+FAF6
+FAF7
+FAF8
+FAF9
+FAFA
+FAFB
+FAFC
+FAFD
+FAFE
+FBA1
+FBA2
+FBA3
+FBA4
+FBA5
+FBA6
+FBA7
+FBA8
+FBA9
+FBAA
+FBAB
+FBAC
+FBAD
+FBAE
+FBAF
+FBB0
+FBB1
+FBB2
+FBB3
+FBB4
+FBB5
+FBB6
+FBB7
+FBB8
+FBB9
+FBBA
+FBBB
+FBBC
+FBBD
+FBBE
+FBBF
+FBC0
+FBC1
+FBC2
+FBC3
+FBC4
+FBC5
+FBC6
+FBC7
+FBC8
+FBC9
+FBCA
+FBCB
+FBCC
+FBCD
+FBCE
+FBCF
+FBD0
+FBD1
+FBD2
+FBD3
+FBD4
+FBD5
+FBD6
+FBD7
+FBD8
+FBD9
+FBDA
+FBDB
+FBDC
+FBDD
+FBDE
+FBDF
+FBE0
+FBE1
+FBE2
+FBE3
+FBE4
+FBE5
+FBE6
+FBE7
+FBE8
+FBE9
+FBEA
+FBEB
+FBEC
+FBED
+FBEE
+FBEF
+FBF0
+FBF1
+FBF2
+FBF3
+FBF4
+FBF5
+FBF6
+FBF7
+FBF8
+FBF9
+FBFA
+FBFB
+FBFC
+FBFD
+FBFE
+FCA1
+FCA2
+FCA3
+FCA4
+FCA5
+FCA6
+FCA7
+FCA8
+FCA9
+FCAA
+FCAB
+FCAC
+FCAD
+FCAE
+FCAF
+FCB0
+FCB1
+FCB2
+FCB3
+FCB4
+FCB5
+FCB6
+FCB7
+FCB8
+FCB9
+FCBA
+FCBB
+FCBC
+FCBD
+FCBE
+FCBF
+FCC0
+FCC1
+FCC2
+FCC3
+FCC4
+FCC5
+FCC6
+FCC7
+FCC8
+FCC9
+FCCA
+FCCB
+FCCC
+FCCD
+FCCE
+FCCF
+FCD0
+FCD1
+FCD2
+FCD3
+FCD4
+FCD5
+FCD6
+FCD7
+FCD8
+FCD9
+FCDA
+FCDB
+FCDC
+FCDD
+FCDE
+FCDF
+FCE0
+FCE1
+FCE2
+FCE3
+FCE4
+FCE5
+FCE6
+FCE7
+FCE8
+FCE9
+FCEA
+FCEB
+FCEC
+FCED
+FCEE
+FCEF
+FCF0
+FCF1
+FCF2
+FCF3
+FCF4
+FCF5
+FCF6
+FCF7
+FCF8
+FCF9
+FCFA
+FCFB
+FCFC
+FCFD
+FCFE
+FDA1
+FDA2
+FDA3
+FDA4
+FDA5
+FDA6
+FDA7
+FDA8
+FDA9
+FDAA
+FDAB
+FDAC
+FDAD
+FDAE
+FDAF
+FDB0
+FDB1
+FDB2
+FDB3
+FDB4
+FDB5
+FDB6
+FDB7
+FDB8
+FDB9
+FDBA
+FDBB
+FDBC
+FDBD
+FDBE
+FDBF
+FDC0
+FDC1
+FDC2
+FDC3
+FDC4
+FDC5
+FDC6
+FDC7
+FDC8
+FDC9
+FDCA
+FDCB
+FDCC
+FDCD
+FDCE
+FDCF
+FDD0
+FDD1
+FDD2
+FDD3
+FDD4
+FDD5
+FDD6
+FDD7
+FDD8
+FDD9
+FDDA
+FDDB
+FDDC
+FDDD
+FDDE
+FDDF
+FDE0
+FDE1
+FDE2
+FDE3
+FDE4
+FDE5
+FDE6
+FDE7
+FDE8
+FDE9
+FDEA
+FDEB
+FDEC
+FDED
+FDEE
+FDEF
+FDF0
+FDF1
+FDF2
+FDF3
+FDF4
+FDF5
+FDF6
+FDF7
+FDF8
+FDF9
+FDFA
+FDFB
+FDFC
+FDFD
+FDFE
+FEA1
+FEA2
+FEA3
+FEA4
+FEA5
+FEA6
+FEA7
+FEA8
+FEA9
+FEAA
+FEAB
+FEAC
+FEAD
+FEAE
+FEAF
+FEB0
+FEB1
+FEB2
+FEB3
+FEB4
+FEB5
+FEB6
+FEB7
+FEB8
+FEB9
+FEBA
+FEBB
+FEBC
+FEBD
+FEBE
+FEBF
+FEC0
+FEC1
+FEC2
+FEC3
+FEC4
+FEC5
+FEC6
+FEC7
+FEC8
+FEC9
+FECA
+FECB
+FECC
+FECD
+FECE
+FECF
+FED0
+FED1
+FED2
+FED3
+FED4
+FED5
+FED6
+FED7
+FED8
+FED9
+FEDA
+FEDB
+FEDC
+FEDD
+FEDE
+FEDF
+FEE0
+FEE1
+FEE2
+FEE3
+FEE4
+FEE5
+FEE6
+FEE7
+FEE8
+FEE9
+FEEA
+FEEB
+FEEC
+FEED
+FEEE
+FEEF
+FEF0
+FEF1
+FEF2
+FEF3
+FEF4
+FEF5
+FEF6
+FEF7
+FEF8
+FEF9
+FEFA
+FEFB
+FEFC
+FEFD
+FEFE
+8FF5A1
+8FF5A2
+8FF5A3
+8FF5A4
+8FF5A5
+8FF5A6
+8FF5A7
+8FF5A8
+8FF5A9
+8FF5AA
+8FF5AB
+8FF5AC
+8FF5AD
+8FF5AE
+8FF5AF
+8FF5B0
+8FF5B1
+8FF5B2
+8FF5B3
+8FF5B4
+8FF5B5
+8FF5B6
+8FF5B7
+8FF5B8
+8FF5B9
+8FF5BA
+8FF5BB
+8FF5BC
+8FF5BD
+8FF5BE
+8FF5BF
+8FF5C0
+8FF5C1
+8FF5C2
+8FF5C3
+8FF5C4
+8FF5C5
+8FF5C6
+8FF5C7
+8FF5C8
+8FF5C9
+8FF5CA
+8FF5CB
+8FF5CC
+8FF5CD
+8FF5CE
+8FF5CF
+8FF5D0
+8FF5D1
+8FF5D2
+8FF5D3
+8FF5D4
+8FF5D5
+8FF5D6
+8FF5D7
+8FF5D8
+8FF5D9
+8FF5DA
+8FF5DB
+8FF5DC
+8FF5DD
+8FF5DE
+8FF5DF
+8FF5E0
+8FF5E1
+8FF5E2
+8FF5E3
+8FF5E4
+8FF5E5
+8FF5E6
+8FF5E7
+8FF5E8
+8FF5E9
+8FF5EA
+8FF5EB
+8FF5EC
+8FF5ED
+8FF5EE
+8FF5EF
+8FF5F0
+8FF5F1
+8FF5F2
+8FF5F3
+8FF5F4
+8FF5F5
+8FF5F6
+8FF5F7
+8FF5F8
+8FF5F9
+8FF5FA
+8FF5FB
+8FF5FC
+8FF5FD
+8FF5FE
+8FF6A1
+8FF6A2
+8FF6A3
+8FF6A4
+8FF6A5
+8FF6A6
+8FF6A7
+8FF6A8
+8FF6A9
+8FF6AA
+8FF6AB
+8FF6AC
+8FF6AD
+8FF6AE
+8FF6AF
+8FF6B0
+8FF6B1
+8FF6B2
+8FF6B3
+8FF6B4
+8FF6B5
+8FF6B6
+8FF6B7
+8FF6B8
+8FF6B9
+8FF6BA
+8FF6BB
+8FF6BC
+8FF6BD
+8FF6BE
+8FF6BF
+8FF6C0
+8FF6C1
+8FF6C2
+8FF6C3
+8FF6C4
+8FF6C5
+8FF6C6
+8FF6C7
+8FF6C8
+8FF6C9
+8FF6CA
+8FF6CB
+8FF6CC
+8FF6CD
+8FF6CE
+8FF6CF
+8FF6D0
+8FF6D1
+8FF6D2
+8FF6D3
+8FF6D4
+8FF6D5
+8FF6D6
+8FF6D7
+8FF6D8
+8FF6D9
+8FF6DA
+8FF6DB
+8FF6DC
+8FF6DD
+8FF6DE
+8FF6DF
+8FF6E0
+8FF6E1
+8FF6E2
+8FF6E3
+8FF6E4
+8FF6E5
+8FF6E6
+8FF6E7
+8FF6E8
+8FF6E9
+8FF6EA
+8FF6EB
+8FF6EC
+8FF6ED
+8FF6EE
+8FF6EF
+8FF6F0
+8FF6F1
+8FF6F2
+8FF6F3
+8FF6F4
+8FF6F5
+8FF6F6
+8FF6F7
+8FF6F8
+8FF6F9
+8FF6FA
+8FF6FB
+8FF6FC
+8FF6FD
+8FF6FE
+8FF7A1
+8FF7A2
+8FF7A3
+8FF7A4
+8FF7A5
+8FF7A6
+8FF7A7
+8FF7A8
+8FF7A9
+8FF7AA
+8FF7AB
+8FF7AC
+8FF7AD
+8FF7AE
+8FF7AF
+8FF7B0
+8FF7B1
+8FF7B2
+8FF7B3
+8FF7B4
+8FF7B5
+8FF7B6
+8FF7B7
+8FF7B8
+8FF7B9
+8FF7BA
+8FF7BB
+8FF7BC
+8FF7BD
+8FF7BE
+8FF7BF
+8FF7C0
+8FF7C1
+8FF7C2
+8FF7C3
+8FF7C4
+8FF7C5
+8FF7C6
+8FF7C7
+8FF7C8
+8FF7C9
+8FF7CA
+8FF7CB
+8FF7CC
+8FF7CD
+8FF7CE
+8FF7CF
+8FF7D0
+8FF7D1
+8FF7D2
+8FF7D3
+8FF7D4
+8FF7D5
+8FF7D6
+8FF7D7
+8FF7D8
+8FF7D9
+8FF7DA
+8FF7DB
+8FF7DC
+8FF7DD
+8FF7DE
+8FF7DF
+8FF7E0
+8FF7E1
+8FF7E2
+8FF7E3
+8FF7E4
+8FF7E5
+8FF7E6
+8FF7E7
+8FF7E8
+8FF7E9
+8FF7EA
+8FF7EB
+8FF7EC
+8FF7ED
+8FF7EE
+8FF7EF
+8FF7F0
+8FF7F1
+8FF7F2
+8FF7F3
+8FF7F4
+8FF7F5
+8FF7F6
+8FF7F7
+8FF7F8
+8FF7F9
+8FF7FA
+8FF7FB
+8FF7FC
+8FF7FD
+8FF7FE
+8FF8A1
+8FF8A2
+8FF8A3
+8FF8A4
+8FF8A5
+8FF8A6
+8FF8A7
+8FF8A8
+8FF8A9
+8FF8AA
+8FF8AB
+8FF8AC
+8FF8AD
+8FF8AE
+8FF8AF
+8FF8B0
+8FF8B1
+8FF8B2
+8FF8B3
+8FF8B4
+8FF8B5
+8FF8B6
+8FF8B7
+8FF8B8
+8FF8B9
+8FF8BA
+8FF8BB
+8FF8BC
+8FF8BD
+8FF8BE
+8FF8BF
+8FF8C0
+8FF8C1
+8FF8C2
+8FF8C3
+8FF8C4
+8FF8C5
+8FF8C6
+8FF8C7
+8FF8C8
+8FF8C9
+8FF8CA
+8FF8CB
+8FF8CC
+8FF8CD
+8FF8CE
+8FF8CF
+8FF8D0
+8FF8D1
+8FF8D2
+8FF8D3
+8FF8D4
+8FF8D5
+8FF8D6
+8FF8D7
+8FF8D8
+8FF8D9
+8FF8DA
+8FF8DB
+8FF8DC
+8FF8DD
+8FF8DE
+8FF8DF
+8FF8E0
+8FF8E1
+8FF8E2
+8FF8E3
+8FF8E4
+8FF8E5
+8FF8E6
+8FF8E7
+8FF8E8
+8FF8E9
+8FF8EA
+8FF8EB
+8FF8EC
+8FF8ED
+8FF8EE
+8FF8EF
+8FF8F0
+8FF8F1
+8FF8F2
+8FF8F3
+8FF8F4
+8FF8F5
+8FF8F6
+8FF8F7
+8FF8F8
+8FF8F9
+8FF8FA
+8FF8FB
+8FF8FC
+8FF8FD
+8FF8FE
+8FF9A1
+8FF9A2
+8FF9A3
+8FF9A4
+8FF9A5
+8FF9A6
+8FF9A7
+8FF9A8
+8FF9A9
+8FF9AA
+8FF9AB
+8FF9AC
+8FF9AD
+8FF9AE
+8FF9AF
+8FF9B0
+8FF9B1
+8FF9B2
+8FF9B3
+8FF9B4
+8FF9B5
+8FF9B6
+8FF9B7
+8FF9B8
+8FF9B9
+8FF9BA
+8FF9BB
+8FF9BC
+8FF9BD
+8FF9BE
+8FF9BF
+8FF9C0
+8FF9C1
+8FF9C2
+8FF9C3
+8FF9C4
+8FF9C5
+8FF9C6
+8FF9C7
+8FF9C8
+8FF9C9
+8FF9CA
+8FF9CB
+8FF9CC
+8FF9CD
+8FF9CE
+8FF9CF
+8FF9D0
+8FF9D1
+8FF9D2
+8FF9D3
+8FF9D4
+8FF9D5
+8FF9D6
+8FF9D7
+8FF9D8
+8FF9D9
+8FF9DA
+8FF9DB
+8FF9DC
+8FF9DD
+8FF9DE
+8FF9DF
+8FF9E0
+8FF9E1
+8FF9E2
+8FF9E3
+8FF9E4
+8FF9E5
+8FF9E6
+8FF9E7
+8FF9E8
+8FF9E9
+8FF9EA
+8FF9EB
+8FF9EC
+8FF9ED
+8FF9EE
+8FF9EF
+8FF9F0
+8FF9F1
+8FF9F2
+8FF9F3
+8FF9F4
+8FF9F5
+8FF9F6
+8FF9F7
+8FF9F8
+8FF9F9
+8FF9FA
+8FF9FB
+8FF9FC
+8FF9FD
+8FF9FE
+8FFAA1
+8FFAA2
+8FFAA3
+8FFAA4
+8FFAA5
+8FFAA6
+8FFAA7
+8FFAA8
+8FFAA9
+8FFAAA
+8FFAAB
+8FFAAC
+8FFAAD
+8FFAAE
+8FFAAF
+8FFAB0
+8FFAB1
+8FFAB2
+8FFAB3
+8FFAB4
+8FFAB5
+8FFAB6
+8FFAB7
+8FFAB8
+8FFAB9
+8FFABA
+8FFABB
+8FFABC
+8FFABD
+8FFABE
+8FFABF
+8FFAC0
+8FFAC1
+8FFAC2
+8FFAC3
+8FFAC4
+8FFAC5
+8FFAC6
+8FFAC7
+8FFAC8
+8FFAC9
+8FFACA
+8FFACB
+8FFACC
+8FFACD
+8FFACE
+8FFACF
+8FFAD0
+8FFAD1
+8FFAD2
+8FFAD3
+8FFAD4
+8FFAD5
+8FFAD6
+8FFAD7
+8FFAD8
+8FFAD9
+8FFADA
+8FFADB
+8FFADC
+8FFADD
+8FFADE
+8FFADF
+8FFAE0
+8FFAE1
+8FFAE2
+8FFAE3
+8FFAE4
+8FFAE5
+8FFAE6
+8FFAE7
+8FFAE8
+8FFAE9
+8FFAEA
+8FFAEB
+8FFAEC
+8FFAED
+8FFAEE
+8FFAEF
+8FFAF0
+8FFAF1
+8FFAF2
+8FFAF3
+8FFAF4
+8FFAF5
+8FFAF6
+8FFAF7
+8FFAF8
+8FFAF9
+8FFAFA
+8FFAFB
+8FFAFC
+8FFAFD
+8FFAFE
+8FFBA1
+8FFBA2
+8FFBA3
+8FFBA4
+8FFBA5
+8FFBA6
+8FFBA7
+8FFBA8
+8FFBA9
+8FFBAA
+8FFBAB
+8FFBAC
+8FFBAD
+8FFBAE
+8FFBAF
+8FFBB0
+8FFBB1
+8FFBB2
+8FFBB3
+8FFBB4
+8FFBB5
+8FFBB6
+8FFBB7
+8FFBB8
+8FFBB9
+8FFBBA
+8FFBBB
+8FFBBC
+8FFBBD
+8FFBBE
+8FFBBF
+8FFBC0
+8FFBC1
+8FFBC2
+8FFBC3
+8FFBC4
+8FFBC5
+8FFBC6
+8FFBC7
+8FFBC8
+8FFBC9
+8FFBCA
+8FFBCB
+8FFBCC
+8FFBCD
+8FFBCE
+8FFBCF
+8FFBD0
+8FFBD1
+8FFBD2
+8FFBD3
+8FFBD4
+8FFBD5
+8FFBD6
+8FFBD7
+8FFBD8
+8FFBD9
+8FFBDA
+8FFBDB
+8FFBDC
+8FFBDD
+8FFBDE
+8FFBDF
+8FFBE0
+8FFBE1
+8FFBE2
+8FFBE3
+8FFBE4
+8FFBE5
+8FFBE6
+8FFBE7
+8FFBE8
+8FFBE9
+8FFBEA
+8FFBEB
+8FFBEC
+8FFBED
+8FFBEE
+8FFBEF
+8FFBF0
+8FFBF1
+8FFBF2
+8FFBF3
+8FFBF4
+8FFBF5
+8FFBF6
+8FFBF7
+8FFBF8
+8FFBF9
+8FFBFA
+8FFBFB
+8FFBFC
+8FFBFD
+8FFBFE
+8FFCA1
+8FFCA2
+8FFCA3
+8FFCA4
+8FFCA5
+8FFCA6
+8FFCA7
+8FFCA8
+8FFCA9
+8FFCAA
+8FFCAB
+8FFCAC
+8FFCAD
+8FFCAE
+8FFCAF
+8FFCB0
+8FFCB1
+8FFCB2
+8FFCB3
+8FFCB4
+8FFCB5
+8FFCB6
+8FFCB7
+8FFCB8
+8FFCB9
+8FFCBA
+8FFCBB
+8FFCBC
+8FFCBD
+8FFCBE
+8FFCBF
+8FFCC0
+8FFCC1
+8FFCC2
+8FFCC3
+8FFCC4
+8FFCC5
+8FFCC6
+8FFCC7
+8FFCC8
+8FFCC9
+8FFCCA
+8FFCCB
+8FFCCC
+8FFCCD
+8FFCCE
+8FFCCF
+8FFCD0
+8FFCD1
+8FFCD2
+8FFCD3
+8FFCD4
+8FFCD5
+8FFCD6
+8FFCD7
+8FFCD8
+8FFCD9
+8FFCDA
+8FFCDB
+8FFCDC
+8FFCDD
+8FFCDE
+8FFCDF
+8FFCE0
+8FFCE1
+8FFCE2
+8FFCE3
+8FFCE4
+8FFCE5
+8FFCE6
+8FFCE7
+8FFCE8
+8FFCE9
+8FFCEA
+8FFCEB
+8FFCEC
+8FFCED
+8FFCEE
+8FFCEF
+8FFCF0
+8FFCF1
+8FFCF2
+8FFCF3
+8FFCF4
+8FFCF5
+8FFCF6
+8FFCF7
+8FFCF8
+8FFCF9
+8FFCFA
+8FFCFB
+8FFCFC
+8FFCFD
+8FFCFE
+8FFDA1
+8FFDA2
+8FFDA3
+8FFDA4
+8FFDA5
+8FFDA6
+8FFDA7
+8FFDA8
+8FFDA9
+8FFDAA
+8FFDAB
+8FFDAC
+8FFDAD
+8FFDAE
+8FFDAF
+8FFDB0
+8FFDB1
+8FFDB2
+8FFDB3
+8FFDB4
+8FFDB5
+8FFDB6
+8FFDB7
+8FFDB8
+8FFDB9
+8FFDBA
+8FFDBB
+8FFDBC
+8FFDBD
+8FFDBE
+8FFDBF
+8FFDC0
+8FFDC1
+8FFDC2
+8FFDC3
+8FFDC4
+8FFDC5
+8FFDC6
+8FFDC7
+8FFDC8
+8FFDC9
+8FFDCA
+8FFDCB
+8FFDCC
+8FFDCD
+8FFDCE
+8FFDCF
+8FFDD0
+8FFDD1
+8FFDD2
+8FFDD3
+8FFDD4
+8FFDD5
+8FFDD6
+8FFDD7
+8FFDD8
+8FFDD9
+8FFDDA
+8FFDDB
+8FFDDC
+8FFDDD
+8FFDDE
+8FFDDF
+8FFDE0
+8FFDE1
+8FFDE2
+8FFDE3
+8FFDE4
+8FFDE5
+8FFDE6
+8FFDE7
+8FFDE8
+8FFDE9
+8FFDEA
+8FFDEB
+8FFDEC
+8FFDED
+8FFDEE
+8FFDEF
+8FFDF0
+8FFDF1
+8FFDF2
+8FFDF3
+8FFDF4
+8FFDF5
+8FFDF6
+8FFDF7
+8FFDF8
+8FFDF9
+8FFDFA
+8FFDFB
+8FFDFC
+8FFDFD
+8FFDFE
+8FFEA1
+8FFEA2
+8FFEA3
+8FFEA4
+8FFEA5
+8FFEA6
+8FFEA7
+8FFEA8
+8FFEA9
+8FFEAA
+8FFEAB
+8FFEAC
+8FFEAD
+8FFEAE
+8FFEAF
+8FFEB0
+8FFEB1
+8FFEB2
+8FFEB3
+8FFEB4
+8FFEB5
+8FFEB6
+8FFEB7
+8FFEB8
+8FFEB9
+8FFEBA
+8FFEBB
+8FFEBC
+8FFEBD
+8FFEBE
+8FFEBF
+8FFEC0
+8FFEC1
+8FFEC2
+8FFEC3
+8FFEC4
+8FFEC5
+8FFEC6
+8FFEC7
+8FFEC8
+8FFEC9
+8FFECA
+8FFECB
+8FFECC
+8FFECD
+8FFECE
+8FFECF
+8FFED0
+8FFED1
+8FFED2
+8FFED3
+8FFED4
+8FFED5
+8FFED6
+8FFED7
+8FFED8
+8FFED9
+8FFEDA
+8FFEDB
+8FFEDC
+8FFEDD
+8FFEDE
+8FFEDF
+8FFEE0
+8FFEE1
+8FFEE2
+8FFEE3
+8FFEE4
+8FFEE5
+8FFEE6
+8FFEE7
+8FFEE8
+8FFEE9
+8FFEEA
+8FFEEB
+8FFEEC
+8FFEED
+8FFEEE
+8FFEEF
+8FFEF0
+8FFEF1
+8FFEF2
+8FFEF3
+8FFEF4
+8FFEF5
+8FFEF6
+8FFEF7
+8FFEF8
+8FFEF9
+8FFEFA
+8FFEFB
+8FFEFC
+8FFEFD
+8FFEFE
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+DROP TABLE t4;
+RESET MASTER;
+CREATE TABLE t1(f1 blob);
+PREPARE stmt1 FROM 'INSERT INTO t1 VALUES(?)';
+SET @var1= x'8300';
+EXECUTE stmt1 USING @var1;
+SHOW BINLOG EVENTS FROM 102;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 102 Query 1 189 use `test`; CREATE TABLE t1(f1 blob)
+master-bin.000001 189 Table_map 1 228 test.t1
+master-bin.000001 228 Write_rows 1 262
+SELECT HEX(f1) FROM t1;
+HEX(f1)
+8300
+DROP table t1;
+SET collation_connection='cp932_japanese_ci';
+create table t1 select repeat('a',4000) a;
+delete from t1;
+insert into t1 values ('a'), ('a '), ('a\t');
+select collation(a),hex(a) from t1 order by a;
+collation(a) hex(a)
+cp932_japanese_ci 6109
+cp932_japanese_ci 61
+cp932_japanese_ci 6120
+drop table t1;
+SET collation_connection='cp932_bin';
+create table t1 select repeat('a',4000) a;
+delete from t1;
+insert into t1 values ('a'), ('a '), ('a\t');
+select collation(a),hex(a) from t1 order by a;
+collation(a) hex(a)
+cp932_bin 6109
+cp932_bin 61
+cp932_bin 6120
+drop table t1;
+create table t1 (col1 varchar(1)) character set cp932;
+insert into t1 values ('a');
+insert into t1 values ('ab');
+Warnings:
+Warning 1265 Data truncated for column 'col1' at row 1
+select * from t1;
+col1
+a
+a
+insert into t1 values ('abc');
+Warnings:
+Warning 1265 Data truncated for column 'col1' at row 1
+select * from t1;
+col1
+a
+a
+a
diff --git a/mysql-test/r/binlog_row_ctype_ucs.result b/mysql-test/r/binlog_row_ctype_ucs.result
new file mode 100644
index 00000000000..12f7062d38a
--- /dev/null
+++ b/mysql-test/r/binlog_row_ctype_ucs.result
@@ -0,0 +1,16 @@
+SET TIMESTAMP=10000;
+create table t2 (c char(30)) charset=ucs2;
+set @v=convert('abc' using ucs2);
+reset master;
+insert into t2 values (@v);
+show binlog events from 102;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 102 Table_map 1 141 test.t2
+master-bin.000001 141 Write_rows 1 231
+/*!40019 SET @@session.max_insert_delayed_threads=0*/;
+/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
+ROLLBACK;
+# End of log file
+ROLLBACK /* added by mysqlbinlog */;
+/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
+drop table t2;
diff --git a/mysql-test/r/binlog_row_drop_tmp_tbl.result b/mysql-test/r/binlog_row_drop_tmp_tbl.result
new file mode 100644
index 00000000000..2b09fe069e3
--- /dev/null
+++ b/mysql-test/r/binlog_row_drop_tmp_tbl.result
@@ -0,0 +1,18 @@
+drop database if exists `drop-temp+table-test`;
+reset master;
+create database `drop-temp+table-test`;
+use `drop-temp+table-test`;
+create temporary table shortn1 (a int);
+create temporary table `table:name` (a int);
+create temporary table shortn2 (a int);
+select get_lock("a",10);
+get_lock("a",10)
+1
+select get_lock("a",10);
+get_lock("a",10)
+1
+show binlog events;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4
+master-bin.000001 # Query 1 # create database `drop-temp+table-test`
+drop database `drop-temp+table-test`;
diff --git a/mysql-test/r/binlog_row_innodb_stat.result b/mysql-test/r/binlog_row_innodb_stat.result
new file mode 100644
index 00000000000..e6813ee2719
--- /dev/null
+++ b/mysql-test/r/binlog_row_innodb_stat.result
@@ -0,0 +1,39 @@
+show status like "binlog_cache_use";
+Variable_name Value
+Binlog_cache_use 0
+show status like "binlog_cache_disk_use";
+Variable_name Value
+Binlog_cache_disk_use 0
+drop table if exists t1;
+create table t1 (a int) engine=innodb;
+show status like "binlog_cache_use";
+Variable_name Value
+Binlog_cache_use 1
+show status like "binlog_cache_disk_use";
+Variable_name Value
+Binlog_cache_disk_use 1
+begin;
+delete from t1;
+commit;
+show status like "binlog_cache_use";
+Variable_name Value
+Binlog_cache_use 2
+show status like "binlog_cache_disk_use";
+Variable_name Value
+Binlog_cache_disk_use 1
+drop table t1;
+show status like "Innodb_buffer_pool_pages_total";
+Variable_name Value
+Innodb_buffer_pool_pages_total 512
+show status like "Innodb_page_size";
+Variable_name Value
+Innodb_page_size 16384
+show status like "Innodb_rows_deleted";
+Variable_name Value
+Innodb_rows_deleted 2000
+show status like "Innodb_rows_inserted";
+Variable_name Value
+Innodb_rows_inserted 2000
+show status like "Innodb_rows_updated";
+Variable_name Value
+Innodb_rows_updated 0
diff --git a/mysql-test/r/binlog_row_insert_select.result b/mysql-test/r/binlog_row_insert_select.result
new file mode 100644
index 00000000000..27c515e5781
--- /dev/null
+++ b/mysql-test/r/binlog_row_insert_select.result
@@ -0,0 +1,26 @@
+create table t1(a int, unique(a));
+insert into t1 values(2);
+create table t2(a int);
+insert into t2 values(1),(2);
+reset master;
+insert into t1 select * from t2;
+ERROR 23000: Duplicate entry '2' for key 1
+show binlog events;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 4 Format_desc 1 102 Server ver: VERSION, Binlog ver: 4
+master-bin.000001 102 Table_map 1 141 test.t1
+master-bin.000001 141 Write_rows 1 175
+select * from t1;
+a
+1
+2
+drop table t1, t2;
+create table t1(a int);
+insert into t1 values(1),(1);
+reset master;
+create table t2(unique(a)) select a from t1;
+ERROR 23000: Duplicate entry '1' for key 1
+show binlog events;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 4 Format_desc 1 102 Server ver: VERSION, Binlog ver: 4
+drop table t1;
diff --git a/mysql-test/r/binlog_row_mix_innodb_myisam.result b/mysql-test/r/binlog_row_mix_innodb_myisam.result
new file mode 100644
index 00000000000..3a26d84d575
--- /dev/null
+++ b/mysql-test/r/binlog_row_mix_innodb_myisam.result
@@ -0,0 +1,282 @@
+drop table if exists t1, t2;
+create table t1 (a int) engine=innodb;
+create table t2 (a int) engine=myisam;
+reset master;
+begin;
+insert into t1 values(1);
+insert into t2 select * from t1;
+commit;
+show binlog events from 102;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 102 Query 1 # use `test`; BEGIN
+master-bin.000001 170 Table_map 1 # test.t1
+master-bin.000001 209 Write_rows 1 #
+master-bin.000001 243 Table_map 1 # test.t2
+master-bin.000001 282 Write_rows 1 #
+master-bin.000001 316 Xid 1 # COMMIT /* xid= */
+delete from t1;
+delete from t2;
+reset master;
+begin;
+insert into t1 values(2);
+insert into t2 select * from t1;
+rollback;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+show binlog events from 102;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 102 Query 1 # use `test`; BEGIN
+master-bin.000001 170 Table_map 1 # test.t1
+master-bin.000001 209 Write_rows 1 #
+master-bin.000001 243 Table_map 1 # test.t2
+master-bin.000001 282 Write_rows 1 #
+master-bin.000001 316 Query 1 # use `test`; ROLLBACK
+delete from t1;
+delete from t2;
+reset master;
+begin;
+insert into t1 values(3);
+savepoint my_savepoint;
+insert into t1 values(4);
+insert into t2 select * from t1;
+rollback to savepoint my_savepoint;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+commit;
+show binlog events from 102;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 102 Query 1 # use `test`; BEGIN
+master-bin.000001 170 Table_map 1 # test.t1
+master-bin.000001 209 Write_rows 1 #
+master-bin.000001 243 Query 1 # use `test`; savepoint my_savepoint
+master-bin.000001 328 Table_map 1 # test.t1
+master-bin.000001 367 Write_rows 1 #
+master-bin.000001 401 Table_map 1 # test.t2
+master-bin.000001 440 Write_rows 1 #
+master-bin.000001 479 Query 1 # use `test`; rollback to savepoint my_savepoint
+master-bin.000001 576 Xid 1 # COMMIT /* xid= */
+delete from t1;
+delete from t2;
+reset master;
+begin;
+insert into t1 values(5);
+savepoint my_savepoint;
+insert into t1 values(6);
+insert into t2 select * from t1;
+rollback to savepoint my_savepoint;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+insert into t1 values(7);
+commit;
+select a from t1 order by a;
+a
+5
+7
+show binlog events from 102;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 102 Query 1 # use `test`; BEGIN
+master-bin.000001 170 Table_map 1 # test.t1
+master-bin.000001 209 Write_rows 1 #
+master-bin.000001 243 Query 1 # use `test`; savepoint my_savepoint
+master-bin.000001 328 Table_map 1 # test.t1
+master-bin.000001 367 Write_rows 1 #
+master-bin.000001 401 Table_map 1 # test.t2
+master-bin.000001 440 Write_rows 1 #
+master-bin.000001 479 Query 1 # use `test`; rollback to savepoint my_savepoint
+master-bin.000001 576 Table_map 1 # test.t1
+master-bin.000001 615 Write_rows 1 #
+master-bin.000001 649 Xid 1 # COMMIT /* xid= */
+delete from t1;
+delete from t2;
+reset master;
+select get_lock("a",10);
+get_lock("a",10)
+1
+begin;
+insert into t1 values(8);
+insert into t2 select * from t1;
+select get_lock("a",10);
+get_lock("a",10)
+1
+show binlog events from 102;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 102 Query 1 # use `test`; BEGIN
+master-bin.000001 170 Table_map 1 # test.t1
+master-bin.000001 209 Write_rows 1 #
+master-bin.000001 243 Table_map 1 # test.t2
+master-bin.000001 282 Write_rows 1 #
+master-bin.000001 316 Query 1 # use `test`; ROLLBACK
+delete from t1;
+delete from t2;
+reset master;
+insert into t1 values(9);
+insert into t2 select * from t1;
+show binlog events from 102;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 102 Table_map 1 # test.t1
+master-bin.000001 141 Write_rows 1 #
+master-bin.000001 175 Xid 1 # COMMIT /* xid= */
+master-bin.000001 202 Table_map 1 # test.t2
+master-bin.000001 241 Write_rows 1 #
+delete from t1;
+delete from t2;
+reset master;
+insert into t1 values(10);
+begin;
+insert into t2 select * from t1;
+show binlog events from 102;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 102 Table_map 1 # test.t1
+master-bin.000001 141 Write_rows 1 #
+master-bin.000001 175 Xid 1 # COMMIT /* xid= */
+master-bin.000001 202 Table_map 1 # test.t2
+master-bin.000001 241 Write_rows 1 #
+insert into t1 values(11);
+commit;
+show binlog events from 102;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 102 Table_map 1 # test.t1
+master-bin.000001 141 Write_rows 1 #
+master-bin.000001 175 Xid 1 # COMMIT /* xid= */
+master-bin.000001 202 Table_map 1 # test.t2
+master-bin.000001 241 Write_rows 1 #
+master-bin.000001 275 Query 1 # use `test`; BEGIN
+master-bin.000001 343 Table_map 1 # test.t1
+master-bin.000001 382 Write_rows 1 #
+master-bin.000001 416 Xid 1 # COMMIT /* xid= */
+alter table t2 engine=INNODB;
+delete from t1;
+delete from t2;
+reset master;
+begin;
+insert into t1 values(12);
+insert into t2 select * from t1;
+commit;
+show binlog events from 102;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 102 Query 1 # use `test`; BEGIN
+master-bin.000001 170 Table_map 1 # test.t1
+master-bin.000001 209 Write_rows 1 #
+master-bin.000001 243 Table_map 1 # test.t2
+master-bin.000001 282 Write_rows 1 #
+master-bin.000001 316 Xid 1 # COMMIT /* xid= */
+delete from t1;
+delete from t2;
+reset master;
+begin;
+insert into t1 values(13);
+insert into t2 select * from t1;
+rollback;
+show binlog events from 102;
+Log_name Pos Event_type Server_id End_log_pos Info
+delete from t1;
+delete from t2;
+reset master;
+begin;
+insert into t1 values(14);
+savepoint my_savepoint;
+insert into t1 values(15);
+insert into t2 select * from t1;
+rollback to savepoint my_savepoint;
+commit;
+show binlog events from 102;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 102 Query 1 # use `test`; BEGIN
+master-bin.000001 170 Table_map 1 # test.t1
+master-bin.000001 209 Write_rows 1 #
+master-bin.000001 243 Xid 1 # COMMIT /* xid= */
+delete from t1;
+delete from t2;
+reset master;
+begin;
+insert into t1 values(16);
+savepoint my_savepoint;
+insert into t1 values(17);
+insert into t2 select * from t1;
+rollback to savepoint my_savepoint;
+insert into t1 values(18);
+commit;
+select a from t1 order by a;
+a
+16
+18
+show binlog events from 102;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 102 Query 1 # use `test`; BEGIN
+master-bin.000001 170 Table_map 1 # test.t1
+master-bin.000001 209 Write_rows 1 #
+master-bin.000001 243 Table_map 1 # test.t1
+master-bin.000001 282 Write_rows 1 #
+master-bin.000001 316 Xid 1 # COMMIT /* xid= */
+delete from t1;
+delete from t2;
+alter table t2 type=MyISAM;
+insert into t1 values (1);
+begin;
+select * from t1 for update;
+a
+1
+select (@before:=unix_timestamp())*0;
+(@before:=unix_timestamp())*0
+0
+begin;
+ select * from t1 for update;
+insert into t2 values (20);
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+select (@after:=unix_timestamp())*0;
+(@after:=unix_timestamp())*0
+0
+select (@after-@before) >= 2;
+(@after-@before) >= 2
+1
+drop table t1,t2;
+commit;
+begin;
+create temporary table ti (a int) engine=innodb;
+rollback;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+insert into ti values(1);
+set autocommit=0;
+create temporary table t1 (a int) engine=myisam;
+commit;
+insert t1 values (1);
+rollback;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+create table t0 (n int);
+insert t0 select * from t1;
+set autocommit=1;
+insert into t0 select GET_LOCK("lock1",null);
+set autocommit=0;
+create table t2 (n int) engine=innodb;
+insert into t2 values (3);
+select get_lock("lock1",60);
+get_lock("lock1",60)
+1
+show binlog events from 102;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 102 Query 1 # use `test`; BEGIN
+master-bin.000001 170 Table_map 1 # test.t1
+master-bin.000001 209 Write_rows 1 #
+master-bin.000001 243 Table_map 1 # test.t1
+master-bin.000001 282 Write_rows 1 #
+master-bin.000001 316 Xid 1 # COMMIT /* xid= */
+master-bin.000001 343 Table_map 1 # test.t1
+master-bin.000001 382 Delete_rows 1 #
+master-bin.000001 421 Xid 1 # COMMIT /* xid= */
+master-bin.000001 448 Query 1 # use `test`; alter table t2 type=MyISAM
+master-bin.000001 537 Table_map 1 # test.t1
+master-bin.000001 576 Write_rows 1 #
+master-bin.000001 610 Xid 1 # COMMIT /* xid= */
+master-bin.000001 637 Table_map 1 # test.t2
+master-bin.000001 676 Write_rows 1 #
+master-bin.000001 710 Query 1 # use `test`; drop table t1,t2
+master-bin.000001 789 Query 1 # use `test`; create table t0 (n int)
+master-bin.000001 875 Table_map 1 # test.t0
+master-bin.000001 914 Write_rows 1 #
+master-bin.000001 948 Table_map 1 # test.t0
+master-bin.000001 987 Write_rows 1 #
+master-bin.000001 1021 Query 1 # use `test`; create table t2 (n int) engine=innodb
+do release_lock("lock1");
+drop table t0,t2;
diff --git a/mysql-test/r/binlog.result b/mysql-test/r/binlog_stm_binlog.result
index 5d5b78abe29..80de6b6eaa9 100644
--- a/mysql-test/r/binlog.result
+++ b/mysql-test/r/binlog_stm_binlog.result
@@ -8,7 +8,7 @@ commit;
begin;
insert t2 values (5);
commit;
-show binlog events from 98;
+show binlog events from 102;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; create table t1 (a int) engine=bdb
master-bin.000001 # Query 1 # use `test`; create table t2 (a int) engine=innodb
@@ -17,14 +17,14 @@ master-bin.000001 # Query 1 # use `test`; insert t1 values (5)
master-bin.000001 # Query 1 # use `test`; COMMIT
master-bin.000001 # Query 1 # use `test`; BEGIN
master-bin.000001 # Query 1 # use `test`; insert t2 values (5)
-master-bin.000001 # Xid 1 # COMMIT /* xid=11 */
+master-bin.000001 # Xid 1 # COMMIT /* xid= */
drop table t1,t2;
reset master;
create table t1 (n int) engine=innodb;
begin;
commit;
drop table t1;
-show binlog events in 'master-bin.000001' from 98;
+show binlog events in 'master-bin.000001' from 102;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; create table t1 (n int) engine=innodb
master-bin.000001 # Query 1 # use `test`; BEGIN
@@ -128,8 +128,8 @@ master-bin.000001 # Query 1 # use `test`; insert into t1 values(4 + 4)
master-bin.000001 # Query 1 # use `test`; insert into t1 values(3 + 4)
master-bin.000001 # Query 1 # use `test`; insert into t1 values(2 + 4)
master-bin.000001 # Query 1 # use `test`; insert into t1 values(1 + 4)
-master-bin.000001 # Xid 1 # COMMIT /* xid=18 */
+master-bin.000001 # Xid 1 # COMMIT /* xid= */
master-bin.000001 # Rotate 1 # master-bin.000002;pos=4
-show binlog events in 'master-bin.000002' from 98;
+show binlog events in 'master-bin.000002' from 102;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000002 # Query 1 # use `test`; drop table t1
diff --git a/mysql-test/r/blackhole.result b/mysql-test/r/binlog_stm_blackhole.result
index 7b6e61984ec..7b6e61984ec 100644
--- a/mysql-test/r/blackhole.result
+++ b/mysql-test/r/binlog_stm_blackhole.result
diff --git a/mysql-test/r/ctype_cp932.result b/mysql-test/r/binlog_stm_ctype_cp932.result
index 1afceb86381..146fb2ca2d5 100755
--- a/mysql-test/r/ctype_cp932.result
+++ b/mysql-test/r/binlog_stm_ctype_cp932.result
@@ -11320,11 +11320,11 @@ CREATE TABLE t1(f1 blob);
PREPARE stmt1 FROM 'INSERT INTO t1 VALUES(?)';
SET @var1= x'8300';
EXECUTE stmt1 USING @var1;
-SHOW BINLOG EVENTS FROM 98;
+SHOW BINLOG EVENTS FROM 102;
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 98 Query 1 185 use `test`; CREATE TABLE t1(f1 blob)
-master-bin.000001 185 User var 1 224 @`var1`=_binary 0x8300 COLLATE binary
-master-bin.000001 224 Query 1 317 use `test`; INSERT INTO t1 VALUES(@'var1')
+master-bin.000001 102 Query 1 189 use `test`; CREATE TABLE t1(f1 blob)
+master-bin.000001 189 User var 1 228 @`var1`=_binary 0x8300 COLLATE binary
+master-bin.000001 228 Query 1 321 use `test`; INSERT INTO t1 VALUES(@'var1')
SELECT HEX(f1) FROM t1;
HEX(f1)
8300
diff --git a/mysql-test/r/ctype_ucs_binlog.result b/mysql-test/r/binlog_stm_ctype_ucs.result
index 14220a7df13..e4448efa7ab 100644
--- a/mysql-test/r/ctype_ucs_binlog.result
+++ b/mysql-test/r/binlog_stm_ctype_ucs.result
@@ -3,10 +3,10 @@ create table t2 (c char(30)) charset=ucs2;
set @v=convert('abc' using ucs2);
reset master;
insert into t2 values (@v);
-show binlog events from 98;
+show binlog events from 102;
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 98 User var 1 138 @`v`=_ucs2 0x006100620063 COLLATE ucs2_general_ci
-master-bin.000001 138 Query 1 227 use `test`; insert into t2 values (@v)
+master-bin.000001 102 User var 1 142 @`v`=_ucs2 0x006100620063 COLLATE ucs2_general_ci
+master-bin.000001 142 Query 1 231 use `test`; insert into t2 values (@v)
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
ROLLBACK;
diff --git a/mysql-test/r/drop_temp_table.result b/mysql-test/r/binlog_stm_drop_tmp_tbl.result
index 96481341bd6..96481341bd6 100644
--- a/mysql-test/r/drop_temp_table.result
+++ b/mysql-test/r/binlog_stm_drop_tmp_tbl.result
diff --git a/mysql-test/r/binlog_stm_innodb_stat.result b/mysql-test/r/binlog_stm_innodb_stat.result
new file mode 100644
index 00000000000..e6813ee2719
--- /dev/null
+++ b/mysql-test/r/binlog_stm_innodb_stat.result
@@ -0,0 +1,39 @@
+show status like "binlog_cache_use";
+Variable_name Value
+Binlog_cache_use 0
+show status like "binlog_cache_disk_use";
+Variable_name Value
+Binlog_cache_disk_use 0
+drop table if exists t1;
+create table t1 (a int) engine=innodb;
+show status like "binlog_cache_use";
+Variable_name Value
+Binlog_cache_use 1
+show status like "binlog_cache_disk_use";
+Variable_name Value
+Binlog_cache_disk_use 1
+begin;
+delete from t1;
+commit;
+show status like "binlog_cache_use";
+Variable_name Value
+Binlog_cache_use 2
+show status like "binlog_cache_disk_use";
+Variable_name Value
+Binlog_cache_disk_use 1
+drop table t1;
+show status like "Innodb_buffer_pool_pages_total";
+Variable_name Value
+Innodb_buffer_pool_pages_total 512
+show status like "Innodb_page_size";
+Variable_name Value
+Innodb_page_size 16384
+show status like "Innodb_rows_deleted";
+Variable_name Value
+Innodb_rows_deleted 2000
+show status like "Innodb_rows_inserted";
+Variable_name Value
+Innodb_rows_inserted 2000
+show status like "Innodb_rows_updated";
+Variable_name Value
+Innodb_rows_updated 0
diff --git a/mysql-test/r/insert_select-binlog.result b/mysql-test/r/binlog_stm_insert_select.result
index 76f460b1de2..42bba580f47 100644
--- a/mysql-test/r/insert_select-binlog.result
+++ b/mysql-test/r/binlog_stm_insert_select.result
@@ -7,8 +7,8 @@ insert into t1 select * from t2;
ERROR 23000: Duplicate entry '2' for key 1
show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 4 Format_desc 1 98 Server ver: VERSION, Binlog ver: 4
-master-bin.000001 98 Query 1 192 use `test`; insert into t1 select * from t2
+master-bin.000001 4 Format_desc 1 102 Server ver: VERSION, Binlog ver: 4
+master-bin.000001 102 Query 1 196 use `test`; insert into t1 select * from t2
select * from t1;
a
1
@@ -21,5 +21,5 @@ create table t2(unique(a)) select a from t1;
ERROR 23000: Duplicate entry '1' for key 1
show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 4 Format_desc 1 98 Server ver: VERSION, Binlog ver: 4
+master-bin.000001 4 Format_desc 1 102 Server ver: VERSION, Binlog ver: 4
drop table t1;
diff --git a/mysql-test/r/binlog_stm_mix_innodb_myisam.result b/mysql-test/r/binlog_stm_mix_innodb_myisam.result
new file mode 100644
index 00000000000..5d75bf79990
--- /dev/null
+++ b/mysql-test/r/binlog_stm_mix_innodb_myisam.result
@@ -0,0 +1,258 @@
+drop table if exists t1, t2;
+create table t1 (a int) engine=innodb;
+create table t2 (a int) engine=myisam;
+reset master;
+begin;
+insert into t1 values(1);
+insert into t2 select * from t1;
+commit;
+show binlog events from 102;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 102 Query 1 # use `test`; BEGIN
+master-bin.000001 170 Query 1 # use `test`; insert into t1 values(1)
+master-bin.000001 257 Query 1 # use `test`; insert into t2 select * from t1
+master-bin.000001 351 Xid 1 # COMMIT /* xid= */
+delete from t1;
+delete from t2;
+reset master;
+begin;
+insert into t1 values(2);
+insert into t2 select * from t1;
+rollback;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+show binlog events from 102;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 102 Query 1 # use `test`; BEGIN
+master-bin.000001 170 Query 1 # use `test`; insert into t1 values(2)
+master-bin.000001 257 Query 1 # use `test`; insert into t2 select * from t1
+master-bin.000001 351 Query 1 # use `test`; ROLLBACK
+delete from t1;
+delete from t2;
+reset master;
+begin;
+insert into t1 values(3);
+savepoint my_savepoint;
+insert into t1 values(4);
+insert into t2 select * from t1;
+rollback to savepoint my_savepoint;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+commit;
+show binlog events from 102;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 102 Query 1 # use `test`; BEGIN
+master-bin.000001 170 Query 1 # use `test`; insert into t1 values(3)
+master-bin.000001 257 Query 1 # use `test`; savepoint my_savepoint
+master-bin.000001 342 Query 1 # use `test`; insert into t1 values(4)
+master-bin.000001 429 Query 1 # use `test`; insert into t2 select * from t1
+master-bin.000001 523 Query 1 # use `test`; rollback to savepoint my_savepoint
+master-bin.000001 620 Xid 1 # COMMIT /* xid= */
+delete from t1;
+delete from t2;
+reset master;
+begin;
+insert into t1 values(5);
+savepoint my_savepoint;
+insert into t1 values(6);
+insert into t2 select * from t1;
+rollback to savepoint my_savepoint;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+insert into t1 values(7);
+commit;
+select a from t1 order by a;
+a
+5
+7
+show binlog events from 102;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 102 Query 1 # use `test`; BEGIN
+master-bin.000001 170 Query 1 # use `test`; insert into t1 values(5)
+master-bin.000001 257 Query 1 # use `test`; savepoint my_savepoint
+master-bin.000001 342 Query 1 # use `test`; insert into t1 values(6)
+master-bin.000001 429 Query 1 # use `test`; insert into t2 select * from t1
+master-bin.000001 523 Query 1 # use `test`; rollback to savepoint my_savepoint
+master-bin.000001 620 Query 1 # use `test`; insert into t1 values(7)
+master-bin.000001 707 Xid 1 # COMMIT /* xid= */
+delete from t1;
+delete from t2;
+reset master;
+select get_lock("a",10);
+get_lock("a",10)
+1
+begin;
+insert into t1 values(8);
+insert into t2 select * from t1;
+select get_lock("a",10);
+get_lock("a",10)
+1
+show binlog events from 102;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 102 Query 1 # use `test`; BEGIN
+master-bin.000001 170 Query 1 # use `test`; insert into t1 values(8)
+master-bin.000001 257 Query 1 # use `test`; insert into t2 select * from t1
+master-bin.000001 351 Query 1 # use `test`; ROLLBACK
+delete from t1;
+delete from t2;
+reset master;
+insert into t1 values(9);
+insert into t2 select * from t1;
+show binlog events from 102;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 102 Query 1 # use `test`; insert into t1 values(9)
+master-bin.000001 189 Xid 1 # COMMIT /* xid= */
+master-bin.000001 216 Query 1 # use `test`; insert into t2 select * from t1
+delete from t1;
+delete from t2;
+reset master;
+insert into t1 values(10);
+begin;
+insert into t2 select * from t1;
+show binlog events from 102;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 102 Query 1 # use `test`; insert into t1 values(10)
+master-bin.000001 190 Xid 1 # COMMIT /* xid= */
+master-bin.000001 217 Query 1 # use `test`; insert into t2 select * from t1
+insert into t1 values(11);
+commit;
+show binlog events from 102;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 102 Query 1 # use `test`; insert into t1 values(10)
+master-bin.000001 190 Xid 1 # COMMIT /* xid= */
+master-bin.000001 217 Query 1 # use `test`; insert into t2 select * from t1
+master-bin.000001 311 Query 1 # use `test`; BEGIN
+master-bin.000001 379 Query 1 # use `test`; insert into t1 values(11)
+master-bin.000001 467 Xid 1 # COMMIT /* xid= */
+alter table t2 engine=INNODB;
+delete from t1;
+delete from t2;
+reset master;
+begin;
+insert into t1 values(12);
+insert into t2 select * from t1;
+commit;
+show binlog events from 102;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 102 Query 1 # use `test`; BEGIN
+master-bin.000001 170 Query 1 # use `test`; insert into t1 values(12)
+master-bin.000001 258 Query 1 # use `test`; insert into t2 select * from t1
+master-bin.000001 352 Xid 1 # COMMIT /* xid= */
+delete from t1;
+delete from t2;
+reset master;
+begin;
+insert into t1 values(13);
+insert into t2 select * from t1;
+rollback;
+show binlog events from 102;
+Log_name Pos Event_type Server_id End_log_pos Info
+delete from t1;
+delete from t2;
+reset master;
+begin;
+insert into t1 values(14);
+savepoint my_savepoint;
+insert into t1 values(15);
+insert into t2 select * from t1;
+rollback to savepoint my_savepoint;
+commit;
+show binlog events from 102;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 102 Query 1 # use `test`; BEGIN
+master-bin.000001 170 Query 1 # use `test`; insert into t1 values(14)
+master-bin.000001 258 Xid 1 # COMMIT /* xid= */
+delete from t1;
+delete from t2;
+reset master;
+begin;
+insert into t1 values(16);
+savepoint my_savepoint;
+insert into t1 values(17);
+insert into t2 select * from t1;
+rollback to savepoint my_savepoint;
+insert into t1 values(18);
+commit;
+select a from t1 order by a;
+a
+16
+18
+show binlog events from 102;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 102 Query 1 # use `test`; BEGIN
+master-bin.000001 170 Query 1 # use `test`; insert into t1 values(16)
+master-bin.000001 258 Query 1 # use `test`; insert into t1 values(18)
+master-bin.000001 346 Xid 1 # COMMIT /* xid= */
+delete from t1;
+delete from t2;
+alter table t2 type=MyISAM;
+insert into t1 values (1);
+begin;
+select * from t1 for update;
+a
+1
+select (@before:=unix_timestamp())*0;
+(@before:=unix_timestamp())*0
+0
+begin;
+ select * from t1 for update;
+insert into t2 values (20);
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+select (@after:=unix_timestamp())*0;
+(@after:=unix_timestamp())*0
+0
+select (@after-@before) >= 2;
+(@after-@before) >= 2
+1
+drop table t1,t2;
+commit;
+begin;
+create temporary table ti (a int) engine=innodb;
+rollback;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+insert into ti values(1);
+set autocommit=0;
+create temporary table t1 (a int) engine=myisam;
+commit;
+insert t1 values (1);
+rollback;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+create table t0 (n int);
+insert t0 select * from t1;
+set autocommit=1;
+insert into t0 select GET_LOCK("lock1",null);
+set autocommit=0;
+create table t2 (n int) engine=innodb;
+insert into t2 values (3);
+select get_lock("lock1",60);
+get_lock("lock1",60)
+1
+show binlog events from 102;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 102 Query 1 # use `test`; BEGIN
+master-bin.000001 170 Query 1 # use `test`; insert into t1 values(16)
+master-bin.000001 258 Query 1 # use `test`; insert into t1 values(18)
+master-bin.000001 346 Xid 1 # COMMIT /* xid= */
+master-bin.000001 373 Query 1 # use `test`; delete from t1
+master-bin.000001 450 Xid 1 # COMMIT /* xid= */
+master-bin.000001 477 Query 1 # use `test`; delete from t2
+master-bin.000001 554 Xid 1 # COMMIT /* xid= */
+master-bin.000001 581 Query 1 # use `test`; alter table t2 type=MyISAM
+master-bin.000001 670 Query 1 # use `test`; insert into t1 values (1)
+master-bin.000001 758 Xid 1 # COMMIT /* xid= */
+master-bin.000001 785 Query 1 # use `test`; insert into t2 values (20)
+master-bin.000001 874 Query 1 # use `test`; drop table t1,t2
+master-bin.000001 953 Query 1 # use `test`; create temporary table ti (a int) engine=innodb
+master-bin.000001 1063 Query 1 # use `test`; insert into ti values(1)
+master-bin.000001 1150 Xid 1 # COMMIT /* xid= */
+master-bin.000001 1177 Query 1 # use `test`; create temporary table t1 (a int) engine=myisam
+master-bin.000001 1287 Query 1 # use `test`; insert t1 values (1)
+master-bin.000001 1370 Query 1 # use `test`; create table t0 (n int)
+master-bin.000001 1456 Query 1 # use `test`; insert t0 select * from t1
+master-bin.000001 1545 Query 1 # use `test`; insert into t0 select GET_LOCK("lock1",null)
+master-bin.000001 1652 Query 1 # use `test`; create table t2 (n int) engine=innodb
+master-bin.000001 1752 Query 1 # use `test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `test`.`t1`,`test`.`ti`
+do release_lock("lock1");
+drop table t0,t2;
diff --git a/mysql-test/r/ctype_cp932_binlog.result b/mysql-test/r/ctype_cp932_binlog_row.result
index d04fce7738c..913e8125619 100644
--- a/mysql-test/r/ctype_cp932_binlog.result
+++ b/mysql-test/r/ctype_cp932_binlog_row.result
@@ -6,11 +6,11 @@ CREATE TABLE t1(f1 blob);
PREPARE stmt1 FROM 'INSERT INTO t1 VALUES(?)';
SET @var1= x'8300';
EXECUTE stmt1 USING @var1;
-SHOW BINLOG EVENTS FROM 98;
+SHOW BINLOG EVENTS FROM 102;
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 98 Query 1 185 use `test`; CREATE TABLE t1(f1 blob)
-master-bin.000001 185 User var 1 224 @`var1`=_binary 0x8300 COLLATE binary
-master-bin.000001 224 Query 1 317 use `test`; INSERT INTO t1 VALUES(@'var1')
+master-bin.000001 # Query 1 # use `test`; CREATE TABLE t1(f1 blob)
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
SELECT HEX(f1) FROM t1;
HEX(f1)
8300
diff --git a/mysql-test/r/ctype_cp932_binlog_stm.result b/mysql-test/r/ctype_cp932_binlog_stm.result
new file mode 100644
index 00000000000..4ea1ecb6999
--- /dev/null
+++ b/mysql-test/r/ctype_cp932_binlog_stm.result
@@ -0,0 +1,17 @@
+drop table if exists t1;
+set names cp932;
+set character_set_database = cp932;
+RESET MASTER;
+CREATE TABLE t1(f1 blob);
+PREPARE stmt1 FROM 'INSERT INTO t1 VALUES(?)';
+SET @var1= x'8300';
+EXECUTE stmt1 USING @var1;
+SHOW BINLOG EVENTS FROM 102;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query 1 # use `test`; CREATE TABLE t1(f1 blob)
+master-bin.000001 # User var 1 # @`var1`=_binary 0x8300 COLLATE binary
+master-bin.000001 # Query 1 # use `test`; INSERT INTO t1 VALUES(@'var1')
+SELECT HEX(f1) FROM t1;
+HEX(f1)
+8300
+DROP table t1;
diff --git a/mysql-test/r/date_formats.result b/mysql-test/r/date_formats.result
index bc289f18169..434a5df1e17 100644
--- a/mysql-test/r/date_formats.result
+++ b/mysql-test/r/date_formats.result
@@ -1,12 +1,14 @@
drop table if exists t1;
SHOW GLOBAL VARIABLES LIKE "%_format%";
Variable_name Value
+binlog_format <format>
date_format %d.%m.%Y
datetime_format %Y-%m-%d %H:%i:%s
default_week_format 0
time_format %H.%i.%s
SHOW SESSION VARIABLES LIKE "%_format%";
Variable_name Value
+binlog_format <format>
date_format %d.%m.%Y
datetime_format %Y-%m-%d %H:%i:%s
default_week_format 0
@@ -30,6 +32,7 @@ set datetime_format= '%h:%i:%s %p %Y-%m-%d';
set datetime_format= '%h:%i:%s.%f %p %Y-%m-%d';
SHOW SESSION VARIABLES LIKE "%format";
Variable_name Value
+binlog_format <format>
date_format %m-%d-%Y
datetime_format %h:%i:%s.%f %p %Y-%m-%d
default_week_format 0
diff --git a/mysql-test/r/flush_block_commit.result b/mysql-test/r/flush_block_commit.result
index 2f6aca7e24a..e4a9dfcfff1 100644
--- a/mysql-test/r/flush_block_commit.result
+++ b/mysql-test/r/flush_block_commit.result
@@ -44,11 +44,11 @@ insert t1 values (1);
flush tables with read lock;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
-master-bin.000001 98
+master-bin.000001 102
commit;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
-master-bin.000001 98
+master-bin.000001 102
unlock tables;
drop table t1;
set autocommit=1;
diff --git a/mysql-test/r/have_binlog_format_row.require b/mysql-test/r/have_binlog_format_row.require
new file mode 100644
index 00000000000..09ad32dbb9a
--- /dev/null
+++ b/mysql-test/r/have_binlog_format_row.require
@@ -0,0 +1,2 @@
+Variable_name Value
+binlog_format ROW
diff --git a/mysql-test/r/have_binlog_format_statement.require b/mysql-test/r/have_binlog_format_statement.require
new file mode 100644
index 00000000000..81e2e31cd6c
--- /dev/null
+++ b/mysql-test/r/have_binlog_format_statement.require
@@ -0,0 +1,2 @@
+Variable_name Value
+binlog_format STATEMENT
diff --git a/mysql-test/r/have_row_based.require b/mysql-test/r/have_row_based.require
new file mode 100644
index 00000000000..c71451a95c3
--- /dev/null
+++ b/mysql-test/r/have_row_based.require
@@ -0,0 +1,2 @@
+Variable_name Value
+have_row_based_replication YES
diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result
index 3c08d2bccfa..ed4c14388ab 100644
--- a/mysql-test/r/innodb.result
+++ b/mysql-test/r/innodb.result
@@ -1640,29 +1640,6 @@ t2 CREATE TABLE `t2` (
CONSTRAINT `t2_ibfk_2` FOREIGN KEY (`b`) REFERENCES `t1` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop table t2, t1;
-show status like "binlog_cache_use";
-Variable_name Value
-Binlog_cache_use 155
-show status like "binlog_cache_disk_use";
-Variable_name Value
-Binlog_cache_disk_use 0
-create table t1 (a int) engine=innodb;
-show status like "binlog_cache_use";
-Variable_name Value
-Binlog_cache_use 156
-show status like "binlog_cache_disk_use";
-Variable_name Value
-Binlog_cache_disk_use 1
-begin;
-delete from t1;
-commit;
-show status like "binlog_cache_use";
-Variable_name Value
-Binlog_cache_use 157
-show status like "binlog_cache_disk_use";
-Variable_name Value
-Binlog_cache_disk_use 1
-drop table t1;
create table t1 (c char(10), index (c,c)) engine=innodb;
ERROR 42S21: Duplicate column name 'c'
create table t1 (c1 char(10), c2 char(10), index (c1,c2,c1)) engine=innodb;
@@ -1774,21 +1751,6 @@ select count(*) from t1 where x = 18446744073709551601;
count(*)
1
drop table t1;
-show status like "Innodb_buffer_pool_pages_total";
-Variable_name Value
-Innodb_buffer_pool_pages_total 512
-show status like "Innodb_page_size";
-Variable_name Value
-Innodb_page_size 16384
-show status like "Innodb_rows_deleted";
-Variable_name Value
-Innodb_rows_deleted 2070
-show status like "Innodb_rows_inserted";
-Variable_name Value
-Innodb_rows_inserted 31727
-show status like "Innodb_rows_updated";
-Variable_name Value
-Innodb_rows_updated 29530
show status like "Innodb_row_lock_waits";
Variable_name Value
Innodb_row_lock_waits 0
diff --git a/mysql-test/r/innodb_concurrent.result b/mysql-test/r/innodb_concurrent.result
new file mode 100644
index 00000000000..8e9d2e2ffe6
--- /dev/null
+++ b/mysql-test/r/innodb_concurrent.result
@@ -0,0 +1,621 @@
+drop table if exists t1;
+Warnings:
+Note 1051 Unknown table 't1'
+create table t1(eta int(11) not null, tipo int(11), c varchar(255)) type=innodb;
+Warnings:
+Warning 1287 'TYPE=storage_engine' is deprecated; use 'ENGINE=storage_engine' instead
+insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
+insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
+insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc");
+insert into t1 values (20,2,"ddddddddddddddddddddddddddddddddddddddddddd");
+insert into t1 values (30,1,"eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee");
+insert into t1 values (40,2,"fffffffffffffffffffffffffffffffffffffffffff");
+insert into t1 values (50,1,"ggggggggggggggggggggggggggggggggggggggggggg");
+insert into t1 values (60,2,"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh");
+insert into t1 values (70,1,"iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii");
+insert into t1 values (80,22,"jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj");
+insert into t1 values (90,11,"kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk");
+select get_lock("hello",1);
+get_lock("hello",1)
+1
+begin;
+ update t1 set eta=1+get_lock("hello",1)*0 where tipo=11;
+begin;
+update t1 set eta=2 where tipo=22;
+select release_lock("hello");
+release_lock("hello")
+1
+select * from t1;
+eta tipo c
+7 7 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+8 8 bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
+10 1 ccccccccccccccccccccccccccccccccccccccccccc
+20 2 ddddddddddddddddddddddddddddddddddddddddddd
+30 1 eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
+40 2 fffffffffffffffffffffffffffffffffffffffffff
+50 1 ggggggggggggggggggggggggggggggggggggggggggg
+60 2 hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
+70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
+2 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
+90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
+select * from t1;
+eta tipo c
+7 7 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+8 8 bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
+10 1 ccccccccccccccccccccccccccccccccccccccccccc
+20 2 ddddddddddddddddddddddddddddddddddddddddddd
+30 1 eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
+40 2 fffffffffffffffffffffffffffffffffffffffffff
+50 1 ggggggggggggggggggggggggggggggggggggggggggg
+60 2 hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
+70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
+80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
+1 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
+ commit;
+select * from t1;
+eta tipo c
+7 7 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+8 8 bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
+10 1 ccccccccccccccccccccccccccccccccccccccccccc
+20 2 ddddddddddddddddddddddddddddddddddddddddddd
+30 1 eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
+40 2 fffffffffffffffffffffffffffffffffffffffffff
+50 1 ggggggggggggggggggggggggggggggggggggggggggg
+60 2 hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
+70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
+2 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
+90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
+commit;
+select * from t1;
+eta tipo c
+7 7 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+8 8 bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
+10 1 ccccccccccccccccccccccccccccccccccccccccccc
+20 2 ddddddddddddddddddddddddddddddddddddddddddd
+30 1 eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
+40 2 fffffffffffffffffffffffffffffffffffffffffff
+50 1 ggggggggggggggggggggggggggggggggggggggggggg
+60 2 hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
+70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
+2 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
+1 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
+select * from t1;
+eta tipo c
+7 7 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+8 8 bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
+10 1 ccccccccccccccccccccccccccccccccccccccccccc
+20 2 ddddddddddddddddddddddddddddddddddddddddddd
+30 1 eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
+40 2 fffffffffffffffffffffffffffffffffffffffffff
+50 1 ggggggggggggggggggggggggggggggggggggggggggg
+60 2 hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
+70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
+2 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
+1 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
+select * from t1;
+eta tipo c
+7 7 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+8 8 bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
+10 1 ccccccccccccccccccccccccccccccccccccccccccc
+20 2 ddddddddddddddddddddddddddddddddddddddddddd
+30 1 eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
+40 2 fffffffffffffffffffffffffffffffffffffffffff
+50 1 ggggggggggggggggggggggggggggggggggggggggggg
+60 2 hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
+70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
+2 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
+1 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
+drop table t1;
+create table t1(eta int(11) not null, tipo int(11), c varchar(255)) type=innodb;
+Warnings:
+Warning 1287 'TYPE=storage_engine' is deprecated; use 'ENGINE=storage_engine' instead
+insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
+insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
+insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc");
+insert into t1 values (20,2,"ddddddddddddddddddddddddddddddddddddddddddd");
+insert into t1 values (30,1,"eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee");
+insert into t1 values (40,2,"fffffffffffffffffffffffffffffffffffffffffff");
+insert into t1 values (50,1,"ggggggggggggggggggggggggggggggggggggggggggg");
+insert into t1 values (60,2,"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh");
+insert into t1 values (70,1,"iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii");
+insert into t1 values (80,22,"jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj");
+insert into t1 values (90,11,"kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk");
+select get_lock("hello",10);
+get_lock("hello",10)
+0
+begin;
+ update t1 set eta=1+get_lock("hello",10)*0 where tipo=1;
+begin;
+update t1 set tipo=1 where tipo=2;
+select release_lock("hello");
+release_lock("hello")
+0
+select * from t1;
+eta tipo c
+7 7 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+8 8 bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
+10 1 ccccccccccccccccccccccccccccccccccccccccccc
+20 1 ddddddddddddddddddddddddddddddddddddddddddd
+30 1 eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
+40 1 fffffffffffffffffffffffffffffffffffffffffff
+50 1 ggggggggggggggggggggggggggggggggggggggggggg
+60 1 hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
+70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
+80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
+90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
+select * from t1;
+eta tipo c
+7 7 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+8 8 bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
+1 1 ccccccccccccccccccccccccccccccccccccccccccc
+20 2 ddddddddddddddddddddddddddddddddddddddddddd
+1 1 eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
+40 2 fffffffffffffffffffffffffffffffffffffffffff
+1 1 ggggggggggggggggggggggggggggggggggggggggggg
+60 2 hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
+1 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
+80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
+90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
+ commit;
+select * from t1;
+eta tipo c
+7 7 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+8 8 bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
+10 1 ccccccccccccccccccccccccccccccccccccccccccc
+20 1 ddddddddddddddddddddddddddddddddddddddddddd
+30 1 eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
+40 1 fffffffffffffffffffffffffffffffffffffffffff
+50 1 ggggggggggggggggggggggggggggggggggggggggggg
+60 1 hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
+70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
+80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
+90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
+commit;
+select * from t1;
+eta tipo c
+7 7 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+8 8 bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
+10 1 ccccccccccccccccccccccccccccccccccccccccccc
+20 1 ddddddddddddddddddddddddddddddddddddddddddd
+30 1 eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
+40 1 fffffffffffffffffffffffffffffffffffffffffff
+50 1 ggggggggggggggggggggggggggggggggggggggggggg
+60 1 hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
+70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
+80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
+90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
+select * from t1;
+eta tipo c
+7 7 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+8 8 bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
+1 1 ccccccccccccccccccccccccccccccccccccccccccc
+20 1 ddddddddddddddddddddddddddddddddddddddddddd
+1 1 eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
+40 1 fffffffffffffffffffffffffffffffffffffffffff
+1 1 ggggggggggggggggggggggggggggggggggggggggggg
+60 1 hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
+1 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
+80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
+90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
+select * from t1;
+eta tipo c
+7 7 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+8 8 bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
+1 1 ccccccccccccccccccccccccccccccccccccccccccc
+20 1 ddddddddddddddddddddddddddddddddddddddddddd
+1 1 eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
+40 1 fffffffffffffffffffffffffffffffffffffffffff
+1 1 ggggggggggggggggggggggggggggggggggggggggggg
+60 1 hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
+1 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
+80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
+90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
+drop table t1;
+create table t1 (a int not null, b int not null) engine=innodb;
+insert into t1 values (1,1),(2,1),(3,1),(4,1);
+select get_lock("hello2",1000);
+get_lock("hello2",1000)
+1
+begin;
+ update t1 set b=10+get_lock(concat("hello",a),1000)*0 where
+a=2;
+insert into t1 values (1,1);
+select release_lock("hello2");
+release_lock("hello2")
+1
+select * from t1;
+a b
+1 1
+2 1
+3 1
+4 1
+1 1
+select * from t1;
+a b
+1 1
+2 10
+3 1
+4 1
+1 1
+ commit;
+drop table t1;
+create table t1(eta int(11) not null, tipo int(11), c varchar(255)) type=innodb;
+Warnings:
+Warning 1287 'TYPE=storage_engine' is deprecated; use 'ENGINE=storage_engine' instead
+insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
+insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
+insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc");
+insert into t1 values (20,2,"ddddddddddddddddddddddddddddddddddddddddddd");
+insert into t1 values (30,1,"eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee");
+insert into t1 values (40,2,"fffffffffffffffffffffffffffffffffffffffffff");
+insert into t1 values (50,1,"ggggggggggggggggggggggggggggggggggggggggggg");
+insert into t1 values (60,2,"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh");
+insert into t1 values (70,1,"iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii");
+insert into t1 values (80,22,"jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj");
+insert into t1 values (90,11,"kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk");
+select get_lock("hello",10);
+get_lock("hello",10)
+1
+begin;
+ select * from t1 where tipo=2 FOR UPDATE;
+begin;
+select release_lock("hello");
+release_lock("hello")
+1
+update t1 set tipo=1+get_lock("hello",10)*0 where tipo=2;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+select * from t1;
+eta tipo c
+7 7 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+8 8 bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
+10 1 ccccccccccccccccccccccccccccccccccccccccccc
+20 2 ddddddddddddddddddddddddddddddddddddddddddd
+30 1 eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
+40 2 fffffffffffffffffffffffffffffffffffffffffff
+50 1 ggggggggggggggggggggggggggggggggggggggggggg
+60 2 hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
+70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
+80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
+90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
+eta tipo c
+20 2 ddddddddddddddddddddddddddddddddddddddddddd
+40 2 fffffffffffffffffffffffffffffffffffffffffff
+60 2 hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
+select * from t1;
+eta tipo c
+7 7 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+8 8 bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
+10 1 ccccccccccccccccccccccccccccccccccccccccccc
+20 2 ddddddddddddddddddddddddddddddddddddddddddd
+30 1 eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
+40 2 fffffffffffffffffffffffffffffffffffffffffff
+50 1 ggggggggggggggggggggggggggggggggggggggggggg
+60 2 hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
+70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
+80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
+90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
+ commit;
+commit;
+select * from t1;
+eta tipo c
+7 7 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+8 8 bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
+10 1 ccccccccccccccccccccccccccccccccccccccccccc
+20 2 ddddddddddddddddddddddddddddddddddddddddddd
+30 1 eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
+40 2 fffffffffffffffffffffffffffffffffffffffffff
+50 1 ggggggggggggggggggggggggggggggggggggggggggg
+60 2 hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
+70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
+80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
+90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
+select * from t1;
+eta tipo c
+7 7 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+8 8 bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
+10 1 ccccccccccccccccccccccccccccccccccccccccccc
+20 2 ddddddddddddddddddddddddddddddddddddddddddd
+30 1 eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
+40 2 fffffffffffffffffffffffffffffffffffffffffff
+50 1 ggggggggggggggggggggggggggggggggggggggggggg
+60 2 hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
+70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
+80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
+90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
+drop table t1;
+create table t1(eta int(11) not null, tipo int(11), c varchar(255)) type=innodb;
+Warnings:
+Warning 1287 'TYPE=storage_engine' is deprecated; use 'ENGINE=storage_engine' instead
+insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
+insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
+insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc");
+insert into t1 values (20,2,"ddddddddddddddddddddddddddddddddddddddddddd");
+insert into t1 values (30,1,"eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee");
+insert into t1 values (40,2,"fffffffffffffffffffffffffffffffffffffffffff");
+insert into t1 values (50,1,"ggggggggggggggggggggggggggggggggggggggggggg");
+insert into t1 values (60,2,"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh");
+insert into t1 values (70,1,"iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii");
+insert into t1 values (80,22,"jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj");
+insert into t1 values (90,11,"kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk");
+select get_lock("hello",10);
+get_lock("hello",10)
+1
+begin;
+ select * from t1 where tipo=2 FOR UPDATE;
+begin;
+select release_lock("hello");
+release_lock("hello")
+1
+update t1 set tipo=11+get_lock("hello",10)*0 where tipo=22;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+select * from t1;
+eta tipo c
+7 7 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+8 8 bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
+10 1 ccccccccccccccccccccccccccccccccccccccccccc
+20 2 ddddddddddddddddddddddddddddddddddddddddddd
+30 1 eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
+40 2 fffffffffffffffffffffffffffffffffffffffffff
+50 1 ggggggggggggggggggggggggggggggggggggggggggg
+60 2 hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
+70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
+80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
+90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
+eta tipo c
+20 2 ddddddddddddddddddddddddddddddddddddddddddd
+40 2 fffffffffffffffffffffffffffffffffffffffffff
+60 2 hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
+select * from t1;
+eta tipo c
+7 7 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+8 8 bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
+10 1 ccccccccccccccccccccccccccccccccccccccccccc
+20 2 ddddddddddddddddddddddddddddddddddddddddddd
+30 1 eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
+40 2 fffffffffffffffffffffffffffffffffffffffffff
+50 1 ggggggggggggggggggggggggggggggggggggggggggg
+60 2 hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
+70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
+80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
+90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
+ commit;
+commit;
+select * from t1;
+eta tipo c
+7 7 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+8 8 bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
+10 1 ccccccccccccccccccccccccccccccccccccccccccc
+20 2 ddddddddddddddddddddddddddddddddddddddddddd
+30 1 eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
+40 2 fffffffffffffffffffffffffffffffffffffffffff
+50 1 ggggggggggggggggggggggggggggggggggggggggggg
+60 2 hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
+70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
+80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
+90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
+select * from t1;
+eta tipo c
+7 7 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+8 8 bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
+10 1 ccccccccccccccccccccccccccccccccccccccccccc
+20 2 ddddddddddddddddddddddddddddddddddddddddddd
+30 1 eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
+40 2 fffffffffffffffffffffffffffffffffffffffffff
+50 1 ggggggggggggggggggggggggggggggggggggggggggg
+60 2 hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
+70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
+80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
+90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
+drop table t1;
+create table t1(eta int(11) not null, tipo int(11), c varchar(255)) type=innodb;
+Warnings:
+Warning 1287 'TYPE=storage_engine' is deprecated; use 'ENGINE=storage_engine' instead
+insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
+insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
+insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc");
+insert into t1 values (20,2,"ddddddddddddddddddddddddddddddddddddddddddd");
+insert into t1 values (30,1,"eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee");
+insert into t1 values (40,2,"fffffffffffffffffffffffffffffffffffffffffff");
+insert into t1 values (50,1,"ggggggggggggggggggggggggggggggggggggggggggg");
+insert into t1 values (60,2,"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh");
+insert into t1 values (70,1,"iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii");
+insert into t1 values (80,22,"jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj");
+insert into t1 values (90,11,"kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk");
+select get_lock("hello",10);
+get_lock("hello",10)
+1
+begin;
+ select * from t1 where tipo=2 FOR UPDATE;
+begin;
+select release_lock("hello");
+release_lock("hello")
+1
+select * from t1 where tipo=1 FOR UPDATE;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+eta tipo c
+20 2 ddddddddddddddddddddddddddddddddddddddddddd
+40 2 fffffffffffffffffffffffffffffffffffffffffff
+60 2 hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
+select * from t1;
+eta tipo c
+7 7 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+8 8 bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
+10 1 ccccccccccccccccccccccccccccccccccccccccccc
+20 2 ddddddddddddddddddddddddddddddddddddddddddd
+30 1 eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
+40 2 fffffffffffffffffffffffffffffffffffffffffff
+50 1 ggggggggggggggggggggggggggggggggggggggggggg
+60 2 hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
+70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
+80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
+90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
+ commit;
+commit;
+select * from t1;
+eta tipo c
+7 7 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+8 8 bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
+10 1 ccccccccccccccccccccccccccccccccccccccccccc
+20 2 ddddddddddddddddddddddddddddddddddddddddddd
+30 1 eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
+40 2 fffffffffffffffffffffffffffffffffffffffffff
+50 1 ggggggggggggggggggggggggggggggggggggggggggg
+60 2 hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
+70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
+80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
+90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
+select * from t1;
+eta tipo c
+7 7 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+8 8 bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
+10 1 ccccccccccccccccccccccccccccccccccccccccccc
+20 2 ddddddddddddddddddddddddddddddddddddddddddd
+30 1 eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
+40 2 fffffffffffffffffffffffffffffffffffffffffff
+50 1 ggggggggggggggggggggggggggggggggggggggggggg
+60 2 hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
+70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
+80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
+90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
+drop table t1;
+create table t1(eta int(11) not null, tipo int(11), c varchar(255)) type=innodb;
+Warnings:
+Warning 1287 'TYPE=storage_engine' is deprecated; use 'ENGINE=storage_engine' instead
+insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
+insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
+insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc");
+insert into t1 values (20,2,"ddddddddddddddddddddddddddddddddddddddddddd");
+insert into t1 values (30,1,"eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee");
+insert into t1 values (40,2,"fffffffffffffffffffffffffffffffffffffffffff");
+insert into t1 values (50,1,"ggggggggggggggggggggggggggggggggggggggggggg");
+insert into t1 values (60,2,"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh");
+insert into t1 values (70,1,"iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii");
+insert into t1 values (80,22,"jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj");
+insert into t1 values (90,11,"kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk");
+select get_lock("hello",10);
+get_lock("hello",10)
+1
+begin;
+ delete from t1 where tipo=2;
+begin;
+select release_lock("hello");
+release_lock("hello")
+1
+update t1 set tipo=1+get_lock("hello",10)*0 where tipo=2;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+select * from t1;
+eta tipo c
+7 7 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+8 8 bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
+10 1 ccccccccccccccccccccccccccccccccccccccccccc
+20 2 ddddddddddddddddddddddddddddddddddddddddddd
+30 1 eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
+40 2 fffffffffffffffffffffffffffffffffffffffffff
+50 1 ggggggggggggggggggggggggggggggggggggggggggg
+60 2 hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
+70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
+80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
+90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
+select * from t1;
+eta tipo c
+7 7 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+8 8 bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
+10 1 ccccccccccccccccccccccccccccccccccccccccccc
+30 1 eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
+50 1 ggggggggggggggggggggggggggggggggggggggggggg
+70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
+80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
+90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
+ commit;
+commit;
+select * from t1;
+eta tipo c
+7 7 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+8 8 bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
+10 1 ccccccccccccccccccccccccccccccccccccccccccc
+30 1 eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
+50 1 ggggggggggggggggggggggggggggggggggggggggggg
+70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
+80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
+90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
+select * from t1;
+eta tipo c
+7 7 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+8 8 bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
+10 1 ccccccccccccccccccccccccccccccccccccccccccc
+30 1 eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
+50 1 ggggggggggggggggggggggggggggggggggggggggggg
+70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
+80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
+90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
+drop table t1;
+create table t1(eta int(11) not null, tipo int(11), c varchar(255)) type=innodb;
+Warnings:
+Warning 1287 'TYPE=storage_engine' is deprecated; use 'ENGINE=storage_engine' instead
+insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
+insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
+insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc");
+insert into t1 values (20,2,"ddddddddddddddddddddddddddddddddddddddddddd");
+insert into t1 values (30,1,"eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee");
+insert into t1 values (40,2,"fffffffffffffffffffffffffffffffffffffffffff");
+insert into t1 values (50,1,"ggggggggggggggggggggggggggggggggggggggggggg");
+insert into t1 values (60,2,"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh");
+insert into t1 values (70,1,"iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii");
+insert into t1 values (80,22,"jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj");
+insert into t1 values (90,11,"kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk");
+select get_lock("hello",10);
+get_lock("hello",10)
+1
+begin;
+ delete from t1 where tipo=2;
+begin;
+select release_lock("hello");
+release_lock("hello")
+1
+update t1 set tipo=1+get_lock("hello",10)*0 where tipo=22;
+select * from t1;
+eta tipo c
+7 7 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+8 8 bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
+10 1 ccccccccccccccccccccccccccccccccccccccccccc
+20 2 ddddddddddddddddddddddddddddddddddddddddddd
+30 1 eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
+40 2 fffffffffffffffffffffffffffffffffffffffffff
+50 1 ggggggggggggggggggggggggggggggggggggggggggg
+60 2 hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
+70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
+80 1 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
+90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
+select * from t1;
+eta tipo c
+7 7 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+8 8 bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
+10 1 ccccccccccccccccccccccccccccccccccccccccccc
+30 1 eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
+50 1 ggggggggggggggggggggggggggggggggggggggggggg
+70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
+80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
+90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
+ commit;
+commit;
+select * from t1;
+eta tipo c
+7 7 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+8 8 bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
+10 1 ccccccccccccccccccccccccccccccccccccccccccc
+30 1 eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
+50 1 ggggggggggggggggggggggggggggggggggggggggggg
+70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
+80 1 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
+90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
+select * from t1;
+eta tipo c
+7 7 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+8 8 bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
+10 1 ccccccccccccccccccccccccccccccccccccccccccc
+30 1 eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
+50 1 ggggggggggggggggggggggggggggggggggggggggggg
+70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
+80 1 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
+90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
+drop table t1;
diff --git a/mysql-test/r/mix_innodb_myisam_binlog.result b/mysql-test/r/mix_innodb_myisam_binlog.result
deleted file mode 100644
index c84bd65e748..00000000000
--- a/mysql-test/r/mix_innodb_myisam_binlog.result
+++ /dev/null
@@ -1,258 +0,0 @@
-drop table if exists t1, t2;
-create table t1 (a int) engine=innodb;
-create table t2 (a int) engine=myisam;
-reset master;
-begin;
-insert into t1 values(1);
-insert into t2 select * from t1;
-commit;
-show binlog events from 98;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 98 Query 1 # use `test`; BEGIN
-master-bin.000001 166 Query 1 # use `test`; insert into t1 values(1)
-master-bin.000001 253 Query 1 # use `test`; insert into t2 select * from t1
-master-bin.000001 347 Xid 1 # COMMIT /* xid=8 */
-delete from t1;
-delete from t2;
-reset master;
-begin;
-insert into t1 values(2);
-insert into t2 select * from t1;
-rollback;
-Warnings:
-Warning 1196 Some non-transactional changed tables couldn't be rolled back
-show binlog events from 98;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 98 Query 1 # use `test`; BEGIN
-master-bin.000001 166 Query 1 # use `test`; insert into t1 values(2)
-master-bin.000001 253 Query 1 # use `test`; insert into t2 select * from t1
-master-bin.000001 347 Query 1 # use `test`; ROLLBACK
-delete from t1;
-delete from t2;
-reset master;
-begin;
-insert into t1 values(3);
-savepoint my_savepoint;
-insert into t1 values(4);
-insert into t2 select * from t1;
-rollback to savepoint my_savepoint;
-Warnings:
-Warning 1196 Some non-transactional changed tables couldn't be rolled back
-commit;
-show binlog events from 98;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 98 Query 1 # use `test`; BEGIN
-master-bin.000001 166 Query 1 # use `test`; insert into t1 values(3)
-master-bin.000001 253 Query 1 # use `test`; savepoint my_savepoint
-master-bin.000001 338 Query 1 # use `test`; insert into t1 values(4)
-master-bin.000001 425 Query 1 # use `test`; insert into t2 select * from t1
-master-bin.000001 519 Query 1 # use `test`; rollback to savepoint my_savepoint
-master-bin.000001 616 Xid 1 # COMMIT /* xid=25 */
-delete from t1;
-delete from t2;
-reset master;
-begin;
-insert into t1 values(5);
-savepoint my_savepoint;
-insert into t1 values(6);
-insert into t2 select * from t1;
-rollback to savepoint my_savepoint;
-Warnings:
-Warning 1196 Some non-transactional changed tables couldn't be rolled back
-insert into t1 values(7);
-commit;
-select a from t1 order by a;
-a
-5
-7
-show binlog events from 98;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 98 Query 1 # use `test`; BEGIN
-master-bin.000001 166 Query 1 # use `test`; insert into t1 values(5)
-master-bin.000001 253 Query 1 # use `test`; savepoint my_savepoint
-master-bin.000001 338 Query 1 # use `test`; insert into t1 values(6)
-master-bin.000001 425 Query 1 # use `test`; insert into t2 select * from t1
-master-bin.000001 519 Query 1 # use `test`; rollback to savepoint my_savepoint
-master-bin.000001 616 Query 1 # use `test`; insert into t1 values(7)
-master-bin.000001 703 Xid 1 # COMMIT /* xid=37 */
-delete from t1;
-delete from t2;
-reset master;
-select get_lock("a",10);
-get_lock("a",10)
-1
-begin;
-insert into t1 values(8);
-insert into t2 select * from t1;
-select get_lock("a",10);
-get_lock("a",10)
-1
-show binlog events from 98;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 98 Query 1 # use `test`; BEGIN
-master-bin.000001 166 Query 1 # use `test`; insert into t1 values(8)
-master-bin.000001 253 Query 1 # use `test`; insert into t2 select * from t1
-master-bin.000001 347 Query 1 # use `test`; ROLLBACK
-delete from t1;
-delete from t2;
-reset master;
-insert into t1 values(9);
-insert into t2 select * from t1;
-show binlog events from 98;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 98 Query 1 # use `test`; insert into t1 values(9)
-master-bin.000001 185 Xid 1 # COMMIT /* xid=60 */
-master-bin.000001 212 Query 1 # use `test`; insert into t2 select * from t1
-delete from t1;
-delete from t2;
-reset master;
-insert into t1 values(10);
-begin;
-insert into t2 select * from t1;
-show binlog events from 98;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 98 Query 1 # use `test`; insert into t1 values(10)
-master-bin.000001 186 Xid 1 # COMMIT /* xid=66 */
-master-bin.000001 213 Query 1 # use `test`; insert into t2 select * from t1
-insert into t1 values(11);
-commit;
-show binlog events from 98;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 98 Query 1 # use `test`; insert into t1 values(10)
-master-bin.000001 186 Xid 1 # COMMIT /* xid=66 */
-master-bin.000001 213 Query 1 # use `test`; insert into t2 select * from t1
-master-bin.000001 307 Query 1 # use `test`; BEGIN
-master-bin.000001 375 Query 1 # use `test`; insert into t1 values(11)
-master-bin.000001 463 Xid 1 # COMMIT /* xid=68 */
-alter table t2 engine=INNODB;
-delete from t1;
-delete from t2;
-reset master;
-begin;
-insert into t1 values(12);
-insert into t2 select * from t1;
-commit;
-show binlog events from 98;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 98 Query 1 # use `test`; BEGIN
-master-bin.000001 166 Query 1 # use `test`; insert into t1 values(12)
-master-bin.000001 254 Query 1 # use `test`; insert into t2 select * from t1
-master-bin.000001 348 Xid 1 # COMMIT /* xid=78 */
-delete from t1;
-delete from t2;
-reset master;
-begin;
-insert into t1 values(13);
-insert into t2 select * from t1;
-rollback;
-show binlog events from 98;
-Log_name Pos Event_type Server_id End_log_pos Info
-delete from t1;
-delete from t2;
-reset master;
-begin;
-insert into t1 values(14);
-savepoint my_savepoint;
-insert into t1 values(15);
-insert into t2 select * from t1;
-rollback to savepoint my_savepoint;
-commit;
-show binlog events from 98;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 98 Query 1 # use `test`; BEGIN
-master-bin.000001 166 Query 1 # use `test`; insert into t1 values(14)
-master-bin.000001 254 Xid 1 # COMMIT /* xid=94 */
-delete from t1;
-delete from t2;
-reset master;
-begin;
-insert into t1 values(16);
-savepoint my_savepoint;
-insert into t1 values(17);
-insert into t2 select * from t1;
-rollback to savepoint my_savepoint;
-insert into t1 values(18);
-commit;
-select a from t1 order by a;
-a
-16
-18
-show binlog events from 98;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 98 Query 1 # use `test`; BEGIN
-master-bin.000001 166 Query 1 # use `test`; insert into t1 values(16)
-master-bin.000001 254 Query 1 # use `test`; insert into t1 values(18)
-master-bin.000001 342 Xid 1 # COMMIT /* xid=105 */
-delete from t1;
-delete from t2;
-alter table t2 type=MyISAM;
-insert into t1 values (1);
-begin;
-select * from t1 for update;
-a
-1
-select (@before:=unix_timestamp())*0;
-(@before:=unix_timestamp())*0
-0
-begin;
- select * from t1 for update;
-insert into t2 values (20);
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-select (@after:=unix_timestamp())*0;
-(@after:=unix_timestamp())*0
-0
-select (@after-@before) >= 2;
-(@after-@before) >= 2
-1
-drop table t1,t2;
-commit;
-begin;
-create temporary table ti (a int) engine=innodb;
-rollback;
-Warnings:
-Warning 1196 Some non-transactional changed tables couldn't be rolled back
-insert into ti values(1);
-set autocommit=0;
-create temporary table t1 (a int) engine=myisam;
-commit;
-insert t1 values (1);
-rollback;
-Warnings:
-Warning 1196 Some non-transactional changed tables couldn't be rolled back
-create table t0 (n int);
-insert t0 select * from t1;
-set autocommit=1;
-insert into t0 select GET_LOCK("lock1",null);
-set autocommit=0;
-create table t2 (n int) engine=innodb;
-insert into t2 values (3);
-select get_lock("lock1",60);
-get_lock("lock1",60)
-1
-show binlog events from 98;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 98 Query 1 # use `test`; BEGIN
-master-bin.000001 166 Query 1 # use `test`; insert into t1 values(16)
-master-bin.000001 254 Query 1 # use `test`; insert into t1 values(18)
-master-bin.000001 342 Xid 1 # COMMIT /* xid=105 */
-master-bin.000001 369 Query 1 # use `test`; delete from t1
-master-bin.000001 446 Xid 1 # COMMIT /* xid=114 */
-master-bin.000001 473 Query 1 # use `test`; delete from t2
-master-bin.000001 550 Xid 1 # COMMIT /* xid=115 */
-master-bin.000001 577 Query 1 # use `test`; alter table t2 type=MyISAM
-master-bin.000001 666 Query 1 # use `test`; insert into t1 values (1)
-master-bin.000001 754 Xid 1 # COMMIT /* xid=117 */
-master-bin.000001 781 Query 1 # use `test`; insert into t2 values (20)
-master-bin.000001 870 Query 1 # use `test`; drop table t1,t2
-master-bin.000001 949 Query 1 # use `test`; create temporary table ti (a int) engine=innodb
-master-bin.000001 1059 Query 1 # use `test`; insert into ti values(1)
-master-bin.000001 1146 Xid 1 # COMMIT /* xid=132 */
-master-bin.000001 1173 Query 1 # use `test`; create temporary table t1 (a int) engine=myisam
-master-bin.000001 1283 Query 1 # use `test`; insert t1 values (1)
-master-bin.000001 1366 Query 1 # use `test`; create table t0 (n int)
-master-bin.000001 1452 Query 1 # use `test`; insert t0 select * from t1
-master-bin.000001 1541 Query 1 # use `test`; insert into t0 select GET_LOCK("lock1",null)
-master-bin.000001 1648 Query 1 # use `test`; create table t2 (n int) engine=innodb
-master-bin.000001 1748 Query 1 # use `test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `test`.`t1`,`test`.`ti`
-do release_lock("lock1");
-drop table t0,t2;
diff --git a/mysql-test/r/mysqlbinlog_base64.result b/mysql-test/r/mysqlbinlog_base64.result
new file mode 100644
index 00000000000..499587cb465
--- /dev/null
+++ b/mysql-test/r/mysqlbinlog_base64.result
@@ -0,0 +1,89 @@
+create table t1 (a int);
+insert into t1 values (1);
+insert into t1 values (2);
+insert into t1 values (3);
+update t1 set a=a+2 where a=2;
+update t1 set a=a+2 where a=3;
+create table t2 (word varchar(20));
+load data infile '../../std_data/words.dat' into table t2;
+drop table t1;
+drop table t2;
+select * from t1;
+a
+1
+4
+5
+select * from t2;
+word
+Aarhus
+Aaron
+Ababa
+aback
+abaft
+abandon
+abandoned
+abandoning
+abandonment
+abandons
+Aarhus
+Aaron
+Ababa
+aback
+abaft
+abandon
+abandoned
+abandoning
+abandonment
+abandons
+abase
+abased
+abasement
+abasements
+abases
+abash
+abashed
+abashes
+abashing
+abasing
+abate
+abated
+abatement
+abatements
+abater
+abates
+abating
+Abba
+abbe
+abbey
+abbeys
+abbot
+abbots
+Abbott
+abbreviate
+abbreviated
+abbreviates
+abbreviating
+abbreviation
+abbreviations
+Abby
+abdomen
+abdomens
+abdominal
+abduct
+abducted
+abduction
+abductions
+abductor
+abductors
+abducts
+Abe
+abed
+Abel
+Abelian
+Abelson
+Aberdeen
+Abernathy
+aberrant
+aberration
+drop table t1;
+drop table t2;
diff --git a/mysql-test/r/not_row_based.require b/mysql-test/r/not_row_based.require
new file mode 100644
index 00000000000..e30e73320fb
--- /dev/null
+++ b/mysql-test/r/not_row_based.require
@@ -0,0 +1,2 @@
+Variable_name Value
+have_row_based_replication NO
diff --git a/mysql-test/r/rpl000017.result b/mysql-test/r/rpl000017.result
index 64e13042e9c..245848a07e4 100644
--- a/mysql-test/r/rpl000017.result
+++ b/mysql-test/r/rpl000017.result
@@ -1,4 +1,10 @@
+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;
+stop slave;
grant replication slave on *.* to replicate@localhost identified by 'aaaaaaaaaaaaaaab';
grant replication slave on *.* to replicate@127.0.0.1 identified by 'aaaaaaaaaaaaaaab';
start slave;
diff --git a/mysql-test/r/rpl000012.result b/mysql-test/r/rpl_000012.result
index 17fb53010ab..e4ca31d8908 100644
--- a/mysql-test/r/rpl000012.result
+++ b/mysql-test/r/rpl_000012.result
@@ -4,31 +4,42 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
-create table t2 (n int);
+create table t2 (n int, PRIMARY KEY(n));
create temporary table t1 (n int);
-insert into t1 values(1),(2),(3);
-insert into t2 select * from t1;
create temporary table t3 (n int not null);
+insert into t1 values(1),(2),(3),(100),(25),(26),(200),(300);
+insert into t2 select * from t1;
alter table t3 add primary key(n);
flush logs;
-insert into t3 values (100);
+insert into t3 values (1010);
insert into t2 select * from t3;
drop table if exists t3;
-insert into t2 values (101);
+insert into t2 values (1012);
create temporary table t1 (n int);
insert into t1 values (4),(5);
insert into t2 select * from t1;
-insert into t2 values(6);
+insert into t2 values(61);
select * from t2;
n
1
2
3
-100
-101
4
5
-6
+25
+26
+61
+100
+200
+300
+1010
+1012
+select count(*) from t2;
+count(*)
+13
+select sum(n) from t2;
+sum(n)
+2749
show status like 'Slave_open_temp_tables';
Variable_name Value
Slave_open_temp_tables 0
diff --git a/mysql-test/r/rpl000015.result b/mysql-test/r/rpl_000015.result
index e33201ced93..d965df347ab 100644
--- a/mysql-test/r/rpl000015.result
+++ b/mysql-test/r/rpl_000015.result
@@ -1,7 +1,7 @@
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
-master-bin.000001 98
+master-bin.000001 102
reset slave;
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
@@ -17,13 +17,18 @@ Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File
start slave;
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
-# 127.0.0.1 root MASTER_PORT 7 master-bin.000001 98 # # master-bin.000001 Yes Yes 0 0 98 # None 0 No #
+# 127.0.0.1 root MASTER_PORT 7 master-bin.000001 102 # # master-bin.000001 Yes Yes 0 0 102 # None 0 No #
drop table if exists t1;
-create table t1 (n int);
+create table t1 (n int, PRIMARY KEY(n));
insert into t1 values (10),(45),(90);
select * from t1;
n
10
45
90
+select * from t1;
+n
+10
+45
+90
drop table t1;
diff --git a/mysql-test/r/rpl_LD_INFILE.result b/mysql-test/r/rpl_LD_INFILE.result
new file mode 100644
index 00000000000..a2e4ef7b83b
--- /dev/null
+++ b/mysql-test/r/rpl_LD_INFILE.result
@@ -0,0 +1,121 @@
+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;
+DROP PROCEDURE IF EXISTS test.p1;
+DROP TABLE IF EXISTS test.t1;
+CREATE TABLE test.t1 (a VARCHAR(255), PRIMARY KEY(a));
+LOAD DATA INFILE '../../std_data/words2.dat' INTO TABLE test.t1;
+DELETE FROM test.t1 WHERE a = 'abashed';
+DELETE FROM test.t1;
+LOAD DATA INFILE '../../std_data/words2.dat' INTO TABLE test.t1;
+SELECT * FROM test.t1;
+a
+abase
+abased
+abasement
+abasements
+abases
+abash
+abashed
+abashes
+abashing
+abasing
+abate
+abated
+abatement
+abatements
+abater
+abates
+abating
+Abba
+abbe
+abbey
+abbeys
+abbot
+abbots
+Abbott
+abbreviate
+abbreviated
+abbreviates
+abbreviating
+abbreviation
+abbreviations
+Abby
+abdomen
+abdomens
+abdominal
+abduct
+abducted
+abduction
+abductions
+abductor
+abductors
+abducts
+Abe
+abed
+Abel
+Abelian
+Abelson
+Aberdeen
+Abernathy
+aberrant
+aberration
+SELECT * FROM test.t1;
+a
+abase
+abased
+abasement
+abasements
+abases
+abash
+abashed
+abashes
+abashing
+abasing
+abate
+abated
+abatement
+abatements
+abater
+abates
+abating
+Abba
+abbe
+abbey
+abbeys
+abbot
+abbots
+Abbott
+abbreviate
+abbreviated
+abbreviates
+abbreviating
+abbreviation
+abbreviations
+Abby
+abdomen
+abdomens
+abdominal
+abduct
+abducted
+abduction
+abductions
+abductor
+abductors
+abducts
+Abe
+abed
+Abel
+Abelian
+Abelson
+Aberdeen
+Abernathy
+aberrant
+aberration
+DROP PROCEDURE IF EXISTS test.p1;
+Warnings:
+Note 1305 PROCEDURE p1 does not exist
+DROP TABLE test.t1;
diff --git a/mysql-test/r/rpl_bit.result b/mysql-test/r/rpl_bit.result
new file mode 100644
index 00000000000..a1b57f1c183
--- /dev/null
+++ b/mysql-test/r/rpl_bit.result
@@ -0,0 +1,138 @@
+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;
+DROP TABLE IF EXISTS test.t1;
+CREATE TABLE test.t1 (
+dummyKey INTEGER NOT NULL,
+f01 TINYINT,
+f10 TINYINT,
+f12 TINYINT,
+f15 TINYINT,
+f16 TINYINT,
+f7 TINYINT,
+f9 TINYINT,
+f29 TINYINT,
+f0 TINYINT,
+fA1 TINYINT,
+C32 TINYINT,
+A42 TINYINT,
+CA3 TINYINT,
+A044 TINYINT,
+f001 TINYINT,
+A3002 TINYINT,
+fC003 TINYINT,
+CA300 TINYINT,
+A305 TINYINT,
+CA321 TINYINT,
+r001 TINYINT,
+bit1 BIT(6),
+bit2 BIT(6),
+bit3 BIT(6),
+State1 TINYINT,
+State2 TINYINT,
+State3 TINYINT,
+State4 TINYINT,
+SubState TINYINT,
+gState TINYINT,
+oSupp TINYINT,
+tSupp TINYINT,
+sSuppD TINYINT,
+mSuppf TINYINT,
+GSuppDf TINYINT,
+VNotSupp TINYINT,
+x034 TINYINT,
+PRIMARY KEY USING HASH (dummyKey) );
+LOCK TABLES test.t1 WRITE;
+INSERT INTO test.t1 VALUES (6,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'111111',b'111110',b'110101',4,5,5,5,5,5,5,5,5,5,3,2,1);
+INSERT INTO test.t1 VALUES (1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'111111',b'000000',b'100100',4,5,5,5,5,5,5,5,5,5,3,2,1);
+INSERT INTO test.t1 VALUES (2,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'000000',b'101010',b'010101',4,5,5,5,5,5,5,5,5,5,3,2,1);
+INSERT INTO test.t1 VALUES (3,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'101010',b'111111',b'000000',4,5,5,5,5,5,5,5,5,5,3,2,1);
+INSERT INTO test.t1 VALUES (4,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,4,5,5,5,5,5,5,5,5,5,3,2,1);
+INSERT INTO test.t1 VALUES (5,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,4,5,5,5,5,5,5,5,5,5,3,2,1);
+INSERT INTO test.t1 VALUES (7,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,4,5,5,5,5,5,5,5,5,5,3,2,1);
+INSERT INTO test.t1 VALUES (8,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,4,5,5,5,5,5,5,5,5,5,3,2,1);
+UNLOCK TABLES;
+SELECT oSupp, sSuppD, GSuppDf, VNotSupp, x034 FROM test.t1;
+oSupp sSuppD GSuppDf VNotSupp x034
+5 5 3 2 1
+5 5 3 2 1
+5 5 3 2 1
+5 5 3 2 1
+5 5 3 2 1
+5 5 3 2 1
+5 5 3 2 1
+5 5 3 2 1
+SELECT hex(bit1) from test.t1;
+hex(bit1)
+3F
+3F
+0
+2A
+0
+0
+0
+0
+SELECT hex(bit2) from test.t1;
+hex(bit2)
+3E
+0
+2A
+3F
+1
+1
+1
+1
+SELECT hex(bit3) from test.t1;
+hex(bit3)
+35
+24
+15
+0
+1
+1
+1
+1
+SELECT oSupp, sSuppD, GSuppDf, VNotSupp, x034 FROM test.t1;
+oSupp sSuppD GSuppDf VNotSupp x034
+5 5 3 2 1
+5 5 3 2 1
+5 5 3 2 1
+5 5 3 2 1
+5 5 3 2 1
+5 5 3 2 1
+5 5 3 2 1
+5 5 3 2 1
+SELECT hex(bit1) from test.t1;
+hex(bit1)
+3F
+3F
+0
+2A
+0
+0
+0
+0
+SELECT hex(bit2) from test.t1;
+hex(bit2)
+3E
+0
+2A
+3F
+1
+1
+1
+1
+SELECT hex(bit3) from test.t1;
+hex(bit3)
+35
+24
+15
+0
+1
+1
+1
+1
+DROP TABLE IF EXISTS test.t1;
diff --git a/mysql-test/r/rpl_bit_npk.result b/mysql-test/r/rpl_bit_npk.result
new file mode 100644
index 00000000000..aeefc77d69b
--- /dev/null
+++ b/mysql-test/r/rpl_bit_npk.result
@@ -0,0 +1,137 @@
+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;
+DROP TABLE IF EXISTS test.t1;
+CREATE TABLE test.t1 (
+dummyKey INTEGER NOT NULL,
+f01 TINYINT,
+f10 TINYINT,
+f12 TINYINT,
+f15 TINYINT,
+f16 TINYINT,
+f7 TINYINT,
+f9 TINYINT,
+f29 TINYINT,
+f0 TINYINT,
+fA1 TINYINT,
+C32 TINYINT,
+A42 TINYINT,
+CA3 TINYINT,
+A044 TINYINT,
+f001 TINYINT,
+A3002 TINYINT,
+fC003 TINYINT,
+CA300 TINYINT,
+A305 TINYINT,
+CA321 TINYINT,
+r001 TINYINT,
+bit1 BIT(6),
+bit2 BIT(6),
+bit3 BIT(6),
+State1 TINYINT,
+State2 TINYINT,
+State3 TINYINT,
+State4 TINYINT,
+SubState TINYINT,
+gState TINYINT,
+oSupp TINYINT,
+tSupp TINYINT,
+sSuppD TINYINT,
+mSuppf TINYINT,
+GSuppDf TINYINT,
+VNotSupp TINYINT,
+x034 TINYINT);
+LOCK TABLES test.t1 WRITE;
+INSERT INTO test.t1 VALUES (6,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'111111',b'111110',b'110101',4,5,5,5,5,5,5,5,5,5,3,2,1);
+INSERT INTO test.t1 VALUES (1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'111111',b'000000',b'100100',4,5,5,5,5,5,5,5,5,5,3,2,1);
+INSERT INTO test.t1 VALUES (2,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'000000',b'101010',b'010101',4,5,5,5,5,5,5,5,5,5,3,2,1);
+INSERT INTO test.t1 VALUES (3,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'101010',b'111111',b'000000',4,5,5,5,5,5,5,5,5,5,3,2,1);
+INSERT INTO test.t1 VALUES (4,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,4,5,5,5,5,5,5,5,5,5,3,2,1);
+INSERT INTO test.t1 VALUES (5,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,4,5,5,5,5,5,5,5,5,5,3,2,1);
+INSERT INTO test.t1 VALUES (7,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,4,5,5,5,5,5,5,5,5,5,3,2,1);
+INSERT INTO test.t1 VALUES (8,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,4,5,5,5,5,5,5,5,5,5,3,2,1);
+UNLOCK TABLES;
+SELECT oSupp, sSuppD, GSuppDf, VNotSupp, x034 FROM test.t1;
+oSupp sSuppD GSuppDf VNotSupp x034
+5 5 3 2 1
+5 5 3 2 1
+5 5 3 2 1
+5 5 3 2 1
+5 5 3 2 1
+5 5 3 2 1
+5 5 3 2 1
+5 5 3 2 1
+SELECT hex(bit1) from test.t1;
+hex(bit1)
+3F
+3F
+0
+2A
+0
+0
+0
+0
+SELECT hex(bit2) from test.t1;
+hex(bit2)
+3E
+0
+2A
+3F
+1
+1
+1
+1
+SELECT hex(bit3) from test.t1;
+hex(bit3)
+35
+24
+15
+0
+1
+1
+1
+1
+SELECT oSupp, sSuppD, GSuppDf, VNotSupp, x034 FROM test.t1;
+oSupp sSuppD GSuppDf VNotSupp x034
+5 5 3 2 1
+5 5 3 2 1
+5 5 3 2 1
+5 5 3 2 1
+5 5 3 2 1
+5 5 3 2 1
+5 5 3 2 1
+5 5 3 2 1
+SELECT hex(bit1) from test.t1;
+hex(bit1)
+3F
+3F
+0
+2A
+0
+0
+0
+0
+SELECT hex(bit2) from test.t1;
+hex(bit2)
+3E
+0
+2A
+3F
+1
+1
+1
+1
+SELECT hex(bit3) from test.t1;
+hex(bit3)
+35
+24
+15
+0
+1
+1
+1
+1
+DROP TABLE IF EXISTS test.t1;
diff --git a/mysql-test/r/rpl_change_master.result b/mysql-test/r/rpl_change_master.result
index 7f2ba568fb3..513de9494ba 100644
--- a/mysql-test/r/rpl_change_master.result
+++ b/mysql-test/r/rpl_change_master.result
@@ -13,11 +13,11 @@ insert into t1 values(2);
stop slave;
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
-# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 357 # # master-bin.000001 No No 0 0 183 # None 0 No #
+# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 # # # master-bin.000001 No No 0 0 187 # None 0 No #
change master to master_user='root';
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
-# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 183 # # master-bin.000001 No No 0 0 183 # None 0 No #
+# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 # # # master-bin.000001 No No 0 0 187 # None 0 No #
start slave;
select * from t1;
n
diff --git a/mysql-test/r/rpl_commit_after_flush.result b/mysql-test/r/rpl_commit_after_flush.result
index d3aba779219..eaddda63b6a 100644
--- a/mysql-test/r/rpl_commit_after_flush.result
+++ b/mysql-test/r/rpl_commit_after_flush.result
@@ -4,7 +4,7 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
-create table t1 (a int) engine=innodb;
+CREATE TABLE t1 (a INT) ENGINE=innodb;
begin;
insert into t1 values(1);
flush tables with read lock;
diff --git a/mysql-test/r/rpl_create_database.result b/mysql-test/r/rpl_create_database.result
index ca4585d0d8d..82ab8c6f434 100644
--- a/mysql-test/r/rpl_create_database.result
+++ b/mysql-test/r/rpl_create_database.result
@@ -42,21 +42,6 @@ INSERT INTO t1 VALUES (1);
CREATE DATABASE mysqltest_sisyfos;
USE mysqltest_sisyfos;
CREATE TABLE t2 (a INT);
-SHOW BINLOG EVENTS;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4
-master-bin.000001 # Query 1 # DROP DATABASE IF EXISTS mysqltest_prometheus
-master-bin.000001 # Query 1 # DROP DATABASE IF EXISTS mysqltest_sisyfos
-master-bin.000001 # Query 1 # CREATE DATABASE mysqltest_prometheus
-master-bin.000001 # Query 1 # CREATE DATABASE mysqltest_sisyfos
-master-bin.000001 # Query 1 # use `mysqltest_sisyfos`; CREATE TABLE t1 (b int)
-master-bin.000001 # Query 1 # use `mysqltest_sisyfos`; INSERT INTO t1 VALUES(1)
-master-bin.000001 # Query 1 # ALTER DATABASE mysqltest_sisyfos CHARACTER SET latin1
-master-bin.000001 # Query 1 # DROP DATABASE IF EXISTS mysqltest_sisyfos
-master-bin.000001 # Query 1 # use `mysqltest_prometheus`; CREATE TABLE t1 (a INT)
-master-bin.000001 # Query 1 # use `mysqltest_prometheus`; INSERT INTO t1 VALUES (1)
-master-bin.000001 # Query 1 # CREATE DATABASE mysqltest_sisyfos
-master-bin.000001 # Query 1 # use `mysqltest_sisyfos`; CREATE TABLE t2 (a INT)
SHOW DATABASES;
Database
information_schema
diff --git a/mysql-test/r/rpl_deadlock.result b/mysql-test/r/rpl_deadlock_innodb.result
index c25cb1e6a53..7d592c2d0cd 100644
--- a/mysql-test/r/rpl_deadlock.result
+++ b/mysql-test/r/rpl_deadlock_innodb.result
@@ -4,10 +4,10 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
-create table t1 (a int not null, key(a)) engine=innodb;
-create table t2 (a int not null, key(a)) engine=innodb;
-create table t3 (a int) engine=innodb;
-create table t4 (a int) engine=innodb;
+CREATE TABLE t1 (a INT NOT NULL, KEY(a)) ENGINE=innodb;
+CREATE TABLE t2 (a INT NOT NULL, KEY(a)) ENGINE=innodb;
+CREATE TABLE t3 (a INT) ENGINE=innodb;
+CREATE TABLE t4 (a INT) ENGINE=innodb;
show variables like 'slave_transaction_retries';
Variable_name Value
slave_transaction_retries 10
@@ -45,9 +45,9 @@ a
22
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
-# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 18911 # # master-bin.000001 Yes Yes 0 0 18911 # None 0 No #
+# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 # # # master-bin.000001 Yes Yes # 0 0 # # None 0 No #
stop slave;
-change master to master_log_pos=532;
+change master to master_log_pos=536;
begin;
select * from t2 for update;
a
@@ -63,10 +63,10 @@ a
22
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
-# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 18911 # # master-bin.000001 Yes Yes 0 0 18911 # None 0 No #
+# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 # # # master-bin.000001 Yes Yes # 0 0 # # None 0 No #
set global max_relay_log_size=0;
stop slave;
-change master to master_log_pos=532;
+change master to master_log_pos=536;
begin;
select * from t2 for update;
a
@@ -83,5 +83,5 @@ a
22
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
-# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 18911 # # master-bin.000001 # Yes 0 0 18911 # None 0 No #
+# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 # # # master-bin.000001 # Yes # 0 0 # # None 0 No #
drop table t1,t2,t3,t4;
diff --git a/mysql-test/r/rpl_delete_no_where.result b/mysql-test/r/rpl_delete_no_where.result
new file mode 100644
index 00000000000..78edf4bf3fa
--- /dev/null
+++ b/mysql-test/r/rpl_delete_no_where.result
@@ -0,0 +1,15 @@
+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;
+create table t1 (a int, b int) engine=myisam;
+insert into t1 values(1,1);
+select * from t1;
+a b
+1 1
+delete from t1;
+select * from t1;
+a b
+drop table t1;
diff --git a/mysql-test/r/rpl_do_grant.result b/mysql-test/r/rpl_do_grant.result
index ff3e059503c..8bf8e615448 100644
--- a/mysql-test/r/rpl_do_grant.result
+++ b/mysql-test/r/rpl_do_grant.result
@@ -24,3 +24,55 @@ delete from mysql.user where user=_binary'rpl_do_grant';
delete from mysql.db where user=_binary'rpl_do_grant';
flush privileges;
flush privileges;
+show grants for rpl_do_grant@localhost;
+ERROR 42000: There is no such grant defined for user 'rpl_do_grant' on host 'localhost'
+show grants for rpl_do_grant@localhost;
+ERROR 42000: There is no such grant defined for user 'rpl_do_grant' on host 'localhost'
+create user rpl_do_grant@localhost;
+show grants for rpl_do_grant@localhost;
+Grants for rpl_do_grant@localhost
+GRANT USAGE ON *.* TO 'rpl_do_grant'@'localhost'
+show grants for rpl_do_grant2@localhost;
+ERROR 42000: There is no such grant defined for user 'rpl_do_grant2' on host 'localhost'
+show grants for rpl_do_grant@localhost;
+Grants for rpl_do_grant@localhost
+GRANT USAGE ON *.* TO 'rpl_do_grant'@'localhost'
+show grants for rpl_do_grant2@localhost;
+ERROR 42000: There is no such grant defined for user 'rpl_do_grant2' on host 'localhost'
+rename user rpl_do_grant@localhost to rpl_do_grant2@localhost;
+show grants for rpl_do_grant2@localhost;
+Grants for rpl_do_grant2@localhost
+GRANT USAGE ON *.* TO 'rpl_do_grant2'@'localhost'
+show grants for rpl_do_grant2@localhost;
+Grants for rpl_do_grant2@localhost
+GRANT USAGE ON *.* TO 'rpl_do_grant2'@'localhost'
+grant DELETE,INSERT on mysqltest1.* to rpl_do_grant2@localhost;
+show grants for rpl_do_grant2@localhost;
+Grants for rpl_do_grant2@localhost
+GRANT USAGE ON *.* TO 'rpl_do_grant2'@'localhost'
+GRANT INSERT, DELETE ON `mysqltest1`.* TO 'rpl_do_grant2'@'localhost'
+show grants for rpl_do_grant2@localhost;
+Grants for rpl_do_grant2@localhost
+GRANT USAGE ON *.* TO 'rpl_do_grant2'@'localhost'
+GRANT INSERT, DELETE ON `mysqltest1`.* TO 'rpl_do_grant2'@'localhost'
+revoke DELETE on mysqltest1.* from rpl_do_grant2@localhost;
+show grants for rpl_do_grant2@localhost;
+Grants for rpl_do_grant2@localhost
+GRANT USAGE ON *.* TO 'rpl_do_grant2'@'localhost'
+GRANT INSERT ON `mysqltest1`.* TO 'rpl_do_grant2'@'localhost'
+show grants for rpl_do_grant2@localhost;
+Grants for rpl_do_grant2@localhost
+GRANT USAGE ON *.* TO 'rpl_do_grant2'@'localhost'
+GRANT INSERT ON `mysqltest1`.* TO 'rpl_do_grant2'@'localhost'
+revoke all privileges, grant option from rpl_do_grant2@localhost;
+show grants for rpl_do_grant2@localhost;
+Grants for rpl_do_grant2@localhost
+GRANT USAGE ON *.* TO 'rpl_do_grant2'@'localhost'
+show grants for rpl_do_grant2@localhost;
+Grants for rpl_do_grant2@localhost
+GRANT USAGE ON *.* TO 'rpl_do_grant2'@'localhost'
+drop user rpl_do_grant2@localhost;
+show grants for rpl_do_grant2@localhost;
+ERROR 42000: There is no such grant defined for user 'rpl_do_grant2' on host 'localhost'
+show grants for rpl_do_grant2@localhost;
+ERROR 42000: There is no such grant defined for user 'rpl_do_grant2' on host 'localhost'
diff --git a/mysql-test/r/rpl_flush_tables.result b/mysql-test/r/rpl_flush_tables.result
deleted file mode 100644
index 667530c4071..00000000000
--- a/mysql-test/r/rpl_flush_tables.result
+++ /dev/null
@@ -1,46 +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;
-create table t1 (a int);
-insert into t1 values (10);
-create table t2 (a int);
-create table t3 (a int) engine=merge union(t1);
-create table t4 (a int);
-insert into t4 select * from t3;
-rename table t1 to t5, t2 to t1;
-flush no_write_to_binlog tables;
-show binlog events;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Format_desc 1 # Server ver: SERVER_VERSION, Binlog ver: 4
-master-bin.000001 # Query 1 # use `test`; create table t1 (a int)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values (10)
-master-bin.000001 # Query 1 # use `test`; create table t2 (a int)
-master-bin.000001 # Query 1 # use `test`; create table t3 (a int) engine=merge union(t1)
-master-bin.000001 # Query 1 # use `test`; create table t4 (a int)
-master-bin.000001 # Query 1 # use `test`; insert into t4 select * from t3
-master-bin.000001 # Query 1 # use `test`; rename table t1 to t5, t2 to t1
-select * from t3;
-a
-flush tables;
-show binlog events;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Format_desc 1 # Server ver: SERVER_VERSION, Binlog ver: 4
-master-bin.000001 # Query 1 # use `test`; create table t1 (a int)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values (10)
-master-bin.000001 # Query 1 # use `test`; create table t2 (a int)
-master-bin.000001 # Query 1 # use `test`; create table t3 (a int) engine=merge union(t1)
-master-bin.000001 # Query 1 # use `test`; create table t4 (a int)
-master-bin.000001 # Query 1 # use `test`; insert into t4 select * from t3
-master-bin.000001 # Query 1 # use `test`; rename table t1 to t5, t2 to t1
-master-bin.000001 # Query 1 # use `test`; flush tables
-select * from t3;
-a
-stop slave;
-drop table t1;
-flush tables with read lock;
-start slave;
-stop slave;
-ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
diff --git a/mysql-test/r/rpl_flush_log_loop.result b/mysql-test/r/rpl_flushlog_loop.result
index f9bd42ec26c..61d3949ac50 100644
--- a/mysql-test/r/rpl_flush_log_loop.result
+++ b/mysql-test/r/rpl_flushlog_loop.result
@@ -8,10 +8,11 @@ stop slave;
change master to master_host='127.0.0.1',master_user='root',
master_password='',master_port=MASTER_PORT;
start slave;
+stop slave;
change master to master_host='127.0.0.1',master_user='root',
master_password='',master_port=SLAVE_PORT;
start slave;
flush logs;
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
-# 127.0.0.1 root SLAVE_PORT 60 slave-bin.000001 208 # # slave-bin.000001 Yes Yes 0 0 208 # None 0 No #
+# 127.0.0.1 root SLAVE_PORT 60 slave-bin.000001 212 # # slave-bin.000001 Yes Yes # 0 0 212 # None 0 No #
diff --git a/mysql-test/r/rpl_foreign_key_innodb.result b/mysql-test/r/rpl_foreign_key_innodb.result
new file mode 100644
index 00000000000..5c7d21a5b1d
--- /dev/null
+++ b/mysql-test/r/rpl_foreign_key_innodb.result
@@ -0,0 +1,42 @@
+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;
+CREATE TABLE t1 (a INT AUTO_INCREMENT KEY) ENGINE=INNODB;
+CREATE TABLE t2 (b INT AUTO_INCREMENT KEY, c INT, FOREIGN KEY(b) REFERENCES t1(a)) ENGINE=INNODB;
+SET FOREIGN_KEY_CHECKS=0;
+INSERT INTO t1 VALUES (10);
+INSERT INTO t1 VALUES (NULL),(NULL),(NULL);
+INSERT INTO t2 VALUES (5,0);
+INSERT INTO t2 VALUES (NULL,LAST_INSERT_ID());
+SET FOREIGN_KEY_CHECKS=1;
+SELECT * FROM t1;
+a
+10
+11
+12
+13
+SELECT * FROM t2;
+b c
+5 0
+6 11
+SELECT * FROM t1;
+a
+10
+11
+12
+13
+SELECT * FROM t2;
+b c
+5 0
+6 11
+SET TIMESTAMP=1000000000;
+CREATE TABLE t3 ( a INT UNIQUE );
+SET FOREIGN_KEY_CHECKS=0;
+INSERT INTO t3 VALUES (1),(1);
+ERROR 23000: Duplicate entry '1' for key 1
+SET FOREIGN_KEY_CHECKS=0;
+DROP TABLE IF EXISTS t1,t2,t3;
+SET FOREIGN_KEY_CHECKS=1;
diff --git a/mysql-test/r/rpl_loaddata.result b/mysql-test/r/rpl_loaddata.result
index dc11d10fab8..0b2e108843b 100644
--- a/mysql-test/r/rpl_loaddata.result
+++ b/mysql-test/r/rpl_loaddata.result
@@ -22,7 +22,7 @@ day id category name
2003-03-22 2416 a bbbbb
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
-slave-bin.000001 1286
+slave-bin.000001 1290
drop table t1;
drop table t2;
drop table t3;
@@ -33,7 +33,7 @@ set global sql_slave_skip_counter=1;
start slave;
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
-# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1789 # # master-bin.000001 Yes Yes 0 0 1789 # None 0 No #
+# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1793 # # master-bin.000001 Yes Yes # 0 0 1793 # None 0 No #
set sql_log_bin=0;
delete from t1;
set sql_log_bin=1;
@@ -43,7 +43,7 @@ change master to master_user='test';
change master to master_user='root';
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
-# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1824 # # master-bin.000001 No No 0 0 1824 # None 0 No #
+# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1828 # # master-bin.000001 No No # 0 0 1828 # None 0 No #
set global sql_slave_skip_counter=1;
start slave;
set sql_log_bin=0;
@@ -54,7 +54,7 @@ stop slave;
reset slave;
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
-# 127.0.0.1 root MASTER_PORT 1 4 # # No No 0 0 0 # None 0 No #
+# 127.0.0.1 root MASTER_PORT 1 4 # # No No # 0 0 0 # None 0 No #
reset master;
create table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60),
unique(day)) engine=MyISAM;
diff --git a/mysql-test/r/rpl_loaddata2.result b/mysql-test/r/rpl_loaddata2.result
new file mode 100644
index 00000000000..e8a0fd0f51a
--- /dev/null
+++ b/mysql-test/r/rpl_loaddata2.result
@@ -0,0 +1,152 @@
+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;
+CREATE TABLE t1 (word CHAR(20) NOT NULL);
+LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE t1;
+SELECT * FROM t1;
+word
+Aarhus
+Aaron
+Ababa
+aback
+abaft
+abandon
+abandoned
+abandoning
+abandonment
+abandons
+Aarhus
+Aaron
+Ababa
+aback
+abaft
+abandon
+abandoned
+abandoning
+abandonment
+abandons
+abase
+abased
+abasement
+abasements
+abases
+abash
+abashed
+abashes
+abashing
+abasing
+abate
+abated
+abatement
+abatements
+abater
+abates
+abating
+Abba
+abbe
+abbey
+abbeys
+abbot
+abbots
+Abbott
+abbreviate
+abbreviated
+abbreviates
+abbreviating
+abbreviation
+abbreviations
+Abby
+abdomen
+abdomens
+abdominal
+abduct
+abducted
+abduction
+abductions
+abductor
+abductors
+abducts
+Abe
+abed
+Abel
+Abelian
+Abelson
+Aberdeen
+Abernathy
+aberrant
+aberration
+SELECT * FROM t1;
+word
+Aarhus
+Aaron
+Ababa
+aback
+abaft
+abandon
+abandoned
+abandoning
+abandonment
+abandons
+Aarhus
+Aaron
+Ababa
+aback
+abaft
+abandon
+abandoned
+abandoning
+abandonment
+abandons
+abase
+abased
+abasement
+abasements
+abases
+abash
+abashed
+abashes
+abashing
+abasing
+abate
+abated
+abatement
+abatements
+abater
+abates
+abating
+Abba
+abbe
+abbey
+abbeys
+abbot
+abbots
+Abbott
+abbreviate
+abbreviated
+abbreviates
+abbreviating
+abbreviation
+abbreviations
+Abby
+abdomen
+abdomens
+abdominal
+abduct
+abducted
+abduction
+abductions
+abductor
+abductors
+abducts
+Abe
+abed
+Abel
+Abelian
+Abelson
+Aberdeen
+Abernathy
+aberrant
+aberration
diff --git a/mysql-test/r/rpl_loaddata_rule_s.result b/mysql-test/r/rpl_loaddata_s.result
index 16720c81374..8d50d9cc0d9 100644
--- a/mysql-test/r/rpl_loaddata_rule_s.result
+++ b/mysql-test/r/rpl_loaddata_s.result
@@ -5,10 +5,10 @@ reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
reset master;
-create table t1(a int, b int, unique(b));
+create table test.t1(a int, b int, unique(b));
load data infile '../../std_data/rpl_loaddata.dat' into table test.t1;
-select count(*) from t1;
+select count(*) from test.t1;
count(*)
2
-show binlog events from 98;
+show binlog events from 102;
Log_name Pos Event_type Server_id End_log_pos Info
diff --git a/mysql-test/r/rpl_loadfile.result b/mysql-test/r/rpl_loadfile.result
new file mode 100644
index 00000000000..f1455958ff2
--- /dev/null
+++ b/mysql-test/r/rpl_loadfile.result
@@ -0,0 +1,234 @@
+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;
+DROP PROCEDURE IF EXISTS test.p1;
+DROP TABLE IF EXISTS test.t1;
+CREATE TABLE test.t1 (a INT, blob_column LONGBLOB, PRIMARY KEY(a));
+INSERT INTO test.t1 VALUES(1,'test');
+UPDATE test.t1 SET blob_column=LOAD_FILE('../../std_data/words2.dat') WHERE a=1;
+create procedure test.p1()
+begin
+INSERT INTO test.t1 VALUES(2,'test');
+UPDATE test.t1 SET blob_column=LOAD_FILE('../../std_data/words2.dat') WHERE a=2;
+end|
+CALL test.p1();
+SELECT * FROM test.t1;
+a blob_column
+1 abase
+abased
+abasement
+abasements
+abases
+abash
+abashed
+abashes
+abashing
+abasing
+abate
+abated
+abatement
+abatements
+abater
+abates
+abating
+Abba
+abbe
+abbey
+abbeys
+abbot
+abbots
+Abbott
+abbreviate
+abbreviated
+abbreviates
+abbreviating
+abbreviation
+abbreviations
+Abby
+abdomen
+abdomens
+abdominal
+abduct
+abducted
+abduction
+abductions
+abductor
+abductors
+abducts
+Abe
+abed
+Abel
+Abelian
+Abelson
+Aberdeen
+Abernathy
+aberrant
+aberration
+
+2 abase
+abased
+abasement
+abasements
+abases
+abash
+abashed
+abashes
+abashing
+abasing
+abate
+abated
+abatement
+abatements
+abater
+abates
+abating
+Abba
+abbe
+abbey
+abbeys
+abbot
+abbots
+Abbott
+abbreviate
+abbreviated
+abbreviates
+abbreviating
+abbreviation
+abbreviations
+Abby
+abdomen
+abdomens
+abdominal
+abduct
+abducted
+abduction
+abductions
+abductor
+abductors
+abducts
+Abe
+abed
+Abel
+Abelian
+Abelson
+Aberdeen
+Abernathy
+aberrant
+aberration
+
+SHOW CREATE TABLE test.t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) NOT NULL default '0',
+ `blob_column` longblob,
+ PRIMARY KEY (`a`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT * FROM test.t1;
+a blob_column
+1 abase
+abased
+abasement
+abasements
+abases
+abash
+abashed
+abashes
+abashing
+abasing
+abate
+abated
+abatement
+abatements
+abater
+abates
+abating
+Abba
+abbe
+abbey
+abbeys
+abbot
+abbots
+Abbott
+abbreviate
+abbreviated
+abbreviates
+abbreviating
+abbreviation
+abbreviations
+Abby
+abdomen
+abdomens
+abdominal
+abduct
+abducted
+abduction
+abductions
+abductor
+abductors
+abducts
+Abe
+abed
+Abel
+Abelian
+Abelson
+Aberdeen
+Abernathy
+aberrant
+aberration
+
+2 abase
+abased
+abasement
+abasements
+abases
+abash
+abashed
+abashes
+abashing
+abasing
+abate
+abated
+abatement
+abatements
+abater
+abates
+abating
+Abba
+abbe
+abbey
+abbeys
+abbot
+abbots
+Abbott
+abbreviate
+abbreviated
+abbreviates
+abbreviating
+abbreviation
+abbreviations
+Abby
+abdomen
+abdomens
+abdominal
+abduct
+abducted
+abduction
+abductions
+abductor
+abductors
+abducts
+Abe
+abed
+Abel
+Abelian
+Abelson
+Aberdeen
+Abernathy
+aberrant
+aberration
+
+DROP PROCEDURE IF EXISTS test.p1;
+DROP TABLE test.t1;
diff --git a/mysql-test/r/rpl_log.result b/mysql-test/r/rpl_log.result
deleted file mode 100644
index be8d5291ad9..00000000000
--- a/mysql-test/r/rpl_log.result
+++ /dev/null
@@ -1,103 +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;
-stop slave;
-reset master;
-reset slave;
-reset master;
-create table t1(n int not null auto_increment primary key);
-insert into t1 values (NULL);
-drop table t1;
-create table t1 (word char(20) not null);
-load data infile '../../std_data/words.dat' into table t1 ignore 1 lines;
-select count(*) from t1;
-count(*)
-69
-drop table t1;
-show binlog events;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 4 Format_desc 1 98 Server ver: VERSION, Binlog ver: 4
-master-bin.000001 98 Query 1 219 use `test`; create table t1(n int not null auto_increment primary key)
-master-bin.000001 219 Intvar 1 247 INSERT_ID=1
-master-bin.000001 247 Query 1 338 use `test`; insert into t1 values (NULL)
-master-bin.000001 338 Query 1 414 use `test`; drop table t1
-master-bin.000001 414 Query 1 517 use `test`; create table t1 (word char(20) not null)
-master-bin.000001 517 Begin_load_query 1 1121 ;file_id=1;block_len=581
-master-bin.000001 1121 Execute_load_query 1 1269 use `test`; load data infile '../../std_data/words.dat' into table t1 ignore 1 lines ;file_id=1
-master-bin.000001 1269 Query 1 1345 use `test`; drop table t1
-show binlog events from 98 limit 1;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 98 Query 1 219 use `test`; create table t1(n int not null auto_increment primary key)
-show binlog events from 98 limit 2;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 98 Query 1 219 use `test`; create table t1(n int not null auto_increment primary key)
-master-bin.000001 219 Intvar 1 247 INSERT_ID=1
-show binlog events from 98 limit 2,1;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 247 Query 1 338 use `test`; insert into t1 values (NULL)
-flush logs;
-create table t5 (a int);
-drop table t5;
-start slave;
-flush logs;
-stop slave;
-create table t1 (n int);
-insert into t1 values (1);
-drop table t1;
-show binlog events;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 4 Format_desc 1 98 Server ver: VERSION, Binlog ver: 4
-master-bin.000001 98 Query 1 219 use `test`; create table t1(n int not null auto_increment primary key)
-master-bin.000001 219 Intvar 1 247 INSERT_ID=1
-master-bin.000001 247 Query 1 338 use `test`; insert into t1 values (NULL)
-master-bin.000001 338 Query 1 414 use `test`; drop table t1
-master-bin.000001 414 Query 1 517 use `test`; create table t1 (word char(20) not null)
-master-bin.000001 517 Begin_load_query 1 1121 ;file_id=1;block_len=581
-master-bin.000001 1121 Execute_load_query 1 1269 use `test`; load data infile '../../std_data/words.dat' into table t1 ignore 1 lines ;file_id=1
-master-bin.000001 1269 Query 1 1345 use `test`; drop table t1
-master-bin.000001 1345 Rotate 1 1389 master-bin.000002;pos=4
-show binlog events in 'master-bin.000002';
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000002 4 Format_desc 1 98 Server ver: VERSION, Binlog ver: 4
-master-bin.000002 98 Query 1 184 use `test`; create table t5 (a int)
-master-bin.000002 184 Query 1 260 use `test`; drop table t5
-master-bin.000002 260 Query 1 346 use `test`; create table t1 (n int)
-master-bin.000002 346 Query 1 434 use `test`; insert into t1 values (1)
-master-bin.000002 434 Query 1 510 use `test`; drop table t1
-show binary logs;
-Log_name File_size
-master-bin.000001 1389
-master-bin.000002 510
-start slave;
-show binary logs;
-Log_name File_size
-slave-bin.000001 1559
-slave-bin.000002 348
-show binlog events in 'slave-bin.000001' from 4;
-Log_name Pos Event_type Server_id End_log_pos Info
-slave-bin.000001 4 Format_desc 2 98 Server ver: VERSION, Binlog ver: 4
-slave-bin.000001 98 Query 1 219 use `test`; create table t1(n int not null auto_increment primary key)
-slave-bin.000001 219 Intvar 1 247 INSERT_ID=1
-slave-bin.000001 247 Query 1 338 use `test`; insert into t1 values (NULL)
-slave-bin.000001 338 Query 1 414 use `test`; drop table t1
-slave-bin.000001 414 Query 1 517 use `test`; create table t1 (word char(20) not null)
-slave-bin.000001 517 Begin_load_query 1 1121 ;file_id=1;block_len=581
-slave-bin.000001 1121 Execute_load_query 1 1278 use `test`; load data INFILE '../../var/tmp/SQL_LOAD-2-1-1.data' INTO table t1 ignore 1 lines ;file_id=1
-slave-bin.000001 1278 Query 1 1354 use `test`; drop table t1
-slave-bin.000001 1354 Query 1 1440 use `test`; create table t5 (a int)
-slave-bin.000001 1440 Query 1 1516 use `test`; drop table t5
-slave-bin.000001 1516 Rotate 2 1559 slave-bin.000002;pos=4
-show binlog events in 'slave-bin.000002' from 4;
-Log_name Pos Event_type Server_id End_log_pos Info
-slave-bin.000002 4 Format_desc 2 98 Server ver: VERSION, Binlog ver: 4
-slave-bin.000002 98 Query 1 184 use `test`; create table t1 (n int)
-slave-bin.000002 184 Query 1 272 use `test`; insert into t1 values (1)
-slave-bin.000002 272 Query 1 348 use `test`; drop table t1
-show slave status;
-Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
-# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 510 # # master-bin.000002 Yes Yes 0 0 510 # None 0 No #
-show binlog events in 'slave-bin.000005' from 4;
-ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
diff --git a/mysql-test/r/rpl_log_pos.result b/mysql-test/r/rpl_log_pos.result
index cf13756966e..d0545f27d99 100644
--- a/mysql-test/r/rpl_log_pos.result
+++ b/mysql-test/r/rpl_log_pos.result
@@ -6,37 +6,37 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
-master-bin.000001 98
+master-bin.000001 102 <Binlog_Ignore_DB>
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
-# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 98 # # master-bin.000001 Yes Yes 0 0 98 # None 0 No #
+# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 102 # # master-bin.000001 Yes Yes 0 0 102 # None 0 No #
stop slave;
-change master to master_log_pos=73;
+change master to master_log_pos=74;
start slave;
stop slave;
-change master to master_log_pos=73;
+change master to master_log_pos=74;
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
-# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 73 # # master-bin.000001 No No 0 0 73 # None 0 No #
+# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 74 # # master-bin.000001 No No 0 0 74 # None 0 No #
start slave;
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
-# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 73 # # master-bin.000001 No Yes 0 0 73 # None 0 No #
+# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 74 # # master-bin.000001 No Yes 0 0 74 # None 0 No #
stop slave;
-change master to master_log_pos=173;
+change master to master_log_pos=177;
start slave;
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
-# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 173 # # master-bin.000001 No Yes 0 0 173 # None 0 No #
+# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 177 # # master-bin.000001 No Yes 0 0 177 # None 0 No #
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
-master-bin.000001 98
+master-bin.000001 102 <Binlog_Ignore_DB>
create table if not exists t1 (n int);
drop table if exists t1;
create table t1 (n int);
insert into t1 values (1),(2),(3);
stop slave;
-change master to master_log_pos=98;
+change master to master_log_pos=102;
start slave;
select * from t1;
n
diff --git a/mysql-test/r/rpl_multi_delete.result b/mysql-test/r/rpl_multi_delete.result
index d2c68eee62e..e94a4e7947e 100644
--- a/mysql-test/r/rpl_multi_delete.result
+++ b/mysql-test/r/rpl_multi_delete.result
@@ -19,13 +19,4 @@ a
select * from t2;
a
1
-delete from t1;
-delete from t2;
-insert into t1 values(1);
-insert into t2 values(1);
-DELETE t1.*, t2.* from t1, t2;
-select * from t1;
-a
-select * from t2;
-a
drop table t1,t2;
diff --git a/mysql-test/r/rpl_multi_engine.result b/mysql-test/r/rpl_multi_engine.result
new file mode 100644
index 00000000000..27482eae6d9
--- /dev/null
+++ b/mysql-test/r/rpl_multi_engine.result
@@ -0,0 +1,365 @@
+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;
+create database if not exists mysqltest1;
+use mysqltest1;
+drop table if exists t1;
+CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc
+VARCHAR(255), bc CHAR(255), d DECIMAL(10,4) DEFAULT 0, f FLOAT DEFAULT
+0, total BIGINT UNSIGNED, y YEAR, t TIMESTAMP,PRIMARY KEY(id));
+use mysqltest1;
+alter table t1 engine=myisam;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) default NULL,
+ `vc` varchar(255) default NULL,
+ `bc` char(255) default NULL,
+ `d` decimal(10,4) default '0.0000',
+ `f` float default '0',
+ `total` bigint(20) unsigned default NULL,
+ `y` year(4) default NULL,
+ `t` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+alter table t1 engine=myisam;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) default NULL,
+ `vc` varchar(255) default NULL,
+ `bc` char(255) default NULL,
+ `d` decimal(10,4) default '0.0000',
+ `f` float default '0',
+ `total` bigint(20) unsigned default NULL,
+ `y` year(4) default NULL,
+ `t` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES(42,1,'Testing MySQL databases is a cool ', 'Must make it bug free for the customer',654321.4321,15.21,0,1965,"2005-11-14");
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 00:00:00
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 00:00:00
+UPDATE t1 SET b1 = 0, t="2005-09-09" WHERE b1 = 1;
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+42 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-09-09 00:00:00
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+42 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-09-09 00:00:00
+DELETE FROM mysqltest1.t1 WHERE id = 42;
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+alter table t1 engine=innodb;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) default NULL,
+ `vc` varchar(255) default NULL,
+ `bc` char(255) default NULL,
+ `d` decimal(10,4) default '0.0000',
+ `f` float default '0',
+ `total` bigint(20) unsigned default NULL,
+ `y` year(4) default NULL,
+ `t` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES(42,1,'Testing MySQL databases is a cool ', 'Must make it bug free for the customer',654321.4321,15.21,0,1965,"2005-11-14");
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 00:00:00
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 00:00:00
+UPDATE t1 SET b1 = 0, t="2005-09-09" WHERE b1 = 1;
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+42 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-09-09 00:00:00
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+42 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-09-09 00:00:00
+DELETE FROM mysqltest1.t1 WHERE id = 42;
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+alter table t1 engine=memory;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) default NULL,
+ `vc` varchar(255) default NULL,
+ `bc` char(255) default NULL,
+ `d` decimal(10,4) default '0.0000',
+ `f` float default '0',
+ `total` bigint(20) unsigned default NULL,
+ `y` year(4) default NULL,
+ `t` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
+ PRIMARY KEY (`id`)
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES(42,1,'Testing MySQL databases is a cool ', 'Must make it bug free for the customer',654321.4321,15.21,0,1965,"2005-11-14");
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 00:00:00
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 00:00:00
+UPDATE t1 SET b1 = 0, t="2005-09-09" WHERE b1 = 1;
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+42 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-09-09 00:00:00
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+42 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-09-09 00:00:00
+DELETE FROM mysqltest1.t1 WHERE id = 42;
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+alter table t1 engine=memory;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) default NULL,
+ `vc` varchar(255) default NULL,
+ `bc` char(255) default NULL,
+ `d` decimal(10,4) default '0.0000',
+ `f` float default '0',
+ `total` bigint(20) unsigned default NULL,
+ `y` year(4) default NULL,
+ `t` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
+ PRIMARY KEY (`id`)
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+alter table t1 engine=myisam;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) default NULL,
+ `vc` varchar(255) default NULL,
+ `bc` char(255) default NULL,
+ `d` decimal(10,4) default '0.0000',
+ `f` float default '0',
+ `total` bigint(20) unsigned default NULL,
+ `y` year(4) default NULL,
+ `t` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES(42,1,'Testing MySQL databases is a cool ', 'Must make it bug free for the customer',654321.4321,15.21,0,1965,"2005-11-14");
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 00:00:00
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 00:00:00
+UPDATE t1 SET b1 = 0, t="2005-09-09" WHERE b1 = 1;
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+42 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-09-09 00:00:00
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+42 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-09-09 00:00:00
+DELETE FROM mysqltest1.t1 WHERE id = 42;
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+alter table t1 engine=innodb;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) default NULL,
+ `vc` varchar(255) default NULL,
+ `bc` char(255) default NULL,
+ `d` decimal(10,4) default '0.0000',
+ `f` float default '0',
+ `total` bigint(20) unsigned default NULL,
+ `y` year(4) default NULL,
+ `t` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES(42,1,'Testing MySQL databases is a cool ', 'Must make it bug free for the customer',654321.4321,15.21,0,1965,"2005-11-14");
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 00:00:00
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 00:00:00
+UPDATE t1 SET b1 = 0, t="2005-09-09" WHERE b1 = 1;
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+42 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-09-09 00:00:00
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+42 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-09-09 00:00:00
+DELETE FROM mysqltest1.t1 WHERE id = 42;
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+alter table t1 engine=memory;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) default NULL,
+ `vc` varchar(255) default NULL,
+ `bc` char(255) default NULL,
+ `d` decimal(10,4) default '0.0000',
+ `f` float default '0',
+ `total` bigint(20) unsigned default NULL,
+ `y` year(4) default NULL,
+ `t` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
+ PRIMARY KEY (`id`)
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES(42,1,'Testing MySQL databases is a cool ', 'Must make it bug free for the customer',654321.4321,15.21,0,1965,"2005-11-14");
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 00:00:00
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 00:00:00
+UPDATE t1 SET b1 = 0, t="2005-09-09" WHERE b1 = 1;
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+42 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-09-09 00:00:00
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+42 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-09-09 00:00:00
+DELETE FROM mysqltest1.t1 WHERE id = 42;
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+alter table t1 engine=innodb;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) default NULL,
+ `vc` varchar(255) default NULL,
+ `bc` char(255) default NULL,
+ `d` decimal(10,4) default '0.0000',
+ `f` float default '0',
+ `total` bigint(20) unsigned default NULL,
+ `y` year(4) default NULL,
+ `t` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+alter table t1 engine=myisam;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) default NULL,
+ `vc` varchar(255) default NULL,
+ `bc` char(255) default NULL,
+ `d` decimal(10,4) default '0.0000',
+ `f` float default '0',
+ `total` bigint(20) unsigned default NULL,
+ `y` year(4) default NULL,
+ `t` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES(42,1,'Testing MySQL databases is a cool ', 'Must make it bug free for the customer',654321.4321,15.21,0,1965,"2005-11-14");
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 00:00:00
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 00:00:00
+UPDATE t1 SET b1 = 0, t="2005-09-09" WHERE b1 = 1;
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+42 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-09-09 00:00:00
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+42 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-09-09 00:00:00
+DELETE FROM mysqltest1.t1 WHERE id = 42;
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+alter table t1 engine=innodb;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) default NULL,
+ `vc` varchar(255) default NULL,
+ `bc` char(255) default NULL,
+ `d` decimal(10,4) default '0.0000',
+ `f` float default '0',
+ `total` bigint(20) unsigned default NULL,
+ `y` year(4) default NULL,
+ `t` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES(42,1,'Testing MySQL databases is a cool ', 'Must make it bug free for the customer',654321.4321,15.21,0,1965,"2005-11-14");
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 00:00:00
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 00:00:00
+UPDATE t1 SET b1 = 0, t="2005-09-09" WHERE b1 = 1;
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+42 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-09-09 00:00:00
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+42 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-09-09 00:00:00
+DELETE FROM mysqltest1.t1 WHERE id = 42;
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+alter table t1 engine=memory;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL,
+ `b1` bit(8) default NULL,
+ `vc` varchar(255) default NULL,
+ `bc` char(255) default NULL,
+ `d` decimal(10,4) default '0.0000',
+ `f` float default '0',
+ `total` bigint(20) unsigned default NULL,
+ `y` year(4) default NULL,
+ `t` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
+ PRIMARY KEY (`id`)
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES(42,1,'Testing MySQL databases is a cool ', 'Must make it bug free for the customer',654321.4321,15.21,0,1965,"2005-11-14");
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 00:00:00
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 00:00:00
+UPDATE t1 SET b1 = 0, t="2005-09-09" WHERE b1 = 1;
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+42 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-09-09 00:00:00
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+42 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-09-09 00:00:00
+DELETE FROM mysqltest1.t1 WHERE id = 42;
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
+id hex(b1) vc bc d f total y t
+DROP TABLE t1;
diff --git a/mysql-test/r/rpl_multi_update.result b/mysql-test/r/rpl_multi_update.result
index 04cb1bc7460..524278be042 100644
--- a/mysql-test/r/rpl_multi_update.result
+++ b/mysql-test/r/rpl_multi_update.result
@@ -24,16 +24,4 @@ a b
1 0
2 1
UPDATE t1, t2 SET t1.b = t2.b WHERE t1.a = t2.a;
-delete from t1;
-delete from t2;
-insert into t1 values(1,1);
-insert into t2 values(1,1);
-update t1 set a=2;
-UPDATE t1, t2 SET t1.a = t2.a;
-select * from t1;
-a b
-1 1
-select * from t2;
-a b
-1 1
drop table t1, t2;
diff --git a/mysql-test/r/rpl_mystery22.result b/mysql-test/r/rpl_mystery22.result
deleted file mode 100644
index 348b3211cd5..00000000000
--- a/mysql-test/r/rpl_mystery22.result
+++ /dev/null
@@ -1,23 +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;
-create table t1(n int auto_increment primary key);
-insert into t1 values (2);
-insert into t1 values(NULL);
-insert into t1 values(NULL);
-delete from t1 where n = 2;
-start slave;
-stop slave;
-create table t2(n int);
-drop table t2;
-insert into t1 values(NULL);
-start slave;
-select * from t1;
-n
-1
-2
-3
-drop table t1;
diff --git a/mysql-test/r/rpl_openssl.result b/mysql-test/r/rpl_openssl.result
index d916e9f2c5c..be9ab29d8b7 100644
--- a/mysql-test/r/rpl_openssl.result
+++ b/mysql-test/r/rpl_openssl.result
@@ -20,11 +20,11 @@ t
1
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
-# 127.0.0.1 replssl MASTER_MYPORT 1 master-bin.000001 398 # # master-bin.000001 Yes Yes 0 0 398 # None 0 Yes MYSQL_TEST_DIR/std_data/cacert.pem MYSQL_TEST_DIR/std_data/client-cert.pem MYSQL_TEST_DIR/std_data/client-key.pem #
+# 127.0.0.1 replssl MASTER_MYPORT 1 # # # # # # Yes # 0 0 # # None 0 Yes MYSQL_TEST_DIR/std_data/cacert.pem MYSQL_TEST_DIR/std_data/client-cert.pem MYSQL_TEST_DIR/std_data/client-key.pem #
stop slave;
change master to master_user='root',master_password='', master_ssl=0;
start slave;
drop table t1;
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
-# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 474 # # master-bin.000001 Yes Yes 0 0 474 # None 0 No MYSQL_TEST_DIR/std_data/cacert.pem MYSQL_TEST_DIR/std_data/client-cert.pem MYSQL_TEST_DIR/std_data/client-key.pem #
+# 127.0.0.1 root MASTER_MYPORT 1 # # # # # # Yes # 0 0 # # None 0 No MYSQL_TEST_DIR/std_data/cacert.pem MYSQL_TEST_DIR/std_data/client-cert.pem MYSQL_TEST_DIR/std_data/client-key.pem #
diff --git a/mysql-test/r/rpl_replicate_do.result b/mysql-test/r/rpl_replicate_do.result
index d8666080a71..438671fb103 100644
--- a/mysql-test/r/rpl_replicate_do.result
+++ b/mysql-test/r/rpl_replicate_do.result
@@ -28,7 +28,7 @@ ERROR 42S02: Table 'test.t11' doesn't exist
drop table if exists t1,t2,t11;
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
-# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1658 # # master-bin.000001 Yes Yes test.t1 0 0 1658 # None 0 No #
+# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 # # # master-bin.000001 Yes Yes test.t1 # 0 0 # # None 0 No #
create table t1 (ts timestamp);
set one_shot time_zone='met';
insert into t1 values('2005-08-12 00:00:00');
diff --git a/mysql-test/r/rpl_replicate_ignore_db.result b/mysql-test/r/rpl_replicate_ignore_db.result
new file mode 100644
index 00000000000..0135804c02d
--- /dev/null
+++ b/mysql-test/r/rpl_replicate_ignore_db.result
@@ -0,0 +1,23 @@
+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;
+drop database if exists mysqltest1;
+drop database if exists mysqltest2;
+create database mysqltest1;
+create database mysqltest2;
+use mysqltest1;
+create table t1 (a int);
+insert into t1 values(1);
+select * from mysqltest1.t1;
+ERROR 42S02: Table 'mysqltest1.t1' doesn't exist
+use mysqltest2;
+create table t1 (a int);
+insert into t1 values(1);
+select * from mysqltest2.t1;
+a
+1
+drop database mysqltest1;
+drop database mysqltest2;
diff --git a/mysql-test/r/rpl_rotate_logs.result b/mysql-test/r/rpl_rotate_logs.result
index bf2ef98c87f..264f5d224bd 100644
--- a/mysql-test/r/rpl_rotate_logs.result
+++ b/mysql-test/r/rpl_rotate_logs.result
@@ -16,7 +16,7 @@ create table t1 (s text);
insert into t1 values('Could not break slave'),('Tried hard');
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
-# 127.0.0.1 root MASTER_PORT 60 master-bin.000001 548 # # master-bin.000001 Yes Yes 0 0 548 # None 0 No #
+# 127.0.0.1 root MASTER_PORT 60 master-bin.000001 552 # # master-bin.000001 Yes Yes # 0 0 552 # None 0 No #
select * from t1;
s
Could not break slave
@@ -27,9 +27,9 @@ insert into t2 values (34),(67),(123);
flush logs;
show binary logs;
Log_name File_size
-master-bin.000001 592
-master-bin.000002 363
-master-bin.000003 98
+master-bin.000001 596
+master-bin.000002 367
+master-bin.000003 102
create table t3 select * from temp_table;
select * from t3;
a
@@ -43,21 +43,21 @@ start slave;
purge master logs to 'master-bin.000002';
show master logs;
Log_name File_size
-master-bin.000002 363
-master-bin.000003 407
+master-bin.000002 367
+master-bin.000003 411
purge binary logs to 'master-bin.000002';
show binary logs;
Log_name File_size
-master-bin.000002 363
-master-bin.000003 407
+master-bin.000002 367
+master-bin.000003 411
purge master logs before now();
show binary logs;
Log_name File_size
-master-bin.000003 407
+master-bin.000003 411
insert into t2 values (65);
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
-# 127.0.0.1 root MASTER_PORT 60 master-bin.000003 496 # # master-bin.000003 Yes Yes 0 0 496 # None 0 No #
+# 127.0.0.1 root MASTER_PORT 60 master-bin.000003 500 # # master-bin.000003 Yes Yes # 0 0 500 # None 0 No #
select * from t2;
m
34
@@ -74,18 +74,18 @@ count(*)
create table t4 select * from temp_table;
show binary logs;
Log_name File_size
-master-bin.000003 4185
-master-bin.000004 4190
-master-bin.000005 2032
+master-bin.000003 4189
+master-bin.000004 4194
+master-bin.000005 2036
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
-master-bin.000005 2032
+master-bin.000005 2036
select * from t4;
a
testing temporary tables part 2
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
-# 127.0.0.1 root MASTER_PORT 60 master-bin.000005 2032 # # master-bin.000005 Yes Yes 0 0 2032 # None 0 No #
+# 127.0.0.1 root MASTER_PORT 60 master-bin.000005 2036 # # master-bin.000005 Yes Yes # 0 0 2036 # None 0 No #
lock tables t3 read;
select count(*) from t3 where n >= 4;
count(*)
diff --git a/mysql-test/r/rpl_row_001.result b/mysql-test/r/rpl_row_001.result
new file mode 100644
index 00000000000..990ebbc5d7a
--- /dev/null
+++ b/mysql-test/r/rpl_row_001.result
@@ -0,0 +1,55 @@
+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;
+CREATE TABLE t1 (word CHAR(20) NOT NULL);
+LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE t1;
+LOAD DATA LOCAL INFILE 'MYSQL_TEST_DIR/std_data/words.dat' INTO TABLE t1;
+SELECT * FROM t1 LIMIT 10;
+word
+Aarhus
+Aaron
+Ababa
+aback
+abaft
+abandon
+abandoned
+abandoning
+abandonment
+abandons
+STOP SLAVE;
+SET PASSWORD FOR root@"localhost" = PASSWORD('foo');
+START SLAVE;
+SET PASSWORD FOR root@"localhost" = PASSWORD('');
+CREATE TABLE t3(n INT);
+INSERT INTO t3 VALUES(1),(2);
+SELECT * FROM t3;
+n
+1
+2
+SELECT SUM(LENGTH(word)) FROM t1;
+SUM(LENGTH(word))
+1022
+DROP TABLE t1,t3;
+CREATE TABLE t1 (n INT) ENGINE=MYISAM;
+RESET MASTER;
+STOP SLAVE;
+RESET SLAVE;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+5000
+LOCK TABLES t1 READ;
+START SLAVE;
+UNLOCK TABLES;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+5000
+DROP TABLE t1;
+CREATE TABLE t1 (n INT);
+INSERT INTO t1 VALUES(3456);
+SELECT n FROM t1;
+n
+3456
+DROP TABLE t1;
diff --git a/mysql-test/r/rpl_row_4_bytes.result b/mysql-test/r/rpl_row_4_bytes.result
new file mode 100644
index 00000000000..b88d5661a90
--- /dev/null
+++ b/mysql-test/r/rpl_row_4_bytes.result
@@ -0,0 +1,27 @@
+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;
+drop database if exists mysqltest1;
+create database mysqltest1;
+use mysqltest1;
+CREATE TABLE t1 (a char(3));
+CREATE TABLE t2 (a char(3));
+insert into t1 values("ANN");
+insert into t1 values("GUI");
+insert into t2 values("LIL");
+insert into t2 values("ABE");
+insert into t2 values("ANG");
+use mysqltest1;
+select * from t1 order by a;
+a
+ANN
+GUI
+select * from t2 order by a;
+a
+ABE
+ANG
+LIL
+DROP TABLE t1,t2;
diff --git a/mysql-test/r/rpl_row_EE_err.result b/mysql-test/r/rpl_row_EE_err.result
new file mode 100644
index 00000000000..23b0c88f49d
--- /dev/null
+++ b/mysql-test/r/rpl_row_EE_err.result
@@ -0,0 +1,19 @@
+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;
+create table t1 (a int) engine=myisam;
+flush tables;
+drop table if exists t1;
+Warnings:
+Error 2 Can't find file: 't1' (errno: 2)
+create table t1 (a int, unique(a)) engine=myisam;
+set sql_log_bin=0;
+insert into t1 values(2);
+set sql_log_bin=1;
+insert into t1 values(1),(2);
+ERROR 23000: Duplicate entry '2' for key 1
+drop table t1;
+stop slave;
diff --git a/mysql-test/r/rpl_row_NOW.result b/mysql-test/r/rpl_row_NOW.result
new file mode 100644
index 00000000000..ed045efa7af
--- /dev/null
+++ b/mysql-test/r/rpl_row_NOW.result
@@ -0,0 +1,28 @@
+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;
+create database if not exists mysqltest1;
+DROP TABLE IF EXISTS mysqltest1.t1;
+CREATE TABLE mysqltest1.t1 (n MEDIUMINT NOT NULL AUTO_INCREMENT,
+a TIMESTAMP DEFAULT '2005-05-05 01:01:01',
+b TIMESTAMP DEFAULT '2005-05-05 01:01:01',
+PRIMARY KEY(n));
+CREATE FUNCTION mysqltest1.f1() RETURNS TIMESTAMP
+BEGIN
+DECLARE v1 INT DEFAULT 300;
+WHILE v1 > 0 DO
+SET v1 = v1 - 1;
+END WHILE;
+RETURN NOW();
+END|
+INSERT INTO mysqltest1.t1 VALUES(NULL,NOW(),mysqltest1.f1());
+CREATE TRIGGER mysqltest1.trig1 BEFORE INSERT ON mysqltest1.t1
+FOR EACH ROW BEGIN
+SET new.b = mysqltest1.f1();
+END|
+INSERT INTO mysqltest1.t1 SET n = NULL, a = now();
+DROP TABLE IF EXISTS mysqltest1.t1;
+DROP FUNCTION mysqltest1.f1;
diff --git a/mysql-test/r/rpl_row_USER.result b/mysql-test/r/rpl_row_USER.result
new file mode 100644
index 00000000000..827afb72b10
--- /dev/null
+++ b/mysql-test/r/rpl_row_USER.result
@@ -0,0 +1,36 @@
+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;
+DROP DATABASE IF EXISTS mysqltest1;
+CREATE DATABASE mysqltest1;
+CREATE USER tester IDENTIFIED BY 'test';
+GRANT ALL ON mysqltest1.* TO 'tester'@'%' IDENTIFIED BY 'test';
+GRANT ALL ON mysqltest1.* TO ''@'localhost%';
+FLUSH PRIVILEGES;
+CREATE TABLE mysqltest1.t1 (a INT, users VARCHAR(255), PRIMARY KEY(a));
+INSERT INTO mysqltest1.t1 VALUES(1,USER());
+INSERT INTO mysqltest1.t1 VALUES(2,CURRENT_USER());
+create procedure mysqltest1.p1()
+begin
+INSERT INTO mysqltest1.t1 VALUES(3,USER());
+INSERT INTO mysqltest1.t1 VALUES(4,CURRENT_USER());
+end|
+CALL mysqltest1.p1();
+SELECT * FROM mysqltest1.t1;
+a users
+1 tester@localhost
+2 @localhost
+3 tester@localhost
+4 @localhost
+SELECT * FROM mysqltest1.t1;
+a users
+1 tester@localhost
+2 @localhost
+3 tester@localhost
+4 @localhost
+DROP DATABASE mysqltest1;
+REVOKE ALL ON mysqltest1.* FROM 'tester'@'%';
+REVOKE ALL ON mysqltest1.* FROM ''@'localhost%';
diff --git a/mysql-test/r/rpl_row_UUID.result b/mysql-test/r/rpl_row_UUID.result
new file mode 100644
index 00000000000..06c81e28ef6
--- /dev/null
+++ b/mysql-test/r/rpl_row_UUID.result
@@ -0,0 +1,38 @@
+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;
+DROP PROCEDURE IF EXISTS test.p1;
+DROP TABLE IF EXISTS test.t1;
+CREATE TABLE test.t1 (a INT, blob_column LONGBLOB, vchar_column VARCHAR(100), PRIMARY KEY(a)) engine=myisam;
+INSERT INTO test.t1 VALUES(1,UUID(),UUID());
+create procedure test.p1()
+begin
+INSERT INTO test.t1 VALUES(2,UUID(),UUID());
+INSERT INTO test.t1 VALUES(3,UUID(),UUID());
+end|
+CALL test.p1();
+create function test.fn1(x int)
+returns int
+begin
+insert into t1 values (4+x,UUID(),UUID());
+insert into t1 values (5+x,UUID(),UUID());
+return 0;
+end|
+select fn1(0);
+fn1(0)
+0
+create table t2 (a int);
+insert into t2 values(fn1(2));
+SHOW CREATE TABLE test.t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) NOT NULL default '0',
+ `blob_column` longblob,
+ `vchar_column` varchar(100) default NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP PROCEDURE test.p1;
+DROP TABLE test.t1;
diff --git a/mysql-test/r/rpl_row_basic_2myisam.result b/mysql-test/r/rpl_row_basic_2myisam.result
new file mode 100644
index 00000000000..12a8d8282e3
--- /dev/null
+++ b/mysql-test/r/rpl_row_basic_2myisam.result
@@ -0,0 +1,426 @@
+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;
+CREATE TABLE t1 (C1 CHAR(1), C2 CHAR(1), INDEX (C1)) ENGINE = 'MYISAM' ;
+SELECT * FROM t1;
+C1 C2
+SELECT * FROM t1;
+C1 C2
+INSERT INTO t1 VALUES ('A','B'), ('X','Y'), ('X','X');
+INSERT INTO t1 VALUES ('A','C'), ('X','Z'), ('A','A');
+SELECT * FROM t1 ORDER BY C1,C2;
+C1 C2
+A A
+A B
+A C
+X X
+X Y
+X Z
+SELECT * FROM t1 ORDER BY C1,C2;
+C1 C2
+A A
+A B
+A C
+X X
+X Y
+X Z
+DELETE FROM t1 WHERE C1 = C2;
+SELECT * FROM t1 ORDER BY C1,C2;
+C1 C2
+A B
+A C
+X Y
+X Z
+SELECT * FROM t1 ORDER BY C1,C2;
+C1 C2
+A B
+A C
+X Y
+X Z
+UPDATE t1 SET C2 = 'I' WHERE C1 = 'A' AND C2 = 'C';
+SELECT * FROM t1 ORDER BY C1,C2;
+C1 C2
+A B
+A I
+X Y
+X Z
+SELECT * FROM t1 ORDER BY C1,C2;
+C1 C2
+A B
+A I
+X Y
+X Z
+UPDATE t1 SET c2 = 'Q' WHERE c1 = 'A' AND c2 = 'N';
+SELECT * FROM t1 ORDER BY c1,c2;
+C1 C2
+A B
+A I
+X Y
+X Z
+SELECT * FROM t1 ORDER BY c1,c2;
+C1 C2
+A B
+A I
+X Y
+X Z
+CREATE TABLE t2 (c1 INT, c12 char(1), c2 INT, PRIMARY KEY (c1)) ENGINE = 'MYISAM' ;
+INSERT INTO t2
+VALUES (1,'A',2), (2,'A',4), (3,'A',9), (4,'A',15), (5,'A',25),
+(6,'A',35), (7,'A',50), (8,'A',64), (9,'A',81);
+SELECT * FROM t2 ORDER BY c1,c2;
+c1 c12 c2
+1 A 2
+2 A 4
+3 A 9
+4 A 15
+5 A 25
+6 A 35
+7 A 50
+8 A 64
+9 A 81
+SELECT * FROM t2 WHERE c2 = c1 * c1 ORDER BY c1,c2;
+c1 c12 c2
+2 A 4
+3 A 9
+5 A 25
+8 A 64
+9 A 81
+SELECT * FROM t2 ORDER BY c1,c2;
+c1 c12 c2
+1 A 2
+2 A 4
+3 A 9
+4 A 15
+5 A 25
+6 A 35
+7 A 50
+8 A 64
+9 A 81
+SELECT * FROM t2 WHERE c2 = c1 * c1 ORDER BY c1,c2;
+c1 c12 c2
+2 A 4
+3 A 9
+5 A 25
+8 A 64
+9 A 81
+UPDATE t2 SET c2 = c1*c1 WHERE c2 != c1*c1;
+SELECT * FROM t2 WHERE c2 = c1 * c1 ORDER BY c1,c2;
+c1 c12 c2
+1 A 1
+2 A 4
+3 A 9
+4 A 16
+5 A 25
+6 A 36
+7 A 49
+8 A 64
+9 A 81
+SELECT * FROM t2 WHERE c2 = c1 * c1 ORDER BY c1,c2;
+c1 c12 c2
+1 A 1
+2 A 4
+3 A 9
+4 A 16
+5 A 25
+6 A 36
+7 A 49
+8 A 64
+9 A 81
+UPDATE t2 SET c12 = 'Q' WHERE c1 = 1 AND c2 = 999;
+SELECT * FROM t2 ORDER BY c1,c2;
+c1 c12 c2
+1 A 1
+2 A 4
+3 A 9
+4 A 16
+5 A 25
+6 A 36
+7 A 49
+8 A 64
+9 A 81
+SELECT * FROM t2 ORDER BY c1,c2;
+c1 c12 c2
+1 A 1
+2 A 4
+3 A 9
+4 A 16
+5 A 25
+6 A 36
+7 A 49
+8 A 64
+9 A 81
+DELETE FROM t2 WHERE c1 % 4 = 0;
+SELECT * FROM t2 ORDER BY c1,c2;
+c1 c12 c2
+1 A 1
+2 A 4
+3 A 9
+5 A 25
+6 A 36
+7 A 49
+9 A 81
+SELECT * FROM t2 ORDER BY c1,c2;
+c1 c12 c2
+1 A 1
+2 A 4
+3 A 9
+5 A 25
+6 A 36
+7 A 49
+9 A 81
+UPDATE t2 SET c12='X';
+CREATE TABLE t3 (C1 CHAR(1), C2 CHAR(1), pk1 INT, C3 CHAR(1), pk2 INT, PRIMARY KEY (pk1,pk2)) ENGINE = 'MYISAM' ;
+INSERT INTO t3 VALUES ('A','B',1,'B',1), ('X','Y',2,'B',1), ('X','X',3,'B',1);
+INSERT INTO t3 VALUES ('A','C',1,'B',2), ('X','Z',2,'B',2), ('A','A',3,'B',2);
+SELECT * FROM t3 ORDER BY C1,C2;
+C1 C2 pk1 C3 pk2
+A A 3 B 2
+A B 1 B 1
+A C 1 B 2
+X X 3 B 1
+X Y 2 B 1
+X Z 2 B 2
+SELECT * FROM t3 ORDER BY C1,C2;
+C1 C2 pk1 C3 pk2
+A A 3 B 2
+A B 1 B 1
+A C 1 B 2
+X X 3 B 1
+X Y 2 B 1
+X Z 2 B 2
+DELETE FROM t3 WHERE C1 = C2;
+SELECT * FROM t3 ORDER BY C1,C2;
+C1 C2 pk1 C3 pk2
+A B 1 B 1
+A C 1 B 2
+X Y 2 B 1
+X Z 2 B 2
+SELECT * FROM t3 ORDER BY C1,C2;
+C1 C2 pk1 C3 pk2
+A B 1 B 1
+A C 1 B 2
+X Y 2 B 1
+X Z 2 B 2
+UPDATE t3 SET C2 = 'I' WHERE C1 = 'A' AND C2 = 'C';
+SELECT * FROM t3 ORDER BY C1,C2;
+C1 C2 pk1 C3 pk2
+A B 1 B 1
+A I 1 B 2
+X Y 2 B 1
+X Z 2 B 2
+SELECT * FROM t3 ORDER BY C1,C2;
+C1 C2 pk1 C3 pk2
+A B 1 B 1
+A I 1 B 2
+X Y 2 B 1
+X Z 2 B 2
+CREATE TABLE t6 (C1 CHAR(1), C2 CHAR(1), C3 INT) ENGINE = 'MYISAM' ;
+INSERT INTO t6 VALUES ('A','B',1), ('X','Y',2), ('X','X',3);
+INSERT INTO t6 VALUES ('A','C',4), ('X','Z',5), ('A','A',6);
+SELECT * FROM t6 ORDER BY C3;
+C1 C2 C3
+A B 1
+X Y 2
+X X 3
+A C 4
+X Z 5
+A A 6
+SELECT * FROM t6 ORDER BY C3;
+C1 C2 C3
+A B 1
+X Y 2
+X X 3
+A C 4
+X Z 5
+A A 6
+DELETE FROM t6 WHERE C1 = C2;
+SELECT * FROM t6 ORDER BY C3;
+C1 C2 C3
+A B 1
+X Y 2
+A C 4
+X Z 5
+SELECT * FROM t6 ORDER BY C3;
+C1 C2 C3
+A B 1
+X Y 2
+A C 4
+X Z 5
+UPDATE t6 SET C2 = 'I' WHERE C1 = 'A' AND C2 = 'C';
+SELECT * FROM t6 ORDER BY C3;
+C1 C2 C3
+A B 1
+X Y 2
+A I 4
+X Z 5
+SELECT * FROM t6 ORDER BY C3;
+C1 C2 C3
+A B 1
+X Y 2
+A I 4
+X Z 5
+CREATE TABLE t5 (C1 CHAR(1), C2 CHAR(1), C3 INT PRIMARY KEY) ENGINE = 'MYISAM' ;
+INSERT INTO t5 VALUES ('A','B',1), ('X','Y',2), ('X','X',3);
+INSERT INTO t5 VALUES ('A','C',4), ('X','Z',5), ('A','A',6);
+UPDATE t5,t2,t3 SET t5.C2='Q', t2.c12='R', t3.C3 ='S' WHERE t5.C1 = t2.c12 AND t5.C1 = t3.C1;
+SELECT * FROM t5,t2,t3 WHERE t5.C2='Q' AND t2.c12='R' AND t3.C3 ='S' ORDER BY t5.C3,t2.c1,t3.pk1,t3.pk2;
+C1 C2 C3 c1 c12 c2 C1 C2 pk1 C3 pk2
+X Q 2 1 R 1 X Y 2 S 1
+X Q 2 1 R 1 X Z 2 S 2
+X Q 2 2 R 4 X Y 2 S 1
+X Q 2 2 R 4 X Z 2 S 2
+X Q 2 3 R 9 X Y 2 S 1
+X Q 2 3 R 9 X Z 2 S 2
+X Q 2 5 R 25 X Y 2 S 1
+X Q 2 5 R 25 X Z 2 S 2
+X Q 2 6 R 36 X Y 2 S 1
+X Q 2 6 R 36 X Z 2 S 2
+X Q 2 7 R 49 X Y 2 S 1
+X Q 2 7 R 49 X Z 2 S 2
+X Q 2 9 R 81 X Y 2 S 1
+X Q 2 9 R 81 X Z 2 S 2
+X Q 3 1 R 1 X Y 2 S 1
+X Q 3 1 R 1 X Z 2 S 2
+X Q 3 2 R 4 X Y 2 S 1
+X Q 3 2 R 4 X Z 2 S 2
+X Q 3 3 R 9 X Y 2 S 1
+X Q 3 3 R 9 X Z 2 S 2
+X Q 3 5 R 25 X Y 2 S 1
+X Q 3 5 R 25 X Z 2 S 2
+X Q 3 6 R 36 X Y 2 S 1
+X Q 3 6 R 36 X Z 2 S 2
+X Q 3 7 R 49 X Y 2 S 1
+X Q 3 7 R 49 X Z 2 S 2
+X Q 3 9 R 81 X Y 2 S 1
+X Q 3 9 R 81 X Z 2 S 2
+X Q 5 1 R 1 X Y 2 S 1
+X Q 5 1 R 1 X Z 2 S 2
+X Q 5 2 R 4 X Y 2 S 1
+X Q 5 2 R 4 X Z 2 S 2
+X Q 5 3 R 9 X Y 2 S 1
+X Q 5 3 R 9 X Z 2 S 2
+X Q 5 5 R 25 X Y 2 S 1
+X Q 5 5 R 25 X Z 2 S 2
+X Q 5 6 R 36 X Y 2 S 1
+X Q 5 6 R 36 X Z 2 S 2
+X Q 5 7 R 49 X Y 2 S 1
+X Q 5 7 R 49 X Z 2 S 2
+X Q 5 9 R 81 X Y 2 S 1
+X Q 5 9 R 81 X Z 2 S 2
+SELECT * FROM t5,t2,t3 WHERE t5.C2='Q' AND t2.c12='R' AND t3.C3 ='S' ORDER BY t5.C3,t2.c1,t3.pk1,t3.pk2;
+C1 C2 C3 c1 c12 c2 C1 C2 pk1 C3 pk2
+X Q 2 1 R 1 X Y 2 S 1
+X Q 2 1 R 1 X Z 2 S 2
+X Q 2 2 R 4 X Y 2 S 1
+X Q 2 2 R 4 X Z 2 S 2
+X Q 2 3 R 9 X Y 2 S 1
+X Q 2 3 R 9 X Z 2 S 2
+X Q 2 5 R 25 X Y 2 S 1
+X Q 2 5 R 25 X Z 2 S 2
+X Q 2 6 R 36 X Y 2 S 1
+X Q 2 6 R 36 X Z 2 S 2
+X Q 2 7 R 49 X Y 2 S 1
+X Q 2 7 R 49 X Z 2 S 2
+X Q 2 9 R 81 X Y 2 S 1
+X Q 2 9 R 81 X Z 2 S 2
+X Q 3 1 R 1 X Y 2 S 1
+X Q 3 1 R 1 X Z 2 S 2
+X Q 3 2 R 4 X Y 2 S 1
+X Q 3 2 R 4 X Z 2 S 2
+X Q 3 3 R 9 X Y 2 S 1
+X Q 3 3 R 9 X Z 2 S 2
+X Q 3 5 R 25 X Y 2 S 1
+X Q 3 5 R 25 X Z 2 S 2
+X Q 3 6 R 36 X Y 2 S 1
+X Q 3 6 R 36 X Z 2 S 2
+X Q 3 7 R 49 X Y 2 S 1
+X Q 3 7 R 49 X Z 2 S 2
+X Q 3 9 R 81 X Y 2 S 1
+X Q 3 9 R 81 X Z 2 S 2
+X Q 5 1 R 1 X Y 2 S 1
+X Q 5 1 R 1 X Z 2 S 2
+X Q 5 2 R 4 X Y 2 S 1
+X Q 5 2 R 4 X Z 2 S 2
+X Q 5 3 R 9 X Y 2 S 1
+X Q 5 3 R 9 X Z 2 S 2
+X Q 5 5 R 25 X Y 2 S 1
+X Q 5 5 R 25 X Z 2 S 2
+X Q 5 6 R 36 X Y 2 S 1
+X Q 5 6 R 36 X Z 2 S 2
+X Q 5 7 R 49 X Y 2 S 1
+X Q 5 7 R 49 X Z 2 S 2
+X Q 5 9 R 81 X Y 2 S 1
+X Q 5 9 R 81 X Z 2 S 2
+CREATE TABLE t4 (C1 CHAR(1) PRIMARY KEY, B1 BIT(1), B2 BIT(1) NOT NULL DEFAULT 0, C2 CHAR(1) NOT NULL DEFAULT 'A') ENGINE = 'MYISAM' ;
+INSERT INTO t4 SET C1 = 1;
+SELECT C1,HEX(B1),HEX(B2) FROM t4 ORDER BY C1;
+C1 HEX(B1) HEX(B2)
+1 NULL 0
+SELECT C1,HEX(B1),HEX(B2) FROM t4 ORDER BY C1;
+C1 HEX(B1) HEX(B2)
+1 NULL 0
+CREATE TABLE t7 (C1 INT PRIMARY KEY, C2 INT) ENGINE = 'MYISAM' ;
+
+--- on slave: original values ---
+INSERT INTO t7 VALUES (1,3), (2,6), (3,9);
+SELECT * FROM t7 ORDER BY C1;
+C1 C2
+1 3
+2 6
+3 9
+
+--- on master: new values inserted ---
+INSERT INTO t7 VALUES (1,2), (2,4), (3,6);
+SELECT * FROM t7 ORDER BY C1;
+C1 C2
+1 2
+2 4
+3 6
+
+--- on slave: old values should be overwritten by replicated values ---
+SELECT * FROM t7 ORDER BY C1;
+C1 C2
+1 2
+2 4
+3 6
+
+--- on master ---
+DROP TABLE t7;
+CREATE TABLE t7 (a INT PRIMARY KEY, b INT UNIQUE, c INT UNIQUE) ENGINE = 'MYISAM' ;
+INSERT INTO t7 VALUES (99,99,99);
+INSERT INTO t7 VALUES (99,22,33);
+ERROR 23000: Duplicate entry '99' for key 1
+INSERT INTO t7 VALUES (11,99,33);
+ERROR 23000: Duplicate entry '99' for key 2
+INSERT INTO t7 VALUES (11,22,99);
+ERROR 23000: Duplicate entry '99' for key 3
+SELECT * FROM t7 ORDER BY a;
+a b c
+99 99 99
+
+--- on slave ---
+SELECT * FROM t7 ORDER BY a;
+a b c
+99 99 99
+INSERT INTO t7 VALUES (1,2,3), (2,4,6), (3,6,9);
+SELECT * FROM t7 ORDER BY a;
+a b c
+1 2 3
+2 4 6
+3 6 9
+99 99 99
+
+--- on master ---
+INSERT INTO t7 VALUES (2,4,8);
+
+--- on slave ---
+SELECT * FROM t7 ORDER BY a;
+a b c
+1 2 3
+2 4 8
+3 6 9
+99 99 99
+DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7;
diff --git a/mysql-test/r/rpl_row_basic_3innodb.result b/mysql-test/r/rpl_row_basic_3innodb.result
new file mode 100644
index 00000000000..ed9b231e1a1
--- /dev/null
+++ b/mysql-test/r/rpl_row_basic_3innodb.result
@@ -0,0 +1,426 @@
+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;
+CREATE TABLE t1 (C1 CHAR(1), C2 CHAR(1), INDEX (C1)) ENGINE = 'INNODB' ;
+SELECT * FROM t1;
+C1 C2
+SELECT * FROM t1;
+C1 C2
+INSERT INTO t1 VALUES ('A','B'), ('X','Y'), ('X','X');
+INSERT INTO t1 VALUES ('A','C'), ('X','Z'), ('A','A');
+SELECT * FROM t1 ORDER BY C1,C2;
+C1 C2
+A A
+A B
+A C
+X X
+X Y
+X Z
+SELECT * FROM t1 ORDER BY C1,C2;
+C1 C2
+A A
+A B
+A C
+X X
+X Y
+X Z
+DELETE FROM t1 WHERE C1 = C2;
+SELECT * FROM t1 ORDER BY C1,C2;
+C1 C2
+A B
+A C
+X Y
+X Z
+SELECT * FROM t1 ORDER BY C1,C2;
+C1 C2
+A B
+A C
+X Y
+X Z
+UPDATE t1 SET C2 = 'I' WHERE C1 = 'A' AND C2 = 'C';
+SELECT * FROM t1 ORDER BY C1,C2;
+C1 C2
+A B
+A I
+X Y
+X Z
+SELECT * FROM t1 ORDER BY C1,C2;
+C1 C2
+A B
+A I
+X Y
+X Z
+UPDATE t1 SET c2 = 'Q' WHERE c1 = 'A' AND c2 = 'N';
+SELECT * FROM t1 ORDER BY c1,c2;
+C1 C2
+A B
+A I
+X Y
+X Z
+SELECT * FROM t1 ORDER BY c1,c2;
+C1 C2
+A B
+A I
+X Y
+X Z
+CREATE TABLE t2 (c1 INT, c12 char(1), c2 INT, PRIMARY KEY (c1)) ENGINE = 'INNODB' ;
+INSERT INTO t2
+VALUES (1,'A',2), (2,'A',4), (3,'A',9), (4,'A',15), (5,'A',25),
+(6,'A',35), (7,'A',50), (8,'A',64), (9,'A',81);
+SELECT * FROM t2 ORDER BY c1,c2;
+c1 c12 c2
+1 A 2
+2 A 4
+3 A 9
+4 A 15
+5 A 25
+6 A 35
+7 A 50
+8 A 64
+9 A 81
+SELECT * FROM t2 WHERE c2 = c1 * c1 ORDER BY c1,c2;
+c1 c12 c2
+2 A 4
+3 A 9
+5 A 25
+8 A 64
+9 A 81
+SELECT * FROM t2 ORDER BY c1,c2;
+c1 c12 c2
+1 A 2
+2 A 4
+3 A 9
+4 A 15
+5 A 25
+6 A 35
+7 A 50
+8 A 64
+9 A 81
+SELECT * FROM t2 WHERE c2 = c1 * c1 ORDER BY c1,c2;
+c1 c12 c2
+2 A 4
+3 A 9
+5 A 25
+8 A 64
+9 A 81
+UPDATE t2 SET c2 = c1*c1 WHERE c2 != c1*c1;
+SELECT * FROM t2 WHERE c2 = c1 * c1 ORDER BY c1,c2;
+c1 c12 c2
+1 A 1
+2 A 4
+3 A 9
+4 A 16
+5 A 25
+6 A 36
+7 A 49
+8 A 64
+9 A 81
+SELECT * FROM t2 WHERE c2 = c1 * c1 ORDER BY c1,c2;
+c1 c12 c2
+1 A 1
+2 A 4
+3 A 9
+4 A 16
+5 A 25
+6 A 36
+7 A 49
+8 A 64
+9 A 81
+UPDATE t2 SET c12 = 'Q' WHERE c1 = 1 AND c2 = 999;
+SELECT * FROM t2 ORDER BY c1,c2;
+c1 c12 c2
+1 A 1
+2 A 4
+3 A 9
+4 A 16
+5 A 25
+6 A 36
+7 A 49
+8 A 64
+9 A 81
+SELECT * FROM t2 ORDER BY c1,c2;
+c1 c12 c2
+1 A 1
+2 A 4
+3 A 9
+4 A 16
+5 A 25
+6 A 36
+7 A 49
+8 A 64
+9 A 81
+DELETE FROM t2 WHERE c1 % 4 = 0;
+SELECT * FROM t2 ORDER BY c1,c2;
+c1 c12 c2
+1 A 1
+2 A 4
+3 A 9
+5 A 25
+6 A 36
+7 A 49
+9 A 81
+SELECT * FROM t2 ORDER BY c1,c2;
+c1 c12 c2
+1 A 1
+2 A 4
+3 A 9
+5 A 25
+6 A 36
+7 A 49
+9 A 81
+UPDATE t2 SET c12='X';
+CREATE TABLE t3 (C1 CHAR(1), C2 CHAR(1), pk1 INT, C3 CHAR(1), pk2 INT, PRIMARY KEY (pk1,pk2)) ENGINE = 'INNODB' ;
+INSERT INTO t3 VALUES ('A','B',1,'B',1), ('X','Y',2,'B',1), ('X','X',3,'B',1);
+INSERT INTO t3 VALUES ('A','C',1,'B',2), ('X','Z',2,'B',2), ('A','A',3,'B',2);
+SELECT * FROM t3 ORDER BY C1,C2;
+C1 C2 pk1 C3 pk2
+A A 3 B 2
+A B 1 B 1
+A C 1 B 2
+X X 3 B 1
+X Y 2 B 1
+X Z 2 B 2
+SELECT * FROM t3 ORDER BY C1,C2;
+C1 C2 pk1 C3 pk2
+A A 3 B 2
+A B 1 B 1
+A C 1 B 2
+X X 3 B 1
+X Y 2 B 1
+X Z 2 B 2
+DELETE FROM t3 WHERE C1 = C2;
+SELECT * FROM t3 ORDER BY C1,C2;
+C1 C2 pk1 C3 pk2
+A B 1 B 1
+A C 1 B 2
+X Y 2 B 1
+X Z 2 B 2
+SELECT * FROM t3 ORDER BY C1,C2;
+C1 C2 pk1 C3 pk2
+A B 1 B 1
+A C 1 B 2
+X Y 2 B 1
+X Z 2 B 2
+UPDATE t3 SET C2 = 'I' WHERE C1 = 'A' AND C2 = 'C';
+SELECT * FROM t3 ORDER BY C1,C2;
+C1 C2 pk1 C3 pk2
+A B 1 B 1
+A I 1 B 2
+X Y 2 B 1
+X Z 2 B 2
+SELECT * FROM t3 ORDER BY C1,C2;
+C1 C2 pk1 C3 pk2
+A B 1 B 1
+A I 1 B 2
+X Y 2 B 1
+X Z 2 B 2
+CREATE TABLE t6 (C1 CHAR(1), C2 CHAR(1), C3 INT) ENGINE = 'INNODB' ;
+INSERT INTO t6 VALUES ('A','B',1), ('X','Y',2), ('X','X',3);
+INSERT INTO t6 VALUES ('A','C',4), ('X','Z',5), ('A','A',6);
+SELECT * FROM t6 ORDER BY C3;
+C1 C2 C3
+A B 1
+X Y 2
+X X 3
+A C 4
+X Z 5
+A A 6
+SELECT * FROM t6 ORDER BY C3;
+C1 C2 C3
+A B 1
+X Y 2
+X X 3
+A C 4
+X Z 5
+A A 6
+DELETE FROM t6 WHERE C1 = C2;
+SELECT * FROM t6 ORDER BY C3;
+C1 C2 C3
+A B 1
+X Y 2
+A C 4
+X Z 5
+SELECT * FROM t6 ORDER BY C3;
+C1 C2 C3
+A B 1
+X Y 2
+A C 4
+X Z 5
+UPDATE t6 SET C2 = 'I' WHERE C1 = 'A' AND C2 = 'C';
+SELECT * FROM t6 ORDER BY C3;
+C1 C2 C3
+A B 1
+X Y 2
+A I 4
+X Z 5
+SELECT * FROM t6 ORDER BY C3;
+C1 C2 C3
+A B 1
+X Y 2
+A I 4
+X Z 5
+CREATE TABLE t5 (C1 CHAR(1), C2 CHAR(1), C3 INT PRIMARY KEY) ENGINE = 'INNODB' ;
+INSERT INTO t5 VALUES ('A','B',1), ('X','Y',2), ('X','X',3);
+INSERT INTO t5 VALUES ('A','C',4), ('X','Z',5), ('A','A',6);
+UPDATE t5,t2,t3 SET t5.C2='Q', t2.c12='R', t3.C3 ='S' WHERE t5.C1 = t2.c12 AND t5.C1 = t3.C1;
+SELECT * FROM t5,t2,t3 WHERE t5.C2='Q' AND t2.c12='R' AND t3.C3 ='S' ORDER BY t5.C3,t2.c1,t3.pk1,t3.pk2;
+C1 C2 C3 c1 c12 c2 C1 C2 pk1 C3 pk2
+X Q 2 1 R 1 X Y 2 S 1
+X Q 2 1 R 1 X Z 2 S 2
+X Q 2 2 R 4 X Y 2 S 1
+X Q 2 2 R 4 X Z 2 S 2
+X Q 2 3 R 9 X Y 2 S 1
+X Q 2 3 R 9 X Z 2 S 2
+X Q 2 5 R 25 X Y 2 S 1
+X Q 2 5 R 25 X Z 2 S 2
+X Q 2 6 R 36 X Y 2 S 1
+X Q 2 6 R 36 X Z 2 S 2
+X Q 2 7 R 49 X Y 2 S 1
+X Q 2 7 R 49 X Z 2 S 2
+X Q 2 9 R 81 X Y 2 S 1
+X Q 2 9 R 81 X Z 2 S 2
+X Q 3 1 R 1 X Y 2 S 1
+X Q 3 1 R 1 X Z 2 S 2
+X Q 3 2 R 4 X Y 2 S 1
+X Q 3 2 R 4 X Z 2 S 2
+X Q 3 3 R 9 X Y 2 S 1
+X Q 3 3 R 9 X Z 2 S 2
+X Q 3 5 R 25 X Y 2 S 1
+X Q 3 5 R 25 X Z 2 S 2
+X Q 3 6 R 36 X Y 2 S 1
+X Q 3 6 R 36 X Z 2 S 2
+X Q 3 7 R 49 X Y 2 S 1
+X Q 3 7 R 49 X Z 2 S 2
+X Q 3 9 R 81 X Y 2 S 1
+X Q 3 9 R 81 X Z 2 S 2
+X Q 5 1 R 1 X Y 2 S 1
+X Q 5 1 R 1 X Z 2 S 2
+X Q 5 2 R 4 X Y 2 S 1
+X Q 5 2 R 4 X Z 2 S 2
+X Q 5 3 R 9 X Y 2 S 1
+X Q 5 3 R 9 X Z 2 S 2
+X Q 5 5 R 25 X Y 2 S 1
+X Q 5 5 R 25 X Z 2 S 2
+X Q 5 6 R 36 X Y 2 S 1
+X Q 5 6 R 36 X Z 2 S 2
+X Q 5 7 R 49 X Y 2 S 1
+X Q 5 7 R 49 X Z 2 S 2
+X Q 5 9 R 81 X Y 2 S 1
+X Q 5 9 R 81 X Z 2 S 2
+SELECT * FROM t5,t2,t3 WHERE t5.C2='Q' AND t2.c12='R' AND t3.C3 ='S' ORDER BY t5.C3,t2.c1,t3.pk1,t3.pk2;
+C1 C2 C3 c1 c12 c2 C1 C2 pk1 C3 pk2
+X Q 2 1 R 1 X Y 2 S 1
+X Q 2 1 R 1 X Z 2 S 2
+X Q 2 2 R 4 X Y 2 S 1
+X Q 2 2 R 4 X Z 2 S 2
+X Q 2 3 R 9 X Y 2 S 1
+X Q 2 3 R 9 X Z 2 S 2
+X Q 2 5 R 25 X Y 2 S 1
+X Q 2 5 R 25 X Z 2 S 2
+X Q 2 6 R 36 X Y 2 S 1
+X Q 2 6 R 36 X Z 2 S 2
+X Q 2 7 R 49 X Y 2 S 1
+X Q 2 7 R 49 X Z 2 S 2
+X Q 2 9 R 81 X Y 2 S 1
+X Q 2 9 R 81 X Z 2 S 2
+X Q 3 1 R 1 X Y 2 S 1
+X Q 3 1 R 1 X Z 2 S 2
+X Q 3 2 R 4 X Y 2 S 1
+X Q 3 2 R 4 X Z 2 S 2
+X Q 3 3 R 9 X Y 2 S 1
+X Q 3 3 R 9 X Z 2 S 2
+X Q 3 5 R 25 X Y 2 S 1
+X Q 3 5 R 25 X Z 2 S 2
+X Q 3 6 R 36 X Y 2 S 1
+X Q 3 6 R 36 X Z 2 S 2
+X Q 3 7 R 49 X Y 2 S 1
+X Q 3 7 R 49 X Z 2 S 2
+X Q 3 9 R 81 X Y 2 S 1
+X Q 3 9 R 81 X Z 2 S 2
+X Q 5 1 R 1 X Y 2 S 1
+X Q 5 1 R 1 X Z 2 S 2
+X Q 5 2 R 4 X Y 2 S 1
+X Q 5 2 R 4 X Z 2 S 2
+X Q 5 3 R 9 X Y 2 S 1
+X Q 5 3 R 9 X Z 2 S 2
+X Q 5 5 R 25 X Y 2 S 1
+X Q 5 5 R 25 X Z 2 S 2
+X Q 5 6 R 36 X Y 2 S 1
+X Q 5 6 R 36 X Z 2 S 2
+X Q 5 7 R 49 X Y 2 S 1
+X Q 5 7 R 49 X Z 2 S 2
+X Q 5 9 R 81 X Y 2 S 1
+X Q 5 9 R 81 X Z 2 S 2
+CREATE TABLE t4 (C1 CHAR(1) PRIMARY KEY, B1 BIT(1), B2 BIT(1) NOT NULL DEFAULT 0, C2 CHAR(1) NOT NULL DEFAULT 'A') ENGINE = 'INNODB' ;
+INSERT INTO t4 SET C1 = 1;
+SELECT C1,HEX(B1),HEX(B2) FROM t4 ORDER BY C1;
+C1 HEX(B1) HEX(B2)
+1 NULL 0
+SELECT C1,HEX(B1),HEX(B2) FROM t4 ORDER BY C1;
+C1 HEX(B1) HEX(B2)
+1 NULL 0
+CREATE TABLE t7 (C1 INT PRIMARY KEY, C2 INT) ENGINE = 'INNODB' ;
+
+--- on slave: original values ---
+INSERT INTO t7 VALUES (1,3), (2,6), (3,9);
+SELECT * FROM t7 ORDER BY C1;
+C1 C2
+1 3
+2 6
+3 9
+
+--- on master: new values inserted ---
+INSERT INTO t7 VALUES (1,2), (2,4), (3,6);
+SELECT * FROM t7 ORDER BY C1;
+C1 C2
+1 2
+2 4
+3 6
+
+--- on slave: old values should be overwritten by replicated values ---
+SELECT * FROM t7 ORDER BY C1;
+C1 C2
+1 2
+2 4
+3 6
+
+--- on master ---
+DROP TABLE t7;
+CREATE TABLE t7 (a INT PRIMARY KEY, b INT UNIQUE, c INT UNIQUE) ENGINE = 'INNODB' ;
+INSERT INTO t7 VALUES (99,99,99);
+INSERT INTO t7 VALUES (99,22,33);
+ERROR 23000: Duplicate entry '99' for key 1
+INSERT INTO t7 VALUES (11,99,33);
+ERROR 23000: Duplicate entry '99' for key 2
+INSERT INTO t7 VALUES (11,22,99);
+ERROR 23000: Duplicate entry '99' for key 3
+SELECT * FROM t7 ORDER BY a;
+a b c
+99 99 99
+
+--- on slave ---
+SELECT * FROM t7 ORDER BY a;
+a b c
+99 99 99
+INSERT INTO t7 VALUES (1,2,3), (2,4,6), (3,6,9);
+SELECT * FROM t7 ORDER BY a;
+a b c
+1 2 3
+2 4 6
+3 6 9
+99 99 99
+
+--- on master ---
+INSERT INTO t7 VALUES (2,4,8);
+
+--- on slave ---
+SELECT * FROM t7 ORDER BY a;
+a b c
+1 2 3
+2 4 8
+3 6 9
+99 99 99
+DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7;
diff --git a/mysql-test/r/rpl_row_charset.result b/mysql-test/r/rpl_row_charset.result
new file mode 100644
index 00000000000..3b065a06826
--- /dev/null
+++ b/mysql-test/r/rpl_row_charset.result
@@ -0,0 +1,201 @@
+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;
+set timestamp=1000000000;
+drop database if exists mysqltest2;
+drop database if exists mysqltest3;
+create database mysqltest2 character set latin2;
+set @@character_set_server=latin5;
+create database mysqltest3;
+
+--- --master--
+show create database mysqltest2;
+Database Create Database
+mysqltest2 CREATE DATABASE `mysqltest2` /*!40100 DEFAULT CHARACTER SET latin2 */
+show create database mysqltest3;
+Database Create Database
+mysqltest3 CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET latin5 */
+
+--- --slave--
+show create database mysqltest2;
+Database Create Database
+mysqltest2 CREATE DATABASE `mysqltest2` /*!40100 DEFAULT CHARACTER SET latin2 */
+show create database mysqltest3;
+Database Create Database
+mysqltest3 CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET latin5 */
+set @@collation_server=armscii8_bin;
+drop database mysqltest3;
+create database mysqltest3;
+
+--- --master--
+show create database mysqltest3;
+Database Create Database
+mysqltest3 CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET armscii8 COLLATE armscii8_bin */
+
+--- --slave--
+show create database mysqltest3;
+Database Create Database
+mysqltest3 CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET armscii8 COLLATE armscii8_bin */
+use mysqltest2;
+create table t1 (a int auto_increment primary key, b varchar(100));
+set character_set_client=cp850, collation_connection=latin2_croatian_ci;
+insert into t1 (b) values(@@character_set_server);
+insert into t1 (b) values(@@collation_server);
+insert into t1 (b) values(@@character_set_client);
+insert into t1 (b) values(@@character_set_connection);
+insert into t1 (b) values(@@collation_connection);
+
+--- --master--
+select * from t1 order by a;
+a b
+1 armscii8
+2 armscii8_bin
+3 cp850
+4 latin2
+5 latin2_croatian_ci
+
+--- --slave--
+select * from mysqltest2.t1 order by a;
+a b
+1 armscii8
+2 armscii8_bin
+3 cp850
+4 latin2
+5 latin2_croatian_ci
+select "--- --muller--" as "";
+
+--- --muller--
+set character_set_client=latin1, collation_connection=latin1_german1_ci;
+truncate table t1;
+insert into t1 (b) values(@@collation_connection);
+insert into t1 (b) values(LEAST("Müller","Muffler"));
+set collation_connection=latin1_german2_ci;
+insert into t1 (b) values(@@collation_connection);
+insert into t1 (b) values(LEAST("Müller","Muffler"));
+
+--- --master--
+select * from t1 order by a;
+a b
+1 latin1_german1_ci
+2 Muffler
+3 latin1_german2_ci
+4 Müller
+
+--- --slave--
+select * from mysqltest2.t1 order by a;
+a b
+1 latin1_german1_ci
+2 Muffler
+3 latin1_german2_ci
+4 Müller
+select "--- --INSERT--" as "";
+
+--- --INSERT--
+set @a= _cp850 'Müller' collate cp850_general_ci;
+truncate table t1;
+insert into t1 (b) values(collation(@a));
+
+--- --master--
+select * from t1 order by a;
+a b
+1 cp850_general_ci
+
+--- --slave--
+select * from mysqltest2.t1 order by a;
+a b
+1 cp850_general_ci
+drop database mysqltest2;
+drop database mysqltest3;
+show binlog events from 102;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query 1 # drop database if exists mysqltest2
+master-bin.000001 # Query 1 # drop database if exists mysqltest3
+master-bin.000001 # Query 1 # create database mysqltest2 character set latin2
+master-bin.000001 # Query 1 # create database mysqltest3
+master-bin.000001 # Query 1 # drop database mysqltest3
+master-bin.000001 # Query 1 # create database mysqltest3
+master-bin.000001 # Query 1 # use `mysqltest2`; create table t1 (a int auto_increment primary key, b varchar(100))
+master-bin.000001 # Table_map 1 # mysqltest2.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # mysqltest2.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # mysqltest2.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # mysqltest2.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # mysqltest2.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Query 1 # use `mysqltest2`; truncate table t1
+master-bin.000001 # Table_map 1 # mysqltest2.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # mysqltest2.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # mysqltest2.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # mysqltest2.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Query 1 # use `mysqltest2`; truncate table t1
+master-bin.000001 # Table_map 1 # mysqltest2.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Query 1 # drop database mysqltest2
+master-bin.000001 # Query 1 # drop database mysqltest3
+select "--- --global--" as "";
+
+--- --global--
+set global character_set_server=latin2;
+set global character_set_server=latin1;
+set global character_set_server=latin2;
+set global character_set_server=latin1;
+select "--- --oneshot--" as "";
+
+--- --oneshot--
+set one_shot @@character_set_server=latin5;
+set @@max_join_size=1000;
+select @@character_set_server;
+@@character_set_server
+latin5
+select @@character_set_server;
+@@character_set_server
+latin1
+set @@character_set_server=latin5;
+select @@character_set_server;
+@@character_set_server
+latin5
+select @@character_set_server;
+@@character_set_server
+latin5
+set one_shot max_join_size=10;
+ERROR HY000: The 'SET ONE_SHOT' syntax is reserved for purposes internal to the MySQL server
+set character_set_client=9999999;
+ERROR 42000: Unknown character set: '9999999'
+set collation_server=9999998;
+ERROR HY000: Unknown collation: '9999998'
+select "--- --3943--" as "";
+
+--- --3943--
+use test;
+CREATE TABLE t1 (c1 VARBINARY(255), c2 VARBINARY(255));
+SET CHARACTER_SET_CLIENT=koi8r,
+CHARACTER_SET_CONNECTION=cp1251,
+CHARACTER_SET_RESULTS=koi8r;
+INSERT INTO t1 (c1, c2) VALUES ('îÕ, ÚÁ ÒÙÂÁÌËÕ','îÕ, ÚÁ ÒÙÂÁÌËÕ');
+select hex(c1), hex(c2) from t1;
+hex(c1) hex(c2)
+CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3
+select hex(c1), hex(c2) from t1;
+hex(c1) hex(c2)
+CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3
+drop table t1;
+select "--- --6676--" as "";
+
+--- --6676--
+create table `t1` (
+`pk` varchar(10) not null default '',
+primary key (`pk`)
+) engine=myisam default charset=latin1;
+set @p=_latin1 'test';
+update t1 set pk='test' where pk=@p;
+drop table t1;
diff --git a/mysql-test/r/rpl_row_create_table.result b/mysql-test/r/rpl_row_create_table.result
new file mode 100644
index 00000000000..9182a1d6d89
--- /dev/null
+++ b/mysql-test/r/rpl_row_create_table.result
@@ -0,0 +1,213 @@
+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;
+CREATE TABLE t1 (a INT, b INT);
+CREATE TABLE t2 (a INT, b INT) ENGINE=Merge;
+CREATE TABLE t3 (a INT, b INT) CHARSET=utf8;
+CREATE TABLE t4 (a INT, b INT) ENGINE=Merge CHARSET=utf8;
+SHOW BINLOG EVENTS FROM 212;
+Log_name #
+Pos 212
+Event_type Query
+Server_id #
+End_log_pos #
+Info use `test`; CREATE TABLE t1 (a INT, b INT)
+Log_name #
+Pos 305
+Event_type Query
+Server_id #
+End_log_pos #
+Info use `test`; CREATE TABLE t2 (a INT, b INT) ENGINE=Merge
+Log_name #
+Pos 411
+Event_type Query
+Server_id #
+End_log_pos #
+Info use `test`; CREATE TABLE t3 (a INT, b INT) CHARSET=utf8
+Log_name #
+Pos 517
+Event_type Query
+Server_id #
+End_log_pos #
+Info use `test`; CREATE TABLE t4 (a INT, b INT) ENGINE=Merge CHARSET=utf8
+**** On Master ****
+SHOW CREATE TABLE t1;
+Table t1
+Create Table CREATE TABLE `t1` (
+ `a` int(11) default NULL,
+ `b` int(11) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SHOW CREATE TABLE t2;
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` int(11) default NULL,
+ `b` int(11) default NULL
+) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 UNION=()
+SHOW CREATE TABLE t3;
+Table t3
+Create Table CREATE TABLE `t3` (
+ `a` int(11) default NULL,
+ `b` int(11) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=utf8
+**** On Slave ****
+SHOW CREATE TABLE t1;
+Table t1
+Create Table CREATE TABLE `t1` (
+ `a` int(11) default NULL,
+ `b` int(11) default NULL
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+SHOW CREATE TABLE t2;
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` int(11) default NULL,
+ `b` int(11) default NULL
+) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 UNION=()
+SHOW CREATE TABLE t3;
+Table t3
+Create Table CREATE TABLE `t3` (
+ `a` int(11) default NULL,
+ `b` int(11) default NULL
+) ENGINE=MEMORY DEFAULT CHARSET=utf8
+CREATE TABLE t5 (b INT, c INT) SELECT * FROM t3;
+CREATE TEMPORARY TABLE tt3 (a INT, b INT);
+INSERT INTO tt3 VALUES (1,2), (2,4), (3,6), (4,2), (5,10), (6,12);
+CREATE TABLE t6 (b INT, c INT) SELECT * FROM tt3;
+**** On Master ****
+SHOW CREATE TABLE t5;
+Table t5
+Create Table CREATE TABLE `t5` (
+ `c` int(11) default NULL,
+ `a` int(11) default NULL,
+ `b` int(11) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT * FROM t5 ORDER BY a,b,c;
+c a b
+SHOW CREATE TABLE t6;
+Table t6
+Create Table CREATE TABLE `t6` (
+ `c` int(11) default NULL,
+ `a` int(11) default NULL,
+ `b` int(11) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT * FROM t6 ORDER BY a,b,c;
+c a b
+NULL 1 2
+NULL 2 4
+NULL 3 6
+NULL 4 2
+NULL 5 10
+NULL 6 12
+**** On Slave ****
+SHOW CREATE TABLE t5;
+Table t5
+Create Table CREATE TABLE `t5` (
+ `c` int(11) default NULL,
+ `a` int(11) default NULL,
+ `b` int(11) default NULL
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+SELECT * FROM t5 ORDER BY a,b,c;
+c a b
+SHOW CREATE TABLE t6;
+Table t6
+Create Table CREATE TABLE `t6` (
+ `c` int(11) default NULL,
+ `a` int(11) default NULL,
+ `b` int(11) default NULL
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+SELECT * FROM t6 ORDER BY a,b,c;
+c a b
+NULL 1 2
+NULL 2 4
+NULL 3 6
+NULL 4 2
+NULL 5 10
+NULL 6 12
+CREATE TABLE t7 (UNIQUE(b)) SELECT a,b FROM tt3;
+ERROR 23000: Duplicate entry '2' for key 1
+SHOW BINLOG EVENTS FROM 1256;
+Log_name Pos Event_type Server_id End_log_pos Info
+CREATE TABLE t7 (a INT, b INT UNIQUE);
+INSERT INTO t7 SELECT a,b FROM tt3;
+ERROR 23000: Duplicate entry '2' for key 1
+SELECT * FROM t7 ORDER BY a,b;
+a b
+1 2
+2 4
+3 6
+SHOW BINLOG EVENTS FROM 1256;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 1256 Query 1 1356 use `test`; CREATE TABLE t7 (a INT, b INT UNIQUE)
+master-bin.000001 1356 Table_map 1 1396 test.t7
+master-bin.000001 1396 Write_rows 1 1452
+SELECT * FROM t7 ORDER BY a,b;
+a b
+1 2
+2 4
+3 6
+CREATE TEMPORARY TABLE tt4 (a INT, b INT);
+INSERT INTO tt4 VALUES (4,8), (5,10), (6,12);
+BEGIN;
+INSERT INTO t7 SELECT a,b FROM tt4;
+ROLLBACK;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+SHOW BINLOG EVENTS FROM 1452;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 1452 Table_map 1 1492 test.t7
+master-bin.000001 1492 Write_rows 1 1548
+SELECT * FROM t7 ORDER BY a,b;
+a b
+1 2
+2 4
+3 6
+4 8
+5 10
+6 12
+SELECT * FROM t7 ORDER BY a,b;
+a b
+1 2
+2 4
+3 6
+4 8
+5 10
+6 12
+CREATE TABLE t8 LIKE t4;
+CREATE TABLE t9 LIKE tt4;
+CREATE TEMPORARY TABLE tt5 LIKE t4;
+CREATE TEMPORARY TABLE tt6 LIKE tt4;
+**** On Master ****
+SHOW CREATE TABLE t8;
+Table t8
+Create Table CREATE TABLE `t8` (
+ `a` int(11) default NULL,
+ `b` int(11) default NULL
+) ENGINE=MRG_MyISAM DEFAULT CHARSET=utf8 UNION=()
+SHOW CREATE TABLE t9;
+Table t9
+Create Table CREATE TABLE `t9` (
+ `a` int(11) default NULL,
+ `b` int(11) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SHOW BINLOG EVENTS FROM 1548;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 1548 Query 1 1634 use `test`; CREATE TABLE t8 LIKE t4
+master-bin.000001 1634 Query 1 1773 use `test`; CREATE TABLE `t9` (
+ `a` int(11) default NULL,
+ `b` int(11) default NULL
+)
+**** On Slave ****
+SHOW CREATE TABLE t8;
+Table t8
+Create Table CREATE TABLE `t8` (
+ `a` int(11) default NULL,
+ `b` int(11) default NULL
+) ENGINE=MRG_MyISAM DEFAULT CHARSET=utf8 UNION=()
+SHOW CREATE TABLE t9;
+Table t9
+Create Table CREATE TABLE `t9` (
+ `a` int(11) default NULL,
+ `b` int(11) default NULL
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
diff --git a/mysql-test/r/rpl_row_ddl.result b/mysql-test/r/rpl_row_ddl.result
new file mode 100644
index 00000000000..c77f4e2b38f
--- /dev/null
+++ b/mysql-test/r/rpl_row_ddl.result
@@ -0,0 +1,1693 @@
+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;
+SET AUTOCOMMIT = 1;
+DROP DATABASE IF EXISTS mysqltest1;
+DROP DATABASE IF EXISTS mysqltest2;
+DROP DATABASE IF EXISTS mysqltest3;
+CREATE DATABASE mysqltest1;
+CREATE DATABASE mysqltest2;
+CREATE TABLE mysqltest1.t1 (f1 BIGINT) ENGINE="InnoDB";
+INSERT INTO mysqltest1.t1 SET f1= 0;
+CREATE TABLE mysqltest1.t2 (f1 BIGINT) ENGINE="InnoDB";
+CREATE TABLE mysqltest1.t3 (f1 BIGINT) ENGINE="InnoDB";
+CREATE TABLE mysqltest1.t4 (f1 BIGINT) ENGINE="InnoDB";
+CREATE TABLE mysqltest1.t5 (f1 BIGINT) ENGINE="InnoDB";
+CREATE TABLE mysqltest1.t6 (f1 BIGINT) ENGINE="InnoDB";
+CREATE INDEX my_idx6 ON mysqltest1.t6(f1);
+CREATE TABLE mysqltest1.t7 (f1 BIGINT) ENGINE="InnoDB";
+INSERT INTO mysqltest1.t7 SET f1= 0;
+CREATE TABLE mysqltest1.t8 (f1 BIGINT) ENGINE="InnoDB";
+CREATE TABLE mysqltest1.t9 (f1 BIGINT) ENGINE="InnoDB";
+CREATE TABLE mysqltest1.t10 (f1 BIGINT) ENGINE="InnoDB";
+CREATE TABLE mysqltest1.t11 (f1 BIGINT) ENGINE="InnoDB";
+CREATE TABLE mysqltest1.t12 (f1 BIGINT) ENGINE="InnoDB";
+CREATE TABLE mysqltest1.t13 (f1 BIGINT) ENGINE="InnoDB";
+CREATE TABLE mysqltest1.t14 (f1 BIGINT) ENGINE="InnoDB";
+CREATE TABLE mysqltest1.t15 (f1 BIGINT) ENGINE="InnoDB";
+CREATE TABLE mysqltest1.t16 (f1 BIGINT) ENGINE="InnoDB";
+CREATE TABLE mysqltest1.t17 (f1 BIGINT) ENGINE="InnoDB";
+CREATE TABLE mysqltest1.t18 (f1 BIGINT) ENGINE="InnoDB";
+CREATE TABLE mysqltest1.t19 (f1 BIGINT) ENGINE="InnoDB";
+CREATE TEMPORARY TABLE mysqltest1.t23 (f1 BIGINT);
+SET AUTOCOMMIT = 0;
+use mysqltest1;
+
+-------- switch to slave --------
+SET AUTOCOMMIT = 0;
+use mysqltest1;
+
+-------- switch to master -------
+
+######## COMMIT ########
+
+-------- switch to master -------
+INSERT INTO t1 SET f1= 0 + 1;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+1
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+0
+
+-------- switch to master -------
+COMMIT;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+1
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+1
+
+-------- switch to master -------
+ROLLBACK;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+1
+
+TEST-INFO: MASTER: The INSERT is committed (Succeeded)
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+1
+
+TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
+
+-------- switch to master -------
+flush logs;
+
+-------- switch to slave --------
+flush logs;
+
+-------- switch to master -------
+
+######## ROLLBACK ########
+
+-------- switch to master -------
+INSERT INTO t1 SET f1= 1 + 1;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+2
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+1
+
+-------- switch to master -------
+ROLLBACK;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+1
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+1
+
+-------- switch to master -------
+ROLLBACK;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+1
+
+TEST-INFO: MASTER: The INSERT is not committed (Succeeded)
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+1
+
+TEST-INFO: SLAVE: The INSERT is not committed (Succeeded)
+
+-------- switch to master -------
+flush logs;
+
+-------- switch to slave --------
+flush logs;
+
+-------- switch to master -------
+
+######## SET AUTOCOMMIT=1 ########
+
+-------- switch to master -------
+INSERT INTO t1 SET f1= 1 + 1;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+2
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+1
+
+-------- switch to master -------
+SET AUTOCOMMIT=1;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+2
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+2
+
+-------- switch to master -------
+ROLLBACK;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+2
+
+TEST-INFO: MASTER: The INSERT is committed (Succeeded)
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+2
+
+TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
+
+-------- switch to master -------
+flush logs;
+
+-------- switch to slave --------
+flush logs;
+
+-------- switch to master -------
+SET AUTOCOMMIT=0;
+
+######## START TRANSACTION ########
+
+-------- switch to master -------
+INSERT INTO t1 SET f1= 2 + 1;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+3
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+2
+
+-------- switch to master -------
+START TRANSACTION;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+3
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+3
+
+-------- switch to master -------
+ROLLBACK;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+3
+
+TEST-INFO: MASTER: The INSERT is committed (Succeeded)
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+3
+
+TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
+
+-------- switch to master -------
+flush logs;
+
+-------- switch to slave --------
+flush logs;
+
+-------- switch to master -------
+
+######## BEGIN ########
+
+-------- switch to master -------
+INSERT INTO t1 SET f1= 3 + 1;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+4
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+3
+
+-------- switch to master -------
+BEGIN;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+4
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+4
+
+-------- switch to master -------
+ROLLBACK;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+4
+
+TEST-INFO: MASTER: The INSERT is committed (Succeeded)
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+4
+
+TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
+
+-------- switch to master -------
+flush logs;
+
+-------- switch to slave --------
+flush logs;
+
+-------- switch to master -------
+
+######## DROP TABLE mysqltest1.t2 ########
+
+-------- switch to master -------
+INSERT INTO t1 SET f1= 4 + 1;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+5
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+4
+
+-------- switch to master -------
+DROP TABLE mysqltest1.t2;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+5
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+5
+
+-------- switch to master -------
+ROLLBACK;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+5
+
+TEST-INFO: MASTER: The INSERT is committed (Succeeded)
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+5
+
+TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
+
+-------- switch to master -------
+flush logs;
+
+-------- switch to slave --------
+flush logs;
+
+-------- switch to master -------
+SHOW TABLES LIKE 't2';
+Tables_in_mysqltest1 (t2)
+
+-------- switch to slave --------
+SHOW TABLES LIKE 't2';
+Tables_in_mysqltest1 (t2)
+
+-------- switch to master -------
+
+######## DROP TEMPORARY TABLE mysqltest1.t23 ########
+
+-------- switch to master -------
+INSERT INTO t1 SET f1= 5 + 1;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+6
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+5
+
+-------- switch to master -------
+DROP TEMPORARY TABLE mysqltest1.t23;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+6
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+5
+
+-------- switch to master -------
+ROLLBACK;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+5
+
+TEST-INFO: MASTER: The INSERT is not committed (Succeeded)
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+6
+
+TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
+
+-------- switch to master -------
+flush logs;
+
+-------- switch to slave --------
+flush logs;
+
+-------- switch to master -------
+SHOW TABLES LIKE 't23';
+Tables_in_mysqltest1 (t23)
+
+-------- switch to slave --------
+SHOW TABLES LIKE 't23';
+Tables_in_mysqltest1 (t23)
+
+-------- switch to master -------
+
+######## RENAME TABLE mysqltest1.t3 to mysqltest1.t20 ########
+
+-------- switch to master -------
+INSERT INTO t1 SET f1= 5 + 1;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+6
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+6
+
+-------- switch to master -------
+RENAME TABLE mysqltest1.t3 to mysqltest1.t20;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+6
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+6
+
+-------- switch to master -------
+ROLLBACK;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+6
+
+TEST-INFO: MASTER: The INSERT is committed (Succeeded)
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+6
+
+TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
+
+-------- switch to master -------
+flush logs;
+
+-------- switch to slave --------
+flush logs;
+
+-------- switch to master -------
+SHOW TABLES LIKE 't20';
+Tables_in_mysqltest1 (t20)
+t20
+
+-------- switch to slave --------
+SHOW TABLES LIKE 't20';
+Tables_in_mysqltest1 (t20)
+t20
+
+-------- switch to master -------
+
+######## ALTER TABLE mysqltest1.t4 ADD column f2 BIGINT ########
+
+-------- switch to master -------
+INSERT INTO t1 SET f1= 6 + 1;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+7
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+6
+
+-------- switch to master -------
+ALTER TABLE mysqltest1.t4 ADD column f2 BIGINT;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+7
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+7
+
+-------- switch to master -------
+ROLLBACK;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+7
+
+TEST-INFO: MASTER: The INSERT is committed (Succeeded)
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+7
+
+TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
+
+-------- switch to master -------
+flush logs;
+
+-------- switch to slave --------
+flush logs;
+
+-------- switch to master -------
+describe mysqltest1.t4;
+Field Type Null Key Default Extra
+f1 bigint(20) YES NULL
+f2 bigint(20) YES NULL
+
+-------- switch to slave --------
+describe mysqltest1.t4;
+Field Type Null Key Default Extra
+f1 bigint(20) YES NULL
+f2 bigint(20) YES NULL
+
+-------- switch to master -------
+
+######## CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE= "InnoDB" ########
+
+-------- switch to master -------
+INSERT INTO t1 SET f1= 7 + 1;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+8
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+7
+
+-------- switch to master -------
+CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE= "InnoDB";
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+8
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+8
+
+-------- switch to master -------
+ROLLBACK;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+8
+
+TEST-INFO: MASTER: The INSERT is committed (Succeeded)
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+8
+
+TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
+
+-------- switch to master -------
+flush logs;
+
+-------- switch to slave --------
+flush logs;
+
+-------- switch to master -------
+
+######## CREATE TEMPORARY TABLE mysqltest1.t22 (f1 BIGINT) ########
+
+-------- switch to master -------
+INSERT INTO t1 SET f1= 8 + 1;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+9
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+8
+
+-------- switch to master -------
+CREATE TEMPORARY TABLE mysqltest1.t22 (f1 BIGINT);
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+9
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+8
+
+-------- switch to master -------
+ROLLBACK;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+8
+
+TEST-INFO: MASTER: The INSERT is not committed (Succeeded)
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+9
+
+TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
+
+-------- switch to master -------
+flush logs;
+
+-------- switch to slave --------
+flush logs;
+
+-------- switch to master -------
+
+######## TRUNCATE TABLE mysqltest1.t7 ########
+
+-------- switch to master -------
+INSERT INTO t1 SET f1= 8 + 1;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+9
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+9
+
+-------- switch to master -------
+TRUNCATE TABLE mysqltest1.t7;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+9
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+9
+
+-------- switch to master -------
+ROLLBACK;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+9
+
+TEST-INFO: MASTER: The INSERT is committed (Succeeded)
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+9
+
+TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
+
+-------- switch to master -------
+flush logs;
+
+-------- switch to slave --------
+flush logs;
+
+-------- switch to master -------
+SELECT * FROM mysqltest1.t7;
+f1
+
+-------- switch to slave --------
+SELECT * FROM mysqltest1.t7;
+f1
+
+-------- switch to master -------
+
+######## LOCK TABLES mysqltest1.t1 WRITE, mysqltest1.t8 READ ########
+
+-------- switch to master -------
+INSERT INTO t1 SET f1= 9 + 1;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+10
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+9
+
+-------- switch to master -------
+LOCK TABLES mysqltest1.t1 WRITE, mysqltest1.t8 READ;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+10
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+10
+
+-------- switch to master -------
+ROLLBACK;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+10
+
+TEST-INFO: MASTER: The INSERT is committed (Succeeded)
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+10
+
+TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
+
+-------- switch to master -------
+flush logs;
+
+-------- switch to slave --------
+flush logs;
+
+-------- switch to master -------
+UNLOCK TABLES;
+
+######## UNLOCK TABLES ########
+
+-------- switch to master -------
+INSERT INTO t1 SET f1= 10 + 1;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+11
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+10
+
+-------- switch to master -------
+UNLOCK TABLES;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+11
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+10
+
+-------- switch to master -------
+ROLLBACK;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+10
+
+TEST-INFO: MASTER: The INSERT is not committed (Succeeded)
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+10
+
+TEST-INFO: SLAVE: The INSERT is not committed (Succeeded)
+
+-------- switch to master -------
+flush logs;
+
+-------- switch to slave --------
+flush logs;
+
+-------- switch to master -------
+LOCK TABLES mysqltest1.t1 READ;
+
+######## UNLOCK TABLES ########
+
+-------- switch to master -------
+INSERT INTO t1 SET f1= 10 + 1;
+ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+10
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+10
+
+-------- switch to master -------
+UNLOCK TABLES;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+10
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+10
+
+-------- switch to master -------
+ROLLBACK;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+10
+
+TEST-INFO: MASTER: The INSERT is not committed (Succeeded)
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+10
+
+TEST-INFO: SLAVE: The INSERT is not committed (Succeeded)
+
+-------- switch to master -------
+flush logs;
+
+-------- switch to slave --------
+flush logs;
+
+-------- switch to master -------
+LOCK TABLES mysqltest1.t1 WRITE, mysqltest1.t8 READ;
+
+######## UNLOCK TABLES ########
+
+-------- switch to master -------
+INSERT INTO t1 SET f1= 10 + 1;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+11
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+10
+
+-------- switch to master -------
+UNLOCK TABLES;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+11
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+11
+
+-------- switch to master -------
+ROLLBACK;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+11
+
+TEST-INFO: MASTER: The INSERT is committed (Succeeded)
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+11
+
+TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
+
+-------- switch to master -------
+flush logs;
+
+-------- switch to slave --------
+flush logs;
+
+-------- switch to master -------
+
+######## DROP INDEX my_idx6 ON mysqltest1.t6 ########
+
+-------- switch to master -------
+INSERT INTO t1 SET f1= 11 + 1;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+12
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+11
+
+-------- switch to master -------
+DROP INDEX my_idx6 ON mysqltest1.t6;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+12
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+12
+
+-------- switch to master -------
+ROLLBACK;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+12
+
+TEST-INFO: MASTER: The INSERT is committed (Succeeded)
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+12
+
+TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
+
+-------- switch to master -------
+flush logs;
+
+-------- switch to slave --------
+flush logs;
+
+-------- switch to master -------
+SHOW INDEX FROM mysqltest1.t6;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
+
+-------- switch to slave --------
+SHOW INDEX FROM mysqltest1.t6;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
+
+-------- switch to master -------
+
+######## CREATE INDEX my_idx5 ON mysqltest1.t5(f1) ########
+
+-------- switch to master -------
+INSERT INTO t1 SET f1= 12 + 1;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+13
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+12
+
+-------- switch to master -------
+CREATE INDEX my_idx5 ON mysqltest1.t5(f1);
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+13
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+13
+
+-------- switch to master -------
+ROLLBACK;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+13
+
+TEST-INFO: MASTER: The INSERT is committed (Succeeded)
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+13
+
+TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
+
+-------- switch to master -------
+flush logs;
+
+-------- switch to slave --------
+flush logs;
+
+-------- switch to master -------
+SHOW INDEX FROM mysqltest1.t5;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
+t5 1 my_idx5 1 f1 A 0 NULL NULL YES BTREE
+
+-------- switch to slave --------
+SHOW INDEX FROM mysqltest1.t5;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
+t5 1 my_idx5 1 f1 A NULL NULL NULL YES BTREE
+
+-------- switch to master -------
+
+######## DROP DATABASE mysqltest2 ########
+
+-------- switch to master -------
+INSERT INTO t1 SET f1= 13 + 1;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+14
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+13
+
+-------- switch to master -------
+DROP DATABASE mysqltest2;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+14
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+14
+
+-------- switch to master -------
+ROLLBACK;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+14
+
+TEST-INFO: MASTER: The INSERT is committed (Succeeded)
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+14
+
+TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
+
+-------- switch to master -------
+flush logs;
+
+-------- switch to slave --------
+flush logs;
+
+-------- switch to master -------
+SHOW DATABASES LIKE "mysqltest2";
+Database (mysqltest2)
+
+-------- switch to slave --------
+SHOW DATABASES LIKE "mysqltest2";
+Database (mysqltest2)
+
+-------- switch to master -------
+
+######## CREATE DATABASE mysqltest3 ########
+
+-------- switch to master -------
+INSERT INTO t1 SET f1= 14 + 1;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+15
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+14
+
+-------- switch to master -------
+CREATE DATABASE mysqltest3;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+15
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+15
+
+-------- switch to master -------
+ROLLBACK;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+15
+
+TEST-INFO: MASTER: The INSERT is committed (Succeeded)
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+15
+
+TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
+
+-------- switch to master -------
+flush logs;
+
+-------- switch to slave --------
+flush logs;
+
+-------- switch to master -------
+SHOW DATABASES LIKE "mysqltest3";
+Database (mysqltest3)
+mysqltest3
+
+-------- switch to slave --------
+SHOW DATABASES LIKE "mysqltest3";
+Database (mysqltest3)
+mysqltest3
+
+-------- switch to master -------
+
+######## CREATE PROCEDURE p1() READS SQL DATA SELECT "this is p1" ########
+
+-------- switch to master -------
+INSERT INTO t1 SET f1= 15 + 1;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+16
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+15
+
+-------- switch to master -------
+CREATE PROCEDURE p1() READS SQL DATA SELECT "this is p1";
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+16
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+16
+
+-------- switch to master -------
+ROLLBACK;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+16
+
+TEST-INFO: MASTER: The INSERT is committed (Succeeded)
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+16
+
+TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
+
+-------- switch to master -------
+flush logs;
+
+-------- switch to slave --------
+flush logs;
+
+-------- switch to master -------
+SHOW PROCEDURE STATUS LIKE 'p1';
+Db mysqltest1
+Name p1
+Type PROCEDURE
+Definer root@localhost
+Modified #
+Created #
+Security_type DEFINER
+Comment
+ -------- switch to slave -------
+SHOW PROCEDURE STATUS LIKE 'p1';
+Db mysqltest1
+Name p1
+Type PROCEDURE
+Definer root@localhost
+Modified #
+Created #
+Security_type DEFINER
+Comment
+
+######## ALTER PROCEDURE p1 COMMENT "I have been altered" ########
+
+-------- switch to master -------
+INSERT INTO t1 SET f1= 16 + 1;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+17
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+16
+
+-------- switch to master -------
+ALTER PROCEDURE p1 COMMENT "I have been altered";
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+17
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+17
+
+-------- switch to master -------
+ROLLBACK;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+17
+
+TEST-INFO: MASTER: The INSERT is committed (Succeeded)
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+17
+
+TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
+
+-------- switch to master -------
+flush logs;
+
+-------- switch to slave --------
+flush logs;
+
+-------- switch to master -------
+SHOW PROCEDURE STATUS LIKE 'p1';
+Db mysqltest1
+Name p1
+Type PROCEDURE
+Definer root@localhost
+Modified #
+Created #
+Security_type DEFINER
+Comment I have been altered
+ -------- switch to slave -------
+SHOW PROCEDURE STATUS LIKE 'p1';
+Db mysqltest1
+Name p1
+Type PROCEDURE
+Definer root@localhost
+Modified #
+Created #
+Security_type DEFINER
+Comment I have been altered
+
+######## DROP PROCEDURE p1 ########
+
+-------- switch to master -------
+INSERT INTO t1 SET f1= 17 + 1;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+18
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+17
+
+-------- switch to master -------
+DROP PROCEDURE p1;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+18
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+18
+
+-------- switch to master -------
+ROLLBACK;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+18
+
+TEST-INFO: MASTER: The INSERT is committed (Succeeded)
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+18
+
+TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
+
+-------- switch to master -------
+flush logs;
+
+-------- switch to slave --------
+flush logs;
+
+-------- switch to master -------
+SHOW PROCEDURE STATUS LIKE 'p1';
+ -------- switch to slave -------
+SHOW PROCEDURE STATUS LIKE 'p1';
+
+######## CREATE OR REPLACE VIEW v1 as select * from t1 ########
+
+-------- switch to master -------
+INSERT INTO t1 SET f1= 18 + 1;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+19
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+18
+
+-------- switch to master -------
+CREATE OR REPLACE VIEW v1 as select * from t1;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+19
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+19
+
+-------- switch to master -------
+ROLLBACK;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+19
+
+TEST-INFO: MASTER: The INSERT is committed (Succeeded)
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+19
+
+TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
+
+-------- switch to master -------
+flush logs;
+
+-------- switch to slave --------
+flush logs;
+
+-------- switch to master -------
+SHOW CREATE VIEW v1;
+View Create View
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1`
+
+-------- switch to slave -------
+SHOW CREATE VIEW v1;
+View Create View
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1`
+
+######## ALTER VIEW v1 AS select f1 from t1 ########
+
+-------- switch to master -------
+INSERT INTO t1 SET f1= 19 + 1;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+20
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+19
+
+-------- switch to master -------
+ALTER VIEW v1 AS select f1 from t1;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+20
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+20
+
+-------- switch to master -------
+ROLLBACK;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+20
+
+TEST-INFO: MASTER: The INSERT is committed (Succeeded)
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+20
+
+TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
+
+-------- switch to master -------
+flush logs;
+
+-------- switch to slave --------
+flush logs;
+
+-------- switch to master -------
+SHOW CREATE VIEW v1;
+View Create View
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1`
+
+-------- switch to slave -------
+SHOW CREATE VIEW v1;
+View Create View
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1`
+
+######## DROP VIEW IF EXISTS v1 ########
+
+-------- switch to master -------
+INSERT INTO t1 SET f1= 20 + 1;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+21
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+20
+
+-------- switch to master -------
+DROP VIEW IF EXISTS v1;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+21
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+21
+
+-------- switch to master -------
+ROLLBACK;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+21
+
+TEST-INFO: MASTER: The INSERT is committed (Succeeded)
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+21
+
+TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
+
+-------- switch to master -------
+flush logs;
+
+-------- switch to slave --------
+flush logs;
+
+-------- switch to master -------
+SHOW CREATE VIEW v1;
+ERROR 42S02: Table 'mysqltest1.v1' doesn't exist
+
+-------- switch to slave -------
+SHOW CREATE VIEW v1;
+ERROR 42S02: Table 'mysqltest1.v1' doesn't exist
+
+######## CREATE TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW SET @a:=1 ########
+
+-------- switch to master -------
+INSERT INTO t1 SET f1= 21 + 1;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+22
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+21
+
+-------- switch to master -------
+CREATE TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW SET @a:=1;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+22
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+22
+
+-------- switch to master -------
+ROLLBACK;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+22
+
+TEST-INFO: MASTER: The INSERT is committed (Succeeded)
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+22
+
+TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
+
+-------- switch to master -------
+flush logs;
+
+-------- switch to slave --------
+flush logs;
+
+-------- switch to master -------
+SHOW TRIGGERS;
+Trigger Event Table Statement Timing Created sql_mode Definer
+trg1 INSERT t1 SET @a:=1 BEFORE NULL root@localhost
+
+-------- switch to slave -------
+SHOW TRIGGERS;
+Trigger Event Table Statement Timing Created sql_mode Definer
+trg1 INSERT t1 SET @a:=1 BEFORE NULL root@localhost
+
+######## DROP TRIGGER trg1 ########
+
+-------- switch to master -------
+INSERT INTO t1 SET f1= 22 + 1;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+23
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+22
+
+-------- switch to master -------
+DROP TRIGGER trg1;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+23
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+23
+
+-------- switch to master -------
+ROLLBACK;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+23
+
+TEST-INFO: MASTER: The INSERT is committed (Succeeded)
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+23
+
+TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
+
+-------- switch to master -------
+flush logs;
+
+-------- switch to slave --------
+flush logs;
+
+-------- switch to master -------
+SHOW TRIGGERS;
+Trigger Event Table Statement Timing Created sql_mode Definer
+
+-------- switch to slave -------
+SHOW TRIGGERS;
+Trigger Event Table Statement Timing Created sql_mode Definer
+
+######## CREATE USER user1@localhost ########
+
+-------- switch to master -------
+INSERT INTO t1 SET f1= 23 + 1;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+24
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+23
+
+-------- switch to master -------
+CREATE USER user1@localhost;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+24
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+24
+
+-------- switch to master -------
+ROLLBACK;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+24
+
+TEST-INFO: MASTER: The INSERT is committed (Succeeded)
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+24
+
+TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
+
+-------- switch to master -------
+flush logs;
+
+-------- switch to slave --------
+flush logs;
+
+-------- switch to master -------
+SELECT user FROM mysql.user WHERE user = 'user1';
+user
+user1
+
+-------- switch to slave -------
+SELECT user FROM mysql.user WHERE user = 'user1';
+user
+user1
+
+######## RENAME USER user1@localhost TO rename1@localhost ########
+
+-------- switch to master -------
+INSERT INTO t1 SET f1= 24 + 1;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+25
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+24
+
+-------- switch to master -------
+RENAME USER user1@localhost TO rename1@localhost;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+25
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+25
+
+-------- switch to master -------
+ROLLBACK;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+25
+
+TEST-INFO: MASTER: The INSERT is committed (Succeeded)
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+25
+
+TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
+
+-------- switch to master -------
+flush logs;
+
+-------- switch to slave --------
+flush logs;
+
+-------- switch to master -------
+SELECT user FROM mysql.user WHERE user = 'rename1';
+user
+rename1
+
+-------- switch to slave -------
+SELECT user FROM mysql.user WHERE user = 'rename1';
+user
+rename1
+
+######## DROP USER rename1@localhost ########
+
+-------- switch to master -------
+INSERT INTO t1 SET f1= 25 + 1;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+26
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+25
+
+-------- switch to master -------
+DROP USER rename1@localhost;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+26
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+26
+
+-------- switch to master -------
+ROLLBACK;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+26
+
+TEST-INFO: MASTER: The INSERT is committed (Succeeded)
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+26
+
+TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
+
+-------- switch to master -------
+flush logs;
+
+-------- switch to slave --------
+flush logs;
+
+-------- switch to master -------
+SELECT user FROM mysql.user WHERE user = 'rename1';
+user
+
+-------- switch to slave -------
+SELECT user FROM mysql.user WHERE user = 'rename1';
+user
+DROP DATABASE IF EXISTS mysqltest1;
+DROP DATABASE IF EXISTS mysqltest2;
+DROP DATABASE IF EXISTS mysqltest3;
diff --git a/mysql-test/r/rpl_row_delayed_ins.result b/mysql-test/r/rpl_row_delayed_ins.result
new file mode 100644
index 00000000000..7ed817b5780
--- /dev/null
+++ b/mysql-test/r/rpl_row_delayed_ins.result
@@ -0,0 +1,27 @@
+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;
+create table t1(a int not null primary key) engine=myisam;
+insert delayed into t1 values (1),(2),(3);
+flush tables;
+select * from t1;
+a
+1
+2
+3
+show binlog events;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 4 Format_desc 1 102 Server ver: VERSION, Binlog ver: 4
+master-bin.000001 102 Query 1 222 use `test`; create table t1(a int not null primary key) engine=myisam
+master-bin.000001 222 Table_map 1 261 test.t1
+master-bin.000001 261 Write_rows 1 305
+master-bin.000001 305 Query 1 380 use `test`; flush tables
+select * from t1;
+a
+1
+2
+3
+drop table t1;
diff --git a/mysql-test/r/rpl_row_drop.result b/mysql-test/r/rpl_row_drop.result
new file mode 100644
index 00000000000..4ef21884fda
--- /dev/null
+++ b/mysql-test/r/rpl_row_drop.result
@@ -0,0 +1,56 @@
+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;
+**** On Master ****
+CREATE TABLE t1 (a int);
+CREATE TABLE t2 (a int);
+CREATE TEMPORARY TABLE t2 (a int, b int);
+SHOW TABLES;
+Tables_in_test
+t1
+t2
+**** On Slave ****
+SHOW TABLES;
+Tables_in_test
+t1
+t2
+**** On Master ****
+DROP TABLE t2;
+SHOW TABLES;
+Tables_in_test
+t1
+t2
+**** On Slave ****
+SHOW TABLES;
+Tables_in_test
+t1
+t2
+**** On Master ****
+CREATE TEMPORARY TABLE t2 (a int, b int);
+SHOW TABLES;
+Tables_in_test
+t1
+t2
+**** On Slave ****
+SHOW TABLES;
+Tables_in_test
+t1
+t2
+**** On Master ****
+DROP TABLE t1,t2;
+SHOW BINLOG EVENTS;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 4 Format_desc 1 102 Server ver: VERSION, Binlog ver: 4
+master-bin.000001 102 Query 1 188 use `test`; CREATE TABLE t1 (a int)
+master-bin.000001 188 Query 1 274 use `test`; CREATE TABLE t2 (a int)
+master-bin.000001 274 Query 1 378 use `test`; DROP TABLE `t1` /* generated by server */
+SHOW TABLES;
+Tables_in_test
+t2
+**** On Slave ****
+SHOW TABLES;
+Tables_in_test
+t2
diff --git a/mysql-test/r/rpl_row_err_ignoredtable.result b/mysql-test/r/rpl_row_err_ignoredtable.result
new file mode 100644
index 00000000000..b696baa57db
--- /dev/null
+++ b/mysql-test/r/rpl_row_err_ignoredtable.result
@@ -0,0 +1,44 @@
+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;
+create table t1 (a int primary key);
+insert into t1 values (1),(1);
+ERROR 23000: Duplicate entry '1' for key 1
+show slave status;
+Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
+# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 269 # # master-bin.000001 Yes Yes 0 0 269 # None 0 No #
+show tables like 't1';
+Tables_in_test (t1)
+t1
+drop table t1;
+select get_lock('crash_lock%20C', 10);
+get_lock('crash_lock%20C', 10)
+1
+create table t2 (a int primary key);
+insert into t2 values(1);
+create table t3 (id int);
+insert into t3 values(connection_id());
+ update t2 set a = a + 1 + get_lock('crash_lock%20C', 10);
+select (@id := id) - id from t3;
+(@id := id) - id
+0
+kill @id;
+drop table t2,t3;
+show binlog events from 102;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query 1 # #
+master-bin.000001 # Table_map 1 # #
+master-bin.000001 # Write_rows 1 # #
+master-bin.000001 # Query 1 # #
+master-bin.000001 # Query 1 # #
+master-bin.000001 # Table_map 1 # #
+master-bin.000001 # Write_rows 1 # #
+master-bin.000001 # Query 1 # #
+master-bin.000001 # Table_map 1 # #
+master-bin.000001 # Write_rows 1 # #
+master-bin.000001 # Table_map 1 # #
+master-bin.000001 # Update_rows 1 # #
+master-bin.000001 # Query 1 # #
diff --git a/mysql-test/r/rpl_row_flsh_tbls.result b/mysql-test/r/rpl_row_flsh_tbls.result
new file mode 100644
index 00000000000..503fcc7a368
--- /dev/null
+++ b/mysql-test/r/rpl_row_flsh_tbls.result
@@ -0,0 +1,32 @@
+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;
+create table t1 (a int);
+insert into t1 values (10);
+create table t2 (a int);
+create table t3 (a int) engine=merge union(t1);
+create table t4 (a int);
+insert into t4 select * from t3;
+rename table t1 to t5, t2 to t1;
+flush no_write_to_binlog tables;
+SHOW BINLOG EVENTS FROM 615 ;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query 1 # use `test`; rename table t1 to t5, t2 to t1
+select * from t3;
+a
+flush tables;
+SHOW BINLOG EVENTS FROM 615 ;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query 1 # use `test`; rename table t1 to t5, t2 to t1
+master-bin.000001 # Query 1 # use `test`; flush tables
+select * from t3;
+a
+stop slave;
+drop table t1;
+flush tables with read lock;
+start slave;
+stop slave;
+ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
diff --git a/mysql-test/r/rpl_row_func001.result b/mysql-test/r/rpl_row_func001.result
new file mode 100644
index 00000000000..b20f3f724d0
--- /dev/null
+++ b/mysql-test/r/rpl_row_func001.result
@@ -0,0 +1,30 @@
+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;
+DROP FUNCTION test.f1;
+DROP TABLE IF EXISTS test.t1;
+create table test.t1 (a int, PRIMARY KEY(a));
+create function test.f1(i int) returns int
+begin
+insert into test.t1 values(i);
+return 0;
+end//
+select test.f1(1);
+test.f1(1)
+0
+select test.f1(2);
+test.f1(2)
+0
+select * from test.t1;
+a
+1
+2
+select * from test.t1;
+a
+1
+2
+DROP FUNCTION test.f1;
+DROP TABLE test.t1;
diff --git a/mysql-test/r/rpl_row_func002.result b/mysql-test/r/rpl_row_func002.result
new file mode 100644
index 00000000000..e65c0a35180
--- /dev/null
+++ b/mysql-test/r/rpl_row_func002.result
@@ -0,0 +1,25 @@
+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;
+DROP FUNCTION test.f1;
+DROP TABLE IF EXISTS test.t1;
+DROP TABLE IF EXISTS test.t2;
+CREATE TABLE test.t1 (a INT NOT NULL AUTO_INCREMENT, t TIMESTAMP, t2 TIMESTAMP, PRIMARY KEY(a));
+CREATE TABLE test.t2 (a INT NOT NULL AUTO_INCREMENT, t TIMESTAMP, t2 TIMESTAMP, PRIMARY KEY(a));
+create function test.f1() RETURNS TIMESTAMP
+BEGIN
+UPDATE test.t1 SET t = CURRENT_TIMESTAMP;
+RETURN CURRENT_TIMESTAMP;
+END//
+INSERT INTO test.t2 VALUES (null,f1(),CURRENT_TIMESTAMP);
+SET TIMESTAMP=2;
+INSERT INTO test.t2 VALUES (null,f1(),CURRENT_TIMESTAMP);
+SET TIMESTAMP=1;
+INSERT INTO test.t2 VALUES (null,f1(),CURRENT_TIMESTAMP);
+SET TIMESTAMP=333300000;
+INSERT INTO test.t2 VALUES (null,f1(),CURRENT_TIMESTAMP);
+DROP FUNCTION test.f1;
+DROP TABLE test.t1;
diff --git a/mysql-test/r/rpl_row_func003.result b/mysql-test/r/rpl_row_func003.result
new file mode 100644
index 00000000000..a5fd46a2ce3
--- /dev/null
+++ b/mysql-test/r/rpl_row_func003.result
@@ -0,0 +1,29 @@
+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;
+DROP FUNCTION IF EXISTS test.f1;
+DROP TABLE IF EXISTS test.t1;
+CREATE TABLE test.t1 (a INT NOT NULL AUTO_INCREMENT, c CHAR(16),PRIMARY KEY(a))ENGINE=INNODB;
+create function test.f1() RETURNS CHAR(16)
+BEGIN
+DECLARE tmp CHAR(16);
+DECLARE var_name FLOAT;
+SET var_name = RAND();
+IF var_name > .6
+THEN SET tmp = 'Texas';
+ELSE SET tmp = 'MySQL';
+END IF;
+RETURN tmp;
+END|
+INSERT INTO test.t1 VALUES (null,test.f1()),(null,test.f1()),(null,test.f1());
+INSERT INTO test.t1 VALUES (null,test.f1()),(null,test.f1()),(null,test.f1());
+SET AUTOCOMMIT=0;
+START TRANSACTION;
+INSERT INTO test.t1 VALUES (null,test.f1());
+ROLLBACK;
+SET AUTOCOMMIT=1;
+DROP FUNCTION test.f1;
+DROP TABLE test.t1;
diff --git a/mysql-test/r/rpl_row_inexist_tbl.result b/mysql-test/r/rpl_row_inexist_tbl.result
new file mode 100644
index 00000000000..1d18819fdd6
--- /dev/null
+++ b/mysql-test/r/rpl_row_inexist_tbl.result
@@ -0,0 +1,45 @@
+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;
+create table t1 (a int not null primary key);
+drop table t1;
+insert into t1 values (1);
+insert into t1 values (2);
+show slave status;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port MASTER_MYPORT
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+Slave_SQL_Running No
+Replicate_Do_DB
+Replicate_Ignore_DB
+Replicate_Do_Table
+Replicate_Ignore_Table
+Replicate_Wild_Do_Table
+Replicate_Wild_Ignore_Table
+Last_Errno 1146
+Last_Error Error 'Table 'test.t1' doesn't exist' on opening table `test`.`t1`
+Skip_Counter 0
+Exec_Master_Log_Pos 209
+Relay_Log_Space #
+Until_Condition None
+Until_Log_File
+Until_Log_Pos 0
+Master_SSL_Allowed No
+Master_SSL_CA_File
+Master_SSL_CA_Path
+Master_SSL_Cert
+Master_SSL_Cipher
+Master_SSL_Key
+Seconds_Behind_Master #
+drop table t1;
diff --git a/mysql-test/r/rpl_row_loaddata_m.result b/mysql-test/r/rpl_row_loaddata_m.result
new file mode 100644
index 00000000000..198e55c71d0
--- /dev/null
+++ b/mysql-test/r/rpl_row_loaddata_m.result
@@ -0,0 +1,20 @@
+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;
+drop database if exists mysqltest;
+stop slave;
+create database mysqltest;
+use mysqltest;
+create table t1(a int, b int, unique(b));
+load data infile '../../std_data/rpl_loaddata.dat' into table t1;
+show binlog events from 102;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query 1 # #
+master-bin.000001 # Query 1 # #
+master-bin.000001 # Query 1 # #
+master-bin.000001 # Table_map 1 # #
+master-bin.000001 # Write_rows 1 # #
+drop database mysqltest;
diff --git a/mysql-test/r/rpl_row_log.result b/mysql-test/r/rpl_row_log.result
new file mode 100644
index 00000000000..8784d9d16e2
--- /dev/null
+++ b/mysql-test/r/rpl_row_log.result
@@ -0,0 +1,105 @@
+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;
+stop slave;
+reset master;
+reset slave;
+reset master;
+create table t1(n int not null auto_increment primary key);
+insert into t1 values (NULL);
+drop table t1;
+create table t1 (word char(20) not null);
+load data infile '../../std_data/words.dat' into table t1 ignore 1 lines;
+select count(*) from t1;
+count(*)
+69
+drop table t1;
+show binlog events;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4
+master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Query 1 # use `test`; drop table t1
+master-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Query 1 # use `test`; drop table t1
+show binlog events from 102 limit 1;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)
+show binlog events from 102 limit 2;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)
+master-bin.000001 # Table_map 1 # test.t1
+show binlog events from 102 limit 2,1;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Write_rows 1 #
+flush logs;
+create table t5 (a int);
+drop table t5;
+start slave;
+flush logs;
+stop slave;
+create table t1 (n int);
+insert into t1 values (1);
+drop table t1;
+show binlog events;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4
+master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Query 1 # use `test`; drop table t1
+master-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)
+master-bin.000001 # Table_map 1 # test.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Query 1 # use `test`; drop table t1
+master-bin.000001 # Rotate 1 # master-bin.000002;pos=4
+show binlog events in 'master-bin.000002';
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000002 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4
+master-bin.000002 # Query 1 # use `test`; create table t5 (a int)
+master-bin.000002 # Query 1 # use `test`; drop table t5
+master-bin.000002 # Query 1 # use `test`; create table t1 (n int)
+master-bin.000002 # Table_map 1 # test.t1
+master-bin.000002 # Write_rows 1 #
+master-bin.000002 # Query 1 # use `test`; drop table t1
+show binary logs;
+Log_name File_size
+master-bin.000001 1306
+master-bin.000002 499
+start slave;
+show binary logs;
+Log_name File_size
+slave-bin.000001 1467
+slave-bin.000002 337
+show binlog events in 'slave-bin.000001' from 4;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4
+slave-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)
+slave-bin.000001 # Table_map 1 # test.t1
+slave-bin.000001 # Write_rows 1 #
+slave-bin.000001 # Query 1 # use `test`; drop table t1
+slave-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)
+slave-bin.000001 # Table_map 1 # test.t1
+slave-bin.000001 # Write_rows 1 #
+slave-bin.000001 # Query 1 # use `test`; drop table t1
+slave-bin.000001 # Query 1 # use `test`; create table t5 (a int)
+slave-bin.000001 # Query 1 # use `test`; drop table t5
+slave-bin.000001 # Rotate 2 # slave-bin.000002;pos=4
+show binlog events in 'slave-bin.000002' from 4;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-bin.000002 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4
+slave-bin.000002 # Query 1 # use `test`; create table t1 (n int)
+slave-bin.000002 # Table_map 1 # test.t1
+slave-bin.000002 # Write_rows 1 #
+slave-bin.000002 # Query 1 # use `test`; drop table t1
+show slave status;
+Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
+# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 499 # # master-bin.000002 Yes Yes # 0 0 499 # None 0 No #
+show binlog events in 'slave-bin.000005' from 4;
+ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
diff --git a/mysql-test/r/rpl_max_relay_size.result b/mysql-test/r/rpl_row_max_relay_size.result
index fbe3b89828a..6146d623ec5 100644
--- a/mysql-test/r/rpl_max_relay_size.result
+++ b/mysql-test/r/rpl_row_max_relay_size.result
@@ -16,7 +16,7 @@ select @@global.max_relay_log_size;
start slave;
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
-# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 72952 # # master-bin.000001 Yes Yes 0 0 72952 # None 0 No #
+# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 58664 # # master-bin.000001 Yes Yes # 0 0 58664 # None 0 No #
stop slave;
reset slave;
set global max_relay_log_size=(5*4096);
@@ -26,7 +26,7 @@ select @@global.max_relay_log_size;
start slave;
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
-# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 72952 # # master-bin.000001 Yes Yes 0 0 72952 # None 0 No #
+# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 58664 # # master-bin.000001 Yes Yes # 0 0 58664 # None 0 No #
stop slave;
reset slave;
set global max_relay_log_size=0;
@@ -36,26 +36,26 @@ select @@global.max_relay_log_size;
start slave;
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
-# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 72952 # # master-bin.000001 Yes Yes 0 0 72952 # None 0 No #
+# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 58664 # # master-bin.000001 Yes Yes # 0 0 58664 # None 0 No #
stop slave;
reset slave;
flush logs;
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
-# 127.0.0.1 root MASTER_PORT 1 4 # # No No 0 0 0 # None 0 No #
+# 127.0.0.1 root MASTER_PORT 1 4 # # No No # 0 0 0 # None 0 No #
reset slave;
start slave;
flush logs;
create table t1 (a int);
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
-# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 73038 # # master-bin.000001 Yes Yes 0 0 73038 # None 0 No #
+# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 58750 # # master-bin.000001 Yes Yes # 0 0 58750 # None 0 No #
flush logs;
drop table t1;
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
-# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 73114 # # master-bin.000001 Yes Yes 0 0 73114 # None 0 No #
+# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 58826 # # master-bin.000001 Yes Yes # 0 0 58826 # None 0 No #
flush logs;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
-master-bin.000002 98
+master-bin.000002 102 <Binlog_Ignore_DB>
diff --git a/mysql-test/r/rpl_row_multi_query.result b/mysql-test/r/rpl_row_multi_query.result
new file mode 100644
index 00000000000..8cb1aec522b
--- /dev/null
+++ b/mysql-test/r/rpl_row_multi_query.result
@@ -0,0 +1,37 @@
+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;
+drop database if exists mysqltest;
+create database mysqltest;
+create table mysqltest.t1 ( n int);
+insert into mysqltest.t1 values(1)/
+insert into mysqltest.t1 values(2);
+insert into mysqltest.t1 values(3);
+insert into mysqltest.t1 values(4);
+insert into mysqltest.t1 values(5)/
+select * from mysqltest.t1;
+n
+1
+2
+3
+4
+5
+show binlog events from 102;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query 1 # #
+master-bin.000001 # Query 1 # #
+master-bin.000001 # Query 1 # #
+master-bin.000001 # Table_map 1 # #
+master-bin.000001 # Write_rows 1 # #
+master-bin.000001 # Table_map 1 # #
+master-bin.000001 # Write_rows 1 # #
+master-bin.000001 # Table_map 1 # #
+master-bin.000001 # Write_rows 1 # #
+master-bin.000001 # Table_map 1 # #
+master-bin.000001 # Write_rows 1 # #
+master-bin.000001 # Table_map 1 # #
+master-bin.000001 # Write_rows 1 # #
+drop database mysqltest;
diff --git a/mysql-test/r/rpl_row_multi_update3.result b/mysql-test/r/rpl_row_multi_update3.result
new file mode 100644
index 00000000000..1b757b1400c
--- /dev/null
+++ b/mysql-test/r/rpl_row_multi_update3.result
@@ -0,0 +1,124 @@
+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;
+
+-------- Test for BUG#9361 --------
+CREATE TABLE t1 (
+a int unsigned not null auto_increment primary key,
+b int unsigned
+) ENGINE=MyISAM;
+CREATE TABLE t2 (
+a int unsigned not null auto_increment primary key,
+b int unsigned
+) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (NULL, 0);
+INSERT INTO t1 SELECT NULL, 0 FROM t1;
+INSERT INTO t2 VALUES (NULL, 0), (NULL,1);
+SELECT * FROM t1 ORDER BY a;
+a b
+1 0
+2 0
+SELECT * FROM t2 ORDER BY a;
+a b
+1 0
+2 1
+UPDATE t2, (SELECT a FROM t1) AS t SET t2.b = t.a+5 ;
+SELECT * FROM t1 ORDER BY a;
+a b
+1 0
+2 0
+SELECT * FROM t2 ORDER BY a;
+a b
+1 6
+2 6
+SELECT * FROM t1 ORDER BY a;
+a b
+1 0
+2 0
+SELECT * FROM t2 ORDER BY a;
+a b
+1 6
+2 6
+drop table t1,t2;
+
+-------- Test 1 for BUG#9361 --------
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+CREATE TABLE t1 (
+a1 char(30),
+a2 int,
+a3 int,
+a4 char(30),
+a5 char(30)
+);
+CREATE TABLE t2 (
+b1 int,
+b2 char(30)
+);
+INSERT INTO t1 VALUES ('Yes', 1, NULL, 'foo', 'bar');
+INSERT INTO t2 VALUES (1, 'baz');
+UPDATE t1 a, t2
+SET a.a1 = 'No'
+WHERE a.a2 =
+(SELECT b1
+FROM t2
+WHERE b2 = 'baz')
+AND a.a3 IS NULL
+AND a.a4 = 'foo'
+AND a.a5 = 'bar';
+SELECT * FROM t1;
+a1 a2 a3 a4 a5
+No 1 NULL foo bar
+SELECT * FROM t2;
+b1 b2
+1 baz
+DROP TABLE t1, t2;
+
+-------- Test 2 for BUG#9361 --------
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+DROP TABLE IF EXISTS t3;
+CREATE TABLE t1 (
+i INT,
+j INT,
+x INT,
+y INT,
+z INT
+);
+CREATE TABLE t2 (
+i INT,
+k INT,
+x INT,
+y INT,
+z INT
+);
+CREATE TABLE t3 (
+j INT,
+k INT,
+x INT,
+y INT,
+z INT
+);
+INSERT INTO t1 VALUES ( 1, 2,13,14,15);
+INSERT INTO t2 VALUES ( 1, 3,23,24,25);
+INSERT INTO t3 VALUES ( 2, 3, 1,34,35), ( 2, 3, 1,34,36);
+UPDATE t1 AS a
+INNER JOIN t2 AS b
+ON a.i = b.i
+INNER JOIN t3 AS c
+ON a.j = c.j AND b.k = c.k
+SET a.x = b.x,
+a.y = b.y,
+a.z = (
+SELECT sum(z)
+FROM t3
+WHERE y = 34
+)
+WHERE b.x = 23;
+SELECT * FROM t1;
+i j x y z
+1 2 23 24 71
+DROP TABLE t1, t2, t3;
diff --git a/mysql-test/r/rpl_row_mystery22.result b/mysql-test/r/rpl_row_mystery22.result
new file mode 100644
index 00000000000..bcf65e4ede3
--- /dev/null
+++ b/mysql-test/r/rpl_row_mystery22.result
@@ -0,0 +1,30 @@
+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;
+create table t1(n int auto_increment primary key, s char(10));
+insert into t1 values (2,'old');
+insert into t1 values(NULL,'new');
+insert into t1 values(NULL,'new');
+select * from t1 order by n;
+n s
+1 new
+2 new
+delete from t1 where n = 2;
+start slave;
+stop slave;
+create table t2(n int);
+drop table t2;
+insert into t1 values(NULL,'new');
+set sql_log_bin=0;
+insert into t1 values(NULL,'new');
+set sql_log_bin=1;
+delete from t1 where n=4;
+start slave;
+select * from t1 order by n;
+n s
+1 new
+3 new
+drop table t1;
diff --git a/mysql-test/r/rpl_row_reset_slave.result b/mysql-test/r/rpl_row_reset_slave.result
new file mode 100644
index 00000000000..57fc95708e5
--- /dev/null
+++ b/mysql-test/r/rpl_row_reset_slave.result
@@ -0,0 +1,32 @@
+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;
+show slave status;
+Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
+# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 102 # # master-bin.000001 Yes Yes # 0 0 102 # None 0 No #
+stop slave;
+change master to master_user='test';
+show slave status;
+Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
+# 127.0.0.1 test MASTER_PORT 1 master-bin.000001 102 # # master-bin.000001 No No # 0 0 102 # None 0 No #
+reset slave;
+show slave status;
+Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
+# 127.0.0.1 root MASTER_PORT 1 4 # # No No # 0 0 0 # None 0 No #
+start slave;
+show slave status;
+Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
+# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 102 # # master-bin.000001 Yes Yes # 0 0 102 # None 0 No #
+stop slave;
+reset slave;
+start slave;
+create temporary table t1 (a int);
+stop slave;
+reset slave;
+start slave;
+show status like 'slave_open_temp_tables';
+Variable_name Value
+Slave_open_temp_tables 0
diff --git a/mysql-test/r/rpl_rewrite_db.result b/mysql-test/r/rpl_row_rewrt_db.result
index 6c72e982e3e..6c72e982e3e 100644
--- a/mysql-test/r/rpl_rewrite_db.result
+++ b/mysql-test/r/rpl_row_rewrt_db.result
diff --git a/mysql-test/r/rpl_row_sp000.result b/mysql-test/r/rpl_row_sp000.result
new file mode 100644
index 00000000000..a7f72193842
--- /dev/null
+++ b/mysql-test/r/rpl_row_sp000.result
@@ -0,0 +1,362 @@
+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;
+drop database if exists mysqltest1;
+create database mysqltest1;
+use mysqltest1;
+create table t1 (a varchar(100));
+use mysqltest1;
+create procedure foo()
+begin
+declare b int;
+set b = 8;
+insert into t1 values (b);
+insert into t1 values (unix_timestamp());
+end|
+select * from mysql.proc where name='foo' and db='mysqltest1';
+db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment
+mysqltest1 foo PROCEDURE foo SQL CONTAINS_SQL NO DEFINER begin
+declare b int;
+set b = 8;
+insert into t1 values (b);
+insert into t1 values (unix_timestamp());
+end root@localhost # #
+select * from mysql.proc where name='foo' and db='mysqltest1';
+db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment
+mysqltest1 foo PROCEDURE foo SQL CONTAINS_SQL NO DEFINER begin
+declare b int;
+set b = 8;
+insert into t1 values (b);
+insert into t1 values (unix_timestamp());
+end root@localhost # #
+set timestamp=1000000000;
+call foo();
+select * from t1;
+a
+8
+1000000000
+select * from t1;
+a
+8
+1000000000
+delete from t1;
+create procedure foo2()
+not deterministic
+select * from mysqltest1.t1;
+call foo2();
+a
+alter procedure foo2 contains sql;
+drop table t1;
+create table t1 (a int);
+create table t2 (a int);
+create procedure foo3()
+deterministic
+insert into t1 values (15);
+grant CREATE ROUTINE, EXECUTE on mysqltest1.* to "zedjzlcsjhd"@127.0.0.1;
+grant SELECT on mysqltest1.t1 to "zedjzlcsjhd"@127.0.0.1;
+grant SELECT, INSERT on mysqltest1.t2 to "zedjzlcsjhd"@127.0.0.1;
+create procedure foo4()
+deterministic
+begin
+insert into t2 values(3);
+insert into t1 values (5);
+end|
+call foo4();
+Got one of the listed errors
+call foo3();
+show warnings;
+Level Code Message
+call foo4();
+Got one of the listed errors
+alter procedure foo4 sql security invoker;
+call foo4();
+show warnings;
+Level Code Message
+select * from t1;
+a
+15
+5
+select * from t2;
+a
+3
+3
+3
+select * from t1;
+a
+15
+5
+select * from t2;
+a
+3
+3
+3
+delete from t2;
+alter table t2 add unique (a);
+drop procedure foo4;
+create procedure foo4()
+deterministic
+begin
+insert into t2 values(20),(20);
+end|
+call foo4();
+ERROR 23000: Duplicate entry '20' for key 1
+show warnings;
+Level Code Message
+Error 1062 Duplicate entry '20' for key 1
+select * from t2;
+a
+20
+select * from t2;
+a
+20
+select * from mysql.proc where name="foo4" and db='mysqltest1';
+db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment
+mysqltest1 foo4 PROCEDURE foo4 SQL CONTAINS_SQL YES DEFINER begin
+insert into t2 values(20),(20);
+end root@localhost # #
+drop procedure foo4;
+select * from mysql.proc where name="foo4" and db='mysqltest1';
+db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment
+select * from mysql.proc where name="foo4" and db='mysqltest1';
+db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment
+drop procedure foo;
+drop procedure foo2;
+drop procedure foo3;
+create function fn1(x int)
+returns int
+deterministic
+begin
+insert into t1 values (x);
+return x+2;
+end|
+delete t1,t2 from t1,t2;
+select fn1(20);
+fn1(20)
+22
+insert into t2 values(fn1(21));
+select * from t1;
+a
+21
+20
+select * from t2;
+a
+23
+select * from t1;
+a
+21
+20
+select * from t2;
+a
+23
+drop function fn1;
+create function fn1()
+returns int
+begin
+return unix_timestamp();
+end|
+alter function fn1 no sql;
+delete from t1;
+set timestamp=1000000000;
+insert into t1 values(fn1());
+create function fn2()
+returns int
+no sql
+begin
+return unix_timestamp();
+end|
+create function fn3()
+returns int
+not deterministic
+reads sql data
+begin
+return 0;
+end|
+select fn3();
+fn3()
+0
+select * from mysql.proc where db='mysqltest1';
+db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment
+mysqltest1 fn1 FUNCTION fn1 SQL NO_SQL NO DEFINER int(11) begin
+return unix_timestamp();
+end root@localhost # #
+mysqltest1 fn2 FUNCTION fn2 SQL NO_SQL NO DEFINER int(11) begin
+return unix_timestamp();
+end zedjzlcsjhd@localhost # #
+mysqltest1 fn3 FUNCTION fn3 SQL READS_SQL_DATA NO DEFINER int(11) begin
+return 0;
+end root@localhost # #
+select * from t1;
+a
+1000000000
+use mysqltest1;
+select * from t1;
+a
+1000000000
+select * from mysql.proc where db='mysqltest1';
+db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment
+mysqltest1 fn1 FUNCTION fn1 SQL NO_SQL NO DEFINER int(11) begin
+return unix_timestamp();
+end root@localhost # #
+mysqltest1 fn2 FUNCTION fn2 SQL NO_SQL NO DEFINER int(11) begin
+return unix_timestamp();
+end zedjzlcsjhd@localhost # #
+mysqltest1 fn3 FUNCTION fn3 SQL READS_SQL_DATA NO DEFINER int(11) begin
+return 0;
+end root@localhost # #
+delete from t2;
+alter table t2 add unique (a);
+drop function fn1;
+create function fn1()
+returns int
+begin
+insert into t2 values(20),(20);
+return 10;
+end|
+select fn1();
+ERROR 23000: Duplicate entry '20' for key 1
+select * from t2;
+a
+20
+select * from t2;
+a
+20
+create trigger trg before insert on t1 for each row set new.a= 10;
+ERROR 42000: Access denied; you need the SUPER privilege for this operation
+delete from t1;
+create trigger trg before insert on t1 for each row set new.a= 10;
+insert into t1 values (1);
+select * from t1;
+a
+10
+select * from t1;
+a
+10
+delete from t1;
+drop trigger trg;
+insert into t1 values (1);
+select * from t1;
+a
+1
+show binlog events in 'master-bin.000001' from 102;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query 1 # drop database if exists mysqltest1
+master-bin.000001 # Query 1 # create database mysqltest1
+master-bin.000001 # Query 1 # use `mysqltest1`; create table t1 (a varchar(100))
+master-bin.000001 # Table_map 1 # mysql.proc
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # mysqltest1.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # mysqltest1.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Query 1 # use `mysqltest1`; delete from t1
+master-bin.000001 # Table_map 1 # mysql.proc
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # mysql.proc
+master-bin.000001 # Update_rows 1 #
+master-bin.000001 # Query 1 # use `mysqltest1`; drop table t1
+master-bin.000001 # Query 1 # use `mysqltest1`; create table t1 (a int)
+master-bin.000001 # Query 1 # use `mysqltest1`; create table t2 (a int)
+master-bin.000001 # Table_map 1 # mysql.proc
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # mysql.user
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # mysql.db
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # mysql.tables_priv
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # mysql.tables_priv
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # mysql.proc
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # mysql.procs_priv
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # mysqltest1.t2
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # mysqltest1.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # mysqltest1.t2
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # mysql.proc
+master-bin.000001 # Update_rows 1 #
+master-bin.000001 # Table_map 1 # mysqltest1.t2
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # mysqltest1.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Query 1 # use `mysqltest1`; delete from t2
+master-bin.000001 # Query 1 # use `mysqltest1`; alter table t2 add unique (a)
+master-bin.000001 # Table_map 1 # mysql.procs_priv
+master-bin.000001 # Delete_rows 1 #
+master-bin.000001 # Table_map 1 # mysql.proc
+master-bin.000001 # Delete_rows 1 #
+master-bin.000001 # Table_map 1 # mysql.proc
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # mysqltest1.t2
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # mysql.proc
+master-bin.000001 # Delete_rows 1 #
+master-bin.000001 # Table_map 1 # mysql.proc
+master-bin.000001 # Delete_rows 1 #
+master-bin.000001 # Table_map 1 # mysql.proc
+master-bin.000001 # Delete_rows 1 #
+master-bin.000001 # Table_map 1 # mysql.proc
+master-bin.000001 # Delete_rows 1 #
+master-bin.000001 # Table_map 1 # mysql.proc
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # mysqltest1.t2
+master-bin.000001 # Delete_rows 1 #
+master-bin.000001 # Table_map 1 # mysqltest1.t1
+master-bin.000001 # Delete_rows 1 #
+master-bin.000001 # Table_map 1 # mysqltest1.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # mysqltest1.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # mysqltest1.t2
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # mysql.proc
+master-bin.000001 # Delete_rows 1 #
+master-bin.000001 # Table_map 1 # mysql.proc
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # mysql.proc
+master-bin.000001 # Update_rows 1 #
+master-bin.000001 # Query 1 # use `mysqltest1`; delete from t1
+master-bin.000001 # Table_map 1 # mysqltest1.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # mysql.proc
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # mysql.procs_priv
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # mysql.proc
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Query 1 # use `mysqltest1`; delete from t2
+master-bin.000001 # Query 1 # use `mysqltest1`; alter table t2 add unique (a)
+master-bin.000001 # Table_map 1 # mysql.proc
+master-bin.000001 # Delete_rows 1 #
+master-bin.000001 # Table_map 1 # mysql.proc
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Table_map 1 # mysqltest1.t2
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Query 1 # use `mysqltest1`; delete from t1
+master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` trigger trg before insert on t1 for each row set new.a= 10
+master-bin.000001 # Table_map 1 # mysqltest1.t1
+master-bin.000001 # Write_rows 1 #
+master-bin.000001 # Query 1 # use `mysqltest1`; delete from t1
+master-bin.000001 # Query 1 # use `mysqltest1`; drop trigger trg
+master-bin.000001 # Table_map 1 # mysqltest1.t1
+master-bin.000001 # Write_rows 1 #
+select * from t1;
+a
+1
+create procedure foo()
+not deterministic
+reads sql data
+select * from t1;
+call foo();
+a
+1
+drop procedure foo;
+drop function fn1;
+drop database mysqltest1;
+drop user "zedjzlcsjhd"@127.0.0.1;
diff --git a/mysql-test/r/rpl_row_sp001.result b/mysql-test/r/rpl_row_sp001.result
new file mode 100644
index 00000000000..0276fb721b9
--- /dev/null
+++ b/mysql-test/r/rpl_row_sp001.result
@@ -0,0 +1,85 @@
+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;
+
+<Begin test section 1 (non deterministic SP)>
+---------------------------------------------
+create table test.t1 (n MEDIUMINT NOT NULL AUTO_INCREMENT, f FLOAT, d DATETIME, PRIMARY KEY(n));
+create procedure test.p1()
+begin
+INSERT INTO test.t1 (f,d) VALUES (RAND(),NOW());
+end//
+
+<End test section 1 (non deterministic SP)>
+-------------------------------------------
+CREATE TABLE test.t2 (a INT NOT NULL AUTO_INCREMENT, t CHAR(4), PRIMARY KEY(a));
+CREATE PROCEDURE test.p2(n int)
+begin
+CASE n
+WHEN 1 THEN
+UPDATE test.t2 set t ='Tex';
+WHEN 2 THEN
+UPDATE test.t2 set t ='SQL';
+ELSE
+UPDATE test.t2 set t ='NONE';
+END CASE;
+end//
+INSERT INTO test.t2 VALUES(NULL,'NEW'),(NULL,'NEW'),(NULL,'NEW'),(NULL,'NEW');
+select * from test.t2;
+a t
+1 NEW
+2 NEW
+3 NEW
+4 NEW
+select * from test.t2;
+a t
+1 NEW
+2 NEW
+3 NEW
+4 NEW
+call test.p2(1);
+select * from test.t2;
+a t
+1 Tex
+2 Tex
+3 Tex
+4 Tex
+select * from test.t2;
+a t
+1 Tex
+2 Tex
+3 Tex
+4 Tex
+call test.p2(2);
+select * from test.t2;
+a t
+1 SQL
+2 SQL
+3 SQL
+4 SQL
+select * from test.t2;
+a t
+1 SQL
+2 SQL
+3 SQL
+4 SQL
+call test.p2(3);
+select * from test.t2;
+a t
+1 NONE
+2 NONE
+3 NONE
+4 NONE
+select * from test.t2;
+a t
+1 NONE
+2 NONE
+3 NONE
+4 NONE
+DROP PROCEDURE test.p1;
+DROP PROCEDURE test.p2;
+DROP TABLE test.t1;
+DROP TABLE test.t2;
diff --git a/mysql-test/r/rpl_row_sp002_innodb.result b/mysql-test/r/rpl_row_sp002_innodb.result
new file mode 100644
index 00000000000..a42c9af988c
--- /dev/null
+++ b/mysql-test/r/rpl_row_sp002_innodb.result
@@ -0,0 +1,239 @@
+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;
+DROP PROCEDURE IF EXISTS test.p1;
+DROP PROCEDURE IF EXISTS test.p2;
+DROP PROCEDURE IF EXISTS test.p3;
+DROP TABLE IF EXISTS test.t3;
+DROP TABLE IF EXISTS test.t1;
+DROP TABLE IF EXISTS test.t2;
+CREATE TABLE test.t1 (a INT AUTO_INCREMENT KEY, t CHAR(6)) ENGINE=INNODB;
+CREATE TABLE test.t2 (a INT AUTO_INCREMENT KEY, f INT, FOREIGN KEY(a) REFERENCES test.t1(a) ON DELETE CASCADE) ENGINE=INNODB;
+create procedure test.p1(IN i CHAR(6))
+begin
+INSERT INTO test.t1 (t) VALUES (i);
+INSERT INTO test.t2 VALUES (NULL,LAST_INSERT_ID());
+end|
+create procedure test.p2(IN i INT)
+begin
+DELETE FROM test.t1 where a < i;
+end|
+
+< -- test 1 call p1 -- >
+------------------------
+SET FOREIGN_KEY_CHECKS=1;
+call test.p1('texas');
+call test.p1('Live');
+call test.p1('next');
+call test.p1('to');
+call test.p1('OK');
+call test.p1('MySQL');
+
+< -- test 1 select master after p1 -- >
+---------------------------------------
+SELECT * FROM test.t1;
+a t
+1 texas
+2 Live
+3 next
+4 to
+5 OK
+6 MySQL
+SELECT * FROM test.t2;
+a f
+1 1
+2 2
+3 3
+4 4
+5 5
+6 6
+
+< -- test 1 select slave after p1 -- >
+--------------------------------------
+SELECT * FROM test.t1;
+a t
+1 texas
+2 Live
+3 next
+4 to
+5 OK
+6 MySQL
+SELECT * FROM test.t2;
+a f
+1 1
+2 2
+3 3
+4 4
+5 5
+6 6
+
+< -- test 1 call p2 & select master -- >
+----------------------------------------
+call test.p2(4);
+SELECT * FROM test.t1;
+a t
+4 to
+5 OK
+6 MySQL
+SELECT * FROM test.t2;
+a f
+4 4
+5 5
+6 6
+
+< -- test 1 select slave after p2 -- >
+--------------------------------------
+SELECT * FROM test.t1;
+a t
+4 to
+5 OK
+6 MySQL
+SELECT * FROM test.t2;
+a f
+4 4
+5 5
+6 6
+
+< -- End test 1 Begin test 2 -- >
+---------------------------------
+SET FOREIGN_KEY_CHECKS=0;
+DROP PROCEDURE IF EXISTS test.p1;
+DROP PROCEDURE IF EXISTS test.p2;
+DROP TABLE IF EXISTS test.t1;
+DROP TABLE IF EXISTS test.t2;
+CREATE TABLE test.t1 (a INT, t CHAR(6), PRIMARY KEY(a)) ENGINE=INNODB;
+CREATE TABLE test.t2 (a INT, f INT, FOREIGN KEY(a) REFERENCES test.t1(a) ON UPDATE CASCADE, PRIMARY KEY(a)) ENGINE=INNODB;
+CREATE PROCEDURE test.p1(IN nm INT, IN ch CHAR(6))
+BEGIN
+INSERT INTO test.t1 (a,t) VALUES (nm, ch);
+INSERT INTO test.t2 VALUES (nm, LAST_INSERT_ID());
+END|
+CREATE PROCEDURE test.p2(IN i INT)
+BEGIN
+UPDATE test.t1 SET a = i*10 WHERE a = i;
+END|
+SET FOREIGN_KEY_CHECKS=1;
+CALL test.p1(1,'texas');
+CALL test.p1(2,'Live');
+CALL test.p1(3,'next');
+CALL test.p1(4,'to');
+CALL test.p1(5,'OK');
+CALL test.p1(6,'MySQL');
+
+< -- test 2 select Master after p1 -- >
+---------------------------------------
+SELECT * FROM test.t1;
+a t
+1 texas
+2 Live
+3 next
+4 to
+5 OK
+6 MySQL
+SELECT * FROM test.t2;
+a f
+1 6
+2 6
+3 6
+4 6
+5 6
+6 6
+
+< -- test 2 select Slave after p1 -- >
+--------------------------------------
+SELECT * FROM test.t1;
+a t
+1 texas
+2 Live
+3 next
+4 to
+5 OK
+6 MySQL
+SELECT * FROM test.t2;
+a f
+1 6
+2 6
+3 6
+4 6
+5 6
+6 6
+
+< -- test 2 call p2 & select Master -- >
+----------------------------------------
+CALL test.p2(2);
+CALL test.p2(4);
+CALL test.p2(6);
+SELECT * FROM test.t1;
+a t
+1 texas
+3 next
+5 OK
+20 Live
+40 to
+60 MySQL
+SELECT * FROM test.t2;
+a f
+1 6
+3 6
+5 6
+20 6
+40 6
+60 6
+
+< -- test 1 select Slave after p2 -- >
+--------------------------------------
+SELECT * FROM test.t1;
+a t
+1 texas
+3 next
+5 OK
+20 Live
+40 to
+60 MySQL
+SELECT * FROM test.t2;
+a f
+1 6
+3 6
+5 6
+20 6
+40 6
+60 6
+
+< -- End test 2 Begin test 3 -- >
+---------------------------------
+CREATE TABLE test.t3 (a INT AUTO_INCREMENT KEY, t CHAR(6))ENGINE=INNODB;
+CREATE PROCEDURE test.p3(IN n INT)
+begin
+CASE n
+WHEN 2 THEN
+DELETE from test.t3;
+ELSE
+INSERT INTO test.t3 VALUES (NULL,'NONE');
+END CASE;
+end|
+SET AUTOCOMMIT=0;
+START TRANSACTION;
+ROLLBACK;
+select * from test.t3;
+a t
+select * from test.t3;
+a t
+START TRANSACTION;
+COMMIT;
+select * from test.t3;
+a t
+98 NONE
+select * from test.t3;
+a t
+98 NONE
+SET AUTOCOMMIT=1;
+SET FOREIGN_KEY_CHECKS=0;
+DROP PROCEDURE IF EXISTS test.p3;
+DROP PROCEDURE IF EXISTS test.p1;
+DROP PROCEDURE IF EXISTS test.p2;
+DROP TABLE IF EXISTS test.t1;
+DROP TABLE IF EXISTS test.t2;
+DROP TABLE IF EXISTS test.t3;
diff --git a/mysql-test/r/rpl_row_sp003.result b/mysql-test/r/rpl_row_sp003.result
new file mode 100644
index 00000000000..01e352c3d46
--- /dev/null
+++ b/mysql-test/r/rpl_row_sp003.result
@@ -0,0 +1,49 @@
+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;
+DROP PROCEDURE IF EXISTS test.p1;
+DROP PROCEDURE IF EXISTS test.p2;
+DROP TABLE IF EXISTS test.t1;
+CREATE TABLE test.t1(a INT,PRIMARY KEY(a))ENGINE=INNODB;
+CREATE PROCEDURE test.p1()
+BEGIN
+INSERT INTO test.t1 VALUES (4);
+SELECT get_lock("test", 100);
+UPDATE test.t1 set a=a+4 WHERE a=4;
+END|
+CREATE PROCEDURE test.p2()
+BEGIN
+UPDATE test.t1 SET a=a+1;
+END|
+SELECT get_lock("test", 200);
+get_lock("test", 200)
+1
+ CALL test.p1();
+CALL test.p2();
+SELECT release_lock("test");
+release_lock("test")
+1
+SELECT * FROM test.t1;
+a
+5
+SELECT * FROM test.t1;
+a
+5
+DROP TABLE IF EXISTS test.t1;
+CREATE TABLE test.t1(a INT,PRIMARY KEY(a))ENGINE=INNODB;
+CALL test.p2();
+CALL test.p1();
+get_lock("test", 100)
+0
+SELECT * FROM test.t1;
+a
+8
+SELECT * FROM test.t1;
+a
+8
+DROP PROCEDURE IF EXISTS test.p1;
+DROP PROCEDURE IF EXISTS test.p2;
+DROP TABLE IF EXISTS test.t1;
diff --git a/mysql-test/r/rpl_row_sp005.result b/mysql-test/r/rpl_row_sp005.result
new file mode 100644
index 00000000000..24d68f3af3d
--- /dev/null
+++ b/mysql-test/r/rpl_row_sp005.result
@@ -0,0 +1,100 @@
+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;
+DROP PROCEDURE IF EXISTS test.p1;
+DROP PROCEDURE IF EXISTS test.p2;
+DROP TABLE IF EXISTS test.t2;
+DROP TABLE IF EXISTS test.t1;
+DROP TABLE IF EXISTS test.t3;
+CREATE TABLE IF NOT EXISTS test.t1(id INT, data CHAR(16),PRIMARY KEY(id));
+CREATE TABLE IF NOT EXISTS test.t2(id2 INT,PRIMARY KEY(id2));
+CREATE TABLE IF NOT EXISTS test.t3(id3 INT,PRIMARY KEY(id3), c CHAR(16));
+CREATE PROCEDURE test.p1()
+BEGIN
+DECLARE done INT DEFAULT 0;
+DECLARE spa CHAR(16);
+DECLARE spb,spc INT;
+DECLARE cur1 CURSOR FOR SELECT id,data FROM test.t1;
+DECLARE cur2 CURSOR FOR SELECT id2 FROM test.t2;
+DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done = 1;
+OPEN cur1;
+OPEN cur2;
+REPEAT
+FETCH cur1 INTO spb, spa;
+FETCH cur2 INTO spc;
+IF NOT done THEN
+IF spb < spc THEN
+INSERT INTO test.t3 VALUES (spb,spa);
+ELSE
+INSERT INTO test.t3 VALUES (spc,spa);
+END IF;
+END IF;
+UNTIL done END REPEAT;
+CLOSE cur1;
+CLOSE cur2;
+END|
+CREATE PROCEDURE test.p2()
+BEGIN
+INSERT INTO test.t1 VALUES (4,'MySQL'),(20,'ROCKS'),(11,'Texas'),(10,'kyle');
+INSERT INTO test.t2 VALUES (4),(2),(1),(3);
+UPDATE test.t1 SET id=id+4 WHERE id=4;
+END|
+
+< ---- Master selects-- >
+-------------------------
+CALL test.p2();
+SELECT * FROM test.t1;
+id data
+8 MySQL
+20 ROCKS
+11 Texas
+10 kyle
+SELECT * FROM test.t2;
+id2
+1
+2
+3
+4
+
+< ---- Slave selects-- >
+------------------------
+SELECT * FROM test.t1;
+id data
+8 MySQL
+20 ROCKS
+11 Texas
+10 kyle
+SELECT * FROM test.t2;
+id2
+1
+2
+3
+4
+
+< ---- Master selects-- >
+-------------------------
+CALL test.p1();
+SELECT * FROM test.t3;
+id3 c
+1 MySQL
+2 ROCKS
+3 Texas
+4 kyle
+
+< ---- Slave selects-- >
+------------------------
+SELECT * FROM test.t3;
+id3 c
+1 MySQL
+2 ROCKS
+3 Texas
+4 kyle
+ALTER PROCEDURE test.p1 MODIFIES SQL DATA;
+DROP PROCEDURE IF EXISTS test.p1;
+DROP PROCEDURE IF EXISTS test.p2;
+DROP TABLE IF EXISTS test.t1;
+DROP TABLE IF EXISTS test.t2;
+DROP TABLE IF EXISTS test.t3;
diff --git a/mysql-test/r/rpl_row_sp006_InnoDB.result b/mysql-test/r/rpl_row_sp006_InnoDB.result
new file mode 100644
index 00000000000..9b9b04dbbee
--- /dev/null
+++ b/mysql-test/r/rpl_row_sp006_InnoDB.result
@@ -0,0 +1,45 @@
+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;
+create database if not exists mysqltest1;
+DROP PROCEDURE IF EXISTS mysqltest1.p1;
+DROP PROCEDURE IF EXISTS mysqltest1.p2;
+DROP TABLE IF EXISTS mysqltest1.t2;
+DROP TABLE IF EXISTS mysqltest1.t1;
+CREATE TABLE IF NOT EXISTS mysqltest1.t1(name CHAR(16), birth DATE,PRIMARY KEY(name))ENGINE=InnoDB;
+CREATE TABLE IF NOT EXISTS mysqltest1.t2(name CHAR(16), age INT ,PRIMARY KEY(name))ENGINE=InnoDB;
+CREATE PROCEDURE mysqltest1.p1()
+BEGIN
+DECLARE done INT DEFAULT 0;
+DECLARE spa CHAR(16);
+DECLARE spb INT;
+DECLARE cur1 CURSOR FOR SELECT name,
+(YEAR(CURDATE())-YEAR(birth))-(RIGHT(CURDATE(),5)<RIGHT(birth,5))
+FROM mysqltest1.t1;
+DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done = 1;
+OPEN cur1;
+SET AUTOCOMMIT=0;
+REPEAT
+FETCH cur1 INTO spa, spb;
+IF NOT done THEN
+START TRANSACTION;
+INSERT INTO mysqltest1.t2 VALUES (spa,spb);
+COMMIT;
+END IF;
+UNTIL done END REPEAT;
+SET AUTOCOMMIT=1;
+CLOSE cur1;
+END|
+CREATE PROCEDURE mysqltest1.p2()
+BEGIN
+INSERT INTO mysqltest1.t1 VALUES ('MySQL','1993-02-04'),('ROCKS', '1990-08-27'),('Texas', '1999-03-30'),('kyle','2005-1-1');
+END|
+CALL mysqltest1.p2();
+CALL mysqltest1.p1();
+DROP PROCEDURE IF EXISTS mysqltest1.p1;
+DROP PROCEDURE IF EXISTS mysqltest1.p2;
+DROP TABLE IF EXISTS mysqltest1.t1;
+DROP TABLE IF EXISTS mysqltest1.t2;
diff --git a/mysql-test/r/rpl_row_sp007_innodb.result b/mysql-test/r/rpl_row_sp007_innodb.result
new file mode 100644
index 00000000000..9a2822835f8
--- /dev/null
+++ b/mysql-test/r/rpl_row_sp007_innodb.result
@@ -0,0 +1,50 @@
+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;
+DROP PROCEDURE IF EXISTS test.p1;
+DROP TABLE IF EXISTS test.t1;
+CREATE PROCEDURE test.p1(IN i INT)
+BEGIN
+DECLARE CONTINUE HANDLER FOR sqlexception BEGIN END;
+DROP TABLE IF EXISTS test.t1;
+CREATE TABLE test.t1 (num INT,PRIMARY KEY(num))ENGINE=INNODB;
+START TRANSACTION;
+INSERT INTO test.t1 VALUES(i);
+savepoint t1_save;
+INSERT INTO test.t1 VALUES (14);
+ROLLBACK to savepoint t1_save;
+COMMIT;
+END|
+
+< ---- Master selects-- >
+-------------------------
+CALL test.p1(12);
+Warnings:
+Note 1051 Unknown table 't1'
+SELECT * FROM test.t1;
+num
+12
+
+< ---- Slave selects-- >
+------------------------
+SELECT * FROM test.t1;
+num
+12
+
+< ---- Master selects-- >
+-------------------------
+CALL test.p1(13);
+SELECT * FROM test.t1;
+num
+13
+
+< ---- Slave selects-- >
+------------------------
+SELECT * FROM test.t1;
+num
+13
+DROP PROCEDURE IF EXISTS test.p1;
+DROP TABLE IF EXISTS test.t1;
diff --git a/mysql-test/r/rpl_row_sp008.result b/mysql-test/r/rpl_row_sp008.result
new file mode 100644
index 00000000000..57606e26f19
--- /dev/null
+++ b/mysql-test/r/rpl_row_sp008.result
@@ -0,0 +1,45 @@
+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;
+DROP PROCEDURE IF EXISTS test.p1;
+DROP TABLE IF EXISTS test.t2;
+CREATE TABLE test.t1 (a INT,PRIMARY KEY(a));
+CREATE TABLE test.t2 (a INT,PRIMARY KEY(a));
+INSERT INTO test.t1 VALUES(1),(2);
+CREATE PROCEDURE test.p1()
+BEGIN
+SELECT SQL_CALC_FOUND_ROWS * FROM test.t1 LIMIT 1;
+INSERT INTO test.t2 VALUES(FOUND_ROWS());
+END|
+
+< ---- Master selects-- >
+-------------------------
+CALL test.p1();
+a
+1
+SELECT * FROM test.t2;
+a
+2
+
+< ---- Slave selects-- >
+------------------------
+SELECT * FROM test.t2;
+a
+2
+show binlog events;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 4 Format_desc 1 102 Server ver: VERSION, Binlog ver: 4
+master-bin.000001 102 Query 1 193 use `test`; DROP TABLE IF EXISTS test.t2
+master-bin.000001 193 Query 1 299 use `test`; CREATE TABLE test.t1 (a INT,PRIMARY KEY(a))
+master-bin.000001 299 Query 1 405 use `test`; CREATE TABLE test.t2 (a INT,PRIMARY KEY(a))
+master-bin.000001 405 Table_map 1 444 test.t1
+master-bin.000001 444 Write_rows 1 483
+master-bin.000001 483 Table_map 1 540 mysql.proc
+master-bin.000001 540 Write_rows 1 723
+master-bin.000001 723 Table_map 1 762 test.t2
+master-bin.000001 762 Write_rows 1 796
+DROP PROCEDURE IF EXISTS test.p1;
+DROP TABLE IF EXISTS test.t1;
diff --git a/mysql-test/r/rpl_row_sp009.result b/mysql-test/r/rpl_row_sp009.result
new file mode 100644
index 00000000000..8073e506ade
--- /dev/null
+++ b/mysql-test/r/rpl_row_sp009.result
@@ -0,0 +1,77 @@
+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;
+DROP PROCEDURE IF EXISTS test.p1;
+DROP TABLE IF EXISTS test.t1;
+DROP TABLE IF EXISTS test.t2;
+CREATE TABLE test.t1 (a INT, PRIMARY KEY(a));
+INSERT INTO test.t1 VALUES (1),(2),(3),(4);
+CREATE TABLE test.t2 (a INT, PRIMARY KEY(a));
+CREATE PROCEDURE test.p1 (arg1 CHAR(1))
+BEGIN
+DECLARE b, c INT;
+IF arg1 = 'a' THEN
+BEGIN
+DECLARE cur1 CURSOR FOR SELECT A FROM test.t1 WHERE a % 2;
+DECLARE continue handler for not found set b = 1;
+SET b = 0;
+OPEN cur1;
+c1_repeat: REPEAT
+FETCH cur1 INTO c;
+IF (b = 1) THEN
+LEAVE c1_repeat;
+END IF;
+INSERT INTO test.t2 VALUES (c);
+UNTIL b = 1
+END REPEAT;
+CLOSE cur1;
+END;
+END IF;
+IF arg1 = 'b' THEN
+BEGIN
+DECLARE cur2 CURSOR FOR SELECT a FROM test.t1 WHERE NOT a % 2;
+DECLARE continue handler for not found set b = 1;
+SET b = 0;
+OPEN cur2;
+c2_repeat: REPEAT
+FETCH cur2 INTO c;
+IF (b = 1) THEN
+LEAVE c2_repeat;
+END IF;
+INSERT INTO test.t2 VALUES (c);
+UNTIL b = 1
+END REPEAT;
+CLOSE cur2;
+END;
+END IF;
+END|
+CALL test.p1('a');
+SELECT * FROM test.t2;
+a
+1
+3
+SELECT * FROM test.t2;
+a
+1
+3
+truncate test.t2;
+call test.p1('b');
+select * from test.t2;
+a
+2
+4
+SELECT * FROM test.t2;
+a
+2
+4
+truncate test.t2;
+SELECT * FROM test.t2;
+a
+SELECT * FROM test.t2;
+a
+DROP PROCEDURE test.p1;
+DROP TABLE test.t1;
+DROP TABLE test.t2;
diff --git a/mysql-test/r/rpl_row_sp010.result b/mysql-test/r/rpl_row_sp010.result
new file mode 100644
index 00000000000..ba97f83b86a
--- /dev/null
+++ b/mysql-test/r/rpl_row_sp010.result
@@ -0,0 +1,56 @@
+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;
+DROP PROCEDURE IF EXISTS test.p1;
+DROP PROCEDURE IF EXISTS test.p2;
+DROP PROCEDURE IF EXISTS test.p3;
+DROP PROCEDURE IF EXISTS test.p4;
+DROP TABLE IF EXISTS test.t1;
+DROP TABLE IF EXISTS test.t2;
+CREATE PROCEDURE test.p1()
+BEGIN
+INSERT INTO test.t1 VALUES(2);
+END|
+CREATE PROCEDURE test.p2()
+BEGIN
+DROP TEMPORARY TABLE IF EXISTS test.t1;
+CREATE TEMPORARY TABLE test.t1 (a int, PRIMARY KEY(a));
+INSERT INTO test.t1 VALUES(1);
+CALL test.p1();
+END|
+CALL test.p2();
+SELECT * FROM test.t1;
+a
+1
+2
+show tables;
+Tables_in_test
+CREATE PROCEDURE test.p3()
+BEGIN
+INSERT INTO test.t2 VALUES(7);
+END|
+CREATE PROCEDURE test.p4()
+BEGIN
+DROP TABLE IF EXISTS test.t2;
+CREATE TABLE test.t2 (a int, PRIMARY KEY(a));
+INSERT INTO test.t2 VALUES(6);
+CALL test.p3();
+END|
+CALL test.p4();
+SELECT * FROM test.t2;
+a
+6
+7
+SELECT * FROM test.t2;
+a
+6
+7
+DROP PROCEDURE IF EXISTS test.p1;
+DROP PROCEDURE IF EXISTS test.p2;
+DROP PROCEDURE IF EXISTS test.p3;
+DROP PROCEDURE IF EXISTS test.p4;
+DROP TABLE IF EXISTS test.t1;
+DROP TABLE IF EXISTS test.t2;
diff --git a/mysql-test/r/rpl_row_sp011.result b/mysql-test/r/rpl_row_sp011.result
new file mode 100644
index 00000000000..e35c9f21adb
--- /dev/null
+++ b/mysql-test/r/rpl_row_sp011.result
@@ -0,0 +1,69 @@
+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;
+DROP PROCEDURE IF EXISTS test.p1;
+DROP PROCEDURE IF EXISTS test.p2;
+DROP PROCEDURE IF EXISTS test.p3;
+DROP PROCEDURE IF EXISTS test.p4;
+DROP PROCEDURE IF EXISTS test.p5;
+DROP PROCEDURE IF EXISTS test.p6;
+DROP PROCEDURE IF EXISTS test.p7;
+DROP TABLE IF EXISTS test.t1;
+DROP TABLE IF EXISTS test.t2;
+CREATE TABLE test.t1 (a int, PRIMARY KEY(a));
+INSERT INTO test.t1 VALUES (1);
+CREATE PROCEDURE test.p1()
+BEGIN
+ALTER TABLE test.t1 ADD COLUMN b CHAR(4) AFTER a;
+UPDATE test.t1 SET b = 'rbr' WHERE a = 1;
+CALL test.p2();
+END|
+CREATE PROCEDURE test.p2()
+BEGIN
+ALTER TABLE test.t1 ADD COLUMN f FLOAT AFTER b;
+UPDATE test.t1 SET f = RAND() WHERE a = 1;
+CALL test.p3();
+END|
+CREATE PROCEDURE test.p3()
+BEGIN
+ALTER TABLE test.t1 RENAME test.t2;
+CALL test.p4();
+END|
+CREATE PROCEDURE test.p4()
+BEGIN
+ALTER TABLE test.t2 ADD INDEX (f);
+ALTER TABLE test.t2 CHANGE a a INT UNSIGNED NOT NULL AUTO_INCREMENT;
+INSERT INTO test.t2 VALUES (NULL,'TEST',RAND());
+CALL test.p5();
+END|
+CREATE PROCEDURE test.p5()
+BEGIN
+ALTER TABLE test.t2 ORDER BY f;
+INSERT INTO test.t2 VALUES (NULL,'STM',RAND());
+CALL test.p6();
+END|
+CREATE PROCEDURE test.p6()
+BEGIN
+ALTER TABLE test.t2 ADD COLUMN b2 CHAR(4) FIRST;
+ALTER TABLE test.t2 ADD COLUMN to_drop BIT(8) AFTER b2;
+INSERT INTO test.t2 VALUES ('new',1,NULL,'STM',RAND());
+CALL test.p7();
+END|
+CREATE PROCEDURE test.p7()
+BEGIN
+ALTER TABLE test.t2 DROP COLUMN to_drop;
+INSERT INTO test.t2 VALUES ('gone',NULL,'STM',RAND());
+END|
+CALL test.p1();
+DROP PROCEDURE IF EXISTS test.p1;
+DROP PROCEDURE IF EXISTS test.p2;
+DROP PROCEDURE IF EXISTS test.p3;
+DROP PROCEDURE IF EXISTS test.p4;
+DROP PROCEDURE IF EXISTS test.p5;
+DROP PROCEDURE IF EXISTS test.p6;
+DROP PROCEDURE IF EXISTS test.p7;
+DROP TABLE IF EXISTS test.t1;
+DROP TABLE IF EXISTS test.t2;
diff --git a/mysql-test/r/rpl_row_sp012.result b/mysql-test/r/rpl_row_sp012.result
new file mode 100644
index 00000000000..28da1c3208e
--- /dev/null
+++ b/mysql-test/r/rpl_row_sp012.result
@@ -0,0 +1,58 @@
+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;
+DROP PROCEDURE IF EXISTS test.p1;
+DROP PROCEDURE IF EXISTS test.p2;
+DROP PROCEDURE IF EXISTS test.p3;
+grant usage on *.* to user1@localhost;
+flush privileges;
+SELECT CURRENT_USER();
+CURRENT_USER()
+root@localhost
+SELECT USER();
+USER()
+root@localhost
+CREATE PROCEDURE test.p1 () SQL SECURITY INVOKER SELECT CURRENT_USER(), USER();
+CREATE PROCEDURE test.p2 () SQL SECURITY DEFINER CALL test.p1();
+CREATE PROCEDURE test.p3 () SQL SECURITY INVOKER CALL test.p1();
+GRANT EXECUTE ON PROCEDURE p1 TO user1@localhost;
+GRANT EXECUTE ON PROCEDURE p2 TO user1@localhost;
+GRANT EXECUTE ON PROCEDURE p3 TO user1@localhost;
+
+<******** Master user1 p3 & p2 calls *******>
+----------------------------------------------
+SELECT CURRENT_USER();
+CURRENT_USER()
+user1@localhost
+SELECT USER();
+USER()
+user1@localhost
+CALL test.p3();
+CURRENT_USER() USER()
+user1@localhost user1@localhost
+CALL test.p2();
+CURRENT_USER() USER()
+root@localhost user1@localhost
+
+<******** Slave user1 p3 & p2 calls *******>
+---------------------------------------------
+SELECT CURRENT_USER();
+CURRENT_USER()
+user1@localhost
+SELECT USER();
+USER()
+user1@localhost
+CALL test.p3();
+CURRENT_USER() USER()
+user1@localhost user1@localhost
+CALL test.p2();
+CURRENT_USER() USER()
+root@localhost user1@localhost
+DROP PROCEDURE IF EXISTS test.p1;
+DROP PROCEDURE IF EXISTS test.p3;
+DROP PROCEDURE IF EXISTS test.p2;
+DROP TABLE IF EXISTS test.t1;
+DROP TABLE IF EXISTS test.t2;
diff --git a/mysql-test/r/rpl_row_stop_middle.result b/mysql-test/r/rpl_row_stop_middle.result
new file mode 100644
index 00000000000..46ca5748174
--- /dev/null
+++ b/mysql-test/r/rpl_row_stop_middle.result
@@ -0,0 +1,26 @@
+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;
+create table t1 (a int not null auto_increment primary key, b int, key(b));
+stop slave;
+INSERT INTO t1 (a) VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+INSERT INTO t1 (a) SELECT null FROM t1;
+INSERT INTO t1 (a) SELECT null FROM t1;
+INSERT INTO t1 (a) SELECT null FROM t1;
+INSERT INTO t1 (a) SELECT null FROM t1;
+INSERT INTO t1 (a) SELECT null FROM t1;
+INSERT INTO t1 (a) SELECT null FROM t1;
+INSERT INTO t1 (a) SELECT null FROM t1;
+INSERT INTO t1 (a) SELECT null FROM t1;
+INSERT INTO t1 (a) SELECT null FROM t1;
+INSERT INTO t1 (a) SELECT null FROM t1;
+INSERT INTO t1 (a) SELECT null FROM t1;
+INSERT INTO t1 (a) SELECT null FROM t1;
+INSERT INTO t1 (a) SELECT null FROM t1;
+start slave;
+stop slave;
+drop table t1;
+drop table t1;
diff --git a/mysql-test/r/rpl_row_stop_middle_update.result b/mysql-test/r/rpl_row_stop_middle_update.result
new file mode 100644
index 00000000000..584a3af4543
--- /dev/null
+++ b/mysql-test/r/rpl_row_stop_middle_update.result
@@ -0,0 +1,16 @@
+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;
+create table t1 (words varchar(20)) engine=myisam;
+load data infile '../../std_data/words.dat' into table t1 (words);
+select count(*) from t1;
+count(*)
+70
+select count(*) from t1;
+count(*)
+70
+drop table t1;
+drop table t1;
diff --git a/mysql-test/r/rpl_row_tabledefs.result b/mysql-test/r/rpl_row_tabledefs.result
new file mode 100644
index 00000000000..715ffcc7578
--- /dev/null
+++ b/mysql-test/r/rpl_row_tabledefs.result
@@ -0,0 +1,248 @@
+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;
+CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=myisam;
+CREATE TABLE t2 (a INT PRIMARY KEY, b INT) ENGINE=myisam;
+CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE=myisam;
+CREATE TABLE t4 (a INT) ENGINE=myisam;
+CREATE TABLE t5 (a INT, b INT, c INT) ENGINE=myisam;
+CREATE TABLE t6 (a INT, b INT, c INT) ENGINE=myisam;
+CREATE TABLE t9 (a INT PRIMARY KEY) ENGINE=myisam;
+ALTER TABLE t1 ADD x INT DEFAULT 42;
+ALTER TABLE t2 ADD x INT DEFAULT 42 AFTER a;
+ALTER TABLE t3 ADD x INT DEFAULT 42 FIRST;
+ALTER TABLE t4 MODIFY a FLOAT;
+ALTER TABLE t5 MODIFY b FLOAT;
+ALTER TABLE t6 MODIFY c FLOAT;
+INSERT INTO t9 VALUES (1);
+INSERT INTO t1 VALUES (1,2);
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port MASTER_PORT
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos 1042
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+Slave_SQL_Running No
+Replicate_Do_DB
+Replicate_Ignore_DB
+Replicate_Do_Table
+Replicate_Ignore_Table
+Replicate_Wild_Do_Table
+Replicate_Wild_Ignore_Table
+Last_Errno 1454
+Last_Error Table width mismatch - received 2 columns, test.t1 has 3 columns
+Skip_Counter 0
+Exec_Master_Log_Pos 968
+Relay_Log_Space #
+Until_Condition None
+Until_Log_File
+Until_Log_Pos 0
+Master_SSL_Allowed No
+Master_SSL_CA_File
+Master_SSL_CA_Path
+Master_SSL_Cert
+Master_SSL_Cipher
+Master_SSL_Key
+Seconds_Behind_Master #
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+INSERT INTO t9 VALUES (2);
+INSERT INTO t2 VALUES (2,4);
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port MASTER_PORT
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos 1185
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+Slave_SQL_Running No
+Replicate_Do_DB
+Replicate_Ignore_DB
+Replicate_Do_Table
+Replicate_Ignore_Table
+Replicate_Wild_Do_Table
+Replicate_Wild_Ignore_Table
+Last_Errno 1454
+Last_Error Table width mismatch - received 2 columns, test.t2 has 3 columns
+Skip_Counter 0
+Exec_Master_Log_Pos 1111
+Relay_Log_Space #
+Until_Condition None
+Until_Log_File
+Until_Log_Pos 0
+Master_SSL_Allowed No
+Master_SSL_CA_File
+Master_SSL_CA_Path
+Master_SSL_Cert
+Master_SSL_Cipher
+Master_SSL_Key
+Seconds_Behind_Master #
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+INSERT INTO t9 VALUES (3);
+INSERT INTO t3 VALUES (3,6);
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port MASTER_PORT
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos 1328
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+Slave_SQL_Running No
+Replicate_Do_DB
+Replicate_Ignore_DB
+Replicate_Do_Table
+Replicate_Ignore_Table
+Replicate_Wild_Do_Table
+Replicate_Wild_Ignore_Table
+Last_Errno 1454
+Last_Error Table width mismatch - received 2 columns, test.t3 has 3 columns
+Skip_Counter 0
+Exec_Master_Log_Pos 1254
+Relay_Log_Space #
+Until_Condition None
+Until_Log_File
+Until_Log_Pos 0
+Master_SSL_Allowed No
+Master_SSL_CA_File
+Master_SSL_CA_Path
+Master_SSL_Cert
+Master_SSL_Cipher
+Master_SSL_Key
+Seconds_Behind_Master #
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+INSERT INTO t9 VALUES (4);
+INSERT INTO t4 VALUES (4);
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port MASTER_PORT
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos 1466
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+Slave_SQL_Running No
+Replicate_Do_DB
+Replicate_Ignore_DB
+Replicate_Do_Table
+Replicate_Ignore_Table
+Replicate_Wild_Do_Table
+Replicate_Wild_Ignore_Table
+Last_Errno 1454
+Last_Error Column 0 type mismatch - received type 3, test.t4 has type 4
+Skip_Counter 0
+Exec_Master_Log_Pos 1397
+Relay_Log_Space #
+Until_Condition None
+Until_Log_File
+Until_Log_Pos 0
+Master_SSL_Allowed No
+Master_SSL_CA_File
+Master_SSL_CA_Path
+Master_SSL_Cert
+Master_SSL_Cipher
+Master_SSL_Key
+Seconds_Behind_Master #
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+INSERT INTO t9 VALUES (5);
+INSERT INTO t5 VALUES (5,10,25);
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port MASTER_PORT
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos 1614
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+Slave_SQL_Running No
+Replicate_Do_DB
+Replicate_Ignore_DB
+Replicate_Do_Table
+Replicate_Ignore_Table
+Replicate_Wild_Do_Table
+Replicate_Wild_Ignore_Table
+Last_Errno 1454
+Last_Error Column 1 type mismatch - received type 3, test.t5 has type 4
+Skip_Counter 0
+Exec_Master_Log_Pos 1535
+Relay_Log_Space #
+Until_Condition None
+Until_Log_File
+Until_Log_Pos 0
+Master_SSL_Allowed No
+Master_SSL_CA_File
+Master_SSL_CA_Path
+Master_SSL_Cert
+Master_SSL_Cipher
+Master_SSL_Key
+Seconds_Behind_Master #
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+INSERT INTO t9 VALUES (6);
+INSERT INTO t6 VALUES (6,12,36);
+SHOW SLAVE STATUS;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port MASTER_PORT
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos 1762
+Relay_Log_File #
+Relay_Log_Pos #
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running Yes
+Slave_SQL_Running No
+Replicate_Do_DB
+Replicate_Ignore_DB
+Replicate_Do_Table
+Replicate_Ignore_Table
+Replicate_Wild_Do_Table
+Replicate_Wild_Ignore_Table
+Last_Errno 1454
+Last_Error Column 2 type mismatch - received type 3, test.t6 has type 4
+Skip_Counter 0
+Exec_Master_Log_Pos 1683
+Relay_Log_Space #
+Until_Condition None
+Until_Log_File
+Until_Log_Pos 0
+Master_SSL_Allowed No
+Master_SSL_CA_File
+Master_SSL_CA_Path
+Master_SSL_Cert
+Master_SSL_Cipher
+Master_SSL_Key
+Seconds_Behind_Master #
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
+START SLAVE;
+DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t9;
diff --git a/mysql-test/r/rpl_row_timezone.result b/mysql-test/r/rpl_row_timezone.result
new file mode 100644
index 00000000000..26c10648ffb
--- /dev/null
+++ b/mysql-test/r/rpl_row_timezone.result
@@ -0,0 +1,121 @@
+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;
+set timestamp=100000000;
+create table t1 (t timestamp, n int not null auto_increment, PRIMARY KEY(n));
+create table t2 (t char(32), n int not null auto_increment, PRIMARY KEY(n));
+select @@time_zone;
+@@time_zone
+Europe/Moscow
+select @@time_zone;
+@@time_zone
+Europe/Moscow
+insert into t1 values ('20050101000000', NULL), ('20050611093902',NULL);
+insert into t1 values ('20040101000000',NULL), ('20040611093902',NULL);
+select * from t1;
+t n
+2005-01-01 00:00:00 1
+2005-06-11 09:39:02 2
+2004-01-01 00:00:00 3
+2004-06-11 09:39:02 4
+select * from t1;
+t n
+2005-01-01 00:00:00 1
+2005-06-11 09:39:02 2
+2004-01-01 00:00:00 3
+2004-06-11 09:39:02 4
+delete from t1;
+set time_zone='Europe/Moscow';
+insert into t1 values ('20040101000000',NULL), ('20040611093902',NULL);
+select * from t1;
+t n
+2004-01-01 00:00:00 5
+2004-06-11 09:39:02 6
+set time_zone='Europe/Moscow';
+select * from t1;
+t n
+2004-01-01 00:00:00 5
+2004-06-11 09:39:02 6
+/*!40019 SET @@session.max_insert_delayed_threads=0*/;
+/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
+ROLLBACK;
+use test;
+SET TIMESTAMP=100000000;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1;
+SET @@session.sql_mode=0;
+SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8;
+create table t1 (t timestamp, n int not null auto_increment, PRIMARY KEY(n));
+SET TIMESTAMP=100000000;
+create table t2 (t char(32), n int not null auto_increment, PRIMARY KEY(n));
+SET TIMESTAMP=100000000;
+delete from t1;
+# End of log file
+ROLLBACK /* added by mysqlbinlog */;
+/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
+delete from t1;
+set time_zone='UTC';
+load data infile '../../std_data/rpl_timezone2.dat' into table t1;
+Warnings:
+Warning 1265 Data truncated for column 't' at row 1
+Warning 1261 Row 1 doesn't contain data for all columns
+Warning 1265 Data truncated for column 't' at row 2
+Warning 1261 Row 2 doesn't contain data for all columns
+select * from t1;
+t n
+0000-00-00 00:00:00 7
+0000-00-00 00:00:00 8
+set time_zone='UTC';
+select * from t1;
+t n
+0000-00-00 00:00:00 7
+0000-00-00 00:00:00 8
+set time_zone='Europe/Moscow';
+set time_zone='Europe/Moscow';
+delete from t1;
+insert into t1 values ('20040101000000',NULL), ('20040611093902',NULL);
+set time_zone='MET';
+insert into t2 (select * from t1);
+select * from t1;
+t n
+2003-12-31 22:00:00 9
+2004-06-11 07:39:02 10
+select * from t2;
+t n
+2003-12-31 22:00:00 9
+2004-06-11 07:39:02 10
+delete from t2;
+set timestamp=1000072000;
+insert into t2 values (current_timestamp,NULL), (current_date,NULL), (current_time,NULL);
+select * from t2;
+t n
+2001-09-09 23:46:40 11
+2001-09-09 12
+23:46:40 13
+delete from t2;
+insert into t2 values (from_unixtime(1000000000),NULL),
+(unix_timestamp('2001-09-09 03:46:40'),NULL);
+select * from t2;
+t n
+2001-09-09 03:46:40 14
+1000000000 15
+select * from t2;
+t n
+2001-09-09 03:46:40 14
+1000000000 15
+set global time_zone='MET';
+delete from t2;
+set time_zone='UTC';
+insert into t2 values(convert_tz('2004-01-01 00:00:00','MET',@@time_zone),NULL);
+insert into t2 values(convert_tz('2005-01-01 00:00:00','MET','Japan'),NULL);
+select * from t2;
+t n
+2003-12-31 23:00:00 16
+2005-01-01 08:00:00 17
+select * from t2;
+t n
+2003-12-31 23:00:00 16
+2005-01-01 08:00:00 17
+drop table t1, t2;
diff --git a/mysql-test/r/rpl_row_trig001.result b/mysql-test/r/rpl_row_trig001.result
new file mode 100644
index 00000000000..dcbb05e4ab4
--- /dev/null
+++ b/mysql-test/r/rpl_row_trig001.result
@@ -0,0 +1,29 @@
+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;
+CREATE TABLE test.t1 (n MEDIUMINT NOT NULL, d DATETIME, PRIMARY KEY(n));
+CREATE TABLE test.t2 (n MEDIUMINT NOT NULL AUTO_INCREMENT, f FLOAT, d DATETIME, PRIMARY KEY(n));
+CREATE TABLE test.t3 (n MEDIUMINT NOT NULL AUTO_INCREMENT, d DATETIME, PRIMARY KEY(n));
+INSERT INTO test.t1 VALUES (1,NOW());
+CREATE TRIGGER test.t2_ai AFTER INSERT ON test.t2 FOR EACH ROW UPDATE test.t1 SET d=NOW() where n = 1;//
+CREATE PROCEDURE test.p3()
+BEGIN
+INSERT INTO test.t3 (d) VALUES (NOW());
+END//
+CREATE TRIGGER test.t3_bi_t2 BEFORE INSERT ON test.t2 FOR EACH ROW CALL test.p3()//
+CREATE PROCEDURE test.p2()
+BEGIN
+INSERT INTO test.t2 (f,d) VALUES (RAND(),NOW());
+END//
+
+<End test section 2 (Tiggers & SP)>
+-----------------------------------
+DROP PROCEDURE test.p2;
+DROP TRIGGER test.t2_ai;
+DROP TRIGGER test.t3_bi_t2;
+DROP TABLE test.t1;
+DROP TABLE test.t2;
+DROP TABLE test.t3;
diff --git a/mysql-test/r/rpl_row_trig002.result b/mysql-test/r/rpl_row_trig002.result
new file mode 100644
index 00000000000..62dc2f17562
--- /dev/null
+++ b/mysql-test/r/rpl_row_trig002.result
@@ -0,0 +1,63 @@
+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;
+DROP TRIGGER test.t2_ai;
+DROP TABLE IF EXISTS test.t1;
+DROP TABLE IF EXISTS test.t2;
+DROP TABLE IF EXISTS test.t3;
+CREATE TABLE test.t2 (value CHAR(30),domain_id INT, mailaccount_id INT, program CHAR(30),keey CHAR(30),PRIMARY KEY(domain_id));
+CREATE TABLE test.t3 (value CHAR(30),domain_id INT, mailaccount_id INT, program CHAR(30),keey CHAR(30),PRIMARY KEY(domain_id));
+CREATE TABLE test.t1 (id INT,domain CHAR(30),PRIMARY KEY(id));
+CREATE TRIGGER test.t2_ai AFTER INSERT ON test.t2 FOR EACH ROW UPDATE test.t3 ms, test.t1 d SET ms.value='No' WHERE ms.domain_id = (SELECT max(id) FROM test.t1 WHERE domain='example.com') AND ms.mailaccount_id IS NULL AND ms.program='spamfilter' AND ms.keey='scan_incoming'|
+INSERT INTO test.t1 VALUES (1, 'example.com'),(2, 'mysql.com'),(3, 'earthmotherwear.com'), (4, 'yahoo.com'),(5, 'example.com');
+select * from test.t1;
+id domain
+1 example.com
+2 mysql.com
+3 earthmotherwear.com
+4 yahoo.com
+5 example.com
+select * from test.t1;
+id domain
+1 example.com
+2 mysql.com
+3 earthmotherwear.com
+4 yahoo.com
+5 example.com
+INSERT INTO test.t3 VALUES ('Yes', 5, NULL, 'spamfilter','scan_incoming');
+INSERT INTO test.t3 VALUES ('Yes', 1, NULL, 'spamfilter','scan_incoming');
+INSERT INTO test.t2 VALUES ('Yes', 1, NULL, 'spamfilter','scan_incoming');
+select * from test.t2;
+value domain_id mailaccount_id program keey
+Yes 1 NULL spamfilter scan_incoming
+select * from test.t3;
+value domain_id mailaccount_id program keey
+No 5 NULL spamfilter scan_incoming
+Yes 1 NULL spamfilter scan_incoming
+select * from test.t2;
+value domain_id mailaccount_id program keey
+Yes 1 NULL spamfilter scan_incoming
+select * from test.t3;
+value domain_id mailaccount_id program keey
+No 5 NULL spamfilter scan_incoming
+Yes 1 NULL spamfilter scan_incoming
+DELETE FROM test.t1 WHERE id = 1;
+select * from test.t1;
+id domain
+2 mysql.com
+3 earthmotherwear.com
+4 yahoo.com
+5 example.com
+select * from test.t1;
+id domain
+2 mysql.com
+3 earthmotherwear.com
+4 yahoo.com
+5 example.com
+DROP TRIGGER test.t2_ai;
+DROP TABLE test.t1;
+DROP TABLE test.t2;
+DROP TABLE test.t3;
diff --git a/mysql-test/r/rpl_row_trig003.result b/mysql-test/r/rpl_row_trig003.result
new file mode 100644
index 00000000000..43c2ecde2b4
--- /dev/null
+++ b/mysql-test/r/rpl_row_trig003.result
@@ -0,0 +1,83 @@
+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;
+DROP TRIGGER test.t1_bi;
+DROP TRIGGER test.t2_ai;
+DROP TRIGGER test.t1_bu;
+DROP TRIGGER test.t2_au;
+DROP TRIGGER test.t1_bd;
+DROP TRIGGER test.t2_ad;
+DROP TABLE IF EXISTS test.t1;
+DROP TABLE IF EXISTS test.t2;
+DROP TABLE IF EXISTS test.t3;
+CREATE TABLE test.t1 (id MEDIUMINT NOT NULL AUTO_INCREMENT, b1 BIT(8), vc VARCHAR(255), bc CHAR(255), d DECIMAL(10,4) DEFAULT 0, f FLOAT DEFAULT 0, total BIGINT UNSIGNED, y YEAR, t TIMESTAMP,PRIMARY KEY(id));
+CREATE TABLE test.t2 (id MEDIUMINT NOT NULL AUTO_INCREMENT, b1 BIT(8), vc VARCHAR(255), bc CHAR(255), d DECIMAL(10,4) DEFAULT 0, f FLOAT DEFAULT 0, total BIGINT UNSIGNED, y YEAR, t TIMESTAMP,PRIMARY KEY(id));
+CREATE TABLE test.t3 (id MEDIUMINT NOT NULL AUTO_INCREMENT, b1 BIT(8), vc VARCHAR(255), bc CHAR(255), d DECIMAL(10,4) DEFAULT 0, f FLOAT DEFAULT 0, total BIGINT UNSIGNED, y YEAR, t TIMESTAMP,PRIMARY KEY(id));
+CREATE TRIGGER test.t1_bi BEFORE INSERT ON test.t1 FOR EACH ROW UPDATE test.t3 SET b1=1 and y=YEAR(NOW())|
+CREATE TRIGGER test.t2_ai AFTER INSERT ON test.t2 FOR EACH ROW BEGIN
+INSERT INTO test.t3 VALUES(NULL,0,'MySQL Replication team rocks!', 'Dark beer in prague is #1',12345.34,12.51,0,1965,NOW());
+UPDATE test.t3 SET f = ROUND(f);
+END|
+CREATE TRIGGER test.t1_bu BEFORE UPDATE on test.t1 FOR EACH ROW BEGIN
+UPDATE test.t3 SET y = '2000';
+INSERT INTO test.t3 VALUES(NULL,1,'Testing MySQL databases before update ', 'Insert should work',621.43, 0105.21,0,1974,NOW());
+END|
+CREATE TRIGGER test.t2_au AFTER UPDATE on test.t2 FOR EACH ROW BEGIN
+DECLARE done INT DEFAULT 0;
+DECLARE a DECIMAL(10,4);
+DECLARE b FLOAT;
+DECLARE num MEDIUMINT;
+DECLARE cur1 CURSOR FOR SELECT t2.id, t2.d, t2.f FROM test.t2;
+DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done = 1;
+OPEN cur1;
+REPEAT
+FETCH cur1 INTO num, a, b;
+IF NOT done THEN
+UPDATE test.t3 SET total =(a*b) WHERE ID = num;
+END IF;
+UNTIL done END REPEAT;
+CLOSE cur1;
+END|
+CREATE TRIGGER test.t1_bd BEFORE DELETE on test.t1 FOR EACH ROW BEGIN
+DECLARE done INT DEFAULT 0;
+DECLARE a BIT(8);
+DECLARE b VARCHAR(255);
+DECLARE c CHAR(255);
+DECLARE d DECIMAL(10,4);
+DECLARE e FLOAT;
+DECLARE f BIGINT UNSIGNED;
+DECLARE g YEAR;
+DECLARE h TIMESTAMP;
+DECLARE cur1 CURSOR FOR SELECT t1.b1, t1.vc, t1.bc, t1.d, t1.f, t1.total, t1.y, t1.t FROM test.t1;
+DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done = 1;
+OPEN cur1;
+REPEAT
+FETCH cur1 INTO a, b, c, d, e, f, g, h;
+IF NOT done THEN
+INSERT INTO test.t3 VALUES(NULL, a, b, c, d, e, f, g, h);
+END IF;
+UNTIL done END REPEAT;
+CLOSE cur1;
+END|
+CREATE TRIGGER test.t2_ad AFTER DELETE ON test.t2 FOR EACH ROW
+DELETE FROM test.t1|
+INSERT INTO test.t1 VALUES(NULL,1,'Testing MySQL databases is a cool ', 'Must make it bug free for the customer',654321.4321,15.21,0,1965,NOW());
+INSERT INTO test.t2 VALUES(NULL,0,'Testing MySQL databases is a cool ', 'MySQL Customers ROCK!',654321.4321,1.24521,0,YEAR(NOW()),NOW());
+UPDATE test.t1 SET b1 = 0 WHERE b1 = 1;
+INSERT INTO test.t2 VALUES(NULL,1,'This is an after update test.', 'If this works, total will not be zero on the master or slave',1.4321,5.221,0,YEAR(NOW()),NOW());
+UPDATE test.t2 SET b1 = 0 WHERE b1 = 1;
+INSERT INTO test.t1 VALUES(NULL,1,'add some more test data test.', 'and hope for the best', 3.321,5.221,0,YEAR(NOW()),NOW());
+DELETE FROM test.t1 WHERE id = 1;
+DELETE FROM test.t2 WHERE id = 1;
+DROP TRIGGER test.t1_bi;
+DROP TRIGGER test.t2_ai;
+DROP TRIGGER test.t1_bu;
+DROP TRIGGER test.t2_au;
+DROP TRIGGER test.t1_bd;
+DROP TRIGGER test.t2_ad;
+DROP TABLE IF EXISTS test.t1;
+DROP TABLE IF EXISTS test.t2;
+DROP TABLE IF EXISTS test.t3;
diff --git a/mysql-test/r/rpl_row_trig004.result b/mysql-test/r/rpl_row_trig004.result
new file mode 100644
index 00000000000..04f46121994
--- /dev/null
+++ b/mysql-test/r/rpl_row_trig004.result
@@ -0,0 +1,29 @@
+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;
+DROP TRIGGER test.t1_bi_t2;
+DROP TABLE IF EXISTS test.t1;
+DROP TABLE IF EXISTS test.t2;
+CREATE TABLE test.t1 (n MEDIUMINT NOT NULL AUTO_INCREMENT, d FLOAT, PRIMARY KEY(n))ENGINE=INNODB;
+CREATE TABLE test.t2 (n MEDIUMINT NOT NULL, f FLOAT, PRIMARY KEY(n))ENGINE=INNODB;
+CREATE TRIGGER test.t1_bi_t2 BEFORE INSERT ON test.t2 FOR EACH ROW INSERT INTO test.t1 VALUES (NULL, 1.234)//
+INSERT INTO test.t2 VALUES (1, 0.0);
+INSERT INTO test.t2 VALUES (1, 0.0);
+select * from test.t1;
+n d
+1 1.234
+select * from test.t2;
+n f
+1 0
+select * from test.t1;
+n d
+1 1.234
+select * from test.t2;
+n f
+1 0
+DROP TRIGGER test.t1_bi_t2;
+DROP TABLE test.t1;
+DROP TABLE test.t2;
diff --git a/mysql-test/r/rpl_row_until.result b/mysql-test/r/rpl_row_until.result
new file mode 100644
index 00000000000..8d4b0d6b591
--- /dev/null
+++ b/mysql-test/r/rpl_row_until.result
@@ -0,0 +1,62 @@
+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;
+stop slave;
+create table t1(n int not null auto_increment primary key);
+insert into t1 values (1),(2),(3),(4);
+drop table t1;
+create table t2(n int not null auto_increment primary key);
+insert into t2 values (1),(2);
+insert into t2 values (3),(4);
+drop table t2;
+start slave until master_log_file='master-bin.000001', master_log_pos=311;
+select * from t1;
+n
+1
+2
+3
+4
+show slave status;
+Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
+# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 740 slave-relay-bin.000004 # master-bin.000001 # No 0 0 311 # Master master-bin.000001 311 No #
+start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291;
+select * from t1;
+n
+1
+2
+3
+4
+show slave status;
+Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
+# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 740 slave-relay-bin.000004 # master-bin.000001 # No 0 0 311 # Master master-no-such-bin.000001 291 No #
+start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=728;
+select * from t2;
+n
+1
+2
+show slave status;
+Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
+# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 740 slave-relay-bin.000004 # master-bin.000001 # No 0 0 586 # Relay slave-relay-bin.000004 728 No #
+start slave;
+stop slave;
+start slave until master_log_file='master-bin.000001', master_log_pos=740;
+show slave status;
+Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
+# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 740 slave-relay-bin.000004 # master-bin.000001 Yes No 0 0 740 # Master master-bin.000001 740 No #
+start slave until master_log_file='master-bin', master_log_pos=561;
+ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
+start slave until master_log_file='master-bin.000001', master_log_pos=561, relay_log_pos=12;
+ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
+start slave until master_log_file='master-bin.000001';
+ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
+start slave until relay_log_file='slave-relay-bin.000002';
+ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
+start slave until relay_log_file='slave-relay-bin.000002', master_log_pos=561;
+ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
+start slave sql_thread;
+start slave until master_log_file='master-bin.000001', master_log_pos=740;
+Warnings:
+Note 1254 Slave is already running
diff --git a/mysql-test/r/rpl_row_user_variables.result b/mysql-test/r/rpl_row_user_variables.result
new file mode 100644
index 00000000000..3e2efcbe9da
--- /dev/null
+++ b/mysql-test/r/rpl_row_user_variables.result
@@ -0,0 +1,82 @@
+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;
+reset master;
+create table t1(n char(30));
+set @i1:=12345678901234, @i2:=-12345678901234, @i3:=0, @i4:=-1;
+set @s1:='This is a test', @r1:=12.5, @r2:=-12.5;
+set @n1:=null;
+set @s2:='', @s3:='abc\'def', @s4:= 'abc\\def', @s5:= 'abc''def';
+insert into t1 values (@i1), (@i2), (@i3), (@i4);
+insert into t1 values (@r1), (@r2);
+insert into t1 values (@s1), (@s2), (@s3), (@s4), (@s5);
+insert into t1 values (@n1);
+insert into t1 values (@n2);
+insert into t1 values (@a:=0), (@a:=@a+1), (@a:=@a+1);
+insert into t1 values (@a+(@b:=@a+1));
+set @q:='abc';
+insert t1 values (@q), (@q:=concat(@q, 'n1')), (@q:=concat(@q, 'n2'));
+set @a:=5;
+insert into t1 values (@a),(@a);
+select * from t1 where n = '<nonexistant>';
+n
+insert into t1 values (@a),(@a),(@a*5);
+select * from t1;
+n
+12345678901234
+-12345678901234
+0
+-1
+12.5
+-12.5
+This is a test
+
+abc'def
+abc\def
+abc'def
+NULL
+NULL
+0
+1
+2
+5
+abc
+abcn1
+abcn1n2
+5
+5
+NULL
+NULL
+NULL
+select * from t1;
+n
+12345678901234
+-12345678901234
+0
+-1
+12.5
+-12.5
+This is a test
+
+abc'def
+abc\def
+abc'def
+NULL
+NULL
+0
+1
+2
+5
+abc
+abcn1
+abcn1n2
+5
+5
+NULL
+NULL
+NULL
+drop table t1;
+stop slave;
diff --git a/mysql-test/r/rpl_row_view.result b/mysql-test/r/rpl_row_view.result
new file mode 100644
index 00000000000..ce807a361ba
--- /dev/null
+++ b/mysql-test/r/rpl_row_view.result
@@ -0,0 +1,44 @@
+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;
+drop table if exists t1,v1;
+drop view if exists t1,v1;
+create table t1 (a int);
+insert into t1 values (1);
+create view v1 as select a from t1;
+insert into v1 values (2);
+select * from v1 order by a;
+a
+1
+2
+select * from v1 order by a;
+a
+1
+2
+update v1 set a=3 where a=1;
+select * from v1 order by a;
+a
+2
+3
+select * from v1 order by a;
+a
+2
+3
+delete from v1 where a=2;
+select * from v1 order by a;
+a
+3
+select * from v1 order by a;
+a
+3
+alter view v1 as select a as b from t1;
+select * from v1 order by 1;
+b
+3
+drop view v1;
+select * from v1 order by a;
+ERROR 42S02: Table 'test.v1' doesn't exist
+drop table t1;
diff --git a/mysql-test/r/rpl_row_view01.result b/mysql-test/r/rpl_row_view01.result
new file mode 100644
index 00000000000..039d14d6272
--- /dev/null
+++ b/mysql-test/r/rpl_row_view01.result
@@ -0,0 +1,100 @@
+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;
+create database if not exists mysqltest1;
+DROP VIEW IF EXISTS mysqltest1.v1;
+DROP VIEW IF EXISTS mysqltest1.v2;
+DROP VIEW IF EXISTS mysqltest1.v3;
+DROP VIEW IF EXISTS mysqltest1.v4;
+DROP TABLE IF EXISTS mysqltest1.t3;
+DROP TABLE IF EXISTS mysqltest1.t1;
+DROP TABLE IF EXISTS mysqltest1.t2;
+DROP TABLE IF EXISTS mysqltest1.t4;
+CREATE TABLE mysqltest1.t1 (a INT, c CHAR(6),PRIMARY KEY(a));
+CREATE TABLE mysqltest1.t2 (a INT, c CHAR(6),PRIMARY KEY(a));
+CREATE TABLE mysqltest1.t3 (a INT, c CHAR(6), c2 CHAR(6), PRIMARY KEY(a));
+CREATE TABLE mysqltest1.t4 (a INT, qty INT, price INT,PRIMARY KEY(a));
+CREATE TABLE mysqltest1.t5 (qty INT, price INT, total INT, PRIMARY KEY(qty));
+INSERT INTO mysqltest1.t1 VALUES (1,'Thank'),(2,'it'),(3,'Friday');
+INSERT INTO mysqltest1.t2 VALUES (1,'GOD'),(2,'is'),(3,'TGIF');
+INSERT INTO mysqltest1.t4 VALUES(1, 3, 50),(2, 18, 3),(4, 4, 4);
+CREATE VIEW mysqltest1.v2 AS SELECT qty, price, qty*price AS value FROM mysqltest1.t4;
+CREATE VIEW mysqltest1.v1 AS SELECT t1.a, t1.c, t2.c as c2 FROM mysqltest1.t1 as t1, mysqltest1.t2 AS t2 WHERE mysqltest1.t1.a = mysqltest1.t2.a;
+CREATE VIEW mysqltest1.v3 AS SELECT * FROM mysqltest1.t1;
+CREATE VIEW mysqltest1.v4 AS SELECT * FROM mysqltest1.v3 WHERE a > 1 WITH LOCAL CHECK OPTION;
+SELECT * FROM mysqltest1.v2;
+qty price value
+3 50 150
+18 3 54
+4 4 16
+SELECT * FROM mysqltest1.v1;
+a c c2
+1 Thank GOD
+2 it is
+3 Friday TGIF
+SELECT * FROM mysqltest1.v2;
+qty price value
+3 50 150
+18 3 54
+4 4 16
+SELECT * FROM mysqltest1.v1;
+a c c2
+1 Thank GOD
+2 it is
+3 Friday TGIF
+INSERT INTO mysqltest1.t5 SELECT * FROM mysqltest1.v2;
+INSERT INTO mysqltest1.t3 SELECT * FROM mysqltest1.v1;
+SELECT * FROM mysqltest1.t5;
+qty price total
+3 50 150
+18 3 54
+4 4 16
+SELECT * FROM mysqltest1.t3;
+a c c2
+1 Thank GOD
+2 it is
+3 Friday TGIF
+SELECT * FROM mysqltest1.t5;
+qty price total
+3 50 150
+18 3 54
+4 4 16
+SELECT * FROM mysqltest1.t3;
+a c c2
+1 Thank GOD
+2 it is
+3 Friday TGIF
+INSERT INTO mysqltest1.v4 VALUES (4,'TEST');
+SELECT * FROM mysqltest1.t1;
+a c
+1 Thank
+2 it
+3 Friday
+4 TEST
+SELECT * FROM mysqltest1.v4;
+a c
+2 it
+3 Friday
+4 TEST
+SELECT * FROM mysqltest1.t1;
+a c
+1 Thank
+2 it
+3 Friday
+4 TEST
+SELECT * FROM mysqltest1.v4;
+a c
+2 it
+3 Friday
+4 TEST
+DROP VIEW IF EXISTS mysqltest1.v1;
+DROP VIEW IF EXISTS mysqltest1.v2;
+DROP VIEW IF EXISTS mysqltest1.v3;
+DROP VIEW IF EXISTS mysqltest1.v4;
+DROP TABLE IF EXISTS mysqltest1.t3;
+DROP TABLE IF EXISTS mysqltest1.t1;
+DROP TABLE IF EXISTS mysqltest1.t2;
+DROP TABLE IF EXISTS mysqltest1.t4;
diff --git a/mysql-test/r/rpl_server_id1.result b/mysql-test/r/rpl_server_id1.result
index a3ab6672f69..c94a7748fcd 100644
--- a/mysql-test/r/rpl_server_id1.result
+++ b/mysql-test/r/rpl_server_id1.result
@@ -10,7 +10,7 @@ stop slave;
change master to master_port=SLAVE_PORT;
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
- 127.0.0.1 root SLAVE_PORT 1 4 slave-relay-bin.000001 4 No No # 0 0 0 98 None 0 No NULL
+ 127.0.0.1 root SLAVE_PORT 1 4 slave-relay-bin.000001 4 No No # # 0 0 0 102 None 0 No NULL
start slave;
insert into t1 values (1);
show status like "slave_running";
diff --git a/mysql-test/r/rpl_server_id2.result b/mysql-test/r/rpl_server_id2.result
index b196646aecc..72db862040e 100644
--- a/mysql-test/r/rpl_server_id2.result
+++ b/mysql-test/r/rpl_server_id2.result
@@ -10,7 +10,7 @@ stop slave;
change master to master_port=SLAVE_PORT;
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
- 127.0.0.1 root SLAVE_PORT 1 4 slave-relay-bin.000001 4 No No # 0 0 0 98 None 0 No NULL
+ 127.0.0.1 root SLAVE_PORT 1 4 slave-relay-bin.000001 4 No No # 0 0 0 102 None 0 No NULL
start slave;
insert into t1 values (1);
select * from t1;
diff --git a/mysql-test/r/rpl_sp004.result b/mysql-test/r/rpl_sp004.result
new file mode 100644
index 00000000000..dfc672d4cd7
--- /dev/null
+++ b/mysql-test/r/rpl_sp004.result
@@ -0,0 +1,93 @@
+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;
+DROP PROCEDURE IF EXISTS test.p1;
+DROP PROCEDURE IF EXISTS test.p2;
+DROP TABLE IF EXISTS test.t2;
+DROP TABLE IF EXISTS test.t1;
+DROP TABLE IF EXISTS test.t3;
+CREATE PROCEDURE test.p1()
+BEGIN
+CREATE TABLE IF NOT EXISTS test.t1(a INT,PRIMARY KEY(a));
+CREATE TABLE IF NOT EXISTS test.t2(a INT,PRIMARY KEY(a));
+INSERT INTO test.t1 VALUES (4),(2),(1),(3);
+UPDATE test.t1 SET a=a+4 WHERE a=4;
+INSERT INTO test.t2 (a) SELECT t1.a FROM test.t1;
+UPDATE test.t1 SET a=a+4 WHERE a=8;
+CREATE TABLE IF NOT EXISTS test.t3(n MEDIUMINT NOT NULL AUTO_INCREMENT, f FLOAT, d DATETIME, PRIMARY KEY(n));
+END|
+CREATE PROCEDURE test.p2()
+BEGIN
+DROP TABLE IF EXISTS test.t1;
+DROP TABLE IF EXISTS test.t2;
+INSERT INTO test.t3 VALUES(NULL,11111111.233333,NOW());
+END|
+CALL test.p1();
+SELECT * FROM test.t1;
+a
+1
+2
+3
+12
+SELECT * FROM test.t2;
+a
+1
+2
+3
+8
+SELECT * FROM test.t1;
+a
+1
+2
+3
+12
+SELECT * FROM test.t2;
+a
+1
+2
+3
+8
+CALL test.p2();
+USE test;
+SHOW TABLES;
+Tables_in_test
+t3
+USE test;
+SHOW TABLES;
+Tables_in_test
+t3
+CALL test.p1();
+Warnings:
+Note 1050 Table 't3' already exists
+SELECT * FROM test.t1;
+a
+1
+2
+3
+12
+SELECT * FROM test.t2;
+a
+1
+2
+3
+8
+SELECT * FROM test.t1;
+a
+1
+2
+3
+12
+SELECT * FROM test.t2;
+a
+1
+2
+3
+8
+DROP PROCEDURE IF EXISTS test.p1;
+DROP PROCEDURE IF EXISTS test.p2;
+DROP TABLE IF EXISTS test.t1;
+DROP TABLE IF EXISTS test.t2;
+DROP TABLE IF EXISTS test.t3;
diff --git a/mysql-test/r/rpl000001.result b/mysql-test/r/rpl_stm_000001.result
index de9f6f16b2a..de9f6f16b2a 100644
--- a/mysql-test/r/rpl000001.result
+++ b/mysql-test/r/rpl_stm_000001.result
diff --git a/mysql-test/r/rpl_EE_error.result b/mysql-test/r/rpl_stm_EE_err.result
index f4765b4b13c..f4765b4b13c 100644
--- a/mysql-test/r/rpl_EE_error.result
+++ b/mysql-test/r/rpl_stm_EE_err.result
diff --git a/mysql-test/r/rpl_charset.result b/mysql-test/r/rpl_stm_charset.result
index 28f694a3933..fcadf43c21c 100644
--- a/mysql-test/r/rpl_charset.result
+++ b/mysql-test/r/rpl_stm_charset.result
@@ -103,7 +103,7 @@ a b
1 cp850_general_ci
drop database mysqltest2;
drop database mysqltest3;
-show binlog events from 98;
+show binlog events from 102;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # drop database if exists mysqltest2
master-bin.000001 # Query 1 # drop database if exists mysqltest3
diff --git a/mysql-test/r/rpl_ddl.result b/mysql-test/r/rpl_stm_ddl.result
index 4d8f2f11d4a..91163f1fe29 100644
--- a/mysql-test/r/rpl_ddl.result
+++ b/mysql-test/r/rpl_stm_ddl.result
@@ -10,28 +10,28 @@ DROP DATABASE IF EXISTS mysqltest2;
DROP DATABASE IF EXISTS mysqltest3;
CREATE DATABASE mysqltest1;
CREATE DATABASE mysqltest2;
-CREATE TABLE mysqltest1.t1 (f1 BIGINT) ENGINE= "InnoDB";
+CREATE TABLE mysqltest1.t1 (f1 BIGINT) ENGINE="InnoDB";
INSERT INTO mysqltest1.t1 SET f1= 0;
-CREATE TABLE mysqltest1.t2 (f1 BIGINT) ENGINE= "InnoDB";
-CREATE TABLE mysqltest1.t3 (f1 BIGINT) ENGINE= "InnoDB";
-CREATE TABLE mysqltest1.t4 (f1 BIGINT) ENGINE= "InnoDB";
-CREATE TABLE mysqltest1.t5 (f1 BIGINT) ENGINE= "InnoDB";
-CREATE TABLE mysqltest1.t6 (f1 BIGINT) ENGINE= "InnoDB";
+CREATE TABLE mysqltest1.t2 (f1 BIGINT) ENGINE="InnoDB";
+CREATE TABLE mysqltest1.t3 (f1 BIGINT) ENGINE="InnoDB";
+CREATE TABLE mysqltest1.t4 (f1 BIGINT) ENGINE="InnoDB";
+CREATE TABLE mysqltest1.t5 (f1 BIGINT) ENGINE="InnoDB";
+CREATE TABLE mysqltest1.t6 (f1 BIGINT) ENGINE="InnoDB";
CREATE INDEX my_idx6 ON mysqltest1.t6(f1);
-CREATE TABLE mysqltest1.t7 (f1 BIGINT) ENGINE= "InnoDB";
+CREATE TABLE mysqltest1.t7 (f1 BIGINT) ENGINE="InnoDB";
INSERT INTO mysqltest1.t7 SET f1= 0;
-CREATE TABLE mysqltest1.t8 (f1 BIGINT) ENGINE= "InnoDB";
-CREATE TABLE mysqltest1.t9 (f1 BIGINT) ENGINE= "InnoDB";
-CREATE TABLE mysqltest1.t10 (f1 BIGINT) ENGINE= "InnoDB";
-CREATE TABLE mysqltest1.t11 (f1 BIGINT) ENGINE= "InnoDB";
-CREATE TABLE mysqltest1.t12 (f1 BIGINT) ENGINE= "InnoDB";
-CREATE TABLE mysqltest1.t13 (f1 BIGINT) ENGINE= "InnoDB";
-CREATE TABLE mysqltest1.t14 (f1 BIGINT) ENGINE= "InnoDB";
-CREATE TABLE mysqltest1.t15 (f1 BIGINT) ENGINE= "InnoDB";
-CREATE TABLE mysqltest1.t16 (f1 BIGINT) ENGINE= "InnoDB";
-CREATE TABLE mysqltest1.t17 (f1 BIGINT) ENGINE= "InnoDB";
-CREATE TABLE mysqltest1.t18 (f1 BIGINT) ENGINE= "InnoDB";
-CREATE TABLE mysqltest1.t19 (f1 BIGINT) ENGINE= "InnoDB";
+CREATE TABLE mysqltest1.t8 (f1 BIGINT) ENGINE="InnoDB";
+CREATE TABLE mysqltest1.t9 (f1 BIGINT) ENGINE="InnoDB";
+CREATE TABLE mysqltest1.t10 (f1 BIGINT) ENGINE="InnoDB";
+CREATE TABLE mysqltest1.t11 (f1 BIGINT) ENGINE="InnoDB";
+CREATE TABLE mysqltest1.t12 (f1 BIGINT) ENGINE="InnoDB";
+CREATE TABLE mysqltest1.t13 (f1 BIGINT) ENGINE="InnoDB";
+CREATE TABLE mysqltest1.t14 (f1 BIGINT) ENGINE="InnoDB";
+CREATE TABLE mysqltest1.t15 (f1 BIGINT) ENGINE="InnoDB";
+CREATE TABLE mysqltest1.t16 (f1 BIGINT) ENGINE="InnoDB";
+CREATE TABLE mysqltest1.t17 (f1 BIGINT) ENGINE="InnoDB";
+CREATE TABLE mysqltest1.t18 (f1 BIGINT) ENGINE="InnoDB";
+CREATE TABLE mysqltest1.t19 (f1 BIGINT) ENGINE="InnoDB";
CREATE TEMPORARY TABLE mysqltest1.t23 (f1 BIGINT);
SET AUTOCOMMIT = 0;
use mysqltest1;
diff --git a/mysql-test/r/rpl_error_ignored_table.result b/mysql-test/r/rpl_stm_err_ignoredtable.result
index a0a808ce9a8..42abb2c3c44 100644
--- a/mysql-test/r/rpl_error_ignored_table.result
+++ b/mysql-test/r/rpl_stm_err_ignoredtable.result
@@ -9,7 +9,7 @@ insert into t1 values (1),(1);
ERROR 23000: Duplicate entry '1' for key 1
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
-# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 288 # # master-bin.000001 Yes Yes test.t3,test.t1,test.t2 0 0 288 # None 0 No #
+# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 292 # # master-bin.000001 Yes Yes test.t3,test.t1,test.t2 0 0 292 # None 0 No #
show tables like 't1';
Tables_in_test (t1)
drop table t1;
@@ -26,7 +26,7 @@ select (@id := id) - id from t3;
0
kill @id;
drop table t2,t3;
-show binlog events from 98;
+show binlog events from 102;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; create table t1 (a int primary key)
master-bin.000001 # Query 1 # use `test`; insert into t1 values (1),(1)
diff --git a/mysql-test/r/rpl_stm_flsh_tbls.result b/mysql-test/r/rpl_stm_flsh_tbls.result
new file mode 100644
index 00000000000..8a813c57451
--- /dev/null
+++ b/mysql-test/r/rpl_stm_flsh_tbls.result
@@ -0,0 +1,32 @@
+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;
+create table t1 (a int);
+insert into t1 values (10);
+create table t2 (a int);
+create table t3 (a int) engine=merge union(t1);
+create table t4 (a int);
+insert into t4 select * from t3;
+rename table t1 to t5, t2 to t1;
+flush no_write_to_binlog tables;
+SHOW BINLOG EVENTS FROM 652 ;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query 1 # use `test`; rename table t1 to t5, t2 to t1
+select * from t3;
+a
+flush tables;
+SHOW BINLOG EVENTS FROM 652 ;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query 1 # use `test`; rename table t1 to t5, t2 to t1
+master-bin.000001 # Query 1 # use `test`; flush tables
+select * from t3;
+a
+stop slave;
+drop table t1;
+flush tables with read lock;
+start slave;
+stop slave;
+ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
diff --git a/mysql-test/r/rpl_loaddata_rule_m.result b/mysql-test/r/rpl_stm_loaddata_m.result
index 3571c9973ea..9c7dba0e711 100644
--- a/mysql-test/r/rpl_loaddata_rule_m.result
+++ b/mysql-test/r/rpl_stm_loaddata_m.result
@@ -7,13 +7,14 @@ start slave;
drop database if exists mysqltest;
stop slave;
create database mysqltest;
-create table t1(a int, b int, unique(b));
use mysqltest;
-load data infile '../../std_data/rpl_loaddata.dat' into table test.t1;
-show binlog events from 98;
+create table t1(a int, b int, unique(b));
+load data infile '../../std_data/rpl_loaddata.dat' into table t1;
+show binlog events from 102;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # drop database if exists mysqltest
master-bin.000001 # Query 1 # create database mysqltest
+master-bin.000001 # Query 1 # use `mysqltest`; create table t1(a int, b int, unique(b))
master-bin.000001 # Begin_load_query 1 # ;file_id=1;block_len=12
-master-bin.000001 # Execute_load_query 1 # use `mysqltest`; load data infile '../../std_data/rpl_loaddata.dat' into table test.t1 ;file_id=1
+master-bin.000001 # Execute_load_query 1 # use `mysqltest`; load data infile '../../std_data/rpl_loaddata.dat' into table t1 ;file_id=1
drop database mysqltest;
diff --git a/mysql-test/r/rpl_stm_log.result b/mysql-test/r/rpl_stm_log.result
new file mode 100644
index 00000000000..a7ef117854d
--- /dev/null
+++ b/mysql-test/r/rpl_stm_log.result
@@ -0,0 +1,103 @@
+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;
+stop slave;
+reset master;
+reset slave;
+reset master;
+create table t1(n int not null auto_increment primary key);
+insert into t1 values (NULL);
+drop table t1;
+create table t1 (word char(20) not null);
+load data infile '../../std_data/words.dat' into table t1 ignore 1 lines;
+select count(*) from t1;
+count(*)
+69
+drop table t1;
+show binlog events;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4
+master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)
+master-bin.000001 # Intvar 1 # INSERT_ID=1
+master-bin.000001 # Query 1 # use `test`; insert into t1 values (NULL)
+master-bin.000001 # Query 1 # use `test`; drop table t1
+master-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)
+master-bin.000001 # Begin_load_query 1 # ;file_id=1;block_len=581
+master-bin.000001 # Execute_load_query 1 # use `test`; load data infile '../../std_data/words.dat' into table t1 ignore 1 lines ;file_id=1
+master-bin.000001 # Query 1 # use `test`; drop table t1
+show binlog events from 102 limit 1;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)
+show binlog events from 102 limit 2;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)
+master-bin.000001 # Intvar 1 # INSERT_ID=1
+show binlog events from 102 limit 2,1;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query 1 # use `test`; insert into t1 values (NULL)
+flush logs;
+create table t5 (a int);
+drop table t5;
+start slave;
+flush logs;
+stop slave;
+create table t1 (n int);
+insert into t1 values (1);
+drop table t1;
+show binlog events;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4
+master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)
+master-bin.000001 # Intvar 1 # INSERT_ID=1
+master-bin.000001 # Query 1 # use `test`; insert into t1 values (NULL)
+master-bin.000001 # Query 1 # use `test`; drop table t1
+master-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)
+master-bin.000001 # Begin_load_query 1 # ;file_id=1;block_len=581
+master-bin.000001 # Execute_load_query 1 # use `test`; load data infile '../../std_data/words.dat' into table t1 ignore 1 lines ;file_id=1
+master-bin.000001 # Query 1 # use `test`; drop table t1
+master-bin.000001 # Rotate 1 # master-bin.000002;pos=4
+show binlog events in 'master-bin.000002';
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000002 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4
+master-bin.000002 # Query 1 # use `test`; create table t5 (a int)
+master-bin.000002 # Query 1 # use `test`; drop table t5
+master-bin.000002 # Query 1 # use `test`; create table t1 (n int)
+master-bin.000002 # Query 1 # use `test`; insert into t1 values (1)
+master-bin.000002 # Query 1 # use `test`; drop table t1
+show binary logs;
+Log_name File_size
+master-bin.000001 1393
+master-bin.000002 514
+start slave;
+show binary logs;
+Log_name File_size
+slave-bin.000001 1563
+slave-bin.000002 352
+show binlog events in 'slave-bin.000001' from 4;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4
+slave-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)
+slave-bin.000001 # Intvar 1 # INSERT_ID=1
+slave-bin.000001 # Query 1 # use `test`; insert into t1 values (NULL)
+slave-bin.000001 # Query 1 # use `test`; drop table t1
+slave-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)
+slave-bin.000001 # Begin_load_query 1 # ;file_id=1;block_len=581
+slave-bin.000001 # Execute_load_query 1 # use `test`; load data INFILE '../../var/tmp/SQL_LOAD-2-1-1.data' INTO table t1 ignore 1 lines ;file_id=1
+slave-bin.000001 # Query 1 # use `test`; drop table t1
+slave-bin.000001 # Query 1 # use `test`; create table t5 (a int)
+slave-bin.000001 # Query 1 # use `test`; drop table t5
+slave-bin.000001 # Rotate 2 # slave-bin.000002;pos=4
+show binlog events in 'slave-bin.000002' from 4;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-bin.000002 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4
+slave-bin.000002 # Query 1 # use `test`; create table t1 (n int)
+slave-bin.000002 # Query 1 # use `test`; insert into t1 values (1)
+slave-bin.000002 # Query 1 # use `test`; drop table t1
+show slave status;
+Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
+# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 514 # # master-bin.000002 Yes Yes # 0 0 514 # None 0 No #
+show binlog events in 'slave-bin.000005' from 4;
+ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
diff --git a/mysql-test/r/rpl_stm_max_relay_size.result b/mysql-test/r/rpl_stm_max_relay_size.result
new file mode 100644
index 00000000000..1afbc406a8e
--- /dev/null
+++ b/mysql-test/r/rpl_stm_max_relay_size.result
@@ -0,0 +1,61 @@
+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;
+stop slave;
+create table t1 (a int);
+drop table t1;
+reset slave;
+set global max_binlog_size=8192;
+set global max_relay_log_size=8192-1;
+select @@global.max_relay_log_size;
+@@global.max_relay_log_size
+4096
+start slave;
+show slave status;
+Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
+# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 72956 # # master-bin.000001 Yes Yes # 0 0 72956 # None 0 No #
+stop slave;
+reset slave;
+set global max_relay_log_size=(5*4096);
+select @@global.max_relay_log_size;
+@@global.max_relay_log_size
+20480
+start slave;
+show slave status;
+Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
+# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 72956 # # master-bin.000001 Yes Yes # 0 0 72956 # None 0 No #
+stop slave;
+reset slave;
+set global max_relay_log_size=0;
+select @@global.max_relay_log_size;
+@@global.max_relay_log_size
+0
+start slave;
+show slave status;
+Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
+# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 72956 # # master-bin.000001 Yes Yes # 0 0 72956 # None 0 No #
+stop slave;
+reset slave;
+flush logs;
+show slave status;
+Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
+# 127.0.0.1 root MASTER_PORT 1 4 # # No No # 0 0 0 # None 0 No #
+reset slave;
+start slave;
+flush logs;
+create table t1 (a int);
+show slave status;
+Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
+# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 73042 # # master-bin.000001 Yes Yes # 0 0 73042 # None 0 No #
+flush logs;
+drop table t1;
+show slave status;
+Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
+# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 73118 # # master-bin.000001 Yes Yes # 0 0 73118 # None 0 No #
+flush logs;
+show master status;
+File Position Binlog_Do_DB Binlog_Ignore_DB
+master-bin.000002 102 <Binlog_Ignore_DB>
diff --git a/mysql-test/r/rpl_multi_query.result b/mysql-test/r/rpl_stm_multi_query.result
index f2d8ea77536..bf914e6ce6c 100644
--- a/mysql-test/r/rpl_multi_query.result
+++ b/mysql-test/r/rpl_stm_multi_query.result
@@ -19,7 +19,7 @@ n
3
4
5
-show binlog events from 98;
+show binlog events from 102;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # drop database if exists mysqltest
master-bin.000001 # Query 1 # create database mysqltest
diff --git a/mysql-test/r/rpl_stm_mystery22.result b/mysql-test/r/rpl_stm_mystery22.result
new file mode 100644
index 00000000000..ea34b308ec2
--- /dev/null
+++ b/mysql-test/r/rpl_stm_mystery22.result
@@ -0,0 +1,31 @@
+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;
+create table t1(n int auto_increment primary key, s char(10));
+insert into t1 values (2,'old');
+insert into t1 values(NULL,'new');
+insert into t1 values(NULL,'new');
+select * from t1 order by n;
+n s
+1 new
+2 old
+delete from t1 where n = 2;
+start slave;
+stop slave;
+create table t2(n int);
+drop table t2;
+insert into t1 values(NULL,'new');
+set sql_log_bin=0;
+insert into t1 values(NULL,'new');
+set sql_log_bin=1;
+delete from t1 where n=4;
+start slave;
+select * from t1 order by n;
+n s
+1 new
+2 new
+3 new
+drop table t1;
diff --git a/mysql-test/r/rpl_delete_all.result b/mysql-test/r/rpl_stm_no_op.result
index 1aa556270c9..eb445085a1d 100644
--- a/mysql-test/r/rpl_delete_all.result
+++ b/mysql-test/r/rpl_stm_no_op.result
@@ -16,16 +16,37 @@ Warnings:
Note 1051 Unknown table 't1'
select * from t1;
ERROR 42S02: Table 'test.t1' doesn't exist
-create table t1 (a int);
-insert into t1 values(1);
+create table t1 (a int, b int);
+insert into t1 values(1,1);
delete from t1;
select * from t1;
-a
-insert into t1 values(1);
-insert into t1 values(2);
+a b
+insert into t1 values(1,1);
+insert into t1 values(2,1);
+update t1 set a=2;
+select * from t1;
+a b
+2 1
+2 1
+create table t2 (a int, b int);
+delete from t1;
+insert into t1 values(1,1);
+insert into t2 values(1,1);
update t1 set a=2;
+UPDATE t1, t2 SET t1.a = t2.a;
+select * from t1;
+a b
+1 1
+select * from t2;
+a b
+1 1
+delete from t1;
+delete from t2;
+insert into t1 values(1,1);
+insert into t2 values(1,1);
+DELETE t1.*, t2.* from t1, t2;
select * from t1;
-a
-2
-2
+a b
+select * from t2;
+a b
drop table t1;
diff --git a/mysql-test/r/rpl_reset_slave.result b/mysql-test/r/rpl_stm_reset_slave.result
index ab55423b773..834b9add089 100644
--- a/mysql-test/r/rpl_reset_slave.result
+++ b/mysql-test/r/rpl_stm_reset_slave.result
@@ -6,20 +6,20 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
-# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 98 # # master-bin.000001 Yes Yes 0 0 98 # None 0 No #
+# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 102 # # master-bin.000001 Yes Yes # 0 0 102 # None 0 No #
stop slave;
change master to master_user='test';
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
-# 127.0.0.1 test MASTER_PORT 1 master-bin.000001 98 # # master-bin.000001 No No 0 0 98 # None 0 No #
+# 127.0.0.1 test MASTER_PORT 1 master-bin.000001 102 # # master-bin.000001 No No # 0 0 102 # None 0 No #
reset slave;
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
-# 127.0.0.1 root MASTER_PORT 1 4 # # No No 0 0 0 # None 0 No #
+# 127.0.0.1 root MASTER_PORT 1 4 # # No No # 0 0 0 # None 0 No #
start slave;
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
-# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 98 # # master-bin.000001 Yes Yes 0 0 98 # None 0 No #
+# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 102 # # master-bin.000001 Yes Yes # 0 0 102 # None 0 No #
stop slave;
reset slave;
start slave;
diff --git a/mysql-test/r/rpl_stm_rewrt_db.result b/mysql-test/r/rpl_stm_rewrt_db.result
new file mode 100644
index 00000000000..6c72e982e3e
--- /dev/null
+++ b/mysql-test/r/rpl_stm_rewrt_db.result
@@ -0,0 +1,93 @@
+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;
+drop database if exists mysqltest1;
+create database mysqltest1;
+use mysqltest1;
+create table t1 (a int);
+insert into t1 values(9);
+select * from mysqltest1.t1;
+a
+9
+show databases like 'mysqltest1';
+Database (mysqltest1)
+mysqltest1
+select * from test.t1;
+a
+9
+drop table t1;
+drop database mysqltest1;
+drop database if exists rewrite;
+create database rewrite;
+use test;
+create table t1 (a date, b date, c date not null, d date);
+load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',';
+Warnings:
+Warning 1265 Data truncated for column 'a' at row 1
+Warning 1265 Data truncated for column 'c' at row 1
+Warning 1265 Data truncated for column 'd' at row 1
+Warning 1265 Data truncated for column 'a' at row 2
+Warning 1265 Data truncated for column 'b' at row 2
+Warning 1265 Data truncated for column 'd' at row 2
+load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' IGNORE 2 LINES;
+select * from rewrite.t1;
+a b c d
+0000-00-00 NULL 0000-00-00 0000-00-00
+0000-00-00 0000-00-00 0000-00-00 0000-00-00
+2003-03-03 2003-03-03 2003-03-03 NULL
+2003-03-03 2003-03-03 2003-03-03 NULL
+truncate table t1;
+load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' LINES STARTING BY ',' (b,c,d);
+Warnings:
+Warning 1265 Data truncated for column 'c' at row 1
+Warning 1265 Data truncated for column 'd' at row 1
+Warning 1265 Data truncated for column 'b' at row 2
+Warning 1265 Data truncated for column 'd' at row 2
+select * from rewrite.t1;
+a b c d
+NULL NULL 0000-00-00 0000-00-00
+NULL 0000-00-00 0000-00-00 0000-00-00
+NULL 2003-03-03 2003-03-03 NULL
+drop table t1;
+create table t1 (a text, b text);
+load data infile '../../std_data/loaddata2.dat' into table t1 fields terminated by ',' enclosed by '''';
+Warnings:
+Warning 1261 Row 3 doesn't contain data for all columns
+select concat('|',a,'|'), concat('|',b,'|') from rewrite.t1;
+concat('|',a,'|') concat('|',b,'|')
+|Field A| |Field B|
+|Field 1| |Field 2'
+Field 3,'Field 4|
+|Field 5' ,'Field 6| NULL
+|Field 6| | 'Field 7'|
+drop table t1;
+create table t1 (a int, b char(10));
+load data infile '../../std_data/loaddata3.dat' into table t1 fields terminated by '' enclosed by '' ignore 1 lines;
+Warnings:
+Warning 1264 Out of range value for column 'a' at row 3
+Warning 1262 Row 3 was truncated; it contained more data than there were input columns
+Warning 1264 Out of range value for column 'a' at row 5
+Warning 1262 Row 5 was truncated; it contained more data than there were input columns
+select * from rewrite.t1;
+a b
+1 row 1
+2 row 2
+0 1234567890
+3 row 3
+0 1234567890
+truncate table t1;
+load data infile '../../std_data/loaddata4.dat' into table t1 fields terminated by '' enclosed by '' lines terminated by '' ignore 1 lines;
+Warnings:
+Warning 1264 Out of range value for column 'a' at row 4
+Warning 1261 Row 4 doesn't contain data for all columns
+select * from rewrite.t1;
+a b
+1 row 1
+2 row 2
+3 row 3
+0
+drop database rewrite;
+drop table t1;
diff --git a/mysql-test/r/rpl_sp.result b/mysql-test/r/rpl_stm_sp.result
index 41bcfc7d72c..4fe0f61b550 100644
--- a/mysql-test/r/rpl_sp.result
+++ b/mysql-test/r/rpl_stm_sp.result
@@ -261,7 +261,7 @@ insert into t1 values (1);
select * from t1;
a
1
-show binlog events in 'master-bin.000001' from 98;
+show binlog events in 'master-bin.000001' from 102;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # drop database if exists mysqltest1
master-bin.000001 # Query 1 # create database mysqltest1
diff --git a/mysql-test/r/rpl_timezone.result b/mysql-test/r/rpl_stm_timezone.result
index 64d05aa787e..64d05aa787e 100644
--- a/mysql-test/r/rpl_timezone.result
+++ b/mysql-test/r/rpl_stm_timezone.result
diff --git a/mysql-test/r/rpl_until.result b/mysql-test/r/rpl_stm_until.result
index b584e04ed57..11b69f55f82 100644
--- a/mysql-test/r/rpl_until.result
+++ b/mysql-test/r/rpl_stm_until.result
@@ -12,17 +12,7 @@ create table t2(n int not null auto_increment primary key);
insert into t2 values (1),(2);
insert into t2 values (3),(4);
drop table t2;
-show binlog events;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 4 Format_desc 1 98 Server ver: VERSION, Binlog ver: 4
-master-bin.000001 98 Query 1 219 use `test`; create table t1(n int not null auto_increment primary key)
-master-bin.000001 219 Query 1 319 use `test`; insert into t1 values (1),(2),(3),(4)
-master-bin.000001 319 Query 1 395 use `test`; drop table t1
-master-bin.000001 395 Query 1 516 use `test`; create table t2(n int not null auto_increment primary key)
-master-bin.000001 516 Query 1 608 use `test`; insert into t2 values (1),(2)
-master-bin.000001 608 Query 1 700 use `test`; insert into t2 values (3),(4)
-master-bin.000001 700 Query 1 776 use `test`; drop table t2
-start slave until master_log_file='master-bin.000001', master_log_pos=319;
+start slave until master_log_file='master-bin.000001', master_log_pos=323;
select * from t1;
n
1
@@ -31,7 +21,7 @@ n
4
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
-# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 776 slave-relay-bin.000004 # master-bin.000001 # No 0 0 319 # Master master-bin.000001 319 No #
+# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 780 slave-relay-bin.000004 # master-bin.000001 # No 0 0 323 # Master master-bin.000001 323 No #
start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291;
select * from t1;
n
@@ -41,7 +31,7 @@ n
4
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
-# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 776 slave-relay-bin.000004 # master-bin.000001 # No 0 0 319 # Master master-no-such-bin.000001 291 No #
+# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 780 slave-relay-bin.000004 # master-bin.000001 # No 0 0 323 # Master master-no-such-bin.000001 291 No #
start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=746;
select * from t2;
n
@@ -49,13 +39,13 @@ n
2
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
-# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 776 slave-relay-bin.000004 # master-bin.000001 # No 0 0 608 # Relay slave-relay-bin.000004 746 No #
+# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 780 slave-relay-bin.000004 # master-bin.000001 # No 0 0 612 # Relay slave-relay-bin.000004 746 No #
start slave;
stop slave;
start slave until master_log_file='master-bin.000001', master_log_pos=776;
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
-# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 776 slave-relay-bin.000004 # master-bin.000001 Yes No 0 0 776 # Master master-bin.000001 776 No #
+# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 780 slave-relay-bin.000004 # master-bin.000001 Yes No 0 0 780 # Master master-bin.000001 776 No #
start slave until master_log_file='master-bin', master_log_pos=561;
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
start slave until master_log_file='master-bin.000001', master_log_pos=561, relay_log_pos=12;
diff --git a/mysql-test/r/rpl_stm_user_variables.result b/mysql-test/r/rpl_stm_user_variables.result
new file mode 100644
index 00000000000..3e2efcbe9da
--- /dev/null
+++ b/mysql-test/r/rpl_stm_user_variables.result
@@ -0,0 +1,82 @@
+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;
+reset master;
+create table t1(n char(30));
+set @i1:=12345678901234, @i2:=-12345678901234, @i3:=0, @i4:=-1;
+set @s1:='This is a test', @r1:=12.5, @r2:=-12.5;
+set @n1:=null;
+set @s2:='', @s3:='abc\'def', @s4:= 'abc\\def', @s5:= 'abc''def';
+insert into t1 values (@i1), (@i2), (@i3), (@i4);
+insert into t1 values (@r1), (@r2);
+insert into t1 values (@s1), (@s2), (@s3), (@s4), (@s5);
+insert into t1 values (@n1);
+insert into t1 values (@n2);
+insert into t1 values (@a:=0), (@a:=@a+1), (@a:=@a+1);
+insert into t1 values (@a+(@b:=@a+1));
+set @q:='abc';
+insert t1 values (@q), (@q:=concat(@q, 'n1')), (@q:=concat(@q, 'n2'));
+set @a:=5;
+insert into t1 values (@a),(@a);
+select * from t1 where n = '<nonexistant>';
+n
+insert into t1 values (@a),(@a),(@a*5);
+select * from t1;
+n
+12345678901234
+-12345678901234
+0
+-1
+12.5
+-12.5
+This is a test
+
+abc'def
+abc\def
+abc'def
+NULL
+NULL
+0
+1
+2
+5
+abc
+abcn1
+abcn1n2
+5
+5
+NULL
+NULL
+NULL
+select * from t1;
+n
+12345678901234
+-12345678901234
+0
+-1
+12.5
+-12.5
+This is a test
+
+abc'def
+abc\def
+abc'def
+NULL
+NULL
+0
+1
+2
+5
+abc
+abcn1
+abcn1n2
+5
+5
+NULL
+NULL
+NULL
+drop table t1;
+stop slave;
diff --git a/mysql-test/r/rpl_view.result b/mysql-test/r/rpl_stm_view.result
index cf4c161b296..cf4c161b296 100644
--- a/mysql-test/r/rpl_view.result
+++ b/mysql-test/r/rpl_stm_view.result
diff --git a/mysql-test/r/rpl_temporary.result b/mysql-test/r/rpl_temporary.result
index a76fb87a52b..a7dbfd44944 100644
--- a/mysql-test/r/rpl_temporary.result
+++ b/mysql-test/r/rpl_temporary.result
@@ -36,21 +36,6 @@ select * from t2;
f
5
7
-show binlog events;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4
-master-bin.000001 # Query 1 # use `test`; drop table if exists t1,t2
-master-bin.000001 # Query 1 # use `test`; create table t1(f int)
-master-bin.000001 # Query 1 # use `test`; create table t2(f int)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10)
-master-bin.000001 # Query 1 # use `test`; create temporary table t3(f int)
-master-bin.000001 # Query 1 # use `test`; insert into t3 select * from t1 where f<6
-master-bin.000001 # Query 1 # use `test`; create temporary table t3(f int)
-master-bin.000001 # Query 1 # use `test`; insert into t2 select count(*) from t3
-master-bin.000001 # Query 1 # use `test`; insert into t3 select * from t1 where f>=4
-master-bin.000001 # Query 1 # use `test`; drop temporary table t3
-master-bin.000001 # Query 1 # use `test`; insert into t2 select count(*) from t3
-master-bin.000001 # Query 1 # use `test`; drop temporary table t3
drop table t1, t2;
use test;
SET TIMESTAMP=1040323920;
diff --git a/mysql-test/r/rpl_user_variables.result b/mysql-test/r/rpl_user_variables.result
deleted file mode 100644
index 4198bbcc154..00000000000
--- a/mysql-test/r/rpl_user_variables.result
+++ /dev/null
@@ -1,110 +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;
-reset master;
-create table t1(n char(30));
-set @i1:=12345678901234, @i2:=-12345678901234, @i3:=0, @i4:=-1;
-set @s1:='This is a test', @r1:=12.5, @r2:=-12.5;
-set @n1:=null;
-set @s2:='', @s3:='abc\'def', @s4:= 'abc\\def', @s5:= 'abc''def';
-insert into t1 values (@i1), (@i2), (@i3), (@i4);
-insert into t1 values (@r1), (@r2);
-insert into t1 values (@s1), (@s2), (@s3), (@s4), (@s5);
-insert into t1 values (@n1);
-insert into t1 values (@n2);
-insert into t1 values (@a:=0), (@a:=@a+1), (@a:=@a+1);
-insert into t1 values (@a+(@b:=@a+1));
-set @q:='abc';
-insert t1 values (@q), (@q:=concat(@q, 'n1')), (@q:=concat(@q, 'n2'));
-set @a:=5;
-insert into t1 values (@a),(@a);
-insert into t1 values (@a),(@a),(@a*5);
-select * from t1;
-n
-12345678901234
--12345678901234
-0
--1
-12.5
--12.5
-This is a test
-
-abc'def
-abc\def
-abc'def
-NULL
-NULL
-0
-1
-2
-5
-abc
-abcn1
-abcn1n2
-5
-5
-NULL
-NULL
-NULL
-select * from t1;
-n
-12345678901234
--12345678901234
-0
--1
-12.5
--12.5
-This is a test
-
-abc'def
-abc\def
-abc'def
-NULL
-NULL
-0
-1
-2
-5
-abc
-abcn1
-abcn1n2
-5
-5
-NULL
-NULL
-NULL
-show binlog events from 98;
-Log_name Pos Event_type Server_id End_log_pos Info
-slave-bin.000001 # Query 1 # use `test`; create table t1(n char(30))
-slave-bin.000001 # User var 2 # @`i1`=12345678901234
-slave-bin.000001 # User var 2 # @`i2`=-12345678901234
-slave-bin.000001 # User var 2 # @`i3`=0
-slave-bin.000001 # User var 2 # @`i4`=-1
-slave-bin.000001 # Query 1 # use `test`; insert into t1 values (@i1), (@i2), (@i3), (@i4)
-slave-bin.000001 # User var 2 # @`r1`=12.5
-slave-bin.000001 # User var 2 # @`r2`=-12.5
-slave-bin.000001 # Query 1 # use `test`; insert into t1 values (@r1), (@r2)
-slave-bin.000001 # User var 2 # @`s1`=_latin1 0x5468697320697320612074657374 COLLATE latin1_swedish_ci
-slave-bin.000001 # User var 2 # @`s2`=_latin1 "" COLLATE latin1_swedish_ci
-slave-bin.000001 # User var 2 # @`s3`=_latin1 0x61626327646566 COLLATE latin1_swedish_ci
-slave-bin.000001 # User var 2 # @`s4`=_latin1 0x6162635C646566 COLLATE latin1_swedish_ci
-slave-bin.000001 # User var 2 # @`s5`=_latin1 0x61626327646566 COLLATE latin1_swedish_ci
-slave-bin.000001 # Query 1 # use `test`; insert into t1 values (@s1), (@s2), (@s3), (@s4), (@s5)
-slave-bin.000001 # User var 2 # @`n1`=NULL
-slave-bin.000001 # Query 1 # use `test`; insert into t1 values (@n1)
-slave-bin.000001 # User var 2 # @`n2`=NULL
-slave-bin.000001 # Query 1 # use `test`; insert into t1 values (@n2)
-slave-bin.000001 # Query 1 # use `test`; insert into t1 values (@a:=0), (@a:=@a+1), (@a:=@a+1)
-slave-bin.000001 # User var 2 # @`a`=2
-slave-bin.000001 # Query 1 # use `test`; insert into t1 values (@a+(@b:=@a+1))
-slave-bin.000001 # User var 2 # @`q`=_latin1 0x616263 COLLATE latin1_swedish_ci
-slave-bin.000001 # Query 1 # use `test`; insert t1 values (@q), (@q:=concat(@q, 'n1')), (@q:=concat(@q, 'n2'))
-slave-bin.000001 # User var 2 # @`a`=5
-slave-bin.000001 # Query 1 # use `test`; insert into t1 values (@a),(@a)
-slave-bin.000001 # User var 2 # @`a`=NULL
-slave-bin.000001 # Query 1 # use `test`; insert into t1 values (@a),(@a),(@a*5)
-drop table t1;
-stop slave;
diff --git a/mysql-test/r/user_var-binlog.result b/mysql-test/r/user_var-binlog.result
index 700ec7b09e0..a77ec20a402 100644
--- a/mysql-test/r/user_var-binlog.result
+++ b/mysql-test/r/user_var-binlog.result
@@ -6,13 +6,13 @@ INSERT INTO t1 VALUES(@`a b`);
set @var1= "';aaa";
SET @var2=char(ascii('a'));
insert into t1 values (@var1),(@var2);
-show binlog events from 98;
+show binlog events from 102;
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 98 User var 1 139 @`a b`=_latin1 0x68656C6C6F COLLATE latin1_swedish_ci
-master-bin.000001 139 Query 1 231 use `test`; INSERT INTO t1 VALUES(@`a b`)
-master-bin.000001 231 User var 1 273 @`var1`=_latin1 0x273B616161 COLLATE latin1_swedish_ci
-master-bin.000001 273 User var 1 311 @`var2`=_binary 0x61 COLLATE binary
-master-bin.000001 311 Query 1 411 use `test`; insert into t1 values (@var1),(@var2)
+master-bin.000001 # User var 1 # @`a b`=_latin1 0x68656C6C6F COLLATE latin1_swedish_ci
+master-bin.000001 # Query 1 # use `test`; INSERT INTO t1 VALUES(@`a b`)
+master-bin.000001 # User var 1 # @`var1`=_latin1 0x273B616161 COLLATE latin1_swedish_ci
+master-bin.000001 # User var 1 # @`var2`=_binary 0x61 COLLATE binary
+master-bin.000001 # Query 1 # use `test`; insert into t1 values (@var1),(@var2)
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
ROLLBACK;
diff --git a/mysql-test/std_data/rpl_timezone2.dat b/mysql-test/std_data/rpl_timezone2.dat
new file mode 100644
index 00000000000..9faeed4b207
--- /dev/null
+++ b/mysql-test/std_data/rpl_timezone2.dat
@@ -0,0 +1,2 @@
+20040101000000,NULL
+20040611093902,NULL
diff --git a/mysql-test/std_data/words2.dat b/mysql-test/std_data/words2.dat
new file mode 100644
index 00000000000..dd52469f8e8
--- /dev/null
+++ b/mysql-test/std_data/words2.dat
@@ -0,0 +1,50 @@
+abase
+abased
+abasement
+abasements
+abases
+abash
+abashed
+abashes
+abashing
+abasing
+abate
+abated
+abatement
+abatements
+abater
+abates
+abating
+Abba
+abbe
+abbey
+abbeys
+abbot
+abbots
+Abbott
+abbreviate
+abbreviated
+abbreviates
+abbreviating
+abbreviation
+abbreviations
+Abby
+abdomen
+abdomens
+abdominal
+abduct
+abducted
+abduction
+abductions
+abductor
+abductors
+abducts
+Abe
+abed
+Abel
+Abelian
+Abelson
+Aberdeen
+Abernathy
+aberrant
+aberration
diff --git a/mysql-test/t/binlog-master.opt b/mysql-test/t/binlog_row_binlog-master.opt
index ad2c6a647b5..ad2c6a647b5 100644
--- a/mysql-test/t/binlog-master.opt
+++ b/mysql-test/t/binlog_row_binlog-master.opt
diff --git a/mysql-test/t/binlog_row_binlog.test b/mysql-test/t/binlog_row_binlog.test
new file mode 100644
index 00000000000..8adc8eee5c1
--- /dev/null
+++ b/mysql-test/t/binlog_row_binlog.test
@@ -0,0 +1,5 @@
+# This is a wrapper for binlog.test so that the same test case can be used
+# For both statement and row based bin logs 9/19/2005 [jbm]
+
+-- source include/have_binlog_format_row.inc
+-- source extra/binlog_tests/binlog.test
diff --git a/mysql-test/t/binlog_row_blackhole.test b/mysql-test/t/binlog_row_blackhole.test
new file mode 100644
index 00000000000..5bf1efb1ecb
--- /dev/null
+++ b/mysql-test/t/binlog_row_blackhole.test
@@ -0,0 +1,5 @@
+# This is a wrapper for binlog.test so that the same test case can be used
+# For both statement and row based bin logs 9/19/2005 [jbm]
+
+-- source include/have_binlog_format_row.inc
+-- source extra/binlog_tests/blackhole.test
diff --git a/mysql-test/t/binlog_row_ctype_cp932.test b/mysql-test/t/binlog_row_ctype_cp932.test
new file mode 100644
index 00000000000..595af5a3114
--- /dev/null
+++ b/mysql-test/t/binlog_row_ctype_cp932.test
@@ -0,0 +1,5 @@
+# This is a wrapper for binlog.test so that the same test case can be used
+# For both statement and row based bin logs 9/19/2005 [jbm]
+
+-- source include/have_binlog_format_row.inc
+-- source extra/binlog_tests/ctype_cp932.test
diff --git a/mysql-test/t/binlog_row_ctype_ucs.test b/mysql-test/t/binlog_row_ctype_ucs.test
new file mode 100644
index 00000000000..96e14ed8882
--- /dev/null
+++ b/mysql-test/t/binlog_row_ctype_ucs.test
@@ -0,0 +1,6 @@
+# This is a wrapper for binlog.test so that the same test case can be used
+# For both statement and row based bin logs 9/19/2005 [jbm]
+
+-- source include/have_binlog_format_row.inc
+-- source extra/binlog_tests/ctype_ucs_binlog.test
+
diff --git a/mysql-test/t/binlog_row_drop_tmp_tbl.test b/mysql-test/t/binlog_row_drop_tmp_tbl.test
new file mode 100644
index 00000000000..5b503b78d85
--- /dev/null
+++ b/mysql-test/t/binlog_row_drop_tmp_tbl.test
@@ -0,0 +1,5 @@
+# This is a wrapper for binlog.test so that the same test case can be used
+# For both statement and row based bin logs 9/19/2005 [jbm]
+
+-- source include/have_binlog_format_row.inc
+-- source extra/binlog_tests/drop_temp_table.test
diff --git a/mysql-test/t/binlog_row_innodb_stat.test b/mysql-test/t/binlog_row_innodb_stat.test
new file mode 100644
index 00000000000..e4e6762226b
--- /dev/null
+++ b/mysql-test/t/binlog_row_innodb_stat.test
@@ -0,0 +1,5 @@
+# This is a wrapper for binlog.test so that the same test case can be used
+# For both statement and row based bin logs 9/19/2005 [jbm]
+
+-- source include/have_binlog_format_row.inc
+-- source extra/binlog_tests/innodb_stat.test
diff --git a/mysql-test/t/binlog_row_insert_select.test b/mysql-test/t/binlog_row_insert_select.test
new file mode 100644
index 00000000000..780dfb75293
--- /dev/null
+++ b/mysql-test/t/binlog_row_insert_select.test
@@ -0,0 +1,5 @@
+# This is a wrapper for binlog.test so that the same test case can be used
+# For both statement and row based bin logs 9/19/2005 [jbm]
+
+-- source include/have_binlog_format_row.inc
+-- source extra/binlog_tests/insert_select-binlog.test
diff --git a/mysql-test/t/binlog_row_mix_innodb_myisam.test b/mysql-test/t/binlog_row_mix_innodb_myisam.test
new file mode 100644
index 00000000000..7986467e5e5
--- /dev/null
+++ b/mysql-test/t/binlog_row_mix_innodb_myisam.test
@@ -0,0 +1,5 @@
+# This is a wrapper for binlog.test so that the same test case can be used
+# For both statement and row based bin logs 9/19/2005 [jbm]
+
+-- source include/have_binlog_format_row.inc
+-- source extra/binlog_tests/mix_innodb_myisam_binlog.test
diff --git a/mysql-test/t/binlog_stm_binlog-master.opt b/mysql-test/t/binlog_stm_binlog-master.opt
new file mode 100644
index 00000000000..ad2c6a647b5
--- /dev/null
+++ b/mysql-test/t/binlog_stm_binlog-master.opt
@@ -0,0 +1 @@
+-O max_binlog_size=4096
diff --git a/mysql-test/t/binlog_stm_binlog.test b/mysql-test/t/binlog_stm_binlog.test
new file mode 100644
index 00000000000..da93d86c7ce
--- /dev/null
+++ b/mysql-test/t/binlog_stm_binlog.test
@@ -0,0 +1,5 @@
+# This is a wrapper for binlog.test so that the same test case can be used
+# For both statement and row based bin logs 9/19/2005 [jbm]
+
+-- source include/have_binlog_format_statement.inc
+-- source extra/binlog_tests/binlog.test
diff --git a/mysql-test/t/binlog_stm_blackhole.test b/mysql-test/t/binlog_stm_blackhole.test
new file mode 100644
index 00000000000..3c0096fa3f6
--- /dev/null
+++ b/mysql-test/t/binlog_stm_blackhole.test
@@ -0,0 +1,5 @@
+# This is a wrapper for binlog.test so that the same test case can be used
+# For both statement and row based bin logs 9/19/2005 [jbm]
+
+-- source include/have_binlog_format_statement.inc
+-- source extra/binlog_tests/blackhole.test
diff --git a/mysql-test/t/binlog_stm_ctype_cp932.test b/mysql-test/t/binlog_stm_ctype_cp932.test
new file mode 100644
index 00000000000..cef179e0028
--- /dev/null
+++ b/mysql-test/t/binlog_stm_ctype_cp932.test
@@ -0,0 +1,5 @@
+# This is a wrapper for binlog.test so that the same test case can be used
+# For both statement and row based bin logs 9/19/2005 [jbm]
+
+-- source include/have_binlog_format_statement.inc
+-- source extra/binlog_tests/ctype_cp932.test
diff --git a/mysql-test/t/binlog_stm_ctype_ucs.test b/mysql-test/t/binlog_stm_ctype_ucs.test
new file mode 100644
index 00000000000..a32ac3155c7
--- /dev/null
+++ b/mysql-test/t/binlog_stm_ctype_ucs.test
@@ -0,0 +1,6 @@
+# This is a wrapper for binlog.test so that the same test case can be used
+# For both statement and row based bin logs 9/19/2005 [jbm]
+
+-- source include/have_binlog_format_statement.inc
+-- source extra/binlog_tests/ctype_ucs_binlog.test
+
diff --git a/mysql-test/t/binlog_stm_drop_tmp_tbl.test b/mysql-test/t/binlog_stm_drop_tmp_tbl.test
new file mode 100644
index 00000000000..e8acd00c779
--- /dev/null
+++ b/mysql-test/t/binlog_stm_drop_tmp_tbl.test
@@ -0,0 +1,5 @@
+# This is a wrapper for binlog.test so that the same test case can be used
+# For both statement and row based bin logs 9/19/2005 [jbm]
+
+-- source include/have_binlog_format_statement.inc
+-- source extra/binlog_tests/drop_temp_table.test
diff --git a/mysql-test/t/binlog_stm_innodb_stat-master.opt b/mysql-test/t/binlog_stm_innodb_stat-master.opt
new file mode 100644
index 00000000000..4cb927540bf
--- /dev/null
+++ b/mysql-test/t/binlog_stm_innodb_stat-master.opt
@@ -0,0 +1 @@
+--binlog_cache_size=32768
diff --git a/mysql-test/t/binlog_stm_innodb_stat.test b/mysql-test/t/binlog_stm_innodb_stat.test
new file mode 100644
index 00000000000..c6017246e6d
--- /dev/null
+++ b/mysql-test/t/binlog_stm_innodb_stat.test
@@ -0,0 +1,5 @@
+# This is a wrapper for binlog.test so that the same test case can be used
+# For both statement and row based bin logs 9/19/2005 [jbm]
+
+-- source include/have_binlog_format_statement.inc
+-- source extra/binlog_tests/innodb_stat.test
diff --git a/mysql-test/t/binlog_stm_insert_select.test b/mysql-test/t/binlog_stm_insert_select.test
new file mode 100644
index 00000000000..06792990a55
--- /dev/null
+++ b/mysql-test/t/binlog_stm_insert_select.test
@@ -0,0 +1,5 @@
+# This is a wrapper for binlog.test so that the same test case can be used
+# For both statement and row based bin logs 9/19/2005 [jbm]
+
+-- source include/have_binlog_format_statement.inc
+-- source extra/binlog_tests/insert_select-binlog.test
diff --git a/mysql-test/t/binlog_stm_mix_innodb_myisam.test b/mysql-test/t/binlog_stm_mix_innodb_myisam.test
new file mode 100644
index 00000000000..2e096aebe1e
--- /dev/null
+++ b/mysql-test/t/binlog_stm_mix_innodb_myisam.test
@@ -0,0 +1,5 @@
+# This is a wrapper for binlog.test so that the same test case can be used
+# For both statement and row based bin logs 9/19/2005 [jbm]
+
+-- source include/have_binlog_format_statement.inc
+-- source extra/binlog_tests/mix_innodb_myisam_binlog.test
diff --git a/mysql-test/t/create_select_tmp.test b/mysql-test/t/create_select_tmp.test
index 1661a115f72..dad83942806 100644
--- a/mysql-test/t/create_select_tmp.test
+++ b/mysql-test/t/create_select_tmp.test
@@ -5,6 +5,9 @@
# binlog if it was a transactional table, it resulted in an
# inconsistency between binlog and the internal list of temp tables.
+# This does not work for RBR yet.
+--source include/have_binlog_format_statement.inc
+
-- source include/have_innodb.inc
--disable_warnings
drop table if exists t1, t2;
diff --git a/mysql-test/t/ctype_cp932_binlog_row.test b/mysql-test/t/ctype_cp932_binlog_row.test
new file mode 100644
index 00000000000..38614ea45c0
--- /dev/null
+++ b/mysql-test/t/ctype_cp932_binlog_row.test
@@ -0,0 +1,5 @@
+# This is a wrapper for binlog.test so that the same test case can be used
+# For both statement and row based bin logs 11/07/2005 [jbm]
+
+-- source include/have_binlog_format_row.inc
+-- source extra/binlog_tests/ctype_cp932_binlog.test
diff --git a/mysql-test/t/ctype_cp932_binlog_stm.test b/mysql-test/t/ctype_cp932_binlog_stm.test
new file mode 100644
index 00000000000..83a9ec59000
--- /dev/null
+++ b/mysql-test/t/ctype_cp932_binlog_stm.test
@@ -0,0 +1,5 @@
+# This is a wrapper for binlog.test so that the same test case can be used
+# For both statement and row based bin logs 11/07/2005 [jbm]
+
+-- source include/have_binlog_format_statement.inc
+-- source extra/binlog_tests/ctype_cp932_binlog.test
diff --git a/mysql-test/t/date_formats.test b/mysql-test/t/date_formats.test
index c007c2f5205..88106ae6956 100644
--- a/mysql-test/t/date_formats.test
+++ b/mysql-test/t/date_formats.test
@@ -6,7 +6,9 @@
drop table if exists t1;
--enable_warnings
+--replace_result ROW <format> STATEMENT <format>
SHOW GLOBAL VARIABLES LIKE "%_format%";
+--replace_result ROW <format> STATEMENT <format>
SHOW SESSION VARIABLES LIKE "%_format%";
#
@@ -34,6 +36,7 @@ set datetime_format= '%H:%i:%s.%f %m-%d-%Y';
set datetime_format= '%h:%i:%s %p %Y-%m-%d';
set datetime_format= '%h:%i:%s.%f %p %Y-%m-%d';
+--replace_result ROW <format> STATEMENT <format>
SHOW SESSION VARIABLES LIKE "%format";
--error 1231
diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def
index 9cfb69ecd8f..f32ed667864 100644
--- a/mysql-test/t/disabled.def
+++ b/mysql-test/t/disabled.def
@@ -6,16 +6,22 @@
#
# <testcasename> : Comment test
#
-# Don't use any TAB characters for whitespace.
+# Do not use any TAB characters for whitespace.
#
##############################################################################
sp-goto : GOTO is currently is disabled - will be fixed in the future
kill : Unstable test case, bug#9712
-ndb_cache2 : Bug#15004
-ndb_cache_multi2: Bug#15004
-func_group : Bug#15448
-func_math : Bug#15448
-group_min_max : Bug#15448
+rpl_bit_npk : Bug #13418
+ndb_cache2 : Bug #15004
+ndb_cache_multi2: Bug #15004
+func_group : Bug #15448
+func_math : Bug #15448
+group_min_max : Bug #15448
+#mysqlslap : Bug #15483
+innodb_concurrent : Results are not deterministic, Elliot will fix (BUG#3300)
subselect : Bug#15706
type_time : Bug#15805
+rpl000002 : Bug#15920 Temporary tables are not binlogged in SBR
+ps_7ndb : Bug#15923 Core dump in RBR mode when executing test suite
+sp_trans : Bug#15924 Code dump in RBR mode when executing test suite
diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test
index 4b97f27ebe6..71b92c419ca 100644
--- a/mysql-test/t/innodb.test
+++ b/mysql-test/t/innodb.test
@@ -1142,40 +1142,6 @@ drop table t2, t1;
#
-# Let us test binlog_cache_use and binlog_cache_disk_use status vars.
-# Actually this test has nothing to do with innodb per se, it just requires
-# transactional table.
-#
-show status like "binlog_cache_use";
-show status like "binlog_cache_disk_use";
-
-create table t1 (a int) engine=innodb;
-
-# Now we are going to create transaction which is long enough so its
-# transaction binlog will be flushed to disk...
-let $1=2000;
-disable_query_log;
-begin;
-while ($1)
-{
- eval insert into t1 values( $1 );
- dec $1;
-}
-commit;
-enable_query_log;
-show status like "binlog_cache_use";
-show status like "binlog_cache_disk_use";
-
-# Transaction which should not be flushed to disk and so should not
-# increase binlog_cache_disk_use.
-begin;
-delete from t1;
-commit;
-show status like "binlog_cache_use";
-show status like "binlog_cache_disk_use";
-drop table t1;
-
-#
# Bug #6126: Duplicate columns in keys gives misleading error message
#
--error 1060
@@ -1289,15 +1255,6 @@ select * from t1 where x > -16;
select count(*) from t1 where x = 18446744073709551601;
drop table t1;
-
-# Test for testable InnoDB status variables. This test
-# uses previous ones(pages_created, rows_deleted, ...).
-show status like "Innodb_buffer_pool_pages_total";
-show status like "Innodb_page_size";
-show status like "Innodb_rows_deleted";
-show status like "Innodb_rows_inserted";
-show status like "Innodb_rows_updated";
-
# Test for row locks InnoDB status variables.
show status like "Innodb_row_lock_waits";
show status like "Innodb_row_lock_current_waits";
diff --git a/mysql-test/t/innodb_concurrent-master.opt b/mysql-test/t/innodb_concurrent-master.opt
new file mode 100644
index 00000000000..f76bada5208
--- /dev/null
+++ b/mysql-test/t/innodb_concurrent-master.opt
@@ -0,0 +1 @@
+--innodb_locks_unsafe_for_binlog
diff --git a/mysql-test/t/innodb_concurrent.test b/mysql-test/t/innodb_concurrent.test
new file mode 100644
index 00000000000..1595fcd2467
--- /dev/null
+++ b/mysql-test/t/innodb_concurrent.test
@@ -0,0 +1,346 @@
+#
+# Concurrent InnoDB tests, mainly in UPDATE's
+# Bug#3300
+# Designed and tested by Sinisa Milivojevic, sinisa@mysql.com
+#
+# two non-interfering UPDATE's not changing result set
+#
+
+# test takes circa 5 minutes to run, so it's big
+-- source include/big_test.inc
+
+connection default;
+drop table if exists t1;
+create table t1(eta int(11) not null, tipo int(11), c varchar(255)) type=innodb;
+connect (thread1, localhost, mysqltest,,);
+connection thread1;
+insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
+insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
+insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc");
+insert into t1 values (20,2,"ddddddddddddddddddddddddddddddddddddddddddd");
+insert into t1 values (30,1,"eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee");
+insert into t1 values (40,2,"fffffffffffffffffffffffffffffffffffffffffff");
+insert into t1 values (50,1,"ggggggggggggggggggggggggggggggggggggggggggg");
+insert into t1 values (60,2,"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh");
+insert into t1 values (70,1,"iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii");
+insert into t1 values (80,22,"jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj");
+insert into t1 values (90,11,"kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk");
+select get_lock("hello",1);
+connect (thread2, localhost, mysqltest,,);
+connection thread2;
+begin;
+send update t1 set eta=1+get_lock("hello",1)*0 where tipo=11;
+sleep 1;
+connection thread1;
+begin;
+update t1 set eta=2 where tipo=22;
+select release_lock("hello");
+select * from t1;
+connection thread2;
+reap;
+select * from t1;
+send commit;
+connection thread1;
+select * from t1;
+commit;
+select * from t1;
+connection thread2;
+reap;
+select * from t1;
+connection thread1;
+select * from t1;
+connection default;
+drop table t1;
+
+#
+# two UPDATE's running and one changing result set
+#
+#connect (thread1, localhost, mysqltest,,);
+connection thread1;
+create table t1(eta int(11) not null, tipo int(11), c varchar(255)) type=innodb;
+insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
+insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
+insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc");
+insert into t1 values (20,2,"ddddddddddddddddddddddddddddddddddddddddddd");
+insert into t1 values (30,1,"eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee");
+insert into t1 values (40,2,"fffffffffffffffffffffffffffffffffffffffffff");
+insert into t1 values (50,1,"ggggggggggggggggggggggggggggggggggggggggggg");
+insert into t1 values (60,2,"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh");
+insert into t1 values (70,1,"iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii");
+insert into t1 values (80,22,"jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj");
+insert into t1 values (90,11,"kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk");
+select get_lock("hello",10);
+#connect (thread2, localhost, mysqltest,,);
+connection thread2;
+begin;
+send update t1 set eta=1+get_lock("hello",10)*0 where tipo=1;
+sleep 1;
+connection thread1;
+begin;
+update t1 set tipo=1 where tipo=2;
+select release_lock("hello");
+select * from t1;
+connection thread2;
+reap;
+select * from t1;
+send commit;
+connection thread1;
+select * from t1;
+commit;
+select * from t1;
+connection thread2;
+reap;
+select * from t1;
+connection thread1;
+select * from t1;
+connection default;
+drop table t1;
+
+
+#
+# One UPDATE and one INSERT .... Monty's test
+#
+
+#connect (thread1, localhost, mysqltest,,);
+connection thread1;
+create table t1 (a int not null, b int not null) engine=innodb;
+insert into t1 values (1,1),(2,1),(3,1),(4,1);
+select get_lock("hello2",1000);
+#connect (thread2, localhost, mysqltest,,);
+connection thread2;
+begin;
+send update t1 set b=10+get_lock(concat("hello",a),1000)*0 where
+a=2;
+sleep 1;
+connection thread1;
+insert into t1 values (1,1);
+select release_lock("hello2");
+select * from t1;
+connection thread2;
+reap;
+select * from t1;
+send commit;
+connection thread1;
+sleep 1;
+connection thread2;
+reap;
+connection default;
+drop table t1;
+
+#
+# one UPDATE changing result set and SELECT ... FOR UPDATE
+#
+#connect (thread1, localhost, mysqltest,,);
+connection thread1;
+create table t1(eta int(11) not null, tipo int(11), c varchar(255)) type=innodb;
+insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
+insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
+insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc");
+insert into t1 values (20,2,"ddddddddddddddddddddddddddddddddddddddddddd");
+insert into t1 values (30,1,"eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee");
+insert into t1 values (40,2,"fffffffffffffffffffffffffffffffffffffffffff");
+insert into t1 values (50,1,"ggggggggggggggggggggggggggggggggggggggggggg");
+insert into t1 values (60,2,"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh");
+insert into t1 values (70,1,"iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii");
+insert into t1 values (80,22,"jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj");
+insert into t1 values (90,11,"kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk");
+select get_lock("hello",10);
+#connect (thread2, localhost, mysqltest,,);
+connection thread2;
+begin;
+send select * from t1 where tipo=2 FOR UPDATE;
+sleep 1;
+connection thread1;
+begin;
+select release_lock("hello");
+--error 1205
+update t1 set tipo=1+get_lock("hello",10)*0 where tipo=2;
+select * from t1;
+connection thread2;
+reap;
+select * from t1;
+send commit;
+connection thread1;
+commit;
+connection thread2;
+reap;
+select * from t1;
+connection thread1;
+select * from t1;
+connection default;
+drop table t1;
+
+#
+# one UPDATE not changing result set and SELECT ... FOR UPDATE
+#
+#connect (thread1, localhost, mysqltest,,);
+connection thread1;
+create table t1(eta int(11) not null, tipo int(11), c varchar(255)) type=innodb;
+insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
+insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
+insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc");
+insert into t1 values (20,2,"ddddddddddddddddddddddddddddddddddddddddddd");
+insert into t1 values (30,1,"eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee");
+insert into t1 values (40,2,"fffffffffffffffffffffffffffffffffffffffffff");
+insert into t1 values (50,1,"ggggggggggggggggggggggggggggggggggggggggggg");
+insert into t1 values (60,2,"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh");
+insert into t1 values (70,1,"iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii");
+insert into t1 values (80,22,"jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj");
+insert into t1 values (90,11,"kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk");
+select get_lock("hello",10);
+#connect (thread2, localhost, mysqltest,,);
+connection thread2;
+begin;
+send select * from t1 where tipo=2 FOR UPDATE;
+sleep 1;
+connection thread1;
+begin;
+select release_lock("hello");
+--error 1205
+update t1 set tipo=11+get_lock("hello",10)*0 where tipo=22;
+select * from t1;
+connection thread2;
+reap;
+select * from t1;
+send commit;
+connection thread1;
+commit;
+connection thread2;
+reap;
+select * from t1;
+connection thread1;
+select * from t1;
+connection default;
+drop table t1;
+
+#
+# two SELECT ... FOR UPDATE
+#
+#connect (thread1, localhost, mysqltest,,);
+connection thread1;
+create table t1(eta int(11) not null, tipo int(11), c varchar(255)) type=innodb;
+insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
+insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
+insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc");
+insert into t1 values (20,2,"ddddddddddddddddddddddddddddddddddddddddddd");
+insert into t1 values (30,1,"eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee");
+insert into t1 values (40,2,"fffffffffffffffffffffffffffffffffffffffffff");
+insert into t1 values (50,1,"ggggggggggggggggggggggggggggggggggggggggggg");
+insert into t1 values (60,2,"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh");
+insert into t1 values (70,1,"iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii");
+insert into t1 values (80,22,"jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj");
+insert into t1 values (90,11,"kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk");
+select get_lock("hello",10);
+#connect (thread2, localhost, mysqltest,,);
+connection thread2;
+begin;
+send select * from t1 where tipo=2 FOR UPDATE;
+sleep 1;
+connection thread1;
+begin;
+select release_lock("hello");
+--error 1205
+select * from t1 where tipo=1 FOR UPDATE;
+connection thread2;
+reap;
+select * from t1;
+send commit;
+connection thread1;
+commit;
+connection thread2;
+reap;
+select * from t1;
+connection thread1;
+select * from t1;
+connection default;
+drop table t1;
+
+
+#
+# one UPDATE changing result set and DELETE
+#
+#connect (thread1, localhost, mysqltest,,);
+connection thread1;
+create table t1(eta int(11) not null, tipo int(11), c varchar(255)) type=innodb;
+insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
+insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
+insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc");
+insert into t1 values (20,2,"ddddddddddddddddddddddddddddddddddddddddddd");
+insert into t1 values (30,1,"eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee");
+insert into t1 values (40,2,"fffffffffffffffffffffffffffffffffffffffffff");
+insert into t1 values (50,1,"ggggggggggggggggggggggggggggggggggggggggggg");
+insert into t1 values (60,2,"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh");
+insert into t1 values (70,1,"iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii");
+insert into t1 values (80,22,"jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj");
+insert into t1 values (90,11,"kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk");
+select get_lock("hello",10);
+#connect (thread2, localhost, mysqltest,,);
+connection thread2;
+begin;
+send delete from t1 where tipo=2;
+sleep 1;
+connection thread1;
+begin;
+select release_lock("hello");
+--error 1205
+update t1 set tipo=1+get_lock("hello",10)*0 where tipo=2;
+select * from t1;
+connection thread2;
+reap;
+select * from t1;
+send commit;
+connection thread1;
+commit;
+connection thread2;
+reap;
+select * from t1;
+connection thread1;
+select * from t1;
+connection default;
+drop table t1;
+
+
+#
+# one UPDATE not changing result set and DELETE
+#
+#connect (thread1, localhost, mysqltest,,);
+connection thread1;
+create table t1(eta int(11) not null, tipo int(11), c varchar(255)) type=innodb;
+insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
+insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
+insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc");
+insert into t1 values (20,2,"ddddddddddddddddddddddddddddddddddddddddddd");
+insert into t1 values (30,1,"eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee");
+insert into t1 values (40,2,"fffffffffffffffffffffffffffffffffffffffffff");
+insert into t1 values (50,1,"ggggggggggggggggggggggggggggggggggggggggggg");
+insert into t1 values (60,2,"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh");
+insert into t1 values (70,1,"iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii");
+insert into t1 values (80,22,"jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj");
+insert into t1 values (90,11,"kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk");
+select get_lock("hello",10);
+#connect (thread2, localhost, mysqltest,,);
+connection thread2;
+begin;
+send delete from t1 where tipo=2;
+sleep 1;
+connection thread1;
+begin;
+select release_lock("hello");
+update t1 set tipo=1+get_lock("hello",10)*0 where tipo=22;
+select * from t1;
+connection thread2;
+reap;
+select * from t1;
+send commit;
+connection thread1;
+commit;
+connection thread2;
+reap;
+select * from t1;
+connection thread1;
+select * from t1;
+connection default;
+sleep 1;
+drop table t1;
+disconnect thread1;
+disconnect thread2;
diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test
index 61d7d9994ba..30af9fd8126 100644
--- a/mysql-test/t/mysqlbinlog.test
+++ b/mysql-test/t/mysqlbinlog.test
@@ -1,4 +1,6 @@
# We are using .opt file since we need small binlog size
+# TODO: Need to look at making a row based version once the new row based client is completed. [jbm]
+-- source include/have_binlog_format_statement.inc
# Embedded server doesn't support binlogging
-- source include/not_embedded.inc
@@ -63,7 +65,7 @@ select "--- --database --" as "";
select "--- --position --" as "";
--enable_query_log
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
---exec $MYSQL_BINLOG --short-form --local-load=$MYSQL_TEST_DIR/var/tmp/ --position=231 $MYSQL_TEST_DIR/var/log/master-bin.000002
+--exec $MYSQL_BINLOG --short-form --local-load=$MYSQL_TEST_DIR/var/tmp/ --position=235 $MYSQL_TEST_DIR/var/log/master-bin.000002
# These are tests for remote binlog.
# They should return the same as previous test.
@@ -95,7 +97,7 @@ select "--- --database --" as "";
select "--- --position --" as "";
--enable_query_log
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
---exec $MYSQL_BINLOG --short-form --local-load=$MYSQL_TEST_DIR/var/tmp/ --read-from-remote-server --position=231 --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000002
+--exec $MYSQL_BINLOG --short-form --local-load=$MYSQL_TEST_DIR/var/tmp/ --read-from-remote-server --position=235 --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000002
# Bug#7853 (mysqlbinlog does not accept input from stdin)
--disable_query_log
diff --git a/mysql-test/t/mysqlbinlog2.test b/mysql-test/t/mysqlbinlog2.test
index a2f1aba05b0..89af8e33a03 100644
--- a/mysql-test/t/mysqlbinlog2.test
+++ b/mysql-test/t/mysqlbinlog2.test
@@ -1,6 +1,9 @@
# Test for the new options --start-datetime, stop-datetime,
# and a few others.
+# TODO: Need to look at making row based version once new binlog client is complete.
+-- source include/have_binlog_format_statement.inc
+
# Embedded server doesn't support binlogging
-- source include/not_embedded.inc
@@ -49,11 +52,11 @@ select "--- offset --" as "";
--disable_query_log
select "--- start-position --" as "";
--enable_query_log
---exec $MYSQL_BINLOG --short-form --start-position=600 $MYSQL_TEST_DIR/var/log/master-bin.000001
+--exec $MYSQL_BINLOG --short-form --start-position=604 $MYSQL_TEST_DIR/var/log/master-bin.000001
--disable_query_log
select "--- stop-position --" as "";
--enable_query_log
---exec $MYSQL_BINLOG --short-form --stop-position=600 $MYSQL_TEST_DIR/var/log/master-bin.000001
+--exec $MYSQL_BINLOG --short-form --stop-position=604 $MYSQL_TEST_DIR/var/log/master-bin.000001
--disable_query_log
select "--- start-datetime --" as "";
--enable_query_log
@@ -78,11 +81,11 @@ select "--- offset --" as "";
--disable_query_log
select "--- start-position --" as "";
--enable_query_log
---exec $MYSQL_BINLOG --short-form --start-position=600 $MYSQL_TEST_DIR/var/log/master-bin.000001 $MYSQL_TEST_DIR/var/log/master-bin.000002
+--exec $MYSQL_BINLOG --short-form --start-position=604 $MYSQL_TEST_DIR/var/log/master-bin.000001 $MYSQL_TEST_DIR/var/log/master-bin.000002
--disable_query_log
select "--- stop-position --" as "";
--enable_query_log
---exec $MYSQL_BINLOG --short-form --stop-position=126 $MYSQL_TEST_DIR/var/log/master-bin.000001 $MYSQL_TEST_DIR/var/log/master-bin.000002
+--exec $MYSQL_BINLOG --short-form --stop-position=130 $MYSQL_TEST_DIR/var/log/master-bin.000001 $MYSQL_TEST_DIR/var/log/master-bin.000002
--disable_query_log
select "--- start-datetime --" as "";
--enable_query_log
@@ -105,11 +108,11 @@ select "--- offset --" as "";
--disable_query_log
select "--- start-position --" as "";
--enable_query_log
---exec $MYSQL_BINLOG --short-form --start-position=600 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
+--exec $MYSQL_BINLOG --short-form --start-position=604 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
--disable_query_log
select "--- stop-position --" as "";
--enable_query_log
---exec $MYSQL_BINLOG --short-form --stop-position=600 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
+--exec $MYSQL_BINLOG --short-form --stop-position=604 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
--disable_query_log
select "--- start-datetime --" as "";
--enable_query_log
@@ -132,11 +135,11 @@ select "--- offset --" as "";
--disable_query_log
select "--- start-position --" as "";
--enable_query_log
---exec $MYSQL_BINLOG --short-form --start-position=600 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002
+--exec $MYSQL_BINLOG --short-form --start-position=604 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002
--disable_query_log
select "--- stop-position --" as "";
--enable_query_log
---exec $MYSQL_BINLOG --short-form --stop-position=126 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002
+--exec $MYSQL_BINLOG --short-form --stop-position=130 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002
--disable_query_log
select "--- start-datetime --" as "";
--enable_query_log
diff --git a/mysql-test/t/mysqlbinlog_base64.test b/mysql-test/t/mysqlbinlog_base64.test
new file mode 100644
index 00000000000..3aab767f9fa
--- /dev/null
+++ b/mysql-test/t/mysqlbinlog_base64.test
@@ -0,0 +1,38 @@
+-- source include/have_binlog_format_row.inc
+#
+# Write different events to binlog
+#
+create table t1 (a int);
+insert into t1 values (1);
+insert into t1 values (2);
+insert into t1 values (3);
+update t1 set a=a+2 where a=2;
+update t1 set a=a+2 where a=3;
+
+create table t2 (word varchar(20));
+load data infile '../../std_data/words.dat' into table t2;
+
+#
+# Save binlog
+#
+--exec $MYSQL_BINLOG --hexdump $MYSQL_TEST_DIR/var/log/master-bin.000001 > $MYSQL_TEST_DIR/var/tmp/mysqlbinlog_base64.sql
+
+#
+# Clear database and restore from binlog
+#
+drop table t1;
+drop table t2;
+--exec $MYSQL test < $MYSQL_TEST_DIR/var/tmp/mysqlbinlog_base64.sql
+
+#
+# Verify that all binlog events have been executed
+#
+select * from t1;
+select * from t2;
+
+#
+# Test cleanup
+#
+--exec rm $MYSQL_TEST_DIR/var/tmp/mysqlbinlog_base64.sql
+drop table t1;
+drop table t2;
diff --git a/mysql-test/t/rpl000002.test b/mysql-test/t/rpl000002.test
index bafd8a30159..5b9ed6898b8 100644
--- a/mysql-test/t/rpl000002.test
+++ b/mysql-test/t/rpl000002.test
@@ -1,3 +1,8 @@
+# Mixed DDL-DML (CREATE ... SELECT ...) statements can only be
+# replicated properly in statement-based replication.
+# Currently statement based due to bug 12345
+--source include/have_binlog_format_statement.inc
+
source include/master-slave.inc;
# Test replication of auto_increment
diff --git a/mysql-test/t/rpl000006.test b/mysql-test/t/rpl000006.test
index 334ed575835..bca97391f8e 100644
--- a/mysql-test/t/rpl000006.test
+++ b/mysql-test/t/rpl000006.test
@@ -1,47 +1,2 @@
-#
-# Test forced timestamp
-#
-source include/master-slave.inc;
-
-# Don't log table creating to the slave as we want to test LOAD TABLE
-set SQL_LOG_BIN=0,timestamp=200006;
-create table t1(t timestamp not null,a char(1));
-insert into t1 ( a) values ('F');
-select unix_timestamp(t) from t1;
-connection slave;
-load table t1 from master;
-select unix_timestamp(t) from t1;
-
-# Delete the created table on master and slave
-connection master;
-set SQL_LOG_BIN=1,timestamp=default;
-drop table t1;
-save_master_pos;
-connection slave;
-sync_with_master;
-connection master;
-
-#
-# Test copying table with checksum
-#
-
-# Don't log table creating to the slave as we want to test LOAD TABLE
-set SQL_LOG_BIN=0;
-
-CREATE TABLE t1 (
- a int not null
-) ENGINE=MyISAM MAX_ROWS=4000 CHECKSUM=1;
-INSERT INTO t1 VALUES (1);
-save_master_pos;
-connection slave;
-sync_with_master;
-load table t1 from master;
-check table t1;
-drop table t1;
-connection master;
-drop table t1;
-save_master_pos;
-connection slave;
-sync_with_master;
-
-# End of 4.1 tests
+let $engine_type=MyISAM;
+-- source extra/rpl_tests/rpl000006.test
diff --git a/mysql-test/t/rpl000013-slave.opt b/mysql-test/t/rpl000013-slave.opt
deleted file mode 100644
index 2662c695b41..00000000000
--- a/mysql-test/t/rpl000013-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---abort-slave-event-count=1
diff --git a/mysql-test/t/rpl000013.test b/mysql-test/t/rpl000013.test
index eca4803c6bc..c681e76cf51 100644
--- a/mysql-test/t/rpl000013.test
+++ b/mysql-test/t/rpl000013.test
@@ -1,3 +1,13 @@
+# This test is to verify that DROP TEMPORARY TABLE
+# is automatically binlogged and sent to slave
+# when a temp table is dropped by disconnection
+# of a master's conection.
+# So it does not apply to row-based, where we neither need
+# nor do this automatic binlogging. And if we run this test
+# in row-based, it hangs waiting for an offset which is never
+# reached (the "sync_with_master 1"), logically.
+
+--source include/have_binlog_format_statement.inc
source include/master-slave.inc;
save_master_pos;
connection slave;
diff --git a/mysql-test/t/rpl000017.test b/mysql-test/t/rpl000017.test
index 3b4574e9547..792801dd3d2 100644
--- a/mysql-test/t/rpl000017.test
+++ b/mysql-test/t/rpl000017.test
@@ -1,7 +1,7 @@
-connect (master,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
-connect (slave,localhost,root,,test,$SLAVE_MYPORT,slave.sock);
+source include/master-slave.inc;
+connection slave;
+stop slave;
connection master;
-reset master;
grant replication slave on *.* to replicate@localhost identified by 'aaaaaaaaaaaaaaab';
grant replication slave on *.* to replicate@127.0.0.1 identified by 'aaaaaaaaaaaaaaab';
connection slave;
diff --git a/mysql-test/t/rpl000012.test b/mysql-test/t/rpl_000012.test
index 2c1c65e4202..17f1d38dbae 100644
--- a/mysql-test/t/rpl000012.test
+++ b/mysql-test/t/rpl_000012.test
@@ -1,37 +1,53 @@
-source include/master-slave.inc;
-connection master;
+# drop table t1 t2 t3 are included int master-slave.inc
+# Like rpl000013, meaningful only in statement-based:
+-- source include/have_binlog_format_statement.inc
+# Should work on both stm and row
+-- source include/master-slave.inc
-create table t2 (n int);
+
+create table t2 (n int, PRIMARY KEY(n));
create temporary table t1 (n int);
-insert into t1 values(1),(2),(3);
-insert into t2 select * from t1;
create temporary table t3 (n int not null);
+
+insert into t1 values(1),(2),(3),(100),(25),(26),(200),(300);
+insert into t2 select * from t1;
alter table t3 add primary key(n);
+
flush logs;
-insert into t3 values (100);
+insert into t3 values (1010);
insert into t2 select * from t3;
+
drop table if exists t3;
-insert into t2 values (101);
+insert into t2 values (1012);
+
connection master1;
create temporary table t1 (n int);
insert into t1 values (4),(5);
insert into t2 select * from t1;
+
save_master_pos;
disconnect master;
-connection slave;
+connection slave;
#add 1 to the saved position, so we will catch drop table on disconnect
#for sure
sync_with_master 1;
+
connection master1;
-insert into t2 values(6);
+insert into t2 values(61);
+
save_master_pos;
disconnect master1;
+
connection slave;
#same trick - make sure we catch drop of temporary table on disconnect
sync_with_master 1;
+
select * from t2;
+select count(*) from t2;
+select sum(n) from t2;
show status like 'Slave_open_temp_tables';
+
#
# Clean up
#
@@ -41,5 +57,3 @@ drop table if exists t1,t2;
save_master_pos;
connection slave;
sync_with_master;
-
-# End of 4.1 tests
diff --git a/mysql-test/t/rpl000015-slave.sh b/mysql-test/t/rpl_000015-slave.sh
index 62748605af1..62748605af1 100755
--- a/mysql-test/t/rpl000015-slave.sh
+++ b/mysql-test/t/rpl_000015-slave.sh
diff --git a/mysql-test/t/rpl000015.slave-mi b/mysql-test/t/rpl_000015.slave-mi
index 28bc753dd56..28bc753dd56 100644
--- a/mysql-test/t/rpl000015.slave-mi
+++ b/mysql-test/t/rpl_000015.slave-mi
diff --git a/mysql-test/t/rpl000015.test b/mysql-test/t/rpl_000015.test
index a53049386af..a19bae1bed0 100644
--- a/mysql-test/t/rpl000015.test
+++ b/mysql-test/t/rpl_000015.test
@@ -30,12 +30,12 @@ connection master;
--disable_warnings
drop table if exists t1;
--enable_warnings
-create table t1 (n int);
+create table t1 (n int, PRIMARY KEY(n));
insert into t1 values (10),(45),(90);
sync_slave_with_master;
+connection slave;
select * from t1;
connection master;
+select * from t1;
drop table t1;
sync_slave_with_master;
-
-# End of 4.1 tests
diff --git a/mysql-test/t/rpl_LD_INFILE.test b/mysql-test/t/rpl_LD_INFILE.test
new file mode 100644
index 00000000000..769462b5898
--- /dev/null
+++ b/mysql-test/t/rpl_LD_INFILE.test
@@ -0,0 +1,41 @@
+#############################################################################
+# Original Author: JBM #
+# Original Date: Aug/18/2005 #
+#############################################################################
+# TEST: To test the LOAD DATA INFILE in rbr #
+#############################################################################
+
+# Includes
+-- source include/master-slave.inc
+
+# Begin clean up test section
+--disable_warnings
+connection master;
+DROP PROCEDURE IF EXISTS test.p1;
+DROP TABLE IF EXISTS test.t1;
+--enable_warnings
+
+# Section 1 test
+CREATE TABLE test.t1 (a VARCHAR(255), PRIMARY KEY(a));
+LOAD DATA INFILE '../../std_data/words2.dat' INTO TABLE test.t1;
+DELETE FROM test.t1 WHERE a = 'abashed';
+DELETE FROM test.t1;
+LOAD DATA INFILE '../../std_data/words2.dat' INTO TABLE test.t1;
+
+
+connection master;
+SELECT * FROM test.t1;
+save_master_pos;
+sync_slave_with_master;
+connection slave;
+SELECT * FROM test.t1;
+
+connection master;
+# Lets cleanup
+#show binlog events;
+
+DROP PROCEDURE IF EXISTS test.p1;
+DROP TABLE test.t1;
+
+# End of 5.0 test case
+
diff --git a/mysql-test/t/rpl_auto_increment.test b/mysql-test/t/rpl_auto_increment.test
index 71032404307..fe0f1689471 100644
--- a/mysql-test/t/rpl_auto_increment.test
+++ b/mysql-test/t/rpl_auto_increment.test
@@ -1,104 +1,7 @@
-#
-# Test of auto_increment with offset
-#
-source include/have_innodb.inc;
-source include/master-slave.inc;
-
-create table t1 (a int not null auto_increment,b int, primary key (a)) engine=myisam auto_increment=3;
-insert into t1 values (NULL,1),(NULL,2),(NULL,3);
-select * from t1;
-
-sync_slave_with_master;
-select * from t1;
-connection master;
-drop table t1;
-
-create table t1 (a int not null auto_increment,b int, primary key (a)) engine=myisam;
-insert into t1 values (1,1),(NULL,2),(3,3),(NULL,4);
-delete from t1 where b=4;
-insert into t1 values (NULL,5),(NULL,6);
-select * from t1;
-
-sync_slave_with_master;
-select * from t1;
-connection master;
-
-drop table t1;
-
-set @@session.auto_increment_increment=100, @@session.auto_increment_offset=10;
-show variables like "%auto_inc%";
-
-create table t1 (a int not null auto_increment, primary key (a)) engine=myisam;
-# Insert with 2 insert statements to get better testing of logging
-insert into t1 values (NULL),(5),(NULL);
-insert into t1 values (250),(NULL);
-select * from t1;
-insert into t1 values (1000);
-set @@insert_id=400;
-insert into t1 values(NULL),(NULL);
-select * from t1;
-
-sync_slave_with_master;
-select * from t1;
-connection master;
-drop table t1;
-
-#
-# Same test with innodb (as the innodb code is a bit different)
-#
-create table t1 (a int not null auto_increment, primary key (a)) engine=innodb;
-# Insert with 2 insert statements to get better testing of logging
-insert into t1 values (NULL),(5),(NULL);
-insert into t1 values (250),(NULL);
-select * from t1;
-insert into t1 values (1000);
-set @@insert_id=400;
-insert into t1 values(NULL),(NULL);
-select * from t1;
-
-sync_slave_with_master;
-select * from t1;
-connection master;
-drop table t1;
-
-set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1;
-create table t1 (a int not null auto_increment, primary key (a)) engine=myisam;
-# Insert with 2 insert statements to get better testing of logging
-insert into t1 values (NULL),(5),(NULL),(NULL);
-insert into t1 values (500),(NULL),(502),(NULL),(NULL);
-select * from t1;
-set @@insert_id=600;
---error 1062
-insert into t1 values(600),(NULL),(NULL);
-set @@insert_id=600;
-insert ignore into t1 values(600),(NULL),(NULL),(610),(NULL);
-select * from t1;
-
-sync_slave_with_master;
-select * from t1;
-connection master;
-drop table t1;
-
-#
-# Test that auto-increment works when slave has rows in the table
-#
-set @@session.auto_increment_increment=10, @@session.auto_increment_offset=1;
-
-create table t1 (a int not null auto_increment, primary key (a)) engine=myisam;
-
-sync_slave_with_master;
-insert into t1 values(2),(12),(22),(32),(42);
-connection master;
-
-insert into t1 values (NULL),(NULL);
-insert into t1 values (3),(NULL),(NULL);
-select * from t1;
-
-sync_slave_with_master;
-select * from t1;
-connection master;
-
-drop table t1;
-
-# End cleanup
-sync_slave_with_master;
+#####################################
+# Wrapper for rpl_auto_increment.test#
+#####################################
+-- source include/have_innodb.inc
+let $engine_type=innodb;
+let $engine_type2=myisam;
+-- source extra/rpl_tests/rpl_auto_increment.test
diff --git a/mysql-test/t/rpl_bit.test b/mysql-test/t/rpl_bit.test
new file mode 100644
index 00000000000..5211f375274
--- /dev/null
+++ b/mysql-test/t/rpl_bit.test
@@ -0,0 +1,90 @@
+#############################################################################
+# Original Author: JBM #
+# Original Date: Sept/15/2005 #
+#############################################################################
+# Test: To test the replication of the bit field #
+#############################################################################
+
+-- source include/master-slave.inc
+
+
+# Begin clean up test section
+connection master;
+--disable_warnings
+DROP TABLE IF EXISTS test.t1;
+--enable_warnings
+# End of cleanup
+
+# Begin test section 1
+
+CREATE TABLE test.t1 (
+ dummyKey INTEGER NOT NULL,
+ f01 TINYINT,
+ f10 TINYINT,
+ f12 TINYINT,
+ f15 TINYINT,
+ f16 TINYINT,
+ f7 TINYINT,
+ f9 TINYINT,
+ f29 TINYINT,
+ f0 TINYINT,
+ fA1 TINYINT,
+ C32 TINYINT,
+ A42 TINYINT,
+ CA3 TINYINT,
+ A044 TINYINT,
+ f001 TINYINT,
+ A3002 TINYINT,
+ fC003 TINYINT,
+ CA300 TINYINT,
+ A305 TINYINT,
+ CA321 TINYINT,
+ r001 TINYINT,
+ bit1 BIT(6),
+ bit2 BIT(6),
+ bit3 BIT(6),
+ State1 TINYINT,
+ State2 TINYINT,
+ State3 TINYINT,
+ State4 TINYINT,
+ SubState TINYINT,
+ gState TINYINT,
+ oSupp TINYINT,
+ tSupp TINYINT,
+ sSuppD TINYINT,
+ mSuppf TINYINT,
+ GSuppDf TINYINT,
+ VNotSupp TINYINT,
+ x034 TINYINT,
+PRIMARY KEY USING HASH (dummyKey) );
+
+LOCK TABLES test.t1 WRITE;
+INSERT INTO test.t1 VALUES (6,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'111111',b'111110',b'110101',4,5,5,5,5,5,5,5,5,5,3,2,1);
+INSERT INTO test.t1 VALUES (1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'111111',b'000000',b'100100',4,5,5,5,5,5,5,5,5,5,3,2,1);
+INSERT INTO test.t1 VALUES (2,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'000000',b'101010',b'010101',4,5,5,5,5,5,5,5,5,5,3,2,1);
+INSERT INTO test.t1 VALUES (3,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'101010',b'111111',b'000000',4,5,5,5,5,5,5,5,5,5,3,2,1);
+INSERT INTO test.t1 VALUES (4,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,4,5,5,5,5,5,5,5,5,5,3,2,1);
+INSERT INTO test.t1 VALUES (5,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,4,5,5,5,5,5,5,5,5,5,3,2,1);
+INSERT INTO test.t1 VALUES (7,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,4,5,5,5,5,5,5,5,5,5,3,2,1);
+INSERT INTO test.t1 VALUES (8,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,4,5,5,5,5,5,5,5,5,5,3,2,1);
+UNLOCK TABLES;
+
+
+SELECT oSupp, sSuppD, GSuppDf, VNotSupp, x034 FROM test.t1;
+SELECT hex(bit1) from test.t1;
+SELECT hex(bit2) from test.t1;
+SELECT hex(bit3) from test.t1;
+save_master_pos;
+
+connection slave;
+sync_with_master;
+SELECT oSupp, sSuppD, GSuppDf, VNotSupp, x034 FROM test.t1;
+SELECT hex(bit1) from test.t1;
+SELECT hex(bit2) from test.t1;
+SELECT hex(bit3) from test.t1;
+
+connection master;
+DROP TABLE IF EXISTS test.t1;
+sync_slave_with_master;
+
+# End of 5.0 test case
diff --git a/mysql-test/t/rpl_bit_npk.test b/mysql-test/t/rpl_bit_npk.test
new file mode 100644
index 00000000000..07fc42b09ef
--- /dev/null
+++ b/mysql-test/t/rpl_bit_npk.test
@@ -0,0 +1,112 @@
+#############################################################################
+# Original Author: JBM #
+# Original Date: Sept/15/2005 #
+#############################################################################
+# Test: To test the replication of the bit field #
+#############################################################################
+
+-- source include/master-slave.inc
+
+
+# Begin clean up test section
+connection master;
+--disable_warnings
+DROP TABLE IF EXISTS test.t1;
+--enable_warnings
+# End of cleanup
+
+# Begin test section 1
+
+CREATE TABLE test.t1 (
+ dummyKey INTEGER NOT NULL,
+ f01 TINYINT,
+ f10 TINYINT,
+ f12 TINYINT,
+ f15 TINYINT,
+ f16 TINYINT,
+ f7 TINYINT,
+ f9 TINYINT,
+ f29 TINYINT,
+ f0 TINYINT,
+ fA1 TINYINT,
+ C32 TINYINT,
+ A42 TINYINT,
+ CA3 TINYINT,
+ A044 TINYINT,
+ f001 TINYINT,
+ A3002 TINYINT,
+ fC003 TINYINT,
+ CA300 TINYINT,
+ A305 TINYINT,
+ CA321 TINYINT,
+ r001 TINYINT,
+ bit1 BIT(6),
+ bit2 BIT(6),
+ bit3 BIT(6),
+ State1 TINYINT,
+ State2 TINYINT,
+ State3 TINYINT,
+ State4 TINYINT,
+ SubState TINYINT,
+ gState TINYINT,
+ oSupp TINYINT,
+ tSupp TINYINT,
+ sSuppD TINYINT,
+ mSuppf TINYINT,
+ GSuppDf TINYINT,
+ VNotSupp TINYINT,
+ x034 TINYINT);
+
+LOCK TABLES test.t1 WRITE;
+INSERT INTO test.t1 VALUES (6,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'111111',b'111110',b'110101',4,5,5,5,5,5,5,5,5,5,3,NULL,1);
+INSERT INTO test.t1 VALUES (1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'111111',b'000000',b'100100',4,5,5,5,5,5,5,5,5,5,3,2,1);
+INSERT INTO test.t1 VALUES (2,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'000000',b'101010',b'010101',4,5,5,5,5,5,5,5,5,5,3,2,1);
+INSERT INTO test.t1 VALUES (3,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'101010',b'111111',b'000000',4,5,5,5,5,5,5,5,5,5,3,2,1);
+INSERT INTO test.t1 VALUES (4,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'0',1,1,4,5,5,5,5,5,5,5,5,5,3,2,1);
+INSERT INTO test.t1 VALUES (5,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,4,5,5,5,5,5,5,5,5,5,3,2,1);
+INSERT INTO test.t1 VALUES (7,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,4,5,5,5,5,5,5,5,5,5,3,2,1);
+INSERT INTO test.t1 VALUES (8,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,4,5,5,5,5,5,5,5,5,5,3,2,1);
+UNLOCK TABLES;
+
+UPDATE test.t1 set x034 = 50 where bit3 = b'000000';
+UPDATE test.t1 set VNotSupp = 33 where bit1 = b'0';
+SELECT oSupp, sSuppD, GSuppDf, VNotSupp, x034 FROM test.t1;
+SELECT hex(bit1) from test.t1;
+SELECT hex(bit2) from test.t1;
+SELECT hex(bit3) from test.t1;
+save_master_pos;
+
+connection slave;
+sync_with_master;
+SELECT oSupp, sSuppD, GSuppDf, VNotSupp, x034 FROM test.t1;
+SELECT hex(bit1) from test.t1;
+SELECT hex(bit2) from test.t1;
+SELECT hex(bit3) from test.t1;
+
+connection master;
+CREATE TABLE test.t2 (a INT, b BIT(1));
+INSERT INTO test.t2 VALUES (1, b'0');
+INSERT INTO test.t2 VALUES (1, b'1');
+UPDATE test.t2 SET a = 2 WHERE b = b'1';
+
+CREATE TABLE test.t3 (a INT, b INT);
+INSERT INTO test.t3 VALUES (1, NULL);
+INSERT INTO test.t3 VALUES (1, 0);
+UPDATE test.t3 SET a = 2 WHERE b = 0;
+
+SELECT a, hex(b) FROM test.t2;
+SELECT * FROM test.t3;
+save_master_pos;
+
+connection slave;
+sync_with_master;
+SELECT a, hex(b) FROM test.t2;
+SELECT * FROM test.t3;
+
+connection master;
+DROP TABLE IF EXISTS test.t1;
+DROP TABLE IF EXISTS test.t2;
+DROP TABLE IF EXISTS test.t3;
+sync_slave_with_master;
+
+# End of 5.0 test case
diff --git a/mysql-test/t/rpl_change_master.test b/mysql-test/t/rpl_change_master.test
index 6c055a81ceb..c031464c95e 100644
--- a/mysql-test/t/rpl_change_master.test
+++ b/mysql-test/t/rpl_change_master.test
@@ -19,11 +19,11 @@ connection slave;
--real_sleep 3 # wait for I/O thread to have read updates
stop slave;
--replace_result $MASTER_MYPORT MASTER_MYPORT
---replace_column 1 # 8 # 9 # 23 # 33 #
+--replace_column 1 # 7 # 8 # 9 # 23 # 33 #
show slave status;
change master to master_user='root';
--replace_result $MASTER_MYPORT MASTER_MYPORT
---replace_column 1 # 8 # 9 # 23 # 33 #
+--replace_column 1 # 7 # 8 # 9 # 23 # 33 #
show slave status;
start slave;
sync_with_master;
diff --git a/mysql-test/t/rpl_commit_after_flush.test b/mysql-test/t/rpl_commit_after_flush.test
index 6129e5485a6..9f6d4591f96 100644
--- a/mysql-test/t/rpl_commit_after_flush.test
+++ b/mysql-test/t/rpl_commit_after_flush.test
@@ -1,19 +1,6 @@
-source include/master-slave.inc;
-source include/have_innodb.inc;
-create table t1 (a int) engine=innodb;
-begin;
-insert into t1 values(1);
-flush tables with read lock;
-commit;
-save_master_pos;
-connection slave;
-sync_with_master;
-# cleanup
-connection master;
-unlock tables;
-drop table t1;
-save_master_pos;
-connection slave;
-sync_with_master;
-
-# End of 4.1 tests
+#####################################
+# Wrapper for rpl_commit_after_flush#
+#####################################
+-- source include/have_innodb.inc
+let $engine_type=innodb;
+-- source extra/rpl_tests/rpl_commit_after_flush.test
diff --git a/mysql-test/t/rpl_create_database.test b/mysql-test/t/rpl_create_database.test
index cfccc4567b5..7ec73132113 100644
--- a/mysql-test/t/rpl_create_database.test
+++ b/mysql-test/t/rpl_create_database.test
@@ -55,9 +55,6 @@ CREATE DATABASE mysqltest_sisyfos;
USE mysqltest_sisyfos;
CREATE TABLE t2 (a INT);
let $VERSION=`select version()`;
---replace_result $VERSION VERSION
---replace_column 2 # 5 #
-SHOW BINLOG EVENTS;
SHOW DATABASES;
sync_slave_with_master;
SHOW DATABASES;
diff --git a/mysql-test/t/rpl_deadlock-slave.opt b/mysql-test/t/rpl_deadlock_innodb-slave.opt
index f4a8c640458..f4a8c640458 100644
--- a/mysql-test/t/rpl_deadlock-slave.opt
+++ b/mysql-test/t/rpl_deadlock_innodb-slave.opt
diff --git a/mysql-test/t/rpl_deadlock_innodb.test b/mysql-test/t/rpl_deadlock_innodb.test
new file mode 100644
index 00000000000..155bb9fdf34
--- /dev/null
+++ b/mysql-test/t/rpl_deadlock_innodb.test
@@ -0,0 +1,6 @@
+################################
+# Wrapper for rpl_deadlock.test#
+################################
+-- source include/have_innodb.inc
+let $engine_type=innodb;
+-- source extra/rpl_tests/rpl_deadlock.test
diff --git a/mysql-test/t/rpl_delete_all.test b/mysql-test/t/rpl_delete_all.test
deleted file mode 100644
index e0c0757bbc2..00000000000
--- a/mysql-test/t/rpl_delete_all.test
+++ /dev/null
@@ -1,43 +0,0 @@
-source include/master-slave.inc;
-
-connection slave;
-create database mysqltest;
-connection master;
-drop database if exists mysqltest;
-sync_slave_with_master;
-# can't read dir
---replace_result "Errcode: 1" "Errcode: X" "Errcode: 2" "Errcode: X" \\ /
---error 1049
-show tables from mysqltest;
-
-connection slave;
-create table t1 (a int);
-connection master;
-drop table if exists t1;
-sync_slave_with_master;
-# table does not exist
---error 1146
-select * from t1;
-
-connection master;
-create table t1 (a int);
-sync_slave_with_master;
-insert into t1 values(1);
-connection master;
-delete from t1;
-sync_slave_with_master;
-select * from t1;
-
-insert into t1 values(1);
-connection master;
-insert into t1 values(2);
-update t1 set a=2;
-sync_slave_with_master;
-select * from t1;
-
-# cleanup
-connection master;
-drop table t1;
-sync_slave_with_master;
-
-# End of 4.1 tests
diff --git a/mysql-test/t/rpl_delete_no_where.test b/mysql-test/t/rpl_delete_no_where.test
new file mode 100644
index 00000000000..b4cbda64ea3
--- /dev/null
+++ b/mysql-test/t/rpl_delete_no_where.test
@@ -0,0 +1,2 @@
+let $engine_type=myisam;
+-- source extra/rpl_tests/rpl_delete_no_where.test
diff --git a/mysql-test/t/rpl_do_grant.test b/mysql-test/t/rpl_do_grant.test
index 54287a67657..8d6f99e4bf1 100644
--- a/mysql-test/t/rpl_do_grant.test
+++ b/mysql-test/t/rpl_do_grant.test
@@ -1,6 +1,7 @@
-# Test that GRANT and SET PASSWORD are replicated to the slave
+# Works in statement-based and row-based binlogging.
+# Test that GRANT and other user management commands are replicated to the slave
-source include/master-slave.inc;
+-- source include/master-slave.inc
# do not be influenced by other tests.
connection master;
@@ -46,3 +47,52 @@ sync_with_master;
flush privileges;
# End of 4.1 tests
+
+connection master;
+--error 1141
+show grants for rpl_do_grant@localhost;
+connection slave;
+--error 1141
+show grants for rpl_do_grant@localhost;
+
+connection master;
+create user rpl_do_grant@localhost;
+show grants for rpl_do_grant@localhost;
+--error 1141
+show grants for rpl_do_grant2@localhost;
+sync_slave_with_master;
+show grants for rpl_do_grant@localhost;
+--error 1141
+show grants for rpl_do_grant2@localhost;
+
+connection master;
+rename user rpl_do_grant@localhost to rpl_do_grant2@localhost;
+show grants for rpl_do_grant2@localhost;
+sync_slave_with_master;
+show grants for rpl_do_grant2@localhost;
+
+connection master;
+grant DELETE,INSERT on mysqltest1.* to rpl_do_grant2@localhost;
+show grants for rpl_do_grant2@localhost;
+sync_slave_with_master;
+show grants for rpl_do_grant2@localhost;
+
+connection master;
+revoke DELETE on mysqltest1.* from rpl_do_grant2@localhost;
+show grants for rpl_do_grant2@localhost;
+sync_slave_with_master;
+show grants for rpl_do_grant2@localhost;
+
+connection master;
+revoke all privileges, grant option from rpl_do_grant2@localhost;
+show grants for rpl_do_grant2@localhost;
+sync_slave_with_master;
+show grants for rpl_do_grant2@localhost;
+
+connection master;
+drop user rpl_do_grant2@localhost;
+--error 1141
+show grants for rpl_do_grant2@localhost;
+sync_slave_with_master;
+--error 1141
+show grants for rpl_do_grant2@localhost;
diff --git a/mysql-test/t/rpl_drop.test b/mysql-test/t/rpl_drop.test
index ebb33c92a20..b38007a755f 100644
--- a/mysql-test/t/rpl_drop.test
+++ b/mysql-test/t/rpl_drop.test
@@ -12,3 +12,5 @@ connection slave;
sync_with_master;
# End of 4.1 tests
+
+
diff --git a/mysql-test/t/rpl_empty_master_crash.test b/mysql-test/t/rpl_empty_master_crash.test
index 5f26bedc9fe..707d1eca8c2 100644
--- a/mysql-test/t/rpl_empty_master_crash.test
+++ b/mysql-test/t/rpl_empty_master_crash.test
@@ -1,6 +1,6 @@
source include/master-slave.inc;
---replace_column 1 # 8 # 9 # 23 # 33 #
+--replace_column 1 # 8 # 9 # 16 # 23 # 33 #
show slave status;
#
diff --git a/mysql-test/t/rpl_failed_optimize.test b/mysql-test/t/rpl_failed_optimize.test
index 57afaa89e83..4b329208fef 100644
--- a/mysql-test/t/rpl_failed_optimize.test
+++ b/mysql-test/t/rpl_failed_optimize.test
@@ -1,20 +1,6 @@
-source include/have_innodb.inc;
-source include/master-slave.inc;
-
-#
-# BUG#5551 "Failed OPTIMIZE TABLE is logged to binary log"
-# Replication should work when OPTIMIZE TABLE timeouts, and
-# when OPTIMIZE TABLE is executed on a non-existing table
-#
-
-CREATE TABLE t1 ( a int ) ENGINE=InnoDB;
-BEGIN;
-INSERT INTO t1 VALUES (1);
-
-connection master1;
-OPTIMIZE TABLE t1;
-
-OPTIMIZE TABLE non_existing;
-sync_slave_with_master;
-
-# End of 4.1 tests
+#######################################
+# Wrapper for rpl_failed_optimize.test#
+#######################################
+-- source include/have_innodb.inc
+let $engine_type=InnoDB;
+-- source extra/rpl_tests/rpl_failed_optimize.test
diff --git a/mysql-test/t/rpl_flush_log_loop-master.opt b/mysql-test/t/rpl_flushlog_loop-master.opt
index 4f6e0f3d00c..4f6e0f3d00c 100644
--- a/mysql-test/t/rpl_flush_log_loop-master.opt
+++ b/mysql-test/t/rpl_flushlog_loop-master.opt
diff --git a/mysql-test/t/rpl_flush_log_loop-master.sh b/mysql-test/t/rpl_flushlog_loop-master.sh
index 9e56af99f5c..9e56af99f5c 100755
--- a/mysql-test/t/rpl_flush_log_loop-master.sh
+++ b/mysql-test/t/rpl_flushlog_loop-master.sh
diff --git a/mysql-test/t/rpl_flush_log_loop-slave.opt b/mysql-test/t/rpl_flushlog_loop-slave.opt
index d1373f139b1..d1373f139b1 100644
--- a/mysql-test/t/rpl_flush_log_loop-slave.opt
+++ b/mysql-test/t/rpl_flushlog_loop-slave.opt
diff --git a/mysql-test/t/rpl_flush_log_loop-slave.sh b/mysql-test/t/rpl_flushlog_loop-slave.sh
index b8814e059a9..b8814e059a9 100755
--- a/mysql-test/t/rpl_flush_log_loop-slave.sh
+++ b/mysql-test/t/rpl_flushlog_loop-slave.sh
diff --git a/mysql-test/t/rpl_flush_log_loop.test b/mysql-test/t/rpl_flushlog_loop.test
index 6e45047bd30..46f41e9a5e3 100644
--- a/mysql-test/t/rpl_flush_log_loop.test
+++ b/mysql-test/t/rpl_flushlog_loop.test
@@ -1,15 +1,23 @@
# Testing if "flush logs" command bouncing resulting in logs created in a loop
# in case of bi-directional replication
+-- source include/master-slave.inc
-source include/master-slave.inc;
+# This test is dependent on the actual events written to the binary
+# log. To not break statement-based testing, we only run this test
+# under statement-based logging.
connection slave;
+--disable_warnings
stop slave;
+--enable_warnings
--replace_result $MASTER_MYPORT MASTER_PORT
eval change master to master_host='127.0.0.1',master_user='root',
master_password='',master_port=$MASTER_MYPORT;
start slave;
connection master;
+--disable_warnings
+stop slave;
+--enable_warnings
--replace_result $SLAVE_MYPORT SLAVE_PORT
eval change master to master_host='127.0.0.1',master_user='root',
master_password='',master_port=$SLAVE_MYPORT;
@@ -18,7 +26,5 @@ sleep 5;
flush logs;
sleep 5;
--replace_result $SLAVE_MYPORT SLAVE_PORT
---replace_column 1 # 8 # 9 # 23 # 33 #
+--replace_column 1 # 8 # 9 # 16 # 23 # 33 #
show slave status;
-
-# End of 4.1 tests
diff --git a/mysql-test/t/rpl_foreign_key_innodb.test b/mysql-test/t/rpl_foreign_key_innodb.test
new file mode 100644
index 00000000000..8615a008739
--- /dev/null
+++ b/mysql-test/t/rpl_foreign_key_innodb.test
@@ -0,0 +1,6 @@
+###################################
+# Wrapper for rpl_foreign_key.test#
+###################################
+-- source include/have_innodb.inc
+let $engine_type=INNODB;
+-- source extra/rpl_tests/rpl_foreign_key.test
diff --git a/mysql-test/t/rpl_heap.test b/mysql-test/t/rpl_heap.test
index 3ee335fe58d..03c9070678b 100644
--- a/mysql-test/t/rpl_heap.test
+++ b/mysql-test/t/rpl_heap.test
@@ -1,3 +1,6 @@
+# Requires statement logging
+-- source include/have_binlog_format_statement.inc
+
# You must run this test with --manager.
require_manager;
@@ -18,6 +21,7 @@ drop table if exists t1;
create table t1 type=HEAP select 10 as a;
insert into t1 values(11);
save_master_pos;
+--replace_column 2 # 5 #
show binlog events from 79;
connection slave;
reset slave;
@@ -35,6 +39,7 @@ select * from t1;
# (the LIMIT is to not use the query cache)
select * from t1 limit 10;
save_master_pos;
+--replace_column 2 # 5 #
show binlog events in 'master-bin.002' from 79;
connection slave;
diff --git a/mysql-test/t/rpl_insert_id.test b/mysql-test/t/rpl_insert_id.test
index 49d3a03640c..62a9fdb4d56 100644
--- a/mysql-test/t/rpl_insert_id.test
+++ b/mysql-test/t/rpl_insert_id.test
@@ -1,77 +1,6 @@
-# See if queries that use both auto_increment and LAST_INSERT_ID()
-# are replicated well
-
-# We also check how the foreign_key_check variable is replicated
-
-source include/master-slave.inc;
-source include/have_innodb.inc;
-connection master;
-create table t1(a int auto_increment, key(a));
-create table t2(b int auto_increment, c int, key(b));
-insert into t1 values (1),(2),(3);
-insert into t1 values (null);
-insert into t2 values (null,last_insert_id());
-save_master_pos;
-connection slave;
-sync_with_master;
-select * from t1;
-select * from t2;
-connection master;
-#check if multi-line inserts,
-#which set last_insert_id to the first id inserted,
-#are replicated the same way
-drop table t1;
-drop table t2;
---disable_warnings
-create table t1(a int auto_increment, key(a)) engine=innodb;
-create table t2(b int auto_increment, c int, key(b), foreign key(b) references t1(a)) engine=innodb;
---enable_warnings
-SET FOREIGN_KEY_CHECKS=0;
-insert into t1 values (10);
-insert into t1 values (null),(null),(null);
-insert into t2 values (5,0);
-insert into t2 values (null,last_insert_id());
-SET FOREIGN_KEY_CHECKS=1;
-save_master_pos;
-connection slave;
-sync_with_master;
-select * from t1;
-select * from t2;
-connection master;
-
-# check if INSERT SELECT in auto_increment is well replicated (bug #490)
-
-drop table t2;
-drop table t1;
-create table t1(a int auto_increment, key(a));
-create table t2(b int auto_increment, c int, key(b));
-insert into t1 values (10);
-insert into t1 values (null),(null),(null);
-insert into t2 values (5,0);
-insert into t2 (c) select * from t1;
-select * from t2;
-save_master_pos;
-connection slave;
-sync_with_master;
-select * from t1;
-select * from t2;
-connection master;
-drop table t1;
-drop table t2;
-save_master_pos;
-connection slave;
-sync_with_master;
-
-#
-# Bug#8412: Error codes reported in binary log for CHARACTER SET,
-# FOREIGN_KEY_CHECKS
-#
-connection master;
-SET TIMESTAMP=1000000000;
-CREATE TABLE t1 ( a INT UNIQUE );
-SET FOREIGN_KEY_CHECKS=0;
---error 1062
-INSERT INTO t1 VALUES (1),(1);
-sync_slave_with_master;
-
-# End of 4.1 tests
+#################################
+# Wrapper for rpl_insert_id.test#
+#################################
+-- source include/have_innodb.inc
+let $engine_type=innodb;
+-- source extra/rpl_tests/rpl_insert_id.test
diff --git a/mysql-test/t/rpl_insert_ignore.test b/mysql-test/t/rpl_insert_ignore.test
index a6cc69b1df8..61222b542ac 100644
--- a/mysql-test/t/rpl_insert_ignore.test
+++ b/mysql-test/t/rpl_insert_ignore.test
@@ -1,73 +1,7 @@
-# Testcase for BUG#6287 "Slave skips auto_increment values in Replication with InnoDB"
-# The bug was that if on master, INSERT IGNORE ignored some
-# rows, and the table was InnoDB with auto_inc column, then on slave
-# some rows received an auto_inc bigger than on master.
-# Slave needs to be started with --innodb to store table in InnoDB.
-# Same test for MyISAM (which had no bug).
-
+#####################################
+# Wrapper for rpl_insert_ignore.test#
+#####################################
-- source include/have_innodb.inc
-
--- source include/master-slave.inc
-
-CREATE TABLE t1 (
- a int unsigned not null auto_increment primary key,
- b int unsigned,
- unique (b)
-) ENGINE=innodb;
-
-CREATE TABLE t2 (
- a int unsigned, # to force INSERT SELECT to have a certain order
- b int unsigned
-) ENGINE=innodb;
-
-
-INSERT INTO t1 VALUES (NULL, 1);
-INSERT INTO t1 VALUES (NULL, 2);
-INSERT INTO t1 VALUES (NULL, 3);
-INSERT INTO t1 VALUES (NULL, 4);
-
-# An alternation of values which will conflict in t1 and will not.
-
-INSERT INTO t2 VALUES (1, 1);
-INSERT INTO t2 VALUES (2, 2);
-INSERT INTO t2 VALUES (3, 5);
-INSERT INTO t2 VALUES (4, 3);
-INSERT INTO t2 VALUES (5, 4);
-INSERT INTO t2 VALUES (6, 6);
-
-INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a;
-
-# Compare results
-
-SELECT * FROM t1 ORDER BY a;
-
-sync_slave_with_master;
-SELECT * FROM t1 ORDER BY a;
-
-# Now do the same for MyISAM
-
-connection master;
-drop table t1;
-CREATE TABLE t1 (
- a int unsigned not null auto_increment primary key,
- b int unsigned,
- unique (b)
-) ENGINE=myisam;
-
-INSERT INTO t1 VALUES (1, 1);
-INSERT INTO t1 VALUES (2, 2);
-INSERT INTO t1 VALUES (3, 3);
-INSERT INTO t1 VALUES (4, 4);
-
-INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a;
-
-SELECT * FROM t1 ORDER BY a;
-
-sync_slave_with_master;
-SELECT * FROM t1 ORDER BY a;
-
-connection master;
-drop table t1, t2;
-sync_slave_with_master;
-
-# End of 4.1 tests
+let $engine_type=innodb;
+let $engine_type2=myisam;
+-- source extra/rpl_tests/rpl_insert_ignore.test
diff --git a/mysql-test/t/rpl_loaddata.test b/mysql-test/t/rpl_loaddata.test
index 00121092bbf..72914717a12 100644
--- a/mysql-test/t/rpl_loaddata.test
+++ b/mysql-test/t/rpl_loaddata.test
@@ -1,153 +1,2 @@
-# See if replication of a "LOAD DATA in an autoincrement column"
-# Honours autoincrement values
-# i.e. if the master and slave have the same sequence
-#
-# check replication of load data for temporary tables with additional
-# parameters
-#
-# check if duplicate entries trigger an error (they should unless IGNORE or
-# REPLACE was used on the master) (bug 571).
-#
-# check if START SLAVE, RESET SLAVE, CHANGE MASTER reset Last_slave_error and
-# Last_slave_errno in SHOW SLAVE STATUS (1st and 3rd commands did not: bug 986)
-
-source include/master-slave.inc;
-
-connection slave;
-reset master;
-connection master;
-
-create table t1(a int not null auto_increment, b int, primary key(a) );
-load data infile '../../std_data/rpl_loaddata.dat' into table t1;
-
-create temporary table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60));
-load data infile '../../std_data/rpl_loaddata2.dat' into table t2 fields terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by '\n##\n' starting by '>' ignore 1 lines;
-
-create table t3 (day date,id int(9),category enum('a','b','c'),name varchar(60));
-insert into t3 select * from t2;
-
-save_master_pos;
-connection slave;
-sync_with_master;
-
-select * from t1;
-select * from t3;
-# We want to be sure that LOAD DATA is in the slave's binlog.
-# But we can't simply read this binlog, because as the slave has not been
-# restarted for this test, the file_id is uncertain (would cause test
-# failures). So instead, we test if the binlog looks long enough to
-# contain LOAD DATA. Since 5.0.3 we assume that binlog of 1292 is ok.
-# If LOAD DATA was not logged, the binlog would be shorter.
-show master status;
-
-connection master;
-
-drop table t1;
-drop table t2;
-drop table t3;
-create table t1(a int, b int, unique(b));
-
-save_master_pos;
-connection slave;
-sync_with_master;
-
-# See if slave stops when there's a duplicate entry for key error in LOAD DATA
-
-insert into t1 values(1,10);
-
-connection master;
-load data infile '../../std_data/rpl_loaddata.dat' into table t1;
-
-save_master_pos;
-connection slave;
-# The SQL slave thread should be stopped now.
-wait_for_slave_to_stop;
-
-# Skip the bad event and see if error is cleared in SHOW SLAVE STATUS by START
-# SLAVE, even though we are not executing any event (as sql_slave_skip_counter
-# takes us directly to the end of the relay log).
-
-set global sql_slave_skip_counter=1;
-start slave;
-sync_with_master;
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 23 # 33 #
-show slave status;
-
-# Trigger error again to test CHANGE MASTER
-
-connection master;
-set sql_log_bin=0;
-delete from t1;
-set sql_log_bin=1;
-load data infile '../../std_data/rpl_loaddata.dat' into table t1;
-save_master_pos;
-connection slave;
-# The SQL slave thread should be stopped now.
-# Exec_Master_Log_Pos should point to the start of Execute event
-# for last load data.
-wait_for_slave_to_stop;
-
-# CHANGE MASTER and see if error is cleared in SHOW SLAVE STATUS.
-stop slave;
-change master to master_user='test';
-change master to master_user='root';
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 23 # 33 #
-show slave status;
-
-# Trigger error again to test RESET SLAVE
-
-set global sql_slave_skip_counter=1;
-start slave;
-sync_with_master;
-connection master;
-set sql_log_bin=0;
-delete from t1;
-set sql_log_bin=1;
-load data infile '../../std_data/rpl_loaddata.dat' into table t1;
-save_master_pos;
-connection slave;
-# The SQL slave thread should be stopped now.
-wait_for_slave_to_stop;
-
-# RESET SLAVE and see if error is cleared in SHOW SLAVE STATUS.
-stop slave;
-reset slave;
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 23 # 33 #
-show slave status;
-
-# Finally, see if logging is done ok on master for a failing LOAD DATA INFILE
-
-connection master;
-reset master;
-create table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60),
-unique(day)) engine=MyISAM; # no transactions
---error 1062
-load data infile '../../std_data/rpl_loaddata2.dat' into table t2 fields
-terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by
-'\n##\n' starting by '>' ignore 1 lines;
-select * from t2;
-save_master_pos;
-connection slave;
-start slave;
-sync_with_master;
-select * from t2;
-
-# verify that if no error on slave, this is an error
-
-alter table t2 drop key day;
-connection master;
-delete from t2;
---error 1062
-load data infile '../../std_data/rpl_loaddata2.dat' into table t2 fields
-terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by
-'\n##\n' starting by '>' ignore 1 lines;
-connection slave;
-wait_for_slave_to_stop;
-drop table t2;
-connection master;
-drop table t2;
-
-# End of 4.1 tests
+let $engine_type=MyISAM;
+-- source extra/rpl_tests/rpl_loaddata.test
diff --git a/mysql-test/t/rpl_loaddata2.test b/mysql-test/t/rpl_loaddata2.test
new file mode 100644
index 00000000000..22429666d5f
--- /dev/null
+++ b/mysql-test/t/rpl_loaddata2.test
@@ -0,0 +1,8 @@
+--source include/master-slave.inc
+
+CREATE TABLE t1 (word CHAR(20) NOT NULL);
+LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE t1;
+SELECT * FROM t1;
+sync_slave_with_master;
+SELECT * FROM t1;
+
diff --git a/mysql-test/t/rpl_loaddata_rule_m-master.opt b/mysql-test/t/rpl_loaddata_s-slave.opt
index 9d4a8f0b95e..9d4a8f0b95e 100644
--- a/mysql-test/t/rpl_loaddata_rule_m-master.opt
+++ b/mysql-test/t/rpl_loaddata_s-slave.opt
diff --git a/mysql-test/t/rpl_loaddata_rule_s.test b/mysql-test/t/rpl_loaddata_s.test
index 98fad3cc06f..c49fe461d7b 100644
--- a/mysql-test/t/rpl_loaddata_rule_s.test
+++ b/mysql-test/t/rpl_loaddata_s.test
@@ -2,13 +2,16 @@
# replicated LOAD DATA INFILE correctly when it has binlog_*_db rules.
# This is for BUG#1100 (LOAD DATA INFILE was half-logged).
-source include/master-slave.inc;
+-- source include/have_binlog_format_statement.inc
+-- source include/master-slave.inc
+
connection slave;
+# Not sure why we connect to slave and then try to reset master, but I will leave it [JBM]
reset master;
connection master;
# 'test' is the current database
-create table t1(a int, b int, unique(b));
+create table test.t1(a int, b int, unique(b));
load data infile '../../std_data/rpl_loaddata.dat' into table test.t1;
# Test logging on slave;
@@ -16,7 +19,6 @@ load data infile '../../std_data/rpl_loaddata.dat' into table test.t1;
save_master_pos;
connection slave;
sync_with_master;
-select count(*) from t1; # check that LOAD was replicated
-show binlog events from 98; # should be nothing
-
-# End of 4.1 tests
+select count(*) from test.t1; # check that LOAD was replicated
+--replace_column 2 # 5 #
+show binlog events from 102; # should be nothing
diff --git a/mysql-test/t/rpl_loadfile.test b/mysql-test/t/rpl_loadfile.test
new file mode 100644
index 00000000000..58d5717b7e8
--- /dev/null
+++ b/mysql-test/t/rpl_loadfile.test
@@ -0,0 +1,47 @@
+#############################################################################
+# Original Author: JBM #
+# Original Date: Aug/18/2005 #
+#############################################################################
+# TEST: To test the LOAD_FILE() in rbr #
+#############################################################################
+
+# Includes
+-- source include/master-slave.inc
+
+
+# Begin clean up test section
+--disable_warnings
+connection master;
+DROP PROCEDURE IF EXISTS test.p1;
+DROP TABLE IF EXISTS test.t1;
+--enable_warnings
+
+# Section 1 test
+
+CREATE TABLE test.t1 (a INT, blob_column LONGBLOB, PRIMARY KEY(a));
+INSERT INTO test.t1 VALUES(1,'test');
+UPDATE test.t1 SET blob_column=LOAD_FILE('../../std_data/words2.dat') WHERE a=1;
+delimiter |;
+create procedure test.p1()
+begin
+ INSERT INTO test.t1 VALUES(2,'test');
+ UPDATE test.t1 SET blob_column=LOAD_FILE('../../std_data/words2.dat') WHERE a=2;
+end|
+delimiter ;|
+
+CALL test.p1();
+SELECT * FROM test.t1;
+save_master_pos;
+sync_slave_with_master;
+connection slave;
+SHOW CREATE TABLE test.t1;
+SELECT * FROM test.t1;
+
+connection master;
+# Lets cleanup
+#show binlog events;
+
+DROP PROCEDURE IF EXISTS test.p1;
+DROP TABLE test.t1;
+
+# End of 5.0 test case
diff --git a/mysql-test/t/rpl_log_pos.test b/mysql-test/t/rpl_log_pos.test
index 979b146bb22..44c00f80e6d 100644
--- a/mysql-test/t/rpl_log_pos.test
+++ b/mysql-test/t/rpl_log_pos.test
@@ -1,19 +1,23 @@
#
# Testing of setting slave to wrong log position with master_log_pos
#
+
+# Passes with rbr no problem, removed statement include [jbm]
+
source include/master-slave.inc;
+--replace_column 3 <Binlog_Ignore_DB>
show master status;
sync_slave_with_master;
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 8 # 9 # 23 # 33 #
show slave status;
stop slave;
-change master to master_log_pos=73;
+change master to master_log_pos=74;
start slave;
sleep 5;
stop slave;
-change master to master_log_pos=73;
+change master to master_log_pos=74;
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 8 # 9 # 23 # 33 #
show slave status;
@@ -23,13 +27,14 @@ sleep 5;
--replace_column 1 # 8 # 9 # 23 # 33 #
show slave status;
stop slave;
-change master to master_log_pos=173;
+change master to master_log_pos=177;
start slave;
sleep 2;
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 8 # 9 # 23 # 33 #
show slave status;
connection master;
+--replace_column 3 <Binlog_Ignore_DB>
show master status;
create table if not exists t1 (n int);
drop table if exists t1;
@@ -38,7 +43,7 @@ insert into t1 values (1),(2),(3);
save_master_pos;
connection slave;
stop slave;
-change master to master_log_pos=98;
+change master to master_log_pos=102;
start slave;
sync_with_master;
select * from t1;
diff --git a/mysql-test/t/rpl_multi_delete.test b/mysql-test/t/rpl_multi_delete.test
index 4a8c0ab6912..2fd7b820b1a 100644
--- a/mysql-test/t/rpl_multi_delete.test
+++ b/mysql-test/t/rpl_multi_delete.test
@@ -16,26 +16,10 @@ sync_with_master;
select * from t1;
select * from t2;
-# End of 4.1 tests
-
-# Check if deleting 0 rows is binlogged (BUG#13348)
-
-connection master;
-delete from t1;
-delete from t2;
-
-sync_slave_with_master;
-# force a difference to see if master's multi-DELETE will correct it
-insert into t1 values(1);
-insert into t2 values(1);
-
-connection master;
-DELETE t1.*, t2.* from t1, t2;
-
-sync_slave_with_master;
-select * from t1;
-select * from t2;
-
connection master;
drop table t1,t2;
-sync_slave_with_master;
+save_master_pos;
+connection slave;
+sync_with_master;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl000001-slave.opt b/mysql-test/t/rpl_multi_engine-slave.opt
index 627becdbfb5..627becdbfb5 100644
--- a/mysql-test/t/rpl000001-slave.opt
+++ b/mysql-test/t/rpl_multi_engine-slave.opt
diff --git a/mysql-test/t/rpl_multi_engine.test b/mysql-test/t/rpl_multi_engine.test
new file mode 100644
index 00000000000..b0879757468
--- /dev/null
+++ b/mysql-test/t/rpl_multi_engine.test
@@ -0,0 +1,99 @@
+# See if replication between MyISAM, MEMORY and InnoDB works.
+
+-- source include/master-slave.inc
+
+connection slave;
+-- source include/have_innodb.inc
+
+connection master;
+-- source include/have_innodb.inc
+--disable_warnings
+create database if not exists mysqltest1;
+use mysqltest1;
+drop table if exists t1;
+
+CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc
+VARCHAR(255), bc CHAR(255), d DECIMAL(10,4) DEFAULT 0, f FLOAT DEFAULT
+0, total BIGINT UNSIGNED, y YEAR, t TIMESTAMP,PRIMARY KEY(id));
+
+sync_slave_with_master;
+use mysqltest1;
+
+# MyISAM to MyISAM then InnoDB then MEMORY
+
+connection master;
+alter table t1 engine=myisam;
+show create table t1;
+
+connection slave;
+alter table t1 engine=myisam;
+show create table t1;
+
+--source include/rpl_multi_engine.inc
+
+connection slave;
+alter table t1 engine=innodb;
+show create table t1;
+
+--source include/rpl_multi_engine.inc
+
+connection slave;
+alter table t1 engine=memory;
+show create table t1;
+
+--source include/rpl_multi_engine.inc
+
+# MEMORY to ...
+
+connection master;
+alter table t1 engine=memory;
+show create table t1;
+
+connection slave;
+alter table t1 engine=myisam;
+show create table t1;
+
+--source include/rpl_multi_engine.inc
+
+connection slave;
+alter table t1 engine=innodb;
+show create table t1;
+
+--source include/rpl_multi_engine.inc
+
+connection slave;
+alter table t1 engine=memory;
+show create table t1;
+
+--source include/rpl_multi_engine.inc
+
+# InnoDB to ...
+
+connection master;
+alter table t1 engine=innodb;
+show create table t1;
+
+connection slave;
+alter table t1 engine=myisam;
+show create table t1;
+
+--source include/rpl_multi_engine.inc
+
+connection slave;
+alter table t1 engine=innodb;
+show create table t1;
+
+--source include/rpl_multi_engine.inc
+
+connection slave;
+alter table t1 engine=memory;
+show create table t1;
+
+--source include/rpl_multi_engine.inc
+
+# cleanup
+connection master;
+DROP TABLE t1;
+sync_slave_with_master;
+
+# End of 5.1 test case
diff --git a/mysql-test/t/rpl_multi_update.test b/mysql-test/t/rpl_multi_update.test
index f6a960434ad..cc147eb3263 100644
--- a/mysql-test/t/rpl_multi_update.test
+++ b/mysql-test/t/rpl_multi_update.test
@@ -1,49 +1,2 @@
-source include/master-slave.inc;
-
-CREATE TABLE t1 (
- a int unsigned not null auto_increment primary key,
- b int unsigned
-) ENGINE=MyISAM;
-
-CREATE TABLE t2 (
- a int unsigned not null auto_increment primary key,
- b int unsigned
-) ENGINE=MyISAM;
-
-INSERT INTO t1 VALUES (NULL, 0);
-INSERT INTO t1 SELECT NULL, 0 FROM t1;
-
-INSERT INTO t2 VALUES (NULL, 0), (NULL,1);
-
-SELECT * FROM t1 ORDER BY a;
-SELECT * FROM t2 ORDER BY a;
-
-UPDATE t1, t2 SET t1.b = t2.b WHERE t1.a = t2.a;
-save_master_pos;
-connection slave;
-sync_with_master;
-
-# End of 4.1 tests
-
-# Check if updating 0 rows is binlogged (BUG#13348)
-
-connection master;
-delete from t1;
-delete from t2;
-insert into t1 values(1,1);
-insert into t2 values(1,1);
-
-sync_slave_with_master;
-# force a difference to see if master's multi-UPDATE will correct it
-update t1 set a=2;
-
-connection master;
-UPDATE t1, t2 SET t1.a = t2.a;
-
-sync_slave_with_master;
-select * from t1;
-select * from t2;
-
-connection master;
-drop table t1, t2;
-sync_slave_with_master;
+let $engine_type=MyISAM;
+-- source extra/rpl_tests/rpl_multi_update.test
diff --git a/mysql-test/t/rpl_multi_update2.test b/mysql-test/t/rpl_multi_update2.test
index a78b1901f51..484d8dd7633 100644
--- a/mysql-test/t/rpl_multi_update2.test
+++ b/mysql-test/t/rpl_multi_update2.test
@@ -1,62 +1,2 @@
-# Let's verify that multi-update is not always skipped by slave if
-# some replicate-* rules exist.
-# (BUG#7011)
-
-source include/master-slave.inc;
-
---disable_warnings
-drop table if exists t1,t2;
---enable_warnings
-
-CREATE TABLE t1 (
- a int unsigned not null auto_increment primary key,
- b int unsigned
-) ENGINE=MyISAM;
-
-CREATE TABLE t2 (
- a int unsigned not null auto_increment primary key,
- b int unsigned
-) ENGINE=MyISAM;
-
-INSERT INTO t1 VALUES (NULL, 0);
-INSERT INTO t1 SELECT NULL, 0 FROM t1;
-
-INSERT INTO t2 VALUES (NULL, 0), (NULL,1);
-
-SELECT * FROM t1 ORDER BY a;
-SELECT * FROM t2 ORDER BY a;
-
-UPDATE t1, t2 SET t1.b = (t2.b+4) WHERE t1.a = t2.a;
-SELECT * FROM t1 ORDER BY a;
-SELECT * FROM t2 ORDER BY a;
-
-save_master_pos;
-connection slave;
-sync_with_master;
-SELECT * FROM t1 ORDER BY a;
-SELECT * FROM t2 ORDER BY a;
-
-connection master;
-drop table t1,t2;
-sync_slave_with_master;
-
-#
-# BUG#13236 multi-update with subquery & --replicate-ignore-table
-#
-reset master;
-
-connection master;
-CREATE TABLE t1 ( a INT );
-INSERT INTO t1 VALUES (0);
-UPDATE t1, (SELECT 3 as b) AS x SET t1.a = x.b;
-select * from t1;
-sync_slave_with_master;
-
-connection slave;
-select * from t1;
-
-connection master;
-drop table t1;
-sync_slave_with_master;
-
-# End of 4.1 tests
+let $engine_type=MyISAM;
+--source extra/rpl_tests/rpl_multi_update2.test
diff --git a/mysql-test/t/rpl_multi_update3.test b/mysql-test/t/rpl_multi_update3.test
index 36ac7a59cb3..d03f03e5638 100644
--- a/mysql-test/t/rpl_multi_update3.test
+++ b/mysql-test/t/rpl_multi_update3.test
@@ -1,220 +1,2 @@
-source include/master-slave.inc;
-
-##############################################################################
-#
-# Let's verify that multi-update with a subselect does not cause the slave to crash
-# (BUG#10442)
-#
---disable_query_log
-SELECT '-------- Test for BUG#9361 --------' as "";
---enable_query_log
-
-CREATE TABLE t1 (
- a int unsigned not null auto_increment primary key,
- b int unsigned
-) ENGINE=MyISAM;
-
-CREATE TABLE t2 (
- a int unsigned not null auto_increment primary key,
- b int unsigned
-) ENGINE=MyISAM;
-
-INSERT INTO t1 VALUES (NULL, 0);
-INSERT INTO t1 SELECT NULL, 0 FROM t1;
-
-INSERT INTO t2 VALUES (NULL, 0), (NULL,1);
-
-SELECT * FROM t1 ORDER BY a;
-SELECT * FROM t2 ORDER BY a;
-
-UPDATE t2, (SELECT a FROM t1) AS t SET t2.b = t.a+5 ;
-SELECT * FROM t1 ORDER BY a;
-SELECT * FROM t2 ORDER BY a;
-
-sync_slave_with_master;
-connection slave;
-SELECT * FROM t1 ORDER BY a;
-SELECT * FROM t2 ORDER BY a;
-
-connection master;
-drop table t1,t2;
-
-##############################################################################
-#
-# Test for BUG#9361:
-# Subselects should work inside multi-updates
-#
---disable_query_log
-SELECT '-------- Test 1 for BUG#9361 --------' as "";
---enable_query_log
-
-connection master;
-
---disable_warnings
-DROP TABLE IF EXISTS t1;
-DROP TABLE IF EXISTS t2;
---enable_warnings
-
-CREATE TABLE t1 (
- a1 char(30),
- a2 int,
- a3 int,
- a4 char(30),
- a5 char(30)
-);
-
-CREATE TABLE t2 (
- b1 int,
- b2 char(30)
-);
-
-# Insert one row per table
-INSERT INTO t1 VALUES ('Yes', 1, NULL, 'foo', 'bar');
-INSERT INTO t2 VALUES (1, 'baz');
-
-# This should update the row in t1
-UPDATE t1 a, t2
- SET a.a1 = 'No'
- WHERE a.a2 =
- (SELECT b1
- FROM t2
- WHERE b2 = 'baz')
- AND a.a3 IS NULL
- AND a.a4 = 'foo'
- AND a.a5 = 'bar';
-
-sync_slave_with_master;
-connection slave;
-SELECT * FROM t1;
-SELECT * FROM t2;
-
-connection master;
-DROP TABLE t1, t2;
-
-##############################################################################
-#
-# Second test for BUG#9361
-#
-
---disable_query_log
-SELECT '-------- Test 2 for BUG#9361 --------' as "";
---enable_query_log
-
-connection master;
-
---disable_warnings
-DROP TABLE IF EXISTS t1;
-DROP TABLE IF EXISTS t2;
-DROP TABLE IF EXISTS t3;
---enable_warnings
-
-CREATE TABLE t1 (
- i INT,
- j INT,
- x INT,
- y INT,
- z INT
-);
-
-CREATE TABLE t2 (
- i INT,
- k INT,
- x INT,
- y INT,
- z INT
-);
-
-CREATE TABLE t3 (
- j INT,
- k INT,
- x INT,
- y INT,
- z INT
-);
-
-INSERT INTO t1 VALUES ( 1, 2,13,14,15);
-INSERT INTO t2 VALUES ( 1, 3,23,24,25);
-INSERT INTO t3 VALUES ( 2, 3, 1,34,35), ( 2, 3, 1,34,36);
-
-UPDATE t1 AS a
-INNER JOIN t2 AS b
- ON a.i = b.i
-INNER JOIN t3 AS c
- ON a.j = c.j AND b.k = c.k
-SET a.x = b.x,
- a.y = b.y,
- a.z = (
- SELECT sum(z)
- FROM t3
- WHERE y = 34
- )
-WHERE b.x = 23;
-
-sync_slave_with_master;
-connection slave;
-
-SELECT * FROM t1;
-
-connection master;
-DROP TABLE t1, t2, t3;
-
-##############################################################################
-#
-# BUG#12618
-#
-# TEST: Replication of a statement containing a join in a multi-update.
-
-DROP TABLE IF EXISTS t1;
-DROP TABLE IF EXISTS t2;
-
-CREATE TABLE t1 (
- idp int(11) NOT NULL default '0',
- idpro int(11) default NULL,
- price decimal(19,4) default NULL,
- PRIMARY KEY (idp)
-);
-
-CREATE TABLE t2 (
- idpro int(11) NOT NULL default '0',
- price decimal(19,4) default NULL,
- nbprice int(11) default NULL,
- PRIMARY KEY (idpro)
-);
-
-INSERT INTO t1 VALUES
- (1,1,'3.0000'),
- (2,2,'1.0000'),
- (3,1,'1.0000'),
- (4,1,'4.0000'),
- (5,3,'2.0000'),
- (6,2,'4.0000');
-
-INSERT INTO t2 VALUES
- (1,'0.0000',0),
- (2,'0.0000',0),
- (3,'0.0000',0);
-
-# This update sets t2 to the minimal prices for each product
-update
- t2
- join
- ( select idpro, min(price) as min_price, count(*) as nbr_price
- from t1
- where idpro>0 and price>0
- group by idpro
- ) as table_price
-on t2.idpro = table_price.idpro
-set t2.price = table_price.min_price,
- t2.nbprice = table_price.nbr_price;
-
-select "-- MASTER AFTER JOIN --" as "";
-select * from t1;
-select * from t2;
-
-sync_slave_with_master;
-
-select "-- SLAVE AFTER JOIN --" as "";
-select * from t1;
-select * from t2;
-
-# End of 4.1 tests
+let $engine_type=MyISAM;
+-- source extra/rpl_tests/rpl_multi_update3.test
diff --git a/mysql-test/t/rpl_openssl.test b/mysql-test/t/rpl_openssl.test
index e15eb9b179a..8a85443e71f 100644
--- a/mysql-test/t/rpl_openssl.test
+++ b/mysql-test/t/rpl_openssl.test
@@ -45,7 +45,7 @@ select * from t1;
#checking show slave status
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_MYPORT
---replace_column 1 # 8 # 9 # 23 # 33 #
+--replace_column 1 # 6 # 7 # 8 # 9 # 10 # 11 # 16 # 22 # 23 # 33 #
show slave status;
#checking if replication works without ssl also performing clean up
@@ -58,7 +58,7 @@ save_master_pos;
connection slave;
sync_with_master;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_MYPORT
---replace_column 1 # 8 # 9 # 23 # 33 #
+--replace_column 1 # 6 # 7 # 8 # 9 # 10 # 11 # 16 # 22 # 23 # 33 #
show slave status;
# End of 4.1 tests
diff --git a/mysql-test/t/rpl_redirect.test b/mysql-test/t/rpl_redirect.test
index beb18348b40..c001d85d2f8 100644
--- a/mysql-test/t/rpl_redirect.test
+++ b/mysql-test/t/rpl_redirect.test
@@ -14,7 +14,7 @@ sync_with_master;
#discover slaves
connection master;
--replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 23 # 33 #
+--replace_column 1 # 8 # 9 # 16 # 23 # 33 #
SHOW SLAVE STATUS;
--replace_result $SLAVE_MYPORT SLAVE_PORT
SHOW SLAVE HOSTS;
diff --git a/mysql-test/t/rpl_relayrotate.test b/mysql-test/t/rpl_relayrotate.test
index 04f03367e20..99fd870e68f 100644
--- a/mysql-test/t/rpl_relayrotate.test
+++ b/mysql-test/t/rpl_relayrotate.test
@@ -1,75 +1,3 @@
-# When the relay log gets rotated while the I/O thread
-# is reading a transaction, the transaction spans on two or more
-# relay logs. If STOP SLAVE occurs while the SQL thread is
-# executing a part of the transaction in the non-first relay logs,
-# we test if START SLAVE will resume in the beginning of the
-# transaction (i.e., step back to the first relay log)
-
-# The slave is started with max_binlog_size=16384 bytes,
-# to force many rotations (approximately 30 rotations)
-
-source include/have_innodb.inc;
-source include/master-slave.inc;
-connection slave;
-stop slave;
-connection master;
---disable_warnings
-create table t1 (a int) engine=innodb;
---enable_warnings
-let $1=8000;
-disable_query_log;
-begin;
-while ($1)
-{
-# eval means expand $ expressions
- eval insert into t1 values( $1 );
- dec $1;
-}
-commit;
-# This will generate a 500kB master's binlog,
-# which corresponds to 30 slave's relay logs.
-enable_query_log;
-save_master_pos;
-connection slave;
-reset slave;
-start slave;
-# We wait 1 sec for the SQL thread to be somewhere in
-# the middle of the transaction, hopefully not in
-# the first relay log, and hopefully before the COMMIT.
-# Usually it stops when the SQL thread is around the 15th relay log.
-# We cannot use MASTER_POS_WAIT() as master's position
-# increases only when the slave executes the COMMIT.
-# Note that except when using Valgrind, 1 second is enough for the I/O slave
-# thread to fetch the whole master's binlog.
-sleep 1;
-stop slave;
-# We suppose the SQL thread stopped before COMMIT.
-# If so the transaction was rolled back
-# and the table is now empty.
-# Now restart
-start slave;
-# And see if the table contains '8000'
-# which proves that the transaction restarted at
-# the right place.
-# We must wait for the transaction to commit before
-# reading:
-sync_with_master;
-select max(a) from t1;
-connection master;
-
-# The following DROP is a very important cleaning task:
-# imagine the next test is run with --skip-innodb: it will do
-# DROP TABLE IF EXISTS t1; but this will delete the frm and leave
-# some data in the InnoDB datafile (because at that time mysqld
-# does not know about InnoDB : --skip-innodb). So if later in the
-# test suite a test wants to create an InnoDB table called t1, it
-# will fail with
-# InnoDB: Error: table t1 already exists in InnoDB internal
-# InnoDB: data dictionary. Have you deleted the .frm file etc
-drop table t1;
-# wait until this drop is executed on slave
-save_master_pos;
-connection slave;
-sync_with_master;
-
-# End of 4.1 tests
+-- source include/have_innodb.inc
+let $engine_type=innodb;
+-- source extra/rpl_tests/rpl_relayrotate.test
diff --git a/mysql-test/t/rpl_replicate_do.test b/mysql-test/t/rpl_replicate_do.test
index b8559af2394..5a2cb50d53a 100644
--- a/mysql-test/t/rpl_replicate_do.test
+++ b/mysql-test/t/rpl_replicate_do.test
@@ -1,6 +1,5 @@
# This test assumes we are ignoring updates on table t2, but doing
# updates on t1
-
source include/master-slave.inc;
--disable_warnings
drop table if exists t11;
@@ -33,7 +32,7 @@ connection slave;
sync_with_master;
# show slave status, just to see of it prints replicate-do-table
--replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 23 # 33 #
+--replace_column 1 # 7 # 8 # 9 # 16 # 22 # 23 # 33 #
show slave status;
#
diff --git a/mysql-test/t/rpl_replicate_ignore_db-slave.opt b/mysql-test/t/rpl_replicate_ignore_db-slave.opt
new file mode 100644
index 00000000000..6e3aed44f78
--- /dev/null
+++ b/mysql-test/t/rpl_replicate_ignore_db-slave.opt
@@ -0,0 +1 @@
+--replicate_ignore_db=mysqltest1
diff --git a/mysql-test/t/rpl_replicate_ignore_db.test b/mysql-test/t/rpl_replicate_ignore_db.test
new file mode 100644
index 00000000000..bcfef919fad
--- /dev/null
+++ b/mysql-test/t/rpl_replicate_ignore_db.test
@@ -0,0 +1,30 @@
+# see if --replicate-ignore-db works
+
+--source include/master-slave.inc
+
+--disable_warnings
+drop database if exists mysqltest1;
+drop database if exists mysqltest2;
+--enable_warnings
+create database mysqltest1;
+create database mysqltest2;
+
+use mysqltest1;
+create table t1 (a int);
+insert into t1 values(1);
+sync_slave_with_master;
+--error 1146
+select * from mysqltest1.t1;
+
+connection master;
+use mysqltest2;
+create table t1 (a int);
+insert into t1 values(1);
+sync_slave_with_master;
+select * from mysqltest2.t1;
+
+# cleanup
+connection master;
+drop database mysqltest1;
+drop database mysqltest2;
+sync_slave_with_master;
diff --git a/mysql-test/t/rpl_rotate_logs.test b/mysql-test/t/rpl_rotate_logs.test
index b125408d89e..1f5f4ebbed2 100644
--- a/mysql-test/t/rpl_rotate_logs.test
+++ b/mysql-test/t/rpl_rotate_logs.test
@@ -9,6 +9,9 @@
# changes
# - Test creating a duplicate key error and recover from it
+# Requires statement logging
+-- source include/have_binlog_format_statement.inc
+
connect (master,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
--disable_warnings
drop table if exists t1, t2, t3, t4;
@@ -56,7 +59,7 @@ create table t1 (s text);
insert into t1 values('Could not break slave'),('Tried hard');
sync_slave_with_master;
--replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 23 # 33 #
+--replace_column 1 # 8 # 9 # 16 # 23 # 33 #
show slave status;
select * from t1;
connection master;
@@ -109,7 +112,7 @@ show binary logs;
insert into t2 values (65);
sync_slave_with_master;
--replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 23 # 33 #
+--replace_column 1 # 8 # 9 # 16 # 23 # 33 #
show slave status;
select * from t2;
@@ -141,7 +144,7 @@ sync_with_master;
select * from t4;
--replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 23 # 33 #
+--replace_column 1 # 8 # 9 # 16 # 23 # 33 #
show slave status;
# because of concurrent insert, the table may not be up to date
# if we do not lock
diff --git a/mysql-test/t/rpl_row_001.test b/mysql-test/t/rpl_row_001.test
new file mode 100644
index 00000000000..923ed16e8b3
--- /dev/null
+++ b/mysql-test/t/rpl_row_001.test
@@ -0,0 +1,2 @@
+let $engine_type=MYISAM;
+-- source extra/rpl_tests/rpl_row_001.test
diff --git a/mysql-test/t/rpl_row_4_bytes-master.opt b/mysql-test/t/rpl_row_4_bytes-master.opt
new file mode 100644
index 00000000000..0e1929507f7
--- /dev/null
+++ b/mysql-test/t/rpl_row_4_bytes-master.opt
@@ -0,0 +1 @@
+--loose-debug=d,"old_row_based_repl_4_byte_map_id_master"
diff --git a/mysql-test/t/rpl_row_4_bytes.test b/mysql-test/t/rpl_row_4_bytes.test
new file mode 100644
index 00000000000..26a4e2f5bfe
--- /dev/null
+++ b/mysql-test/t/rpl_row_4_bytes.test
@@ -0,0 +1,33 @@
+# This test is to make sure that slaves can read a binlog containining
+# table map ids stored in 4 bytes, even though we now store them in 6
+# bytes. This is for backward-compatibility.
+# If the slave does not detect that the master stores the table map id
+# in 4 bytes, slave will read 6 bytes, and so will read the 2 bytes of
+# flags at the place where there actually is data, so the test should
+# fail.
+
+-- source include/have_binlog_format_row.inc
+-- source include/have_debug.inc
+-- source include/master-slave.inc
+
+connection master;
+--disable_warnings
+drop database if exists mysqltest1;
+create database mysqltest1;
+--enable_warnings
+use mysqltest1;
+CREATE TABLE t1 (a char(3));
+CREATE TABLE t2 (a char(3));
+insert into t1 values("ANN");
+insert into t1 values("GUI");
+insert into t2 values("LIL");
+insert into t2 values("ABE");
+insert into t2 values("ANG");
+sync_slave_with_master;
+use mysqltest1;
+select * from t1 order by a;
+select * from t2 order by a;
+
+connection master;
+DROP TABLE t1,t2;
+sync_slave_with_master;
diff --git a/mysql-test/t/rpl_row_EE_err.test b/mysql-test/t/rpl_row_EE_err.test
new file mode 100644
index 00000000000..7895a66adfd
--- /dev/null
+++ b/mysql-test/t/rpl_row_EE_err.test
@@ -0,0 +1,2 @@
+let $engine_type=myisam;
+-- source extra/rpl_tests/rpl_row_EE_err.test
diff --git a/mysql-test/t/rpl_row_NOW.test b/mysql-test/t/rpl_row_NOW.test
new file mode 100644
index 00000000000..dba6fb16bb2
--- /dev/null
+++ b/mysql-test/t/rpl_row_NOW.test
@@ -0,0 +1,73 @@
+#############################################################################
+# Original Author: JBM #
+# Original Date: Aug/18/2005 #
+# Updated 08/30/2005 Added dumps and diff #
+#############################################################################
+#TEST: Taken and modfied from http://bugs.mysql.com/bug.php?id=12480 #
+#############################################################################
+
+# Includes
+-- source include/have_binlog_format_row.inc
+-- source include/master-slave.inc
+
+
+# Begin clean up test section
+connection master;
+--disable_warnings
+create database if not exists mysqltest1;
+DROP TABLE IF EXISTS mysqltest1.t1;
+--enable_warnings
+
+
+# Begin test section 1
+CREATE TABLE mysqltest1.t1 (n MEDIUMINT NOT NULL AUTO_INCREMENT,
+ a TIMESTAMP DEFAULT '2005-05-05 01:01:01',
+ b TIMESTAMP DEFAULT '2005-05-05 01:01:01',
+ PRIMARY KEY(n));
+delimiter |;
+CREATE FUNCTION mysqltest1.f1() RETURNS TIMESTAMP
+BEGIN
+ DECLARE v1 INT DEFAULT 300;
+ WHILE v1 > 0 DO
+ SET v1 = v1 - 1;
+ END WHILE;
+ RETURN NOW();
+END|
+delimiter ;|
+
+INSERT INTO mysqltest1.t1 VALUES(NULL,NOW(),mysqltest1.f1());
+
+delimiter |;
+CREATE TRIGGER mysqltest1.trig1 BEFORE INSERT ON mysqltest1.t1
+FOR EACH ROW BEGIN
+ SET new.b = mysqltest1.f1();
+END|
+delimiter ;|
+
+INSERT INTO mysqltest1.t1 SET n = NULL, a = now();
+
+sync_slave_with_master;
+
+connection master;
+
+--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info mysqltest1 > ./var/tmp/NOW_master.sql
+--exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info mysqltest1 > ./var/tmp/NOW_slave.sql
+
+# lets cleanup
+DROP TABLE IF EXISTS mysqltest1.t1;
+DROP FUNCTION mysqltest1.f1;
+
+# Lets compare. Note: If they match test will pass, if they do not match
+# the test will show that the diff statement failed and not reject file
+# will be created. You will need to go to the mysql-test dir and diff
+# the files your self to see what is not matching :-) The failed dump
+# files will be located in mysql-test/var/tmp
+
+exec diff ./var/tmp/NOW_master.sql ./var/tmp/NOW_slave.sql;
+
+# If all is good, when can cleanup our dump files.
+system rm ./var/tmp/NOW_master.sql;
+system rm ./var/tmp/NOW_slave.sql;
+
+sync_slave_with_master;
+# End of 5.1 test case
diff --git a/mysql-test/t/rpl_row_USER.test b/mysql-test/t/rpl_row_USER.test
new file mode 100644
index 00000000000..85eaf571d4a
--- /dev/null
+++ b/mysql-test/t/rpl_row_USER.test
@@ -0,0 +1,54 @@
+#############################################################################
+# Original Author: JBM #
+# Original Date: Aug/18/2005 #
+#############################################################################
+# TEST: To test the UUID() in rbr #
+#############################################################################
+
+# Includes
+-- source include/have_binlog_format_row.inc
+-- source include/master-slave.inc
+
+# Begin clean up test section
+connection master;
+--disable_warnings
+DROP DATABASE IF EXISTS mysqltest1;
+CREATE DATABASE mysqltest1;
+--enable_warnings
+
+# Section 1 test
+CREATE USER tester IDENTIFIED BY 'test';
+GRANT ALL ON mysqltest1.* TO 'tester'@'%' IDENTIFIED BY 'test';
+GRANT ALL ON mysqltest1.* TO ''@'localhost%';
+FLUSH PRIVILEGES;
+connect (m_1,localhost,tester,,mysqltest1);
+
+connection m_1;
+CREATE TABLE mysqltest1.t1 (a INT, users VARCHAR(255), PRIMARY KEY(a));
+INSERT INTO mysqltest1.t1 VALUES(1,USER());
+INSERT INTO mysqltest1.t1 VALUES(2,CURRENT_USER());
+delimiter |;
+create procedure mysqltest1.p1()
+begin
+ INSERT INTO mysqltest1.t1 VALUES(3,USER());
+ INSERT INTO mysqltest1.t1 VALUES(4,CURRENT_USER());
+end|
+delimiter ;|
+
+CALL mysqltest1.p1();
+connection master;
+SELECT * FROM mysqltest1.t1;
+sync_slave_with_master;
+SELECT * FROM mysqltest1.t1;
+
+connection master;
+# Lets cleanup
+#show binlog events;
+
+DROP DATABASE mysqltest1;
+REVOKE ALL ON mysqltest1.* FROM 'tester'@'%';
+REVOKE ALL ON mysqltest1.* FROM ''@'localhost%';
+
+sync_slave_with_master;
+
+# End of 5.0 test case
diff --git a/mysql-test/t/rpl_row_UUID.test b/mysql-test/t/rpl_row_UUID.test
new file mode 100644
index 00000000000..477cb31c504
--- /dev/null
+++ b/mysql-test/t/rpl_row_UUID.test
@@ -0,0 +1,2 @@
+let $engine_type=myisam;
+--source extra/rpl_tests/rpl_row_UUID.test
diff --git a/mysql-test/t/rpl_row_basic_2myisam.test b/mysql-test/t/rpl_row_basic_2myisam.test
new file mode 100644
index 00000000000..471f4d6dbc5
--- /dev/null
+++ b/mysql-test/t/rpl_row_basic_2myisam.test
@@ -0,0 +1,3 @@
+let $type= 'MYISAM' ;
+let $extra_index= ;
+-- source include/rpl_row_basic.inc
diff --git a/mysql-test/t/rpl_row_basic_3innodb-slave.opt b/mysql-test/t/rpl_row_basic_3innodb-slave.opt
new file mode 100644
index 00000000000..627becdbfb5
--- /dev/null
+++ b/mysql-test/t/rpl_row_basic_3innodb-slave.opt
@@ -0,0 +1 @@
+--innodb
diff --git a/mysql-test/t/rpl_row_basic_3innodb.test b/mysql-test/t/rpl_row_basic_3innodb.test
new file mode 100644
index 00000000000..b97f1543cc3
--- /dev/null
+++ b/mysql-test/t/rpl_row_basic_3innodb.test
@@ -0,0 +1,6 @@
+-- source include/have_innodb.inc
+
+let $type= 'INNODB' ;
+let $extra_index= ;
+-- source include/rpl_row_basic.inc
+
diff --git a/mysql-test/t/rpl_row_charset.test b/mysql-test/t/rpl_row_charset.test
new file mode 100644
index 00000000000..81658fab041
--- /dev/null
+++ b/mysql-test/t/rpl_row_charset.test
@@ -0,0 +1,2 @@
+let $engine_type=myisam;
+-- source extra/rpl_tests/rpl_row_charset.test
diff --git a/mysql-test/t/rpl_row_create_table.test b/mysql-test/t/rpl_row_create_table.test
new file mode 100644
index 00000000000..faabf489bba
--- /dev/null
+++ b/mysql-test/t/rpl_row_create_table.test
@@ -0,0 +1,108 @@
+# Testing table creations for row-based replication.
+
+--source include/have_binlog_format_row.inc
+--source include/master-slave.inc
+
+--disable_query_log
+--disable_warnings
+DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8,t9;
+--enable_warnings
+--enable_query_log
+
+# Set the default storage engine to different values on master and
+# slave. We need to stop the slave for the server variable to take
+# effect, since the variable is only read on start-up.
+connection slave;
+--disable_query_log
+set @storage_engine = @@global.storage_engine;
+STOP SLAVE;
+SET GLOBAL storage_engine=memory;
+START SLAVE;
+--enable_query_log
+
+connection master;
+CREATE TABLE t1 (a INT, b INT);
+CREATE TABLE t2 (a INT, b INT) ENGINE=Merge;
+CREATE TABLE t3 (a INT, b INT) CHARSET=utf8;
+CREATE TABLE t4 (a INT, b INT) ENGINE=Merge CHARSET=utf8;
+--replace_column 1 # 4 # 5 #
+--query_vertical SHOW BINLOG EVENTS FROM 212
+--echo **** On Master ****
+--query_vertical SHOW CREATE TABLE t1
+--query_vertical SHOW CREATE TABLE t2
+--query_vertical SHOW CREATE TABLE t3
+sync_slave_with_master;
+--echo **** On Slave ****
+--query_vertical SHOW CREATE TABLE t1
+--query_vertical SHOW CREATE TABLE t2
+--query_vertical SHOW CREATE TABLE t3
+
+connection master;
+CREATE TABLE t5 (b INT, c INT) SELECT * FROM t3;
+
+CREATE TEMPORARY TABLE tt3 (a INT, b INT);
+INSERT INTO tt3 VALUES (1,2), (2,4), (3,6), (4,2), (5,10), (6,12);
+CREATE TABLE t6 (b INT, c INT) SELECT * FROM tt3;
+--echo **** On Master ****
+--query_vertical SHOW CREATE TABLE t5
+SELECT * FROM t5 ORDER BY a,b,c;
+--query_vertical SHOW CREATE TABLE t6
+SELECT * FROM t6 ORDER BY a,b,c;
+sync_slave_with_master;
+--echo **** On Slave ****
+--query_vertical SHOW CREATE TABLE t5
+SELECT * FROM t5 ORDER BY a,b,c;
+--query_vertical SHOW CREATE TABLE t6
+SELECT * FROM t6 ORDER BY a,b,c;
+
+connection master;
+# Test for erroneous constructions
+--error 1062
+CREATE TABLE t7 (UNIQUE(b)) SELECT a,b FROM tt3;
+# Shouldn't be written to the binary log
+SHOW BINLOG EVENTS FROM 1256;
+
+# Test that INSERT-SELECT works the same way as for SBR.
+CREATE TABLE t7 (a INT, b INT UNIQUE);
+--error 1062
+INSERT INTO t7 SELECT a,b FROM tt3;
+SELECT * FROM t7 ORDER BY a,b;
+# Should be written to the binary log
+SHOW BINLOG EVENTS FROM 1256;
+sync_slave_with_master;
+SELECT * FROM t7 ORDER BY a,b;
+
+connection master;
+CREATE TEMPORARY TABLE tt4 (a INT, b INT);
+INSERT INTO tt4 VALUES (4,8), (5,10), (6,12);
+BEGIN;
+INSERT INTO t7 SELECT a,b FROM tt4;
+ROLLBACK;
+SHOW BINLOG EVENTS FROM 1452;
+SELECT * FROM t7 ORDER BY a,b;
+sync_slave_with_master;
+SELECT * FROM t7 ORDER BY a,b;
+
+connection master;
+CREATE TABLE t8 LIKE t4;
+CREATE TABLE t9 LIKE tt4;
+CREATE TEMPORARY TABLE tt5 LIKE t4;
+CREATE TEMPORARY TABLE tt6 LIKE tt4;
+--echo **** On Master ****
+--query_vertical SHOW CREATE TABLE t8
+--query_vertical SHOW CREATE TABLE t9
+SHOW BINLOG EVENTS FROM 1548;
+sync_slave_with_master;
+--echo **** On Slave ****
+--query_vertical SHOW CREATE TABLE t8
+--query_vertical SHOW CREATE TABLE t9
+
+connection master;
+--disable_query_log
+DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8,t9;
+sync_slave_with_master;
+# Here we reset the value of the default storage engine
+STOP SLAVE;
+SET GLOBAL storage_engine=@storage_engine;
+START SLAVE;
+--enable_query_log
diff --git a/mysql-test/t/rpl_row_ddl.test b/mysql-test/t/rpl_row_ddl.test
new file mode 100644
index 00000000000..2433d6a83a7
--- /dev/null
+++ b/mysql-test/t/rpl_row_ddl.test
@@ -0,0 +1,35 @@
+######################## rpl_ddl.test ########################
+# #
+# DDL statements (sometimes with implicit COMMIT) executed #
+# by the master and it's propagation into the slave #
+# #
+##############################################################
+
+#
+# NOTE, PLEASE BE CAREFUL, WHEN MODIFYING THE TESTS !!
+#
+# 1. !All! objects to be dropped, renamed, altered ... must be created
+# in AUTOCOMMIT= 1 mode before AUTOCOMMIT is set to 0 and the test
+# sequences start.
+#
+# 2. Never use a test object, which was direct or indirect affected by a
+# preceeding test sequence again.
+# Except table d1.t1 where ONLY DML is allowed.
+#
+# If one preceeding test sequence hits a (sometimes not good visible,
+# because the sql error code of the statement might be 0) bug
+# and these rules are ignored, a following test sequence might earn ugly
+# effects like failing 'sync_slave_with_master', crashes of the slave or
+# abort of the test case etc..
+#
+# 3. The assignment of the DDL command to be tested to $my_stmt can
+# be a bit difficult. "'" must be avoided, because the test
+# routine "include/rpl_stmt_seq.inc" performs a
+# eval SELECT CONCAT('######## ','$my_stmt',' ########') as "";
+#
+
+--source include/have_innodb.inc
+--source include/have_binlog_format_row.inc
+--source include/master-slave.inc
+let $engine_type= "InnoDB";
+-- source extra/rpl_tests/rpl_ddl.test
diff --git a/mysql-test/t/rpl_row_delayed_ins.test b/mysql-test/t/rpl_row_delayed_ins.test
new file mode 100644
index 00000000000..b898a9a120a
--- /dev/null
+++ b/mysql-test/t/rpl_row_delayed_ins.test
@@ -0,0 +1,2 @@
+let $engine_type=myisam;
+-- source extra/rpl_tests/rpl_row_delayed_ins.test
diff --git a/mysql-test/t/rpl_row_drop.test b/mysql-test/t/rpl_row_drop.test
new file mode 100644
index 00000000000..816bd108b88
--- /dev/null
+++ b/mysql-test/t/rpl_row_drop.test
@@ -0,0 +1,47 @@
+-- source include/have_binlog_format_row.inc
+-- source include/master-slave.inc
+
+# Bug#12415: DROP of temporary table on master stops slave
+connection master;
+--echo **** On Master ****
+CREATE TABLE t1 (a int);
+CREATE TABLE t2 (a int);
+CREATE TEMPORARY TABLE t2 (a int, b int);
+SHOW TABLES;
+sync_slave_with_master;
+--echo **** On Slave ****
+SHOW TABLES;
+connection master;
+--echo **** On Master ****
+DROP TABLE t2; # Dropping the temporary table
+SHOW TABLES;
+sync_slave_with_master;
+--echo **** On Slave ****
+SHOW TABLES; # There should be two tables on the slave
+
+connection master;
+--echo **** On Master ****
+CREATE TEMPORARY TABLE t2 (a int, b int);
+SHOW TABLES;
+sync_slave_with_master;
+--echo **** On Slave ****
+SHOW TABLES;
+connection master;
+--echo **** On Master ****
+# Should drop the non-temporary table t1 and the temporary table t2
+DROP TABLE t1,t2;
+let $VERSION=`select version()`;
+--replace_result $VERSION VERSION
+SHOW BINLOG EVENTS;
+SHOW TABLES;
+sync_slave_with_master;
+--echo **** On Slave ****
+SHOW TABLES;
+
+--disable_query_log
+--disable_warnings
+connection master;
+DROP TABLE IF EXISTS t2;
+sync_slave_with_master;
+--enable_warnings
+--enable_query_log
diff --git a/mysql-test/t/rpl_row_err_daisychain-master.opt b/mysql-test/t/rpl_row_err_daisychain-master.opt
new file mode 100644
index 00000000000..83ed8522e72
--- /dev/null
+++ b/mysql-test/t/rpl_row_err_daisychain-master.opt
@@ -0,0 +1 @@
+--binlog-format=row
diff --git a/mysql-test/t/rpl_row_err_daisychain-slave.opt b/mysql-test/t/rpl_row_err_daisychain-slave.opt
new file mode 100644
index 00000000000..4cb7a31da81
--- /dev/null
+++ b/mysql-test/t/rpl_row_err_daisychain-slave.opt
@@ -0,0 +1 @@
+--binlog-format=statement --log-slave-updates
diff --git a/mysql-test/t/rpl_row_flsh_tbls.test b/mysql-test/t/rpl_row_flsh_tbls.test
new file mode 100644
index 00000000000..72babb4e21f
--- /dev/null
+++ b/mysql-test/t/rpl_row_flsh_tbls.test
@@ -0,0 +1,6 @@
+# depends on the binlog output
+-- source include/have_binlog_format_row.inc
+
+let $rename_event_pos= 615;
+-- source extra/rpl_tests/rpl_flsh_tbls.test
+
diff --git a/mysql-test/t/rpl_row_func001.test b/mysql-test/t/rpl_row_func001.test
new file mode 100644
index 00000000000..6c538017911
--- /dev/null
+++ b/mysql-test/t/rpl_row_func001.test
@@ -0,0 +1,56 @@
+#############################################################################
+# This test is being created to test out the non deterministic items with #
+# row based replication. #
+# Original Author: JBM #
+# Original Date: Aug/10/2005 #
+# Update: 08/29/2005 change name to initails #
+#############################################################################
+
+# Includes
+-- source include/have_binlog_format_row.inc
+-- source include/master-slave.inc
+
+
+# Begin clean up test section
+connection master;
+--disable_warnings
+--error 0,1305
+DROP FUNCTION test.f1;
+DROP TABLE IF EXISTS test.t1;
+
+
+--enable_warnings
+
+# Section 1 test from bug #12487 Uses stored function to insert rows to see what is replicated.
+
+create table test.t1 (a int, PRIMARY KEY(a));
+
+delimiter //;
+create function test.f1(i int) returns int
+begin
+insert into test.t1 values(i);
+return 0;
+end//
+delimiter ;//
+
+select test.f1(1);
+select test.f1(2);
+select * from test.t1;
+
+save_master_pos;
+sync_slave_with_master;
+connection slave;
+#show create table test.t1;
+select * from test.t1;
+
+connection master;
+
+#Used for debugging
+#show binlog events;
+
+# Lets cleanup
+
+DROP FUNCTION test.f1;
+DROP TABLE test.t1;
+
+# End of 5.0 test case
diff --git a/mysql-test/t/rpl_row_func002.test b/mysql-test/t/rpl_row_func002.test
new file mode 100644
index 00000000000..3812eac201c
--- /dev/null
+++ b/mysql-test/t/rpl_row_func002.test
@@ -0,0 +1,104 @@
+#############################################################################
+# This test is being created to test out the non deterministic items with #
+# row based replication. #
+# Original Author: JBM #
+# Original Date: Aug/10/2005 #
+# Update: 08/29/2005 Turn on diff #
+#############################################################################
+# Note: Many lines are commented out in this test case. These were used for #
+# creating the test case and debugging and are being left for #
+# debugging, but they can not be used for the regular testing as the #
+# Time changes and is not deteministic, so instead we dump both the #
+# master and slave and diff the dumps. If the dumps differ then the #
+# test case will fail. To run during diff failuers, comment out the #
+# diff. #
+#############################################################################
+
+# Includes
+-- source include/have_binlog_format_row.inc
+-- source include/master-slave.inc
+
+
+# Begin clean up test section
+connection master;
+--disable_warnings
+--error 0,1305
+DROP FUNCTION test.f1;
+DROP TABLE IF EXISTS test.t1;
+DROP TABLE IF EXISTS test.t2;
+
+--enable_warnings
+
+# Section 1 test from Peter G. This test changes uses a stored function to update rows and return the timestamp. We change the value of the time stamp on the master to see what is replicated.
+
+CREATE TABLE test.t1 (a INT NOT NULL AUTO_INCREMENT, t TIMESTAMP, t2 TIMESTAMP, PRIMARY KEY(a));
+CREATE TABLE test.t2 (a INT NOT NULL AUTO_INCREMENT, t TIMESTAMP, t2 TIMESTAMP, PRIMARY KEY(a));
+
+delimiter //;
+create function test.f1() RETURNS TIMESTAMP
+BEGIN
+UPDATE test.t1 SET t = CURRENT_TIMESTAMP;
+RETURN CURRENT_TIMESTAMP;
+END//
+delimiter ;//
+
+INSERT INTO test.t2 VALUES (null,f1(),CURRENT_TIMESTAMP);
+#select * from test.t1;
+#save_master_pos;
+#sync_slave_with_master;
+#connection slave;
+#select * from test.t1;
+#connection master;
+
+
+SET TIMESTAMP=2;
+INSERT INTO test.t2 VALUES (null,f1(),CURRENT_TIMESTAMP);
+#select * from test.t1;
+#save_master_pos;
+#sync_slave_with_master;
+#connection slave;
+#select * from test.t1;
+#connection master;
+
+#sleep 3;
+SET TIMESTAMP=1;
+INSERT INTO test.t2 VALUES (null,f1(),CURRENT_TIMESTAMP);
+#select * from test.t1;
+#save_master_pos;
+#sync_slave_with_master;
+#connection slave;
+#select * from test.t1;
+#connection master;
+
+
+SET TIMESTAMP=333300000;
+INSERT INTO test.t2 VALUES (null,f1(),CURRENT_TIMESTAMP);
+
+# We need a sync to ensure that the slave has caught up before
+# dumping the database.
+sync_slave_with_master;
+
+connection master;
+#Used for debugging
+#show binlog events;
+
+# time to dump the databases and so we can see if they match
+
+--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > ./var/tmp/func002_master.sql
+--exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > ./var/tmp/func002_slave.sql
+
+# First lets cleanupi
+DROP FUNCTION test.f1;
+DROP TABLE test.t1;
+
+
+# the test will show that the diff statement failed and no reject file
+# will be created. You will need to go to the mysql-test dir and diff
+# the files your self to see what is not matching :-). The files are located
+# in mysql-test/var/tmp
+
+exec diff ./var/tmp/func002_master.sql ./var/tmp/func002_slave.sql;
+
+
+# End of 5.0 test case
+
diff --git a/mysql-test/t/rpl_row_func003.test b/mysql-test/t/rpl_row_func003.test
new file mode 100644
index 00000000000..bac13698620
--- /dev/null
+++ b/mysql-test/t/rpl_row_func003.test
@@ -0,0 +1,6 @@
+###################################
+# Wrapper for rpl_row_func003.test#
+###################################
+-- source include/have_innodb.inc
+let $engine_type=INNODB;
+-- source extra/rpl_tests/rpl_row_func003.test
diff --git a/mysql-test/t/rpl_row_inexist_tbl.test b/mysql-test/t/rpl_row_inexist_tbl.test
new file mode 100644
index 00000000000..e77ea216571
--- /dev/null
+++ b/mysql-test/t/rpl_row_inexist_tbl.test
@@ -0,0 +1,27 @@
+# Test to see what slave says when master is updating a table it does
+# not have
+--source include/have_binlog_format_row.inc
+
+source include/master-slave.inc;
+
+connection master;
+create table t1 (a int not null primary key);
+sync_slave_with_master;
+drop table t1;
+
+connection master;
+insert into t1 values (1);
+insert into t1 values (2);
+
+connection slave;
+# slave should have stopped because can't find table
+wait_for_slave_to_stop;
+# see if we have a good error message:
+--replace_result $MASTER_MYPORT MASTER_MYPORT
+--replace_column 1 # 7 # 8 # 9 # 23 # 33 #
+--vertical_results
+show slave status;
+
+# cleanup
+connection master;
+drop table t1;
diff --git a/mysql-test/t/rpl_log-master.opt b/mysql-test/t/rpl_row_log-master.opt
index e0d075c3fbd..e0d075c3fbd 100644
--- a/mysql-test/t/rpl_log-master.opt
+++ b/mysql-test/t/rpl_row_log-master.opt
diff --git a/mysql-test/t/rpl_log-slave.opt b/mysql-test/t/rpl_row_log-slave.opt
index 8b137891791..8b137891791 100644
--- a/mysql-test/t/rpl_log-slave.opt
+++ b/mysql-test/t/rpl_row_log-slave.opt
diff --git a/mysql-test/t/rpl_row_log.test b/mysql-test/t/rpl_row_log.test
new file mode 100644
index 00000000000..290a08ff75a
--- /dev/null
+++ b/mysql-test/t/rpl_row_log.test
@@ -0,0 +1,4 @@
+# Requires statement logging
+-- source include/have_binlog_format_row.inc
+-- source extra/rpl_tests/rpl_log.test
+
diff --git a/mysql-test/t/rpl_row_max_relay_size.test b/mysql-test/t/rpl_row_max_relay_size.test
new file mode 100644
index 00000000000..a4b762059b3
--- /dev/null
+++ b/mysql-test/t/rpl_row_max_relay_size.test
@@ -0,0 +1,9 @@
+# Test of options max_binlog_size and max_relay_log_size and
+# how they act (if max_relay_log_size == 0, use max_binlog_size
+# for relay logs too).
+# Test of manual relay log rotation with FLUSH LOGS.
+
+# Requires statement logging
+-- source include/have_binlog_format_row.inc
+-- source extra/rpl_tests/rpl_max_relay_size.test
+
diff --git a/mysql-test/t/rpl_row_multi_update3.test b/mysql-test/t/rpl_row_multi_update3.test
new file mode 100644
index 00000000000..fc606b2f134
--- /dev/null
+++ b/mysql-test/t/rpl_row_multi_update3.test
@@ -0,0 +1,2 @@
+let $engine_type=MyISAM;
+-- source extra/rpl_tests/rpl_row_multi_update3.test
diff --git a/mysql-test/t/rpl_row_mystery22.test b/mysql-test/t/rpl_row_mystery22.test
new file mode 100644
index 00000000000..9933fec22fc
--- /dev/null
+++ b/mysql-test/t/rpl_row_mystery22.test
@@ -0,0 +1,45 @@
+# Originally taken from rpl_mystery22.test,
+# but this row-based-replication test has a totally different spirit:
+# slave will not stop because of dup key,
+# instead we test if it does overwrite the dup key
+# as expected.
+-- source include/have_binlog_format_row.inc
+-- source include/master-slave.inc
+
+# first, cause a duplicate key problem on the slave
+create table t1(n int auto_increment primary key, s char(10));
+sync_slave_with_master;
+insert into t1 values (2,'old');
+connection master;
+insert into t1 values(NULL,'new');
+insert into t1 values(NULL,'new');
+save_master_pos;
+connection slave;
+sync_with_master;
+select * from t1 order by n;
+delete from t1 where n = 2;
+--disable_warnings
+start slave;
+--enable_warnings
+sync_with_master;
+stop slave;
+connection master;
+create table t2(n int);
+drop table t2;
+insert into t1 values(NULL,'new');
+# what happens when we delete a row which does not exist on slave?
+set sql_log_bin=0;
+insert into t1 values(NULL,'new');
+set sql_log_bin=1;
+delete from t1 where n=4;
+save_master_pos;
+connection slave;
+--disable_warnings
+start slave;
+--enable_warnings
+sync_with_master;
+select * from t1 order by n;
+#clean up
+connection master;
+drop table t1;
+sync_slave_with_master;
diff --git a/mysql-test/t/rpl_row_reset_slave.test b/mysql-test/t/rpl_row_reset_slave.test
new file mode 100644
index 00000000000..a970c161153
--- /dev/null
+++ b/mysql-test/t/rpl_row_reset_slave.test
@@ -0,0 +1,5 @@
+# TBF - difference in row level logging
+# Temp tables are not replicated in rbr, but it is still good to hit rbr with everthing
+-- source include/have_binlog_format_row.inc
+-- source extra/rpl_tests/rpl_reset_slave.test
+
diff --git a/mysql-test/t/rpl_rewrite_db-slave.opt b/mysql-test/t/rpl_row_rewrt_db-slave.opt
index a462ad19ba0..a462ad19ba0 100644
--- a/mysql-test/t/rpl_rewrite_db-slave.opt
+++ b/mysql-test/t/rpl_row_rewrt_db-slave.opt
diff --git a/mysql-test/t/rpl_rewrite_db.test b/mysql-test/t/rpl_row_rewrt_db.test
index 1e8e5a992d8..8781b361d87 100644
--- a/mysql-test/t/rpl_rewrite_db.test
+++ b/mysql-test/t/rpl_row_rewrt_db.test
@@ -1,4 +1,7 @@
-source include/master-slave.inc;
+# TBF - difference in row level logging
+-- source include/have_binlog_format_row.inc
+-- source include/master-slave.inc
+
--disable_warnings
drop database if exists mysqltest1;
--enable_warnings
@@ -78,4 +81,3 @@ drop database rewrite;
connection master;
drop table t1;
-# End of 4.1 tests
diff --git a/mysql-test/t/rpl_sp-master.opt b/mysql-test/t/rpl_row_sp000-master.opt
index 709a224fd92..709a224fd92 100644
--- a/mysql-test/t/rpl_sp-master.opt
+++ b/mysql-test/t/rpl_row_sp000-master.opt
diff --git a/mysql-test/t/rpl_row_sp000-slave.opt b/mysql-test/t/rpl_row_sp000-slave.opt
new file mode 100644
index 00000000000..709a224fd92
--- /dev/null
+++ b/mysql-test/t/rpl_row_sp000-slave.opt
@@ -0,0 +1 @@
+--log_bin_trust_routine_creators=0
diff --git a/mysql-test/t/rpl_row_sp000.test b/mysql-test/t/rpl_row_sp000.test
new file mode 100644
index 00000000000..e591cb054fc
--- /dev/null
+++ b/mysql-test/t/rpl_row_sp000.test
@@ -0,0 +1,323 @@
+# row-based and statement have expected binlog difference in result files
+-- source include/have_binlog_format_row.inc
+
+# Test of replication of stored procedures in row-based replication.
+# Initially copied from the statement-based version rpl_stm_sp.test.
+
+# Note that in the .opt files we still use the old variable name
+# log-bin-trust-routine-creators so that this test checks that it's
+# still accepted (this test also checks that the new name is
+# accepted). The old name could be removed in 5.1 or 6.0.
+
+source include/master-slave.inc;
+
+# we need a db != test, where we don't have automatic grants
+--disable_warnings
+drop database if exists mysqltest1;
+--enable_warnings
+create database mysqltest1;
+use mysqltest1;
+create table t1 (a varchar(100));
+sync_slave_with_master;
+use mysqltest1;
+
+# ********************** PART 1 : STORED PROCEDURES ***************
+
+# Does the same proc as on master get inserted into mysql.proc ?
+# (all same properties)
+
+connection master;
+
+delimiter |;
+create procedure foo()
+begin
+ declare b int;
+ set b = 8;
+ insert into t1 values (b);
+ insert into t1 values (unix_timestamp());
+end|
+delimiter ;|
+
+# we replace columns having times
+# (even with fixed timestamp displayed time may changed based on TZ)
+--replace_result localhost.localdomain localhost 127.0.0.1 localhost
+--replace_column 13 # 14 #
+select * from mysql.proc where name='foo' and db='mysqltest1';
+sync_slave_with_master;
+--replace_result localhost.localdomain localhost 127.0.0.1 localhost
+--replace_column 13 # 14 #
+select * from mysql.proc where name='foo' and db='mysqltest1';
+
+connection master;
+# see if timestamp used in SP on slave is same as on master
+set timestamp=1000000000;
+call foo();
+select * from t1;
+sync_slave_with_master;
+select * from t1;
+
+# Now a SP which is not updating tables
+
+connection master;
+delete from t1;
+create procedure foo2()
+ not deterministic
+ select * from mysqltest1.t1;
+call foo2();
+
+alter procedure foo2 contains sql;
+
+# SP with definer's right
+
+drop table t1;
+create table t1 (a int);
+create table t2 (a int);
+
+create procedure foo3()
+ deterministic
+ insert into t1 values (15);
+
+# let's create a non-privileged user
+grant CREATE ROUTINE, EXECUTE on mysqltest1.* to "zedjzlcsjhd"@127.0.0.1;
+grant SELECT on mysqltest1.t1 to "zedjzlcsjhd"@127.0.0.1;
+grant SELECT, INSERT on mysqltest1.t2 to "zedjzlcsjhd"@127.0.0.1;
+
+connect (con1,127.0.0.1,zedjzlcsjhd,,mysqltest1,$MASTER_MYPORT,);
+connection con1;
+
+# this routine will fail in the second INSERT because of privileges
+delimiter |;
+create procedure foo4()
+ deterministic
+ begin
+ insert into t2 values(3);
+ insert into t1 values (5);
+ end|
+
+delimiter ;|
+
+# I add ,0 so that it does not print the error in the test output,
+# because this error is hostname-dependent
+--error 1142,0
+call foo4(); # invoker has no INSERT grant on table t1 => failure
+
+connection master;
+call foo3(); # success (definer == root)
+show warnings;
+
+--error 1142,0
+call foo4(); # definer's rights => failure
+
+# we test replication of ALTER PROCEDURE
+alter procedure foo4 sql security invoker;
+call foo4(); # invoker's rights => success
+show warnings;
+
+# Note that half-failed procedure calls are ok with binlogging;
+# if we compare t2 on master and slave we see they are identical:
+
+select * from t1;
+select * from t2;
+sync_slave_with_master;
+select * from t1;
+select * from t2;
+
+# Let's check another failing-in-the-middle procedure
+connection master;
+delete from t2;
+alter table t2 add unique (a);
+
+drop procedure foo4;
+delimiter |;
+create procedure foo4()
+ deterministic
+ begin
+ insert into t2 values(20),(20);
+ end|
+
+delimiter ;|
+
+--error 1062
+call foo4();
+show warnings;
+
+select * from t2;
+sync_slave_with_master;
+# check that this failed-in-the-middle replicated right:
+select * from t2;
+
+# Test of DROP PROCEDURE
+
+--replace_result localhost.localdomain localhost 127.0.0.1 localhost
+--replace_column 13 # 14 #
+select * from mysql.proc where name="foo4" and db='mysqltest1';
+connection master;
+drop procedure foo4;
+select * from mysql.proc where name="foo4" and db='mysqltest1';
+sync_slave_with_master;
+select * from mysql.proc where name="foo4" and db='mysqltest1';
+
+# Test of a procedure and function containing UUID() is done in
+# rpl_row_UUID.
+
+
+# ********************** PART 2 : FUNCTIONS ***************
+
+connection master;
+drop procedure foo;
+drop procedure foo2;
+drop procedure foo3;
+
+delimiter |;
+create function fn1(x int)
+ returns int
+ deterministic
+begin
+ insert into t1 values (x);
+ return x+2;
+end|
+
+delimiter ;|
+delete t1,t2 from t1,t2;
+select fn1(20);
+insert into t2 values(fn1(21));
+select * from t1;
+select * from t2;
+sync_slave_with_master;
+select * from t1;
+select * from t2;
+
+connection master;
+delimiter |;
+
+drop function fn1;
+
+create function fn1()
+ returns int
+begin
+ return unix_timestamp();
+end|
+
+delimiter ;|
+# Just to test ALTER FUNCTION
+alter function fn1 no sql;
+delete from t1;
+set timestamp=1000000000;
+insert into t1 values(fn1());
+
+connection con1;
+
+delimiter |;
+create function fn2()
+ returns int
+ no sql
+begin
+ return unix_timestamp();
+end|
+delimiter ;|
+
+connection master;
+
+delimiter |;
+create function fn3()
+ returns int
+ not deterministic
+ reads sql data
+begin
+ return 0;
+end|
+delimiter ;|
+
+select fn3();
+
+--replace_result localhost.localdomain localhost 127.0.0.1 localhost
+--replace_column 13 # 14 #
+select * from mysql.proc where db='mysqltest1';
+select * from t1;
+
+sync_slave_with_master;
+use mysqltest1;
+select * from t1;
+--replace_result localhost.localdomain localhost 127.0.0.1 localhost
+--replace_column 13 # 14 #
+select * from mysql.proc where db='mysqltest1';
+
+# Let's check a failing-in-the-middle function
+connection master;
+delete from t2;
+alter table t2 add unique (a);
+
+drop function fn1;
+
+delimiter |;
+create function fn1()
+ returns int
+begin
+ insert into t2 values(20),(20);
+ return 10;
+end|
+
+delimiter ;|
+
+--error 1062
+select fn1();
+
+select * from t2;
+sync_slave_with_master;
+
+# check that this failed-in-the-middle replicated right:
+select * from t2;
+
+# ********************** PART 3 : TRIGGERS ***************
+
+connection con1;
+--error 1227
+create trigger trg before insert on t1 for each row set new.a= 10;
+
+connection master;
+delete from t1;
+# TODO: when triggers can contain an update, test that this update
+# does not go into binlog.
+# I'm not setting user vars in the trigger, because replication of user vars
+# would take care of propagating the user var's value to slave, so even if
+# the trigger was not executed on slave it would not be discovered.
+create trigger trg before insert on t1 for each row set new.a= 10;
+insert into t1 values (1);
+select * from t1;
+sync_slave_with_master;
+select * from t1;
+
+connection master;
+delete from t1;
+drop trigger trg;
+insert into t1 values (1);
+select * from t1;
+--replace_column 2 # 5 #
+show binlog events in 'master-bin.000001' from 102;
+sync_slave_with_master;
+select * from t1;
+
+
+#
+# Test for bug #13969 "Routines which are replicated from master can't be
+# executed on slave".
+#
+connection master;
+create procedure foo()
+ not deterministic
+ reads sql data
+ select * from t1;
+sync_slave_with_master;
+# This should not fail
+call foo();
+connection master;
+drop procedure foo;
+sync_slave_with_master;
+
+
+# Clean up
+connection master;
+drop function fn1;
+drop database mysqltest1;
+drop user "zedjzlcsjhd"@127.0.0.1;
+sync_slave_with_master;
diff --git a/mysql-test/t/rpl_row_sp001.test b/mysql-test/t/rpl_row_sp001.test
new file mode 100644
index 00000000000..f6ac18dc78b
--- /dev/null
+++ b/mysql-test/t/rpl_row_sp001.test
@@ -0,0 +1,144 @@
+#############################################################################
+# This test is being created to test out the non deterministic items with #
+# row based replication. #
+# Original Author: JBM #
+# Original Date: Aug/09/2005 #
+# Updated: Aug/29/2005
+#############################################################################
+# Test: Includes two stored procedure tests. First test uses SP to insert #
+# values from RAND() and NOW() into a table. #
+# The second test uses SP with CASE structure to decide what to text #
+# to update a given table with. #
+############################################################################
+
+# Includes
+-- source include/have_binlog_format_row.inc
+-- source include/master-slave.inc
+
+-- disable_query_log
+-- disable_result_log
+
+# Begin clean up test section
+connection master;
+--disable_warnings
+DROP PROCEDURE IF EXISTS test.p1;
+DROP PROCEDURE IF EXISTS test.p2;
+DROP TABLE IF EXISTS test.t1;
+DROP TABLE IF EXISTS test.t2;
+
+-- enable_query_log
+-- enable_result_log
+
+# Begin test section 1 for non deterministic SP
+let $message=<Begin test section 1 (non deterministic SP)>;
+--source include/show_msg.inc
+
+create table test.t1 (n MEDIUMINT NOT NULL AUTO_INCREMENT, f FLOAT, d DATETIME, PRIMARY KEY(n));
+
+delimiter //;
+create procedure test.p1()
+begin
+ INSERT INTO test.t1 (f,d) VALUES (RAND(),NOW());
+end//
+delimiter ;//
+
+# show binlog events;
+
+-- disable_query_log
+-- disable_result_log
+let $1=10;
+while ($1)
+{
+ call test.p1();
+ sleep 1;
+ dec $1;
+}
+-- enable_result_log
+-- enable_query_log
+
+## Used for debugging
+#show binlog events;
+#select * from test.t1;
+#sync_slave_with_master;
+#select * from test.t1;
+#connection master;
+
+let $message=<End test section 1 (non deterministic SP)>;
+--source include/show_msg.inc
+
+
+CREATE TABLE test.t2 (a INT NOT NULL AUTO_INCREMENT, t CHAR(4), PRIMARY KEY(a));
+
+delimiter //;
+CREATE PROCEDURE test.p2(n int)
+begin
+CASE n
+WHEN 1 THEN
+ UPDATE test.t2 set t ='Tex';
+WHEN 2 THEN
+ UPDATE test.t2 set t ='SQL';
+ELSE
+ UPDATE test.t2 set t ='NONE';
+END CASE;
+end//
+delimiter ;//
+
+INSERT INTO test.t2 VALUES(NULL,'NEW'),(NULL,'NEW'),(NULL,'NEW'),(NULL,'NEW');
+
+select * from test.t2;
+save_master_pos;
+connection slave;
+sync_with_master;
+select * from test.t2;
+
+connection master;
+call test.p2(1);
+select * from test.t2;
+sync_slave_with_master;
+select * from test.t2;
+
+
+connection master;
+call test.p2(2);
+select * from test.t2;
+save_master_pos;
+connection slave;
+sync_with_master;
+select * from test.t2;
+
+connection master;
+call test.p2(3);
+select * from test.t2;
+save_master_pos;
+connection slave;
+sync_with_master;
+select * from test.t2;
+
+##Used for debugging
+#show binlog events;
+
+# time to dump the databases and so we can see if they match
+
+--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > ./var/tmp/sp001_master.sql
+--exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > ./var/tmp/sp001_slave.sql
+
+# First lets cleanup
+
+DROP PROCEDURE test.p1;
+DROP PROCEDURE test.p2;
+DROP TABLE test.t1;
+DROP TABLE test.t2;
+
+# Lets compare. Note: If they match test will pass, if they do not match
+# the test will show that the diff statement failed and not reject file
+# will be created. You will need to go to the mysql-test dir and diff
+# the files your self to see what is not matching :-) Failed dump files
+# will be located in mysql-test/var/tmp
+
+--exec diff ./var/tmp/sp001_master.sql ./var/tmp/sp001_slave.sql;
+
+# If all is good, when can cleanup our dump files.
+system rm ./var/tmp/sp001_master.sql;
+system rm ./var/tmp/sp001_slave.sql;
+
+# End of 5.0 test case
diff --git a/mysql-test/t/rpl_row_sp002_innodb-master.opt b/mysql-test/t/rpl_row_sp002_innodb-master.opt
new file mode 100644
index 00000000000..627becdbfb5
--- /dev/null
+++ b/mysql-test/t/rpl_row_sp002_innodb-master.opt
@@ -0,0 +1 @@
+--innodb
diff --git a/mysql-test/t/rpl_row_sp002_innodb-slave.opt b/mysql-test/t/rpl_row_sp002_innodb-slave.opt
new file mode 100644
index 00000000000..627becdbfb5
--- /dev/null
+++ b/mysql-test/t/rpl_row_sp002_innodb-slave.opt
@@ -0,0 +1 @@
+--innodb
diff --git a/mysql-test/t/rpl_row_sp002_innodb.test b/mysql-test/t/rpl_row_sp002_innodb.test
new file mode 100644
index 00000000000..a00d9ae2327
--- /dev/null
+++ b/mysql-test/t/rpl_row_sp002_innodb.test
@@ -0,0 +1,6 @@
+#################################
+# Wrapper for rpl_row_sp002.test#
+#################################
+-- source include/have_innodb.inc
+let $engine_type=INNODB;
+-- source extra/rpl_tests/rpl_row_sp002.test
diff --git a/mysql-test/t/rpl_row_sp003-master.opt b/mysql-test/t/rpl_row_sp003-master.opt
new file mode 100644
index 00000000000..627becdbfb5
--- /dev/null
+++ b/mysql-test/t/rpl_row_sp003-master.opt
@@ -0,0 +1 @@
+--innodb
diff --git a/mysql-test/t/rpl_row_sp003-slave.opt b/mysql-test/t/rpl_row_sp003-slave.opt
new file mode 100644
index 00000000000..627becdbfb5
--- /dev/null
+++ b/mysql-test/t/rpl_row_sp003-slave.opt
@@ -0,0 +1 @@
+--innodb
diff --git a/mysql-test/t/rpl_row_sp003.test b/mysql-test/t/rpl_row_sp003.test
new file mode 100644
index 00000000000..34774a227bb
--- /dev/null
+++ b/mysql-test/t/rpl_row_sp003.test
@@ -0,0 +1,6 @@
+#################################
+# Wrapper for rpl_row_sp003.test#
+#################################
+-- source include/have_innodb.inc
+let $engine_type=INNODB;
+-- source extra/rpl_tests/rpl_row_sp003.test
diff --git a/mysql-test/t/rpl_row_sp005.test b/mysql-test/t/rpl_row_sp005.test
new file mode 100644
index 00000000000..c2cdd820eeb
--- /dev/null
+++ b/mysql-test/t/rpl_row_sp005.test
@@ -0,0 +1,105 @@
+#############################################################################
+# Original Author: JBM #
+# Original Date: Aug/15/2005 #
+# Updated: Aug/29/2005: Removed sleeps #
+#############################################################################
+# Test: Tests SPs with cursors, flow logic, and alter sp. In addition the #
+# tests SPs with insert and update operations. #
+#############################################################################
+
+
+# Includes
+-- source include/have_binlog_format_row.inc
+-- source include/master-slave.inc
+
+
+# Begin clean up test section
+connection master;
+--disable_warnings
+DROP PROCEDURE IF EXISTS test.p1;
+DROP PROCEDURE IF EXISTS test.p2;
+DROP TABLE IF EXISTS test.t2;
+DROP TABLE IF EXISTS test.t1;
+DROP TABLE IF EXISTS test.t3;
+--enable_warnings
+# End of cleanup
+
+# Begin test section 1
+CREATE TABLE IF NOT EXISTS test.t1(id INT, data CHAR(16),PRIMARY KEY(id));
+CREATE TABLE IF NOT EXISTS test.t2(id2 INT,PRIMARY KEY(id2));
+CREATE TABLE IF NOT EXISTS test.t3(id3 INT,PRIMARY KEY(id3), c CHAR(16));
+
+delimiter |;
+CREATE PROCEDURE test.p1()
+BEGIN
+DECLARE done INT DEFAULT 0;
+ DECLARE spa CHAR(16);
+ DECLARE spb,spc INT;
+ DECLARE cur1 CURSOR FOR SELECT id,data FROM test.t1;
+ DECLARE cur2 CURSOR FOR SELECT id2 FROM test.t2;
+ DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done = 1;
+
+ OPEN cur1;
+ OPEN cur2;
+
+ REPEAT
+ FETCH cur1 INTO spb, spa;
+ FETCH cur2 INTO spc;
+ IF NOT done THEN
+ IF spb < spc THEN
+ INSERT INTO test.t3 VALUES (spb,spa);
+ ELSE
+ INSERT INTO test.t3 VALUES (spc,spa);
+ END IF;
+ END IF;
+ UNTIL done END REPEAT;
+
+ CLOSE cur1;
+ CLOSE cur2;
+END|
+CREATE PROCEDURE test.p2()
+BEGIN
+ INSERT INTO test.t1 VALUES (4,'MySQL'),(20,'ROCKS'),(11,'Texas'),(10,'kyle');
+ INSERT INTO test.t2 VALUES (4),(2),(1),(3);
+ UPDATE test.t1 SET id=id+4 WHERE id=4;
+END|
+delimiter ;|
+
+let $message=< ---- Master selects-- >;
+--source include/show_msg.inc
+CALL test.p2();
+SELECT * FROM test.t1;
+SELECT * FROM test.t2;
+
+let $message=< ---- Slave selects-- >;
+--source include/show_msg.inc
+save_master_pos;
+connection slave;
+sync_with_master;
+SELECT * FROM test.t1;
+SELECT * FROM test.t2;
+
+let $message=< ---- Master selects-- >;
+--source include/show_msg.inc
+connection master;
+CALL test.p1();
+sleep 6;
+SELECT * FROM test.t3;
+
+let $message=< ---- Slave selects-- >;
+--source include/show_msg.inc
+connection slave;
+SELECT * FROM test.t3;
+
+connection master;
+
+ALTER PROCEDURE test.p1 MODIFIES SQL DATA;
+#show binlog events;
+
+DROP PROCEDURE IF EXISTS test.p1;
+DROP PROCEDURE IF EXISTS test.p2;
+DROP TABLE IF EXISTS test.t1;
+DROP TABLE IF EXISTS test.t2;
+DROP TABLE IF EXISTS test.t3;
+
+# End of 5.0 test case
diff --git a/mysql-test/t/rpl_row_sp006_InnoDB-slave.opt b/mysql-test/t/rpl_row_sp006_InnoDB-slave.opt
new file mode 100644
index 00000000000..627becdbfb5
--- /dev/null
+++ b/mysql-test/t/rpl_row_sp006_InnoDB-slave.opt
@@ -0,0 +1 @@
+--innodb
diff --git a/mysql-test/t/rpl_row_sp006_InnoDB.test b/mysql-test/t/rpl_row_sp006_InnoDB.test
new file mode 100644
index 00000000000..4afa3c41aeb
--- /dev/null
+++ b/mysql-test/t/rpl_row_sp006_InnoDB.test
@@ -0,0 +1,6 @@
+#################################
+# Wrapper for rpl_row_sp006.test#
+#################################
+-- source include/have_innodb.inc
+let $engine_type=InnoDB;
+-- source extra/rpl_tests/rpl_row_sp006.test
diff --git a/mysql-test/t/rpl_row_sp007_innodb.test b/mysql-test/t/rpl_row_sp007_innodb.test
new file mode 100644
index 00000000000..9b257e14320
--- /dev/null
+++ b/mysql-test/t/rpl_row_sp007_innodb.test
@@ -0,0 +1,6 @@
+#################################
+# Wrapper for rpl_row_sp007.test#
+#################################
+-- source include/have_innodb.inc
+let $engine_type=INNODB;
+-- source extra/rpl_tests/rpl_row_sp007.test
diff --git a/mysql-test/t/rpl_row_sp008.test b/mysql-test/t/rpl_row_sp008.test
new file mode 100644
index 00000000000..c30339b8c7c
--- /dev/null
+++ b/mysql-test/t/rpl_row_sp008.test
@@ -0,0 +1,58 @@
+#############################################################################
+# Original Author: JBM #
+# Original Date: Aug/15/2005 #
+# Update: 08/29/2005 Remove sleep #
+#############################################################################
+# TEST: Use SQL_CALC_FOUND_ROWS and insert results into a table inside a sp #
+#############################################################################
+
+
+# Includes
+-- source include/have_binlog_format_row.inc
+-- source include/master-slave.inc
+
+# Begin clean up test section
+connection master;
+--disable_warnings
+DROP PROCEDURE IF EXISTS test.p1;
+DROP TABLE IF EXISTS test.t2;
+--enable_warnings
+# End of cleanup
+
+
+
+# Begin test section 1
+CREATE TABLE test.t1 (a INT,PRIMARY KEY(a));
+CREATE TABLE test.t2 (a INT,PRIMARY KEY(a));
+INSERT INTO test.t1 VALUES(1),(2);
+
+delimiter |;
+CREATE PROCEDURE test.p1()
+BEGIN
+ SELECT SQL_CALC_FOUND_ROWS * FROM test.t1 LIMIT 1;
+ INSERT INTO test.t2 VALUES(FOUND_ROWS());
+END|
+delimiter ;|
+
+let $message=< ---- Master selects-- >;
+--source include/show_msg.inc
+CALL test.p1();
+SELECT * FROM test.t2;
+
+let $message=< ---- Slave selects-- >;
+--source include/show_msg.inc
+save_master_pos;
+connection slave;
+sync_with_master;
+SELECT * FROM test.t2;
+
+connection master;
+let $VERSION=`select version()`;
+--replace_result $VERSION VERSION
+show binlog events;
+
+
+DROP PROCEDURE IF EXISTS test.p1;
+DROP TABLE IF EXISTS test.t1;
+
+# End of 5.0 test case
diff --git a/mysql-test/t/rpl_row_sp009.test b/mysql-test/t/rpl_row_sp009.test
new file mode 100644
index 00000000000..b06267df783
--- /dev/null
+++ b/mysql-test/t/rpl_row_sp009.test
@@ -0,0 +1,105 @@
+#############################################################################
+# Original Author: JBM #
+# Original Date: Aug/18/2005 #
+# Updated: 08/29/2005 removed sleeps and added master pos save and snyc #
+#############################################################################
+#TEST: Taken and modfied from http://bugs.mysql.com/bug.php?id=12168 #
+#############################################################################
+
+# Includes
+-- source include/have_binlog_format_row.inc
+-- source include/master-slave.inc
+
+
+# Begin clean up test section
+connection master;
+--disable_warnings
+DROP PROCEDURE IF EXISTS test.p1;
+DROP TABLE IF EXISTS test.t1;
+DROP TABLE IF EXISTS test.t2;
+
+
+# Begin test section 1
+CREATE TABLE test.t1 (a INT, PRIMARY KEY(a));
+INSERT INTO test.t1 VALUES (1),(2),(3),(4);
+CREATE TABLE test.t2 (a INT, PRIMARY KEY(a));
+
+delimiter |;
+CREATE PROCEDURE test.p1 (arg1 CHAR(1))
+BEGIN
+ DECLARE b, c INT;
+ IF arg1 = 'a' THEN
+ BEGIN
+ DECLARE cur1 CURSOR FOR SELECT A FROM test.t1 WHERE a % 2;
+ DECLARE continue handler for not found set b = 1;
+ SET b = 0;
+ OPEN cur1;
+ c1_repeat: REPEAT
+ FETCH cur1 INTO c;
+ IF (b = 1) THEN
+ LEAVE c1_repeat;
+ END IF;
+
+ INSERT INTO test.t2 VALUES (c);
+ UNTIL b = 1
+ END REPEAT;
+ CLOSE cur1;
+ END;
+ END IF;
+ IF arg1 = 'b' THEN
+ BEGIN
+ DECLARE cur2 CURSOR FOR SELECT a FROM test.t1 WHERE NOT a % 2;
+ DECLARE continue handler for not found set b = 1;
+ SET b = 0;
+ OPEN cur2;
+ c2_repeat: REPEAT
+ FETCH cur2 INTO c;
+ IF (b = 1) THEN
+ LEAVE c2_repeat;
+ END IF;
+
+ INSERT INTO test.t2 VALUES (c);
+ UNTIL b = 1
+ END REPEAT;
+ CLOSE cur2;
+ END;
+ END IF;
+END|
+delimiter ;|
+
+CALL test.p1('a');
+SELECT * FROM test.t2;
+save_master_pos;
+connection slave;
+sync_with_master;
+SELECT * FROM test.t2;
+connection master;
+truncate test.t2;
+
+# this next call fails, but should not
+call test.p1('b');
+select * from test.t2;
+save_master_pos;
+connection slave;
+sync_with_master;
+SELECT * FROM test.t2;
+
+connection master;
+truncate test.t2;
+SELECT * FROM test.t2;
+save_master_pos;
+connection slave;
+sync_with_master;
+SELECT * FROM test.t2;
+
+
+connection master;
+#show binlog events;
+# lets cleanup
+
+DROP PROCEDURE test.p1;
+DROP TABLE test.t1;
+DROP TABLE test.t2;
+
+
+# End of 5.0 test case
diff --git a/mysql-test/t/rpl_row_sp010.test b/mysql-test/t/rpl_row_sp010.test
new file mode 100644
index 00000000000..8d11ca10087
--- /dev/null
+++ b/mysql-test/t/rpl_row_sp010.test
@@ -0,0 +1,81 @@
+#############################################################################
+# Original Author: JBM #
+# Original Date: Aug/18/2005 #
+# Update: 08/29/2005 remove sleep added master pos save and sync #
+#############################################################################
+#TEST: Taken and modfied from http://bugs.mysql.com/bug.php?id=11126 #
+#############################################################################
+
+# Includes
+-- source include/have_binlog_format_row.inc
+-- source include/master-slave.inc
+
+
+# Begin clean up test section
+connection master;
+--disable_warnings
+DROP PROCEDURE IF EXISTS test.p1;
+DROP PROCEDURE IF EXISTS test.p2;
+DROP PROCEDURE IF EXISTS test.p3;
+DROP PROCEDURE IF EXISTS test.p4;
+DROP TABLE IF EXISTS test.t1;
+DROP TABLE IF EXISTS test.t2;
+
+
+# Begin test section 1
+delimiter |;
+CREATE PROCEDURE test.p1()
+BEGIN
+ INSERT INTO test.t1 VALUES(2);
+END|
+CREATE PROCEDURE test.p2()
+BEGIN
+ DROP TEMPORARY TABLE IF EXISTS test.t1;
+ CREATE TEMPORARY TABLE test.t1 (a int, PRIMARY KEY(a));
+ INSERT INTO test.t1 VALUES(1);
+ CALL test.p1();
+END|
+delimiter ;|
+CALL test.p2();
+SELECT * FROM test.t1;
+
+save_master_pos;
+connection slave;
+sync_with_master;
+show tables;
+
+connection master;
+delimiter |;
+CREATE PROCEDURE test.p3()
+BEGIN
+ INSERT INTO test.t2 VALUES(7);
+END|
+CREATE PROCEDURE test.p4()
+BEGIN
+ DROP TABLE IF EXISTS test.t2;
+ CREATE TABLE test.t2 (a int, PRIMARY KEY(a));
+ INSERT INTO test.t2 VALUES(6);
+ CALL test.p3();
+END|
+delimiter ;|
+CALL test.p4();
+SELECT * FROM test.t2;
+
+save_master_pos;
+connection slave;
+sync_with_master;
+SELECT * FROM test.t2;
+
+connection master;
+#show binlog events;
+# lets cleanup
+
+DROP PROCEDURE IF EXISTS test.p1;
+DROP PROCEDURE IF EXISTS test.p2;
+DROP PROCEDURE IF EXISTS test.p3;
+DROP PROCEDURE IF EXISTS test.p4;
+DROP TABLE IF EXISTS test.t1;
+DROP TABLE IF EXISTS test.t2;
+
+
+# End of 5.0 test case
diff --git a/mysql-test/t/rpl_row_sp011.test b/mysql-test/t/rpl_row_sp011.test
new file mode 100644
index 00000000000..8d843510b6b
--- /dev/null
+++ b/mysql-test/t/rpl_row_sp011.test
@@ -0,0 +1,115 @@
+#############################################################################
+# Original Author: JBM #
+# Original Date: Aug/18/2005 #
+# Updated: 08/29/2005 turned on diff and commented out debug SQL statements#
+#############################################################################
+#TEST: SP to test alter table and nested SP calls #
+#############################################################################
+
+# Includes
+-- source include/have_binlog_format_row.inc
+-- source include/master-slave.inc
+
+
+# Begin clean up test section
+connection master;
+--disable_warnings
+DROP PROCEDURE IF EXISTS test.p1;
+DROP PROCEDURE IF EXISTS test.p2;
+DROP PROCEDURE IF EXISTS test.p3;
+DROP PROCEDURE IF EXISTS test.p4;
+DROP PROCEDURE IF EXISTS test.p5;
+DROP PROCEDURE IF EXISTS test.p6;
+DROP PROCEDURE IF EXISTS test.p7;
+DROP TABLE IF EXISTS test.t1;
+DROP TABLE IF EXISTS test.t2;
+
+
+# Begin test section 1
+CREATE TABLE test.t1 (a int, PRIMARY KEY(a));
+INSERT INTO test.t1 VALUES (1);
+
+delimiter |;
+CREATE PROCEDURE test.p1()
+BEGIN
+ ALTER TABLE test.t1 ADD COLUMN b CHAR(4) AFTER a;
+ UPDATE test.t1 SET b = 'rbr' WHERE a = 1;
+ CALL test.p2();
+END|
+CREATE PROCEDURE test.p2()
+BEGIN
+ ALTER TABLE test.t1 ADD COLUMN f FLOAT AFTER b;
+ UPDATE test.t1 SET f = RAND() WHERE a = 1;
+ CALL test.p3();
+END|
+CREATE PROCEDURE test.p3()
+BEGIN
+ ALTER TABLE test.t1 RENAME test.t2;
+ CALL test.p4();
+END|
+CREATE PROCEDURE test.p4()
+BEGIN
+ ALTER TABLE test.t2 ADD INDEX (f);
+ ALTER TABLE test.t2 CHANGE a a INT UNSIGNED NOT NULL AUTO_INCREMENT;
+ INSERT INTO test.t2 VALUES (NULL,'TEST',RAND());
+ CALL test.p5();
+END|
+CREATE PROCEDURE test.p5()
+BEGIN
+ ALTER TABLE test.t2 ORDER BY f;
+ INSERT INTO test.t2 VALUES (NULL,'STM',RAND());
+ CALL test.p6();
+END|
+CREATE PROCEDURE test.p6()
+BEGIN
+ ALTER TABLE test.t2 ADD COLUMN b2 CHAR(4) FIRST;
+ ALTER TABLE test.t2 ADD COLUMN to_drop BIT(8) AFTER b2;
+ INSERT INTO test.t2 VALUES ('new',1,NULL,'STM',RAND());
+ CALL test.p7();
+END|
+CREATE PROCEDURE test.p7()
+BEGIN
+ ALTER TABLE test.t2 DROP COLUMN to_drop;
+ INSERT INTO test.t2 VALUES ('gone',NULL,'STM',RAND());
+END|
+delimiter ;|
+CALL test.p1();
+
+#SELECT * FROM test.t2;
+sync_slave_with_master;
+#SELECT * FROM test.t2;
+connection master;
+
+#show binlog events;
+# lets cleanup
+
+--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > ./var/tmp/sp011_master.sql
+--exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > ./var/tmp/sp011_slave.sql
+
+
+DROP PROCEDURE IF EXISTS test.p1;
+DROP PROCEDURE IF EXISTS test.p2;
+DROP PROCEDURE IF EXISTS test.p3;
+DROP PROCEDURE IF EXISTS test.p4;
+DROP PROCEDURE IF EXISTS test.p5;
+DROP PROCEDURE IF EXISTS test.p6;
+DROP PROCEDURE IF EXISTS test.p7;
+DROP TABLE IF EXISTS test.t1;
+DROP TABLE IF EXISTS test.t2;
+
+
+# First lets cleanup
+
+# Lets compare. Note: If they match test will pass, if they do not match
+# the test will show that the diff statement failed and not reject file
+# will be created. You will need to go to the mysql-test dir and diff
+# the files your self to see what is not matching :-) Failed test
+# Will leave dump files in mysql-test/var/tmp
+
+exec diff ./var/tmp/sp011_master.sql ./var/tmp/sp011_slave.sql;
+
+# If all is good, when can cleanup our dump files.
+system rm ./var/tmp/sp011_master.sql;
+system rm ./var/tmp/sp011_slave.sql;
+
+# End of 5.0 test case
diff --git a/mysql-test/t/rpl_row_sp012.test b/mysql-test/t/rpl_row_sp012.test
new file mode 100644
index 00000000000..2b9c07895f0
--- /dev/null
+++ b/mysql-test/t/rpl_row_sp012.test
@@ -0,0 +1,74 @@
+#############################################################################
+# Original Author: JBM #
+# Original Date: Aug/22/2005 #
+# Update: 08/29/2005 Added save pos and sync #
+#############################################################################
+#TEST: SP to test security and current_user and user #
+#############################################################################
+
+
+# Includes
+-- source include/have_binlog_format_row.inc
+-- source include/not_embedded.inc
+-- source include/master-slave.inc
+
+
+# Begin clean up test section
+connection master;
+--disable_warnings
+DROP PROCEDURE IF EXISTS test.p1;
+DROP PROCEDURE IF EXISTS test.p2;
+DROP PROCEDURE IF EXISTS test.p3;
+
+
+# Begin test section 1
+# Create user user1 with no particular access rights
+grant usage on *.* to user1@localhost;
+flush privileges;
+
+SELECT CURRENT_USER();
+SELECT USER();
+CREATE PROCEDURE test.p1 () SQL SECURITY INVOKER SELECT CURRENT_USER(), USER();
+CREATE PROCEDURE test.p2 () SQL SECURITY DEFINER CALL test.p1();
+CREATE PROCEDURE test.p3 () SQL SECURITY INVOKER CALL test.p1();
+GRANT EXECUTE ON PROCEDURE p1 TO user1@localhost;
+GRANT EXECUTE ON PROCEDURE p2 TO user1@localhost;
+GRANT EXECUTE ON PROCEDURE p3 TO user1@localhost;
+
+# Need to wait for the rights to be applied at the slave
+sync_slave_with_master;
+
+let $message=<******** Master user1 p3 & p2 calls *******>;
+--source include/show_msg.inc
+connect (muser1,localhost,user1,,);
+connection muser1;
+SELECT CURRENT_USER();
+SELECT USER();
+CALL test.p3();
+CALL test.p2();
+
+let $message=<******** Slave user1 p3 & p2 calls *******>;
+--source include/show_msg.inc
+connect (suser1,127.0.0.1,user1,,test,$SLAVE_MYPORT,);
+
+connection master;
+save_master_pos;
+connection suser1;
+sync_with_master;
+
+SELECT CURRENT_USER();
+SELECT USER();
+CALL test.p3();
+CALL test.p2();
+
+connection master;
+
+# lets cleanup
+DROP PROCEDURE IF EXISTS test.p1;
+DROP PROCEDURE IF EXISTS test.p3;
+DROP PROCEDURE IF EXISTS test.p2;
+DROP TABLE IF EXISTS test.t1;
+DROP TABLE IF EXISTS test.t2;
+
+# End of 5.0 test case
+
diff --git a/mysql-test/t/rpl_row_stop_middle.test b/mysql-test/t/rpl_row_stop_middle.test
new file mode 100644
index 00000000000..553a026e5e7
--- /dev/null
+++ b/mysql-test/t/rpl_row_stop_middle.test
@@ -0,0 +1,44 @@
+# Test for BUG#11729: see if, when STOP SLAVE occurs while the slave
+# SQL thread has processed a Table_map_log_event but has not processed
+# the last Rows_log_event associated to it, the slave thread does not
+# forget to close its tables.
+
+# Can be run with statement-based but no interest (and long test)
+source include/have_binlog_format_row.inc;
+source include/master-slave.inc;
+
+connection master;
+create table t1 (a int not null auto_increment primary key, b int, key(b));
+sync_slave_with_master;
+stop slave;
+connection master;
+INSERT INTO t1 (a) VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+INSERT INTO t1 (a) SELECT null FROM t1;
+INSERT INTO t1 (a) SELECT null FROM t1;
+INSERT INTO t1 (a) SELECT null FROM t1;
+INSERT INTO t1 (a) SELECT null FROM t1;
+INSERT INTO t1 (a) SELECT null FROM t1;
+INSERT INTO t1 (a) SELECT null FROM t1;
+INSERT INTO t1 (a) SELECT null FROM t1;
+INSERT INTO t1 (a) SELECT null FROM t1;
+INSERT INTO t1 (a) SELECT null FROM t1;
+INSERT INTO t1 (a) SELECT null FROM t1;
+INSERT INTO t1 (a) SELECT null FROM t1;
+INSERT INTO t1 (a) SELECT null FROM t1;
+INSERT INTO t1 (a) SELECT null FROM t1;
+
+connection slave;
+start slave;
+
+# hope one second is not enough for slave to reach the last
+# Rows_log_event, so that test actually tests something.
+
+real_sleep 1;
+stop slave;
+
+# see if slave hangs on DROP TABLE
+
+drop table t1;
+
+connection master; # cleanup
+drop table t1;
diff --git a/mysql-test/t/rpl_row_stop_middle_update-master.opt b/mysql-test/t/rpl_row_stop_middle_update-master.opt
new file mode 100644
index 00000000000..b7db8f97bdd
--- /dev/null
+++ b/mysql-test/t/rpl_row_stop_middle_update-master.opt
@@ -0,0 +1 @@
+--loose-binlog-row-event-max-size=256
diff --git a/mysql-test/t/rpl_row_stop_middle_update-slave.opt b/mysql-test/t/rpl_row_stop_middle_update-slave.opt
new file mode 100644
index 00000000000..ea49a27adf4
--- /dev/null
+++ b/mysql-test/t/rpl_row_stop_middle_update-slave.opt
@@ -0,0 +1 @@
+--loose-debug=d,STOP_SLAVE_after_first_Rows_event
diff --git a/mysql-test/t/rpl_row_stop_middle_update.test b/mysql-test/t/rpl_row_stop_middle_update.test
new file mode 100644
index 00000000000..82c4b1a9936
--- /dev/null
+++ b/mysql-test/t/rpl_row_stop_middle_update.test
@@ -0,0 +1,31 @@
+-- source include/have_binlog_format_row.inc
+-- source include/have_debug.inc
+-- source include/master-slave.inc
+
+# master is asked to create small Rows events: if only one event is
+# created, stopping slave at the end of that one will show no bug, we
+# need at least two (and stop after first); in this test we use three.
+
+connection master;
+create table t1 (words varchar(20)) engine=myisam;
+
+load data infile '../../std_data/words.dat' into table t1 (words);
+select count(*) from t1;
+save_master_pos;
+
+connection slave;
+
+# slave will automatically tell itself to stop thanks to the .opt
+# file; it will initiate the stop request after the first
+# Rows_log_event (out of 3) but should wait until the last one is
+# executed before stopping.
+
+wait_for_slave_to_stop;
+
+# check that we inserted all rows (waited until the last Rows event)
+select count(*) from t1;
+
+connection master;
+drop table t1;
+connection slave; # slave SQL thread is stopped
+drop table t1;
diff --git a/mysql-test/t/rpl_timezone-master.opt b/mysql-test/t/rpl_row_timezone-master.opt
index 8e43bfbbb7e..8e43bfbbb7e 100644
--- a/mysql-test/t/rpl_timezone-master.opt
+++ b/mysql-test/t/rpl_row_timezone-master.opt
diff --git a/mysql-test/t/rpl_row_timezone-slave.opt b/mysql-test/t/rpl_row_timezone-slave.opt
new file mode 100644
index 00000000000..c383fd9f17d
--- /dev/null
+++ b/mysql-test/t/rpl_row_timezone-slave.opt
@@ -0,0 +1,2 @@
+--default-time-zone=Europe/Moscow
+
diff --git a/mysql-test/t/rpl_row_timezone.test b/mysql-test/t/rpl_row_timezone.test
new file mode 100644
index 00000000000..047a458f09f
--- /dev/null
+++ b/mysql-test/t/rpl_row_timezone.test
@@ -0,0 +1,129 @@
+# TBF - difference in row level logging
+-- source include/have_binlog_format_row.inc
+
+# Test of replication of time zones.
+
+# There is currently some bug possibly in prepared statements (this
+# test fails with --ps-protocol): sys_var_thd_time_zone::value_ptr()
+# is called only at prepare time, not at execution time. So,
+# thd->time_zone_used is not equal to 1 (it is back to 0, because of
+# reset_thd_for_next_command called at execution time), so the
+# timezone used in CONVERT_TZ is not binlogged. To debug (by Guilhem
+# and possibly Konstantin).
+
+--disable_ps_protocol
+
+source include/master-slave.inc;
+
+# Some preparations
+let $VERSION=`select version()`;
+set timestamp=100000000; # for fixed output of mysqlbinlog
+create table t1 (t timestamp, n int not null auto_increment, PRIMARY KEY(n));
+create table t2 (t char(32), n int not null auto_increment, PRIMARY KEY(n));
+
+connection slave;
+select @@time_zone;
+#set time_zone='UTC';
+#select @@time_zone;
+#
+# Let us check how well replication works when we are saving datetime
+# value in TIMESTAMP field.
+#
+connection master;
+select @@time_zone;
+#set time_zone='UTC';
+#select @@time_zone;
+insert into t1 values ('20050101000000', NULL), ('20050611093902',NULL);
+insert into t1 values ('20040101000000',NULL), ('20040611093902',NULL);
+select * from t1;
+sync_slave_with_master;
+#set time_zone='UTC';
+select * from t1;
+
+# Let us check also that setting of time_zone back to default also works
+# well
+connection master;
+delete from t1;
+set time_zone='Europe/Moscow';
+insert into t1 values ('20040101000000',NULL), ('20040611093902',NULL);
+select * from t1;
+sync_slave_with_master;
+set time_zone='Europe/Moscow';
+select * from t1;
+connection master;
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+--exec $MYSQL_BINLOG --short-form $MYSQL_TEST_DIR/var/log/master-bin.000001
+
+# Let us check with LOAD DATA INFILE
+# (we do it after mysqlbinlog because the temp files names are not constant)
+connection master;
+delete from t1;
+set time_zone='UTC';
+load data infile '../../std_data/rpl_timezone2.dat' into table t1;
+select * from t1;
+sync_slave_with_master;
+set time_zone='UTC';
+select * from t1;
+set time_zone='Europe/Moscow';
+
+# Put back values of before the LOAD
+connection master;
+set time_zone='Europe/Moscow';
+delete from t1;
+insert into t1 values ('20040101000000',NULL), ('20040611093902',NULL);
+
+#
+# Now let us check how well we replicate statments reading TIMESTAMP fields
+# (We should see the same data on master and on slave but it should differ
+# from originally inserted)
+#
+set time_zone='MET';
+insert into t2 (select * from t1);
+select * from t1;
+sync_slave_with_master;
+select * from t2;
+
+#
+# Now let us check how well we replicate various CURRENT_* functions
+#
+connection master;
+delete from t2;
+set timestamp=1000072000;
+insert into t2 values (current_timestamp,NULL), (current_date,NULL), (current_time,NULL);
+sync_slave_with_master;
+select * from t2;
+
+#
+# At last let us check replication of FROM_UNIXTIME/UNIX_TIMESTAMP functions.
+#
+connection master;
+delete from t2;
+insert into t2 values (from_unixtime(1000000000),NULL),
+ (unix_timestamp('2001-09-09 03:46:40'),NULL);
+select * from t2;
+sync_slave_with_master;
+# We should get same result on slave as on master
+select * from t2;
+
+#
+# Let us check that we are allowing to set global time_zone with
+# replication
+#
+connection master;
+set global time_zone='MET';
+
+#
+# Let us see if CONVERT_TZ(@@time_zone) replicates
+#
+delete from t2;
+set time_zone='UTC';
+insert into t2 values(convert_tz('2004-01-01 00:00:00','MET',@@time_zone),NULL);
+insert into t2 values(convert_tz('2005-01-01 00:00:00','MET','Japan'),NULL);
+select * from t2;
+sync_slave_with_master;
+select * from t2;
+
+# Clean up
+connection master;
+drop table t1, t2;
+sync_slave_with_master;
diff --git a/mysql-test/t/rpl_row_trig001.test b/mysql-test/t/rpl_row_trig001.test
new file mode 100644
index 00000000000..e2f10ecf1fa
--- /dev/null
+++ b/mysql-test/t/rpl_row_trig001.test
@@ -0,0 +1,98 @@
+#############################################################################
+# Original Author: JBM #
+# Original Date: Aug/09/2005 #
+#############################################################################
+# TEST: Use after insert and before inset triggers and stored procdures to #
+# Update and insert data #
+#############################################################################
+
+# Includes
+-- source include/have_binlog_format_row.inc
+-- source include/master-slave.inc
+
+-- disable_query_log
+-- disable_result_log
+
+# Begin clean up test section
+connection master;
+--disable_warnings
+DROP PROCEDURE IF EXISTS test.p2;
+DROP PROCEDURE IF EXISTS test.p3;
+--error 0,1360
+DROP TRIGGER test.t2_ai;
+--error 0,1360
+DROP TRIGGER test.t3_bi_t2;
+--error 0,1360
+DROP TABLE IF EXISTS test.t1;
+DROP TABLE IF EXISTS test.t2;
+DROP TABLE IF EXISTS test.t3;
+
+
+# test section 1, lets add a trigger to the mix. Taken from bug #12280
+let $message=<Begin test section 1 (Tiggers & SP)>;
+--source include/show_msg.inc
+
+CREATE TABLE test.t1 (n MEDIUMINT NOT NULL, d DATETIME, PRIMARY KEY(n));
+CREATE TABLE test.t2 (n MEDIUMINT NOT NULL AUTO_INCREMENT, f FLOAT, d DATETIME, PRIMARY KEY(n));
+CREATE TABLE test.t3 (n MEDIUMINT NOT NULL AUTO_INCREMENT, d DATETIME, PRIMARY KEY(n));
+
+INSERT INTO test.t1 VALUES (1,NOW());
+
+delimiter //;
+CREATE TRIGGER test.t2_ai AFTER INSERT ON test.t2 FOR EACH ROW UPDATE test.t1 SET d=NOW() where n = 1;//
+CREATE PROCEDURE test.p3()
+BEGIN
+ INSERT INTO test.t3 (d) VALUES (NOW());
+END//
+CREATE TRIGGER test.t3_bi_t2 BEFORE INSERT ON test.t2 FOR EACH ROW CALL test.p3()//
+CREATE PROCEDURE test.p2()
+BEGIN
+ INSERT INTO test.t2 (f,d) VALUES (RAND(),NOW());
+END//
+delimiter ;//
+
+-- disable_query_log
+-- disable_result_log
+let $1=10;
+while ($1)
+{
+ CALL test.p2();
+ sleep 1;
+ dec $1;
+}
+-- enable_result_log
+-- enable_query_log
+
+#show binlog events;
+#select * from test.t2;
+#select * from test.t3;
+#connection slave;
+#select * from test.t2;
+#select * from test.t3;
+
+let $message=<End test section 2 (Tiggers & SP)>;
+--source include/show_msg.inc
+
+# time to dump the databases and so we can see if they match
+
+--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > ./var/tmp/trig001_master.sql
+--exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > ./var/tmp/trig001_slave.sql
+
+# First lets cleanup
+
+DROP PROCEDURE test.p2;
+DROP TRIGGER test.t2_ai;
+DROP TRIGGER test.t3_bi_t2;
+DROP TABLE test.t1;
+DROP TABLE test.t2;
+DROP TABLE test.t3;
+
+# Lets compare. Note: If they match test will pass, if they do not match
+# the test will show that the diff statement failed and not reject file
+# will be created. You will need to go to the mysql-test dir and diff
+# the files your self to see what is not matching :-) Failed tests
+# will leave dump files in mysql-test/var/tmp
+
+exec diff ./var/tmp/trig001_master.sql ./var/tmp/trig001_slave.sql;
+
+# End of 5.0 test case
diff --git a/mysql-test/t/rpl_row_trig002.test b/mysql-test/t/rpl_row_trig002.test
new file mode 100644
index 00000000000..2cd84009b2b
--- /dev/null
+++ b/mysql-test/t/rpl_row_trig002.test
@@ -0,0 +1,79 @@
+#############################################################################
+# Original Author: JBM #
+# Original Date: Aug/14/2005 #
+# Updated: 08/29/2005 added save master pos and sync with master #
+#############################################################################
+# TEST: Taken and modified from BUG#12048 After Insert updates replication #
+#############################################################################
+
+# Includes
+-- source include/have_binlog_format_row.inc
+-- source include/master-slave.inc
+
+#-- disable_query_log
+#-- disable_result_log
+
+# Begin clean up test section
+connection master;
+--disable_warnings
+--error 0,1360
+DROP TRIGGER test.t2_ai;
+DROP TABLE IF EXISTS test.t1;
+DROP TABLE IF EXISTS test.t2;
+DROP TABLE IF EXISTS test.t3;
+--enable_warnings
+
+# test section 1, Taken from bug #12408
+
+CREATE TABLE test.t2 (value CHAR(30),domain_id INT, mailaccount_id INT, program CHAR(30),keey CHAR(30),PRIMARY KEY(domain_id));
+
+CREATE TABLE test.t3 (value CHAR(30),domain_id INT, mailaccount_id INT, program CHAR(30),keey CHAR(30),PRIMARY KEY(domain_id));
+
+CREATE TABLE test.t1 (id INT,domain CHAR(30),PRIMARY KEY(id));
+
+delimiter |;
+CREATE TRIGGER test.t2_ai AFTER INSERT ON test.t2 FOR EACH ROW UPDATE test.t3 ms, test.t1 d SET ms.value='No' WHERE ms.domain_id = (SELECT max(id) FROM test.t1 WHERE domain='example.com') AND ms.mailaccount_id IS NULL AND ms.program='spamfilter' AND ms.keey='scan_incoming'|
+delimiter ;|
+
+INSERT INTO test.t1 VALUES (1, 'example.com'),(2, 'mysql.com'),(3, 'earthmotherwear.com'), (4, 'yahoo.com'),(5, 'example.com');
+
+select * from test.t1;
+#show binlog events;
+save_master_pos;
+connection slave;
+sync_with_master;
+select * from test.t1;
+connection master;
+
+INSERT INTO test.t3 VALUES ('Yes', 5, NULL, 'spamfilter','scan_incoming');
+INSERT INTO test.t3 VALUES ('Yes', 1, NULL, 'spamfilter','scan_incoming');
+INSERT INTO test.t2 VALUES ('Yes', 1, NULL, 'spamfilter','scan_incoming');
+
+select * from test.t2;
+select * from test.t3;
+save_master_pos;
+connection slave;
+sync_with_master;
+select * from test.t2;
+select * from test.t3;
+connection master;
+
+DELETE FROM test.t1 WHERE id = 1;
+
+select * from test.t1;
+save_master_pos;
+connection slave;
+sync_with_master;
+select * from test.t1;
+connection master;
+
+#show binlog events;
+
+# cleanup
+
+DROP TRIGGER test.t2_ai;
+DROP TABLE test.t1;
+DROP TABLE test.t2;
+DROP TABLE test.t3;
+
+# End of 5.0 test case
diff --git a/mysql-test/t/rpl_row_trig003.test b/mysql-test/t/rpl_row_trig003.test
new file mode 100644
index 00000000000..799c2d6c9c7
--- /dev/null
+++ b/mysql-test/t/rpl_row_trig003.test
@@ -0,0 +1,152 @@
+#############################################################################
+# Original Author: JBM #
+# Original Date: Aug/16/2005 #
+# Updated: 8/29/2005 Remove sleep calls add dump and diff #
+#############################################################################
+# TEST: This test includes all trigger types. BEFORE/AFTER INSERT, UPDATE & #
+# DELETE. In addition, includes cursor, bit, varchar, flow control, #
+# looping, ROUND(), NOW(), YEAR(), TIMESTAMP #
+#############################################################################
+
+# Includes
+-- source include/have_binlog_format_row.inc
+-- source include/master-slave.inc
+
+#-- disable_query_log
+#-- disable_result_log
+
+# Begin clean up test section
+connection master;
+--disable_warnings
+--error 0,1360
+DROP TRIGGER test.t1_bi;
+--error 0,1360
+DROP TRIGGER test.t2_ai;
+--error 0,1360
+DROP TRIGGER test.t1_bu;
+--error 0,1360
+DROP TRIGGER test.t2_au;
+--error 0,1360
+DROP TRIGGER test.t1_bd;
+--error 0,1360
+DROP TRIGGER test.t2_ad;
+DROP TABLE IF EXISTS test.t1;
+DROP TABLE IF EXISTS test.t2;
+DROP TABLE IF EXISTS test.t3;
+--enable_warnings
+
+# test section 1
+
+CREATE TABLE test.t1 (id MEDIUMINT NOT NULL AUTO_INCREMENT, b1 BIT(8), vc VARCHAR(255), bc CHAR(255), d DECIMAL(10,4) DEFAULT 0, f FLOAT DEFAULT 0, total BIGINT UNSIGNED, y YEAR, t TIMESTAMP,PRIMARY KEY(id));
+CREATE TABLE test.t2 (id MEDIUMINT NOT NULL AUTO_INCREMENT, b1 BIT(8), vc VARCHAR(255), bc CHAR(255), d DECIMAL(10,4) DEFAULT 0, f FLOAT DEFAULT 0, total BIGINT UNSIGNED, y YEAR, t TIMESTAMP,PRIMARY KEY(id));
+CREATE TABLE test.t3 (id MEDIUMINT NOT NULL AUTO_INCREMENT, b1 BIT(8), vc VARCHAR(255), bc CHAR(255), d DECIMAL(10,4) DEFAULT 0, f FLOAT DEFAULT 0, total BIGINT UNSIGNED, y YEAR, t TIMESTAMP,PRIMARY KEY(id));
+
+# Note Most of these cause the slave to core or do not produce desired results. Currently commenting out the ones not working until they are fixed.
+
+delimiter |;
+CREATE TRIGGER test.t1_bi BEFORE INSERT ON test.t1 FOR EACH ROW UPDATE test.t3 SET b1=1 and y=YEAR(NOW())|
+CREATE TRIGGER test.t2_ai AFTER INSERT ON test.t2 FOR EACH ROW BEGIN
+ INSERT INTO test.t3 VALUES(NULL,0,'MySQL Replication team rocks!', 'Dark beer in prague is #1',12345.34,12.51,0,1965,NOW());
+ UPDATE test.t3 SET f = ROUND(f);
+END|
+CREATE TRIGGER test.t1_bu BEFORE UPDATE on test.t1 FOR EACH ROW BEGIN
+ UPDATE test.t3 SET y = '2000';
+ INSERT INTO test.t3 VALUES(NULL,1,'Testing MySQL databases before update ', 'Insert should work',621.43, 0105.21,0,1974,NOW());
+END|
+CREATE TRIGGER test.t2_au AFTER UPDATE on test.t2 FOR EACH ROW BEGIN
+ DECLARE done INT DEFAULT 0;
+ DECLARE a DECIMAL(10,4);
+ DECLARE b FLOAT;
+ DECLARE num MEDIUMINT;
+ DECLARE cur1 CURSOR FOR SELECT t2.id, t2.d, t2.f FROM test.t2;
+ DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done = 1;
+
+ OPEN cur1;
+
+ REPEAT
+ FETCH cur1 INTO num, a, b;
+ IF NOT done THEN
+ UPDATE test.t3 SET total =(a*b) WHERE ID = num;
+ END IF;
+ UNTIL done END REPEAT;
+ CLOSE cur1;
+END|
+CREATE TRIGGER test.t1_bd BEFORE DELETE on test.t1 FOR EACH ROW BEGIN
+ DECLARE done INT DEFAULT 0;
+ DECLARE a BIT(8);
+ DECLARE b VARCHAR(255);
+ DECLARE c CHAR(255);
+ DECLARE d DECIMAL(10,4);
+ DECLARE e FLOAT;
+ DECLARE f BIGINT UNSIGNED;
+ DECLARE g YEAR;
+ DECLARE h TIMESTAMP;
+ DECLARE cur1 CURSOR FOR SELECT t1.b1, t1.vc, t1.bc, t1.d, t1.f, t1.total, t1.y, t1.t FROM test.t1;
+ DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done = 1;
+
+ OPEN cur1;
+
+ REPEAT
+ FETCH cur1 INTO a, b, c, d, e, f, g, h;
+ IF NOT done THEN
+ INSERT INTO test.t3 VALUES(NULL, a, b, c, d, e, f, g, h);
+ END IF;
+ UNTIL done END REPEAT;
+ CLOSE cur1;
+END|
+CREATE TRIGGER test.t2_ad AFTER DELETE ON test.t2 FOR EACH ROW
+ DELETE FROM test.t1|
+delimiter ;|
+
+INSERT INTO test.t1 VALUES(NULL,1,'Testing MySQL databases is a cool ', 'Must make it bug free for the customer',654321.4321,15.21,0,1965,NOW());
+INSERT INTO test.t2 VALUES(NULL,0,'Testing MySQL databases is a cool ', 'MySQL Customers ROCK!',654321.4321,1.24521,0,YEAR(NOW()),NOW());
+
+UPDATE test.t1 SET b1 = 0 WHERE b1 = 1;
+
+INSERT INTO test.t2 VALUES(NULL,1,'This is an after update test.', 'If this works, total will not be zero on the master or slave',1.4321,5.221,0,YEAR(NOW()),NOW());
+UPDATE test.t2 SET b1 = 0 WHERE b1 = 1;
+
+INSERT INTO test.t1 VALUES(NULL,1,'add some more test data test.', 'and hope for the best', 3.321,5.221,0,YEAR(NOW()),NOW());
+
+# To make sure BUG#14698 is gone, we sleep 2 seconds before calling trigger
+# (with the bug in, that caused differences in TIMESTAMP columns).
+# We just need to let the machine's clock advance, it's not
+# to do synchronization, so real_sleep is good.
+real_sleep 2;
+
+DELETE FROM test.t1 WHERE id = 1;
+
+DELETE FROM test.t2 WHERE id = 1;
+
+save_master_pos;
+connection slave;
+sync_with_master;
+connection master;
+
+# time to dump the databases and so we can see if they match
+
+--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > ./var/tmp/trg003_master.sql
+--exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > ./var/tmp/trg003_slave.sql
+
+# cleanup
+--disable_warnings
+--error 0,1360
+DROP TRIGGER test.t1_bi;
+--error 0,1360
+DROP TRIGGER test.t2_ai;
+--error 0,1360
+DROP TRIGGER test.t1_bu;
+--error 0,1360
+DROP TRIGGER test.t2_au;
+--error 0,1360
+DROP TRIGGER test.t1_bd;
+--error 0,1360
+DROP TRIGGER test.t2_ad;
+DROP TABLE IF EXISTS test.t1;
+DROP TABLE IF EXISTS test.t2;
+DROP TABLE IF EXISTS test.t3;
+--enable_warnings
+
+exec diff ./var/tmp/trg003_master.sql ./var/tmp/trg003_slave.sql;
+
+# End of 5.0 test case
diff --git a/mysql-test/t/rpl_row_trig004.test b/mysql-test/t/rpl_row_trig004.test
new file mode 100644
index 00000000000..2ad0b46211b
--- /dev/null
+++ b/mysql-test/t/rpl_row_trig004.test
@@ -0,0 +1,14 @@
+#############################################################################
+# Original Author: JBM #
+# Original Date: Oct/18/2005 #
+#############################################################################
+# TEST: Use before insert triggers and has the second insert fail #
+#############################################################################
+
+# Includes
+-- source include/have_binlog_format_row.inc
+-- source include/have_innodb.inc
+-- source include/master-slave.inc
+let $engine_type=INNODB;
+-- source extra/rpl_tests/rpl_trig004.test
+
diff --git a/mysql-test/t/rpl_row_until.test b/mysql-test/t/rpl_row_until.test
new file mode 100644
index 00000000000..5ddeea911a8
--- /dev/null
+++ b/mysql-test/t/rpl_row_until.test
@@ -0,0 +1,86 @@
+-- source include/have_binlog_format_row.inc
+-- source include/master-slave.inc
+
+# Test is dependent on binlog positions
+
+# prepare version for substitutions
+let $VERSION=`select version()`;
+
+# stop slave before he will start replication also sync with master
+# for avoiding undetermenistic behaviour
+save_master_pos;
+connection slave;
+sync_with_master;
+stop slave;
+
+connection master;
+# create some events on master
+create table t1(n int not null auto_increment primary key);
+insert into t1 values (1),(2),(3),(4);
+drop table t1;
+create table t2(n int not null auto_increment primary key);
+insert into t2 values (1),(2);
+insert into t2 values (3),(4);
+drop table t2;
+
+# try to replicate all queries until drop of t1
+connection slave;
+start slave until master_log_file='master-bin.000001', master_log_pos=311;
+sleep 2;
+wait_for_slave_to_stop;
+# here table should be still not deleted
+select * from t1;
+--replace_result $MASTER_MYPORT MASTER_MYPORT
+--replace_column 1 # 9 # 11 # 23 # 33 #
+show slave status;
+
+# this should fail right after start
+start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291;
+# again this table should be still not deleted
+select * from t1;
+sleep 2;
+wait_for_slave_to_stop;
+--replace_result $MASTER_MYPORT MASTER_MYPORT
+--replace_column 1 # 9 # 11 # 23 # 33 #
+show slave status;
+
+# try replicate all up to and not including the second insert to t2;
+start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=728;
+sleep 2;
+wait_for_slave_to_stop;
+select * from t2;
+--replace_result $MASTER_MYPORT MASTER_MYPORT
+--replace_column 1 # 9 # 11 # 23 # 33 #
+show slave status;
+
+# clean up
+start slave;
+connection master;
+save_master_pos;
+connection slave;
+sync_with_master;
+stop slave;
+
+# this should stop immediately as we are already there
+start slave until master_log_file='master-bin.000001', master_log_pos=740;
+sleep 2;
+wait_for_slave_to_stop;
+# here the sql slave thread should be stopped
+--replace_result $MASTER_MYPORT MASTER_MYPORT bin.000005 bin.000004 bin.000006 bin.000004 bin.000007 bin.000004
+--replace_column 1 # 9 # 23 # 33 #
+show slave status;
+
+#testing various error conditions
+--error 1277
+start slave until master_log_file='master-bin', master_log_pos=561;
+--error 1277
+start slave until master_log_file='master-bin.000001', master_log_pos=561, relay_log_pos=12;
+--error 1277
+start slave until master_log_file='master-bin.000001';
+--error 1277
+start slave until relay_log_file='slave-relay-bin.000002';
+--error 1277
+start slave until relay_log_file='slave-relay-bin.000002', master_log_pos=561;
+# Warning should be given for second command
+start slave sql_thread;
+start slave until master_log_file='master-bin.000001', master_log_pos=740;
diff --git a/mysql-test/t/rpl_row_user_variables.test b/mysql-test/t/rpl_row_user_variables.test
new file mode 100644
index 00000000000..2ebb668b1a8
--- /dev/null
+++ b/mysql-test/t/rpl_row_user_variables.test
@@ -0,0 +1,4 @@
+# row-based and statement binlog difference in result files
+-- source include/have_binlog_format_row.inc
+-- source extra/rpl_tests/rpl_user_variables.test
+
diff --git a/mysql-test/t/rpl_view.test b/mysql-test/t/rpl_row_view.test
index 0a0c6a6dddb..6d460d58df6 100644
--- a/mysql-test/t/rpl_view.test
+++ b/mysql-test/t/rpl_row_view.test
@@ -1,9 +1,11 @@
+# NYI - row-based cannot use CREATE ... SELECT
+--source include/have_binlog_format_row.inc
+
source include/master-slave.inc;
--disable_warnings
drop table if exists t1,v1;
drop view if exists t1,v1;
sync_slave_with_master;
-reset master;
--enable_warnings
#
@@ -43,5 +45,3 @@ select * from v1 order by a;
connection master;
drop table t1;
sync_slave_with_master;
---replace_column 2 # 5 #
-show binlog events limit 1,100;
diff --git a/mysql-test/t/rpl_row_view01.test b/mysql-test/t/rpl_row_view01.test
new file mode 100644
index 00000000000..85137e03dbf
--- /dev/null
+++ b/mysql-test/t/rpl_row_view01.test
@@ -0,0 +1,82 @@
+#############################################################################
+# Original Author: JBM #
+# Original Date: Aug/19/2005 #
+# Updated: 08/29/2005 Remove sleeps #
+#############################################################################
+#TEST: row based replication of views #
+#############################################################################
+
+# Includes
+-- source include/have_binlog_format_row.inc
+-- source include/master-slave.inc
+
+# Begin clean up test section
+connection master;
+--disable_warnings
+create database if not exists mysqltest1;
+DROP VIEW IF EXISTS mysqltest1.v1;
+DROP VIEW IF EXISTS mysqltest1.v2;
+DROP VIEW IF EXISTS mysqltest1.v3;
+DROP VIEW IF EXISTS mysqltest1.v4;
+DROP TABLE IF EXISTS mysqltest1.t3;
+DROP TABLE IF EXISTS mysqltest1.t1;
+DROP TABLE IF EXISTS mysqltest1.t2;
+DROP TABLE IF EXISTS mysqltest1.t4;
+
+# Begin test section 1
+CREATE TABLE mysqltest1.t1 (a INT, c CHAR(6),PRIMARY KEY(a));
+CREATE TABLE mysqltest1.t2 (a INT, c CHAR(6),PRIMARY KEY(a));
+CREATE TABLE mysqltest1.t3 (a INT, c CHAR(6), c2 CHAR(6), PRIMARY KEY(a));
+CREATE TABLE mysqltest1.t4 (a INT, qty INT, price INT,PRIMARY KEY(a));
+CREATE TABLE mysqltest1.t5 (qty INT, price INT, total INT, PRIMARY KEY(qty));
+INSERT INTO mysqltest1.t1 VALUES (1,'Thank'),(2,'it'),(3,'Friday');
+INSERT INTO mysqltest1.t2 VALUES (1,'GOD'),(2,'is'),(3,'TGIF');
+INSERT INTO mysqltest1.t4 VALUES(1, 3, 50),(2, 18, 3),(4, 4, 4);
+
+
+CREATE VIEW mysqltest1.v2 AS SELECT qty, price, qty*price AS value FROM mysqltest1.t4;
+CREATE VIEW mysqltest1.v1 AS SELECT t1.a, t1.c, t2.c as c2 FROM mysqltest1.t1 as t1, mysqltest1.t2 AS t2 WHERE mysqltest1.t1.a = mysqltest1.t2.a;
+CREATE VIEW mysqltest1.v3 AS SELECT * FROM mysqltest1.t1;
+CREATE VIEW mysqltest1.v4 AS SELECT * FROM mysqltest1.v3 WHERE a > 1 WITH LOCAL CHECK OPTION;
+
+
+SELECT * FROM mysqltest1.v2;
+SELECT * FROM mysqltest1.v1;
+sync_slave_with_master;
+SELECT * FROM mysqltest1.v2;
+SELECT * FROM mysqltest1.v1;
+connection master;
+
+INSERT INTO mysqltest1.t5 SELECT * FROM mysqltest1.v2;
+INSERT INTO mysqltest1.t3 SELECT * FROM mysqltest1.v1;
+
+SELECT * FROM mysqltest1.t5;
+SELECT * FROM mysqltest1.t3;
+sync_slave_with_master;
+SELECT * FROM mysqltest1.t5;
+SELECT * FROM mysqltest1.t3;
+connection master;
+
+INSERT INTO mysqltest1.v4 VALUES (4,'TEST');
+
+SELECT * FROM mysqltest1.t1;
+SELECT * FROM mysqltest1.v4;
+sync_slave_with_master;
+SELECT * FROM mysqltest1.t1;
+SELECT * FROM mysqltest1.v4;
+
+connection master;
+
+# lets cleanup
+DROP VIEW IF EXISTS mysqltest1.v1;
+DROP VIEW IF EXISTS mysqltest1.v2;
+DROP VIEW IF EXISTS mysqltest1.v3;
+DROP VIEW IF EXISTS mysqltest1.v4;
+DROP TABLE IF EXISTS mysqltest1.t3;
+DROP TABLE IF EXISTS mysqltest1.t1;
+DROP TABLE IF EXISTS mysqltest1.t2;
+DROP TABLE IF EXISTS mysqltest1.t4;
+sync_slave_with_master;
+
+# End of 5.1 test case
+
diff --git a/mysql-test/t/rpl_server_id1.test b/mysql-test/t/rpl_server_id1.test
index 3583f05284c..71310750b60 100644
--- a/mysql-test/t/rpl_server_id1.test
+++ b/mysql-test/t/rpl_server_id1.test
@@ -13,7 +13,7 @@ stop slave;
--replace_result $SLAVE_MYPORT SLAVE_PORT
eval change master to master_port=$SLAVE_MYPORT;
--replace_result $SLAVE_MYPORT SLAVE_PORT
---replace_column 18 #
+--replace_column 16 # 18 #
show slave status;
start slave;
insert into t1 values (1);
diff --git a/mysql-test/t/rpl_sp004.test b/mysql-test/t/rpl_sp004.test
new file mode 100644
index 00000000000..6f6bd79ae82
--- /dev/null
+++ b/mysql-test/t/rpl_sp004.test
@@ -0,0 +1,97 @@
+#############################################################################
+# Original Author: JBM #
+# Original Date: Aug/14/2005 #
+#############################################################################
+# Test: This test contains two sp that create and drop tables, insert and #
+# updated data and uses the NOW() function. #
+#############################################################################
+
+
+# Includes
+-- source include/master-slave.inc
+
+
+# Begin clean up test section
+connection master;
+--disable_warnings
+DROP PROCEDURE IF EXISTS test.p1;
+DROP PROCEDURE IF EXISTS test.p2;
+DROP TABLE IF EXISTS test.t2;
+DROP TABLE IF EXISTS test.t1;
+DROP TABLE IF EXISTS test.t3;
+--enable_warnings
+# End of cleanup
+
+# Begin test section 1
+
+delimiter |;
+CREATE PROCEDURE test.p1()
+BEGIN
+ CREATE TABLE IF NOT EXISTS test.t1(a INT,PRIMARY KEY(a));
+ CREATE TABLE IF NOT EXISTS test.t2(a INT,PRIMARY KEY(a));
+ INSERT INTO test.t1 VALUES (4),(2),(1),(3);
+ UPDATE test.t1 SET a=a+4 WHERE a=4;
+ INSERT INTO test.t2 (a) SELECT t1.a FROM test.t1;
+ UPDATE test.t1 SET a=a+4 WHERE a=8;
+ CREATE TABLE IF NOT EXISTS test.t3(n MEDIUMINT NOT NULL AUTO_INCREMENT, f FLOAT, d DATETIME, PRIMARY KEY(n));
+END|
+CREATE PROCEDURE test.p2()
+BEGIN
+ DROP TABLE IF EXISTS test.t1;
+ DROP TABLE IF EXISTS test.t2;
+ INSERT INTO test.t3 VALUES(NULL,11111111.233333,NOW());
+END|
+delimiter ;|
+
+CALL test.p1();
+SELECT * FROM test.t1;
+SELECT * FROM test.t2;
+save_master_pos;
+connection slave;
+sync_with_master;
+SELECT * FROM test.t1;
+SELECT * FROM test.t2;
+
+connection master;
+CALL test.p2();
+USE test;
+SHOW TABLES;
+#SELECT * FROM test.t3;
+save_master_pos;
+connection slave;
+sync_with_master;
+USE test;
+SHOW TABLES;
+#SELECT * FROM test.t3;
+
+connection master;
+CALL test.p1();
+SELECT * FROM test.t1;
+SELECT * FROM test.t2;
+#SELECT * FROM test.t3;
+save_master_pos;
+connection slave;
+sync_with_master;
+SELECT * FROM test.t1;
+SELECT * FROM test.t2;
+#SELECT * FROM test.t3;
+connection master;
+#show binlog events;
+
+
+# If the test fails, you will need to diff the dumps to see why.
+
+--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > ./var/tmp/sp004_master.sql
+--exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > ./var/tmp/sp004_slave.sql
+
+DROP PROCEDURE IF EXISTS test.p1;
+DROP PROCEDURE IF EXISTS test.p2;
+DROP TABLE IF EXISTS test.t1;
+DROP TABLE IF EXISTS test.t2;
+DROP TABLE IF EXISTS test.t3;
+#sync_slave_with_master;
+
+-- exec diff ./var/tmp/sp004_master.sql ./var/tmp/sp004_slave.sql
+
+
+# End of 5.0 test case
diff --git a/mysql-test/t/rpl_sp_effects.test b/mysql-test/t/rpl_sp_effects.test
index 9da5723b993..1c23f956082 100644
--- a/mysql-test/t/rpl_sp_effects.test
+++ b/mysql-test/t/rpl_sp_effects.test
@@ -1,6 +1,8 @@
# Test of replication of stored procedures (WL#2146 for MySQL 5.0)
-
-source include/master-slave.inc;
+# Make this statement only until bug 13115 is corrected [jbm]
+# TODO: Remove statement include once bug 13115 is patched.
+-- source include/have_binlog_format_statement.inc
+-- source include/master-slave.inc
# ****************************************************************
connection master;
@@ -140,7 +142,6 @@ begin
end while;
end//
delimiter ;//
-
call p1(15);
select 'master:',a from t1;
sync_slave_with_master;
diff --git a/mysql-test/t/rpl_stm_000001-slave.opt b/mysql-test/t/rpl_stm_000001-slave.opt
new file mode 100644
index 00000000000..627becdbfb5
--- /dev/null
+++ b/mysql-test/t/rpl_stm_000001-slave.opt
@@ -0,0 +1 @@
+--innodb
diff --git a/mysql-test/t/rpl_stm_000001.test b/mysql-test/t/rpl_stm_000001.test
new file mode 100644
index 00000000000..aee067b2d4a
--- /dev/null
+++ b/mysql-test/t/rpl_stm_000001.test
@@ -0,0 +1,2 @@
+let $engine_type=myisam;
+-- source extra/rpl_tests/rpl_stm_000001.test
diff --git a/mysql-test/t/rpl_stm_EE_err.test b/mysql-test/t/rpl_stm_EE_err.test
new file mode 100644
index 00000000000..e883a6ce616
--- /dev/null
+++ b/mysql-test/t/rpl_stm_EE_err.test
@@ -0,0 +1,2 @@
+let $engine_type=myisam;
+-- source extra/rpl_tests/rpl_stm_EE_err.test
diff --git a/mysql-test/t/rpl_stm_charset.test b/mysql-test/t/rpl_stm_charset.test
new file mode 100644
index 00000000000..b103a47d78c
--- /dev/null
+++ b/mysql-test/t/rpl_stm_charset.test
@@ -0,0 +1,2 @@
+let $engine_type=myisam;
+-- source extra/rpl_tests/rpl_stm_charset.test
diff --git a/mysql-test/t/rpl_stm_ddl.test b/mysql-test/t/rpl_stm_ddl.test
new file mode 100644
index 00000000000..54548114f86
--- /dev/null
+++ b/mysql-test/t/rpl_stm_ddl.test
@@ -0,0 +1,35 @@
+######################## rpl_ddl.test ########################
+# #
+# DDL statements (sometimes with implicit COMMIT) executed #
+# by the master and it's propagation into the slave #
+# #
+##############################################################
+
+#
+# NOTE, PLEASE BE CAREFUL, WHEN MODIFYING THE TESTS !!
+#
+# 1. !All! objects to be dropped, renamed, altered ... must be created
+# in AUTOCOMMIT= 1 mode before AUTOCOMMIT is set to 0 and the test
+# sequences start.
+#
+# 2. Never use a test object, which was direct or indirect affected by a
+# preceeding test sequence again.
+# Except table d1.t1 where ONLY DML is allowed.
+#
+# If one preceeding test sequence hits a (sometimes not good visible,
+# because the sql error code of the statement might be 0) bug
+# and these rules are ignored, a following test sequence might earn ugly
+# effects like failing 'sync_slave_with_master', crashes of the slave or
+# abort of the test case etc..
+#
+# 3. The assignment of the DDL command to be tested to $my_stmt can
+# be a bit difficult. "'" must be avoided, because the test
+# routine "include/rpl_stmt_seq.inc" performs a
+# eval SELECT CONCAT('######## ','$my_stmt',' ########') as "";
+#
+
+--source include/have_innodb.inc
+--source include/have_binlog_format_statement.inc
+--source include/master-slave.inc
+let $engine_type= "InnoDB";
+-- source extra/rpl_tests/rpl_ddl.test
diff --git a/mysql-test/t/rpl_error_ignored_table-slave.opt b/mysql-test/t/rpl_stm_err_ignoredtable-slave.opt
index cb49119bfcb..cb49119bfcb 100644
--- a/mysql-test/t/rpl_error_ignored_table-slave.opt
+++ b/mysql-test/t/rpl_stm_err_ignoredtable-slave.opt
diff --git a/mysql-test/t/rpl_stm_err_ignoredtable.test b/mysql-test/t/rpl_stm_err_ignoredtable.test
new file mode 100644
index 00000000000..a426be27b59
--- /dev/null
+++ b/mysql-test/t/rpl_stm_err_ignoredtable.test
@@ -0,0 +1,8 @@
+# Test for
+# Bug #797: If a query is ignored on slave (replicate-ignore-table) the slave
+# still checks that it has the same error as on the master.
+
+# Requires statement logging
+-- source include/have_binlog_format_statement.inc
+-- source extra/rpl_tests/rpl_err_ignoredtable.test
+
diff --git a/mysql-test/t/rpl_stm_flsh_tbls.test b/mysql-test/t/rpl_stm_flsh_tbls.test
new file mode 100644
index 00000000000..3a6102de279
--- /dev/null
+++ b/mysql-test/t/rpl_stm_flsh_tbls.test
@@ -0,0 +1,8 @@
+# depends on the binlog output
+--source include/have_binlog_format_statement.inc
+
+let $rename_event_pos= 652;
+-- source extra/rpl_tests/rpl_flsh_tbls.test
+
+# End of 4.1 tests
+# Adding comment for force manual merge 5.0 -> wl1012. Delete me if needed.
diff --git a/mysql-test/t/rpl_loaddata_rule_s-slave.opt b/mysql-test/t/rpl_stm_loaddata_m-master.opt
index 9d4a8f0b95e..9d4a8f0b95e 100644
--- a/mysql-test/t/rpl_loaddata_rule_s-slave.opt
+++ b/mysql-test/t/rpl_stm_loaddata_m-master.opt
diff --git a/mysql-test/t/rpl_stm_loaddata_m.test b/mysql-test/t/rpl_stm_loaddata_m.test
new file mode 100644
index 00000000000..ac52a8dfb9e
--- /dev/null
+++ b/mysql-test/t/rpl_stm_loaddata_m.test
@@ -0,0 +1,10 @@
+# See if the master logs LOAD DATA INFILE correctly when binlog_*_db rules
+# exist.
+# This is for BUG#1100 (LOAD DATA INFILE was half-logged).
+
+# Requires statement logging
+-- source include/have_binlog_format_statement.inc
+-- source extra/rpl_tests/rpl_loaddata_m.test
+
+# End of 4.1 tests
+# Adding comment for force manual merge 5.0 -> wl1012: Delete me
diff --git a/mysql-test/t/rpl_stm_log-master.opt b/mysql-test/t/rpl_stm_log-master.opt
new file mode 100644
index 00000000000..e0d075c3fbd
--- /dev/null
+++ b/mysql-test/t/rpl_stm_log-master.opt
@@ -0,0 +1 @@
+--skip-external-locking
diff --git a/mysql-test/t/rpl_stm_log-slave.opt b/mysql-test/t/rpl_stm_log-slave.opt
new file mode 100644
index 00000000000..8b137891791
--- /dev/null
+++ b/mysql-test/t/rpl_stm_log-slave.opt
@@ -0,0 +1 @@
+
diff --git a/mysql-test/t/rpl_stm_log.test b/mysql-test/t/rpl_stm_log.test
new file mode 100644
index 00000000000..f5b0a7eead8
--- /dev/null
+++ b/mysql-test/t/rpl_stm_log.test
@@ -0,0 +1,7 @@
+# Requires statement logging
+-- source include/have_binlog_format_statement.inc
+-- source extra/rpl_tests/rpl_log.test
+
+
+# End of 4.1 tests
+# Adding comment for force manual merge 5.0 -> wl1012: Delete me
diff --git a/mysql-test/t/rpl_stm_max_relay_size.test b/mysql-test/t/rpl_stm_max_relay_size.test
new file mode 100644
index 00000000000..50008533388
--- /dev/null
+++ b/mysql-test/t/rpl_stm_max_relay_size.test
@@ -0,0 +1,11 @@
+# Test of options max_binlog_size and max_relay_log_size and
+# how they act (if max_relay_log_size == 0, use max_binlog_size
+# for relay logs too).
+# Test of manual relay log rotation with FLUSH LOGS.
+
+# Requires statement logging
+-- source include/have_binlog_format_statement.inc
+-- source extra/rpl_tests/rpl_max_relay_size.test
+
+# End of 4.1 tests
+#
diff --git a/mysql-test/t/rpl_stm_multi_query.test b/mysql-test/t/rpl_stm_multi_query.test
new file mode 100644
index 00000000000..97c322ac780
--- /dev/null
+++ b/mysql-test/t/rpl_stm_multi_query.test
@@ -0,0 +1,12 @@
+# Test for BUG#8436: verify that a multi-query (i.e. one query
+# containing several queries (assuming client has
+# CLIENT_MULTI_STATEMENTS) will be binlogged ONE-query-per-event (not
+# one binlog event containing all queries)
+
+# Requires statement logging
+-- source include/have_binlog_format_statement.inc
+-- source extra/rpl_tests/rpl_multi_query.test
+
+
+# End of 4.1 tests
+#
diff --git a/mysql-test/t/rpl_mystery22.test b/mysql-test/t/rpl_stm_mystery22.test
index f190968a03c..bb810ffb4ac 100644
--- a/mysql-test/t/rpl_mystery22.test
+++ b/mysql-test/t/rpl_stm_mystery22.test
@@ -1,20 +1,25 @@
+-- source include/have_binlog_format_statement.inc
+
# test case to make slave thread get ahead by 22 bytes
-source include/master-slave.inc;
+-- source include/master-slave.inc
# first, cause a duplicate key problem on the slave
-create table t1(n int auto_increment primary key);
+create table t1(n int auto_increment primary key, s char(10));
sync_slave_with_master;
-insert into t1 values (2);
+insert into t1 values (2,'old');
connection master;
-insert into t1 values(NULL);
-insert into t1 values(NULL);
+insert into t1 values(NULL,'new');
+insert into t1 values(NULL,'new');
save_master_pos;
connection slave;
-sleep 3; # there is no way around this sleep - we have to wait until
-# the slave tries to run the query, fails and aborts slave thread
+# wait until the slave tries to run the query, fails and aborts slave thread
+wait_for_slave_to_stop;
+select * from t1 order by n;
delete from t1 where n = 2;
+--disable_warnings
start slave;
+--enable_warnings
sync_with_master;
#now the buggy slave would be confused on the offset but it can replicate
#in order to make it break, we need to stop/start the slave one more time
@@ -24,14 +29,21 @@ connection master;
# events in the log
create table t2(n int);
drop table t2;
-insert into t1 values(NULL);
+insert into t1 values(NULL,'new');
+# what happens when we delete a row which does not exist on slave?
+set sql_log_bin=0;
+insert into t1 values(NULL,'new');
+set sql_log_bin=1;
+delete from t1 where n=4;
save_master_pos;
connection slave;
+--disable_warnings
start slave;
+--enable_warnings
#now the truth comes out - if the slave is buggy, it will never sync because
#the slave thread is not able to read events
sync_with_master;
-select * from t1;
+select * from t1 order by n;
#clean up
connection master;
drop table t1;
diff --git a/mysql-test/t/rpl_stm_no_op.test b/mysql-test/t/rpl_stm_no_op.test
new file mode 100644
index 00000000000..d1e0b49abe9
--- /dev/null
+++ b/mysql-test/t/rpl_stm_no_op.test
@@ -0,0 +1,93 @@
+# It's true only in statement-based replication that a statement which
+# updates no rows (UPDATE/DELETE) is binlogged; in row-based
+# replication, as we log modified rows, nothing is binlogged in this
+# case. So this test is meaningul only in statement-based (and if it was
+# enabled in row-based, it would fail as expected).
+
+-- source include/have_binlog_format_statement.inc
+
+source include/master-slave.inc;
+
+# see if DROP DATABASE is binlogged even if no effect
+connection slave;
+create database mysqltest;
+connection master;
+drop database if exists mysqltest;
+sync_slave_with_master;
+# can't read dir
+--replace_result "Errcode: 1" "Errcode: X" "Errcode: 2" "Errcode: X" \\ /
+--error 1049
+show tables from mysqltest;
+
+# see if DROP TABLE is binlogged even if no effect
+connection slave;
+create table t1 (a int);
+connection master;
+drop table if exists t1;
+sync_slave_with_master;
+# table does not exist
+--error 1146
+select * from t1;
+
+# see if single-table DELETE is binlogged even if no effect
+connection master;
+create table t1 (a int, b int);
+sync_slave_with_master;
+insert into t1 values(1,1);
+connection master;
+delete from t1;
+sync_slave_with_master;
+select * from t1;
+
+# see if single-table UPDATE is binlogged even if no effect
+insert into t1 values(1,1);
+connection master;
+insert into t1 values(2,1);
+update t1 set a=2;
+sync_slave_with_master;
+select * from t1;
+
+# End of 4.1 tests
+
+# see if multi-table UPDATE is binlogged even if no effect (BUG#13348)
+
+connection master;
+create table t2 (a int, b int);
+delete from t1;
+insert into t1 values(1,1);
+insert into t2 values(1,1);
+
+sync_slave_with_master;
+# force a difference to see if master's multi-UPDATE will correct it
+update t1 set a=2;
+
+connection master;
+UPDATE t1, t2 SET t1.a = t2.a;
+
+sync_slave_with_master;
+select * from t1;
+select * from t2;
+
+# See if multi-table DELETE is binlogged even if no effect
+
+connection master;
+delete from t1;
+delete from t2;
+
+sync_slave_with_master;
+# force a difference to see if master's multi-DELETE will correct it
+insert into t1 values(1,1);
+insert into t2 values(1,1);
+
+connection master;
+DELETE t1.*, t2.* from t1, t2;
+
+sync_slave_with_master;
+select * from t1;
+select * from t2;
+
+
+# cleanup
+connection master;
+drop table t1;
+sync_slave_with_master;
diff --git a/mysql-test/t/rpl_stm_reset_slave.test b/mysql-test/t/rpl_stm_reset_slave.test
new file mode 100644
index 00000000000..282033bf6d1
--- /dev/null
+++ b/mysql-test/t/rpl_stm_reset_slave.test
@@ -0,0 +1,6 @@
+# TBF - difference in row level logging
+-- source include/have_binlog_format_statement.inc
+-- source extra/rpl_tests/rpl_reset_slave.test
+
+# End of 4.1 tests
+#
diff --git a/mysql-test/t/rpl_stm_rewrt_db-slave.opt b/mysql-test/t/rpl_stm_rewrt_db-slave.opt
new file mode 100644
index 00000000000..a462ad19ba0
--- /dev/null
+++ b/mysql-test/t/rpl_stm_rewrt_db-slave.opt
@@ -0,0 +1 @@
+"--replicate-rewrite-db=test->rewrite" "--replicate-rewrite-db=mysqltest1->test"
diff --git a/mysql-test/t/rpl_stm_rewrt_db.test b/mysql-test/t/rpl_stm_rewrt_db.test
new file mode 100644
index 00000000000..c66ced46717
--- /dev/null
+++ b/mysql-test/t/rpl_stm_rewrt_db.test
@@ -0,0 +1,84 @@
+# TBF - difference in row level logging
+-- source include/have_binlog_format_statement.inc
+-- source include/master-slave.inc
+
+--disable_warnings
+drop database if exists mysqltest1;
+--enable_warnings
+create database mysqltest1;
+
+use mysqltest1;
+create table t1 (a int);
+insert into t1 values(9);
+select * from mysqltest1.t1;
+sync_slave_with_master;
+show databases like 'mysqltest1'; # should be empty
+select * from test.t1;
+# cleanup
+connection master;
+drop table t1;
+drop database mysqltest1;
+sync_slave_with_master;
+
+#
+# BUG#6353:
+# Option --replicate-rewrite-db should work together with LOAD DATA INFILE
+#
+
+connection slave;
+--disable_warnings
+drop database if exists rewrite;
+--enable_warnings
+create database rewrite;
+
+connection master;
+use test;
+create table t1 (a date, b date, c date not null, d date);
+load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',';
+load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' IGNORE 2 LINES;
+sync_slave_with_master;
+
+connection slave;
+select * from rewrite.t1;
+
+connection master;
+truncate table t1;
+load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' LINES STARTING BY ',' (b,c,d);
+sync_slave_with_master;
+
+connection slave;
+select * from rewrite.t1;
+
+connection master;
+drop table t1;
+create table t1 (a text, b text);
+load data infile '../../std_data/loaddata2.dat' into table t1 fields terminated by ',' enclosed by '''';
+sync_slave_with_master;
+
+connection slave;
+select concat('|',a,'|'), concat('|',b,'|') from rewrite.t1;
+
+connection master;
+drop table t1;
+create table t1 (a int, b char(10));
+load data infile '../../std_data/loaddata3.dat' into table t1 fields terminated by '' enclosed by '' ignore 1 lines;
+sync_slave_with_master;
+
+connection slave;
+select * from rewrite.t1;
+
+connection master;
+truncate table t1;
+load data infile '../../std_data/loaddata4.dat' into table t1 fields terminated by '' enclosed by '' lines terminated by '' ignore 1 lines;
+sync_slave_with_master;
+
+connection slave;
+# The empty line last comes from the end line field in the file
+select * from rewrite.t1;
+
+drop database rewrite;
+
+connection master;
+drop table t1;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_stm_sp-master.opt b/mysql-test/t/rpl_stm_sp-master.opt
new file mode 100644
index 00000000000..709a224fd92
--- /dev/null
+++ b/mysql-test/t/rpl_stm_sp-master.opt
@@ -0,0 +1 @@
+--log_bin_trust_routine_creators=0
diff --git a/mysql-test/t/rpl_sp-slave.opt b/mysql-test/t/rpl_stm_sp-slave.opt
index 611ee1f33be..611ee1f33be 100644
--- a/mysql-test/t/rpl_sp-slave.opt
+++ b/mysql-test/t/rpl_stm_sp-slave.opt
diff --git a/mysql-test/t/rpl_sp.test b/mysql-test/t/rpl_stm_sp.test
index 386582f8f1b..95c4543c952 100644
--- a/mysql-test/t/rpl_sp.test
+++ b/mysql-test/t/rpl_stm_sp.test
@@ -1,3 +1,6 @@
+# row-based and statement have expected binlog difference in result files
+-- source include/have_binlog_format_statement.inc
+
# Test of replication of stored procedures (WL#2146 for MySQL 5.0)
# Modified by WL#2971.
@@ -333,7 +336,7 @@ drop trigger trg;
insert into t1 values (1);
select * from t1;
--replace_column 2 # 5 #
-show binlog events in 'master-bin.000001' from 98;
+show binlog events in 'master-bin.000001' from 102;
sync_slave_with_master;
select * from t1;
diff --git a/mysql-test/t/rpl_stm_timezone-master.opt b/mysql-test/t/rpl_stm_timezone-master.opt
new file mode 100644
index 00000000000..8e43bfbbb7e
--- /dev/null
+++ b/mysql-test/t/rpl_stm_timezone-master.opt
@@ -0,0 +1 @@
+--default-time-zone=Europe/Moscow
diff --git a/mysql-test/t/rpl_timezone-slave.opt b/mysql-test/t/rpl_stm_timezone-slave.opt
index 191182c329c..191182c329c 100644
--- a/mysql-test/t/rpl_timezone-slave.opt
+++ b/mysql-test/t/rpl_stm_timezone-slave.opt
diff --git a/mysql-test/t/rpl_timezone.test b/mysql-test/t/rpl_stm_timezone.test
index 2e9883141d8..0cd6dbf5d89 100644
--- a/mysql-test/t/rpl_timezone.test
+++ b/mysql-test/t/rpl_stm_timezone.test
@@ -1,3 +1,6 @@
+# TBF - difference in row level logging
+-- source include/have_binlog_format_statement.inc
+
# Test of replication of time zones.
# There is currently some bug possibly in prepared statements (this
diff --git a/mysql-test/t/rpl_until.test b/mysql-test/t/rpl_stm_until.test
index e0ecf981fea..1bd87db88cb 100644
--- a/mysql-test/t/rpl_until.test
+++ b/mysql-test/t/rpl_stm_until.test
@@ -1,4 +1,7 @@
-source include/master-slave.inc;
+-- source include/have_binlog_format_statement.inc
+-- source include/master-slave.inc
+
+# Test is dependent on binlog positions
# prepare version for substitutions
let $VERSION=`select version()`;
@@ -19,12 +22,10 @@ create table t2(n int not null auto_increment primary key);
insert into t2 values (1),(2);
insert into t2 values (3),(4);
drop table t2;
---replace_result $VERSION VERSION
-show binlog events;
# try to replicate all queries until drop of t1
connection slave;
-start slave until master_log_file='master-bin.000001', master_log_pos=319;
+start slave until master_log_file='master-bin.000001', master_log_pos=323;
sleep 2;
wait_for_slave_to_stop;
# here table should be still not deleted
@@ -43,7 +44,7 @@ wait_for_slave_to_stop;
--replace_column 1 # 9 # 11 # 23 # 33 #
show slave status;
-# try replicate all until second insert to t2;
+# try replicate all up to and not including the second insert to t2;
start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=746;
sleep 2;
wait_for_slave_to_stop;
diff --git a/mysql-test/t/rpl_stm_user_variables.test b/mysql-test/t/rpl_stm_user_variables.test
new file mode 100644
index 00000000000..af4e46cdace
--- /dev/null
+++ b/mysql-test/t/rpl_stm_user_variables.test
@@ -0,0 +1,5 @@
+# row-based and statement binlog difference in result files
+-- source include/have_binlog_format_statement.inc
+-- source extra/rpl_tests/rpl_user_variables.test
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_stm_view.test b/mysql-test/t/rpl_stm_view.test
new file mode 100644
index 00000000000..39f39705f77
--- /dev/null
+++ b/mysql-test/t/rpl_stm_view.test
@@ -0,0 +1,50 @@
+# NYI - row-based cannot use CREATE ... SELECT
+--source include/have_binlog_format_statement.inc
+
+source include/master-slave.inc;
+--disable_warnings
+drop table if exists t1,v1;
+drop view if exists t1,v1;
+sync_slave_with_master;
+reset master;
+--enable_warnings
+
+#
+# Check that createion drop of view is replicated, also check replication of
+# updating of view
+#
+connection master;
+create table t1 (a int);
+insert into t1 values (1);
+create view v1 as select a from t1;
+insert into v1 values (2);
+select * from v1 order by a;
+sync_slave_with_master;
+# view already have to be on slave
+select * from v1 order by a;
+connection master;
+update v1 set a=3 where a=1;
+select * from v1 order by a;
+sync_slave_with_master;
+select * from v1 order by a;
+connection master;
+delete from v1 where a=2;
+select * from v1 order by a;
+sync_slave_with_master;
+select * from v1 order by a;
+connection master;
+# 'alter view' internally maped to creation, but still check that it works
+alter view v1 as select a as b from t1;
+sync_slave_with_master;
+select * from v1 order by 1;
+connection master;
+drop view v1;
+sync_slave_with_master;
+#error, because view have to be removed from slave
+-- error 1146
+select * from v1 order by a;
+connection master;
+drop table t1;
+sync_slave_with_master;
+--replace_column 2 # 5 #
+show binlog events limit 1,100;
diff --git a/mysql-test/t/rpl_temporary.test b/mysql-test/t/rpl_temporary.test
index fcb2391a9d8..0eb5d4074d8 100644
--- a/mysql-test/t/rpl_temporary.test
+++ b/mysql-test/t/rpl_temporary.test
@@ -1,4 +1,4 @@
-source include/master-slave.inc;
+-- source include/master-slave.inc
# Clean up old slave's binlogs.
# The slave is started with --log-slave-updates
@@ -81,9 +81,10 @@ drop temporary table t3;
select * from t2;
---replace_result $VERSION VERSION
---replace_column 2 # 5 #
-show binlog events;
+# Commented out 8/30/2005 to make compatable with both sbr and rbr
+#--replace_result $VERSION VERSION
+#--replace_column 2 # 5 #
+#show binlog events;
drop table t1, t2;
@@ -130,5 +131,3 @@ create temporary table t3 (f int);
sync_with_master;
# The server will now close done
-
-# End of 4.1 tests
diff --git a/mysql-test/t/rpl_trigger.test b/mysql-test/t/rpl_trigger.test
index fa6054372c7..0eca7308adc 100644
--- a/mysql-test/t/rpl_trigger.test
+++ b/mysql-test/t/rpl_trigger.test
@@ -1,7 +1,8 @@
#
# Test of triggers with replication
-#
-
+# Adding statement include due to Bug 12574
+# TODO: Remove statement include once 12574 is patched
+--source include/have_binlog_format_statement.inc
source include/master-slave.inc;
#
diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test
index f73288f04ba..91973da6c22 100644
--- a/mysql-test/t/sp.test
+++ b/mysql-test/t/sp.test
@@ -4132,9 +4132,13 @@ end|
--error 1062
select bug12379()|
select 1|
+# statement-based binlogging will show warning which row-based won't;
+# so we hide it (this warning is already tested in rpl_stm_sp.test)
+--disable_warnings
call bug12379_1()|
select 2|
call bug12379_2()|
+--enable_warnings
select 3|
--error 1062
call bug12379_3()|
diff --git a/mysql-test/t/user_var-binlog.test b/mysql-test/t/user_var-binlog.test
index 004154339b2..a3128064c91 100644
--- a/mysql-test/t/user_var-binlog.test
+++ b/mysql-test/t/user_var-binlog.test
@@ -1,3 +1,6 @@
+# Requires statement logging
+-- source include/have_binlog_format_statement.inc
+# TODO: Create row based version once $MYSQL_BINLOG has new RB version
# Embedded server does not support binlogging
--source include/not_embedded.inc
@@ -10,7 +13,8 @@ INSERT INTO t1 VALUES(@`a b`);
set @var1= "';aaa";
SET @var2=char(ascii('a'));
insert into t1 values (@var1),(@var2);
-show binlog events from 98;
+--replace_column 2 # 5 #
+show binlog events from 102;
# more important than SHOW BINLOG EVENTS, mysqlbinlog (where we
# absolutely need variables names to be quoted and strings to be
# escaped).